function e(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)}function t(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n}var n,r,i,a,o,s=`__TAURI_TO_IPC_KEY__`;function c(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}var l=class{constructor(o){n.set(this,void 0),r.set(this,0),i.set(this,[]),a.set(this,void 0),t(this,n,o||(()=>{}),`f`),this.id=c(o=>{let s=o.index;if(`end`in o){s==e(this,r,`f`)?this.cleanupCallback():t(this,a,s,`f`);return}let c=o.message;if(s==e(this,r,`f`)){for(e(this,n,`f`).call(this,c),t(this,r,e(this,r,`f`)+1,`f`);e(this,r,`f`)in e(this,i,`f`);){let a=e(this,i,`f`)[e(this,r,`f`)];e(this,n,`f`).call(this,a),delete e(this,i,`f`)[e(this,r,`f`)],t(this,r,e(this,r,`f`)+1,`f`)}e(this,r,`f`)===e(this,a,`f`)&&this.cleanupCallback()}else e(this,i,`f`)[s]=c})}cleanupCallback(){window.__TAURI_INTERNALS__.unregisterCallback(this.id)}set onmessage(e){t(this,n,e,`f`)}get onmessage(){return e(this,n,`f`)}[(n=new WeakMap,r=new WeakMap,i=new WeakMap,a=new WeakMap,s)](){return`__CHANNEL__:${this.id}`}toJSON(){return this[s]()}};async function u(e,t={},n){return window.__TAURI_INTERNALS__.invoke(e,t,n)}var d=class{get rid(){return e(this,o,`f`)}constructor(e){o.set(this,void 0),t(this,o,e,`f`)}async close(){return u(`plugin:resources|close`,{rid:this.rid})}};o=new WeakMap;export{l as Channel,d as Resource,s as SERIALIZE_TO_IPC_FN,u as invoke,c as transformCallback};