"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6083],{56083:(e,t,i)=>{var s,r,n,a,o;function c(e,t,i,s){if("a"===i&&!s)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?s:"a"===i?s.call(e):s?s.value:t.get(e)}function h(e,t,i,s,r){if("m"===s)throw TypeError("Private method is not writable");if("a"===s&&!r)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?r.call(e,i):r?r.value=i:t.set(e,i),i}i.r(t),i.d(t,{Channel:()=>f,PluginListener:()=>_,Resource:()=>k,SERIALIZE_TO_IPC_FN:()=>l,addPluginListener:()=>d,checkPermissions:()=>p,convertFileSrc:()=>v,invoke:()=>g,isTauri:()=>T,requestPermissions:()=>w,transformCallback:()=>u}),"function"==typeof SuppressedError&&SuppressedError;let l="__TAURI_TO_IPC_KEY__";function u(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}class f{constructor(e){s.set(this,void 0),r.set(this,0),n.set(this,[]),a.set(this,void 0),h(this,s,e||(()=>{}),"f"),this.id=u(e=>{let t=e.index;if("end"in e)return void(t==c(this,r,"f")?this.cleanupCallback():h(this,a,t,"f"));let i=e.message;if(t==c(this,r,"f")){for(c(this,s,"f").call(this,i),h(this,r,c(this,r,"f")+1,"f");c(this,r,"f")in c(this,n,"f");){let e=c(this,n,"f")[c(this,r,"f")];c(this,s,"f").call(this,e),delete c(this,n,"f")[c(this,r,"f")],h(this,r,c(this,r,"f")+1,"f")}c(this,r,"f")===c(this,a,"f")&&this.cleanupCallback()}else c(this,n,"f")[t]=i})}cleanupCallback(){window.__TAURI_INTERNALS__.unregisterCallback(this.id)}set onmessage(e){h(this,s,e,"f")}get onmessage(){return c(this,s,"f")}[(s=new WeakMap,r=new WeakMap,n=new WeakMap,a=new WeakMap,l)](){return`__CHANNEL__:${this.id}`}toJSON(){return this[l]()}}class _{constructor(e,t,i){this.plugin=e,this.event=t,this.channelId=i}async unregister(){return g(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}}async function d(e,t,i){let s=new f(i);try{return await g(`plugin:${e}|register_listener`,{event:t,handler:s}),new _(e,t,s.id)}catch{return await g(`plugin:${e}|registerListener`,{event:t,handler:s}),new _(e,t,s.id)}}async function p(e){return g(`plugin:${e}|check_permissions`)}async function w(e){return g(`plugin:${e}|request_permissions`)}async function g(e,t={},i){return window.__TAURI_INTERNALS__.invoke(e,t,i)}function v(e,t="asset"){return window.__TAURI_INTERNALS__.convertFileSrc(e,t)}class k{get rid(){return c(this,o,"f")}constructor(e){o.set(this,void 0),h(this,o,e,"f")}async close(){return g("plugin:resources|close",{rid:this.rid})}}function T(){return!!(globalThis||window).isTauri}o=new WeakMap}}]);