var l=Object.defineProperty;var d=(r,e)=>{for(var s in e)l(r,s,{get:e[s],enumerable:!0})};var g={};d(g,{HOST_RUNTIME:()=>h});var a=class{postMessage(e,s){self.postMessage(e,s)}set onmessage(e){self.addEventListener("message",e)}},i=class{#e;#s;#r;constructor(e){this.#e=new Promise((s,t)=>{this.#r=t;let o=new Worker(new URL(e),{type:"module"});o.onerror=n=>{console.error(`Failed to load worker for ${e}:`,n)},o.onmessage=n=>{console.assert(n.data==="workerReady"),o.onmessage=null,s(o)}})}postMessage(e,s){this.#e.then(t=>{this.#s||t.postMessage(e,s??[])})}dispose(){this.#s=!0,this.#e.then(e=>e.terminate())}terminate(e=!1){e&&this.#r?.(new Error("Worker terminated")),this.dispose()}set onmessage(e){this.#e.then(s=>{s.onmessage=e})}set onerror(e){this.#e.then(s=>{s.onerror=e})}},h={createWorker(r){return new i(r)},workerScope:new a,getOnLine(){return navigator.onLine},getUserAgent(){return navigator.userAgent},getLocalStorage(){return"localStorage"in globalThis?globalThis.localStorage:void 0}};export{g as HostRuntime};
//# sourceMappingURL=browser.js.map
