"use strict";var l=Object.defineProperty;var o=(i,e,t)=>e in i?l(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var s=(i,e,t)=>o(i,typeof e!="symbol"?e+"":e,t);let n;function u(i){n=i}function c(){if(!n)throw new Error("[@netless/appliance-plugin/bridge] white-web-sdk runtime has not been bound yet.");return n}const a="/assets/fullWorker-Cud7fwjG.js",h="/assets/subWorker-BL9l8peV.js";class g{constructor(){s(this,"control");s(this,"_listeners",{})}_inject(e){this.control=e}_onEvent(e,t){this._listeners[e]&&this._listeners[e](...t)}callbacks(e,t){this._listeners[e]=t}removeCallback(e){delete this._listeners[e]}}class d{constructor(e){s(this,"control");s(this,"worker");s(this,"publicMsgEmitter");s(this,"plugins",new Map);const{control:t,publicMsgEmitter:r}=e;this.control=t,this.publicMsgEmitter=r,this.worker=t.worker}use(e){this.plugins.set(e.kind,e),e._inject(this.control),e.onCreate()}destroy(){this.plugins.forEach(e=>{this.plugins.delete(e.kind),e.onDestroy()})}dispatchPluginEvent(e,...t){this.plugins.forEach(r=>{r._onEvent(e,t)})}}async function k(i){return u(i),Promise.resolve().then(()=>require("./index-vyNIKk26.js")).then(e=>e.index)}exports.Plugin=g;exports.PluginManager=d;exports.fullWorker=a;exports.getWhiteWebSdkBridgeRuntime=c;exports.loadAppliancePluginBridge=k;exports.subWorker=h;
