@shijiu/jsview 2.2.201 → 2.2.426-test.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dom/bin/DroidSansFallback.ttf +0 -0
- package/dom/bin/NotoColorEmoji.ttf +0 -0
- package/dom/bin/jsview-dom-browser-engine-core.min.js +2 -0
- package/dom/bin/jsview-dom-browser-engine-modules.min.js +2 -0
- package/dom/bin/jsview-dom-browser-forge.1385.f80e.wasm +0 -0
- package/dom/bin/jsview-dom-browser-forge.min.js +1 -0
- package/dom/bin/jsview-dom-browser-forge.worker.min.js +1 -0
- package/dom/bin/jsview-dom-browser.min.js +1 -1
- package/dom/bin/jsview-dom-native.min.js +1 -1
- package/dom/bin/jsview-engine-js-browser.min.js +1 -22
- package/dom/bin/jsview-engine-js-native.min.js +2 -0
- package/dom/bin/jsview-forge-define.min.js +1 -1
- package/dom/index.mjs +38 -14
- package/dom/target_core_revision.mjs +10 -5
- package/loader/jsv-core-api/jsview-core-api-glue.js +74 -0
- package/loader/jsv-core-api/wasm/backgroundtask.js +66 -0
- package/loader/jsv-core-api/wasm/core-api.js +206 -0
- package/loader/jsview-config.js +22 -0
- package/loader/jsview-loader.js +74 -85
- package/loader/jsview-main.mjs +8 -14
- package/loader/jsview.config.default.js +2 -2
- package/package.json +1 -1
- package/patches/node_modules/vite/dist/node/jsview-vite-extension.js +67 -6
- package/shijiu-jsview-0.0.0.tgz +0 -0
- package/tools/https-server-config/cert.pem +61 -0
- package/tools/https-server-config/key.pem +27 -0
- package/tools/https-server-config/serve.config.json +16 -0
- package/tools/jsview-common.mjs +87 -3
- package/tools/jsview-post-build.mjs +248 -70
- package/tools/jsview-post-install.mjs +7 -4
- package/tools/jsview-retrieve-sourcemap.mjs +64 -49
- package/tools/jsview-run-tool.mjs +53 -3
- package/tools/jsview-vue-devtools.mjs +2 -0
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* eslint-disable */ class t{static SetOnEventListener(...e){return t.WasmBridge.SetOnEventListener(e)}static RunSyncTask(...e){return t.WasmBridge.RunSyncTask(e)}static RunLazyTaskList(...e){return t.WasmBridge.RunLazyTaskList(e)}static JsViewId=1;static WasmBridge}const e={print:(...t)=>{console.log(...t)},canvas:void 0,setStatus:t=>{},totalDependencies:0,monitorRunDependencies:t=>{}};let s=new class{constructor(){this.observer_map={},this._OnJsNotifyFunc=this.onJsNotify.bind(this),this._OnEmitEventFunc=this.onEmitEvent.bind(this),this.subscribe("watchdog",this._watchdog)}subscribe(t,e){this.observer_map.hasOwnProperty(t)||(this.observer_map[t]=[]),this.observer_map[t].push(e)}unsubscribe(t,e){if(this.observer_map.hasOwnProperty(t)){let s=this.observer_map[t];for(let t=0;t<s.length;t++)if(s[t]==e){s.splice(t,1);break}}}notify(t,e){this._OnJsNotifyFunc(t,e)}emitEvent(t,e){this._OnEmitEventFunc(t,e)}onEmitEvent(t,e){console.log("onEmitEvent() key: "+t+" message="+e),0!=this.observer_map.hasOwnProperty(t)?this._JsNotify(t,e):console.warn("Message from JsView.emitEvent key='"+t+"' is not subscribed.")}onJsNotify(t,e){0!=this.observer_map.hasOwnProperty(t)&&this._JsNotify(t,e)}_JsNotify(t,e){var s;let n=this.observer_map[t].length;for(let i=0;i<n;i++)s=this.observer_map[t][i](e);return s}_watchdog(){}};class n{constructor(){this.limitFps=0,this.fpsDisplay=!1,this.surfaceWidth=0,this.surfaceHeight=0}pack(){try{const t={};return t.limitFps=this.limitFps,t.fpsDisp=this.fpsDisplay,t.fpsConsole=!1,t.width=this.surfaceWidth,t.height=this.surfaceHeight,JSON.stringify(t)}catch(t){return console.error("Json error:",t),null}}}var i;function o(t,e,s,n,o,a,r){let c=t.getElementById("input-layer"),l=t.getElementById("ime_"+o);if(null!=a){let n=JSON.parse(a),r=n.inputType,h=n.text?decodeURIComponent(n.text):"",f=n.showImeIfNeeded?n.showImeIfNeeded:0,p=isNaN(n.selectionStart)?0:n.selectionStart,g=isNaN(n.selectionEnd)?0:n.selectionEnd,u=isNaN(n.scrollLeft)?0:n.scrollLeft,m=isNaN(n.scrollTop)?0:n.scrollTop,d=isNaN(n.fontSize)?20:n.fontSize,y=n.textAlign?n.textAlign:"left",v=n.coverColor?n.coverColor:"#FFFFFF",_=n.textColor?n.textColor:"#000000";f?(null==l&&(l=t.createElement("input"),l.id="ime_"+o,c.appendChild(l),l.style.position="absolute",l.style.backgroundColor=v,l.style.color=_,l.style.textAlign=y,l.style.fontSize=d+"px",l.style.border="none",l.style.outline="none",l.jsvAttachInfo={keepAlive:!1},function(t,e,s,n){e.oninput=e=>{if(e.target.value.length>0&&e.target.selectionStart>0){const t=e.target.selectionStart-1,n=e.target.selectionStart;if(o=e.target.value.slice(t,n),!("0".charCodeAt()<=o.charCodeAt()&&o.charCodeAt()<="9".charCodeAt()||s!==i.NUMBER))return e.target.value=e.target.value.substr(0,t)+e.target.value.substr(n),void(e.target.selectionStart=t)}var o;const a=e.target.value,r=e.target.selectionStart,c=e.target.scrollLeft,l=e.target.scrollTop;n(t,a,r,r,c,l)}}(o,l,r,e),function(t,e,s,n){e.style.pointerEvents="auto",e.addEventListener("keydown",(t=>{38===(t=t||window.event).keyCode||40===t.keyCode?e.blur():27!==t.keyCode&&1e4!==t.keyCode||e.blur()})),e.addEventListener("selectionchange",(s=>{n(t,e.value,e.selectionStart,e.selectionEnd,e.scrollLeft,e.scrollTop)})),e.addEventListener("scroll",(s=>{n(t,e.value,e.selectionStart,e.selectionEnd,e.scrollLeft,e.scrollTop)}))}(o,l,l.jsvAttachInfo,e),function(t,e,s,n){e.onfocus=t=>{},e.onblur=s=>{n(t,!1,!1),setTimeout((()=>{e.remove()}),0)}}(o,l,l.jsvAttachInfo,s),s(o,!0,!1)),l.value=h,setTimeout((()=>{l.selectionStart=p,l.selectionEnd=g,l.scrollLeft=u+d/2,l.scrollTop=m}),0),l.focus()):null!=l&&(l.remove(),s(o,!1,!1))}if(null!=r){let t=JSON.parse(r);null!=l&&(l.style.left=t.x+"px",l.style.top=t.y+"px",l.style.width=t.width+"px",l.style.height=t.height+"px")}}!function(t){t[t.NONE=0]="NONE",t[t.TEXT=1]="TEXT",t[t.PASSWORD=2]="PASSWORD",t[t.TEXT_AREA=3]="TEXT_AREA",t[t.CONTENT_EDITABLE=4]="CONTENT_EDITABLE",t[t.SEARCH=5]="SEARCH",t[t.URL=6]="URL",t[t.EMAIL=7]="EMAIL",t[t.TELEPHONE=8]="TELEPHONE",t[t.NUMBER=9]="NUMBER"}(i||(i={}));class a{constructor(t,e){this._WasmCanvasApi=t,this._MessageDispatcher=null,this._DynamicConfigSet=new n,this._canvasToken=674500,this._jsviewId=e,this._OnImeSyncBackInfoWrap=this._OnImeSyncBackInfo.bind(this),this._OnImeSyncViewStatusWrap=this._OnImeSyncViewStatus.bind(this),this._OnImeSyncActionWrap=this._OnImeSyncAction.bind(this),this._DynamicConfigSet.surfaceWidth=1280,this._DynamicConfigSet.surfaceHeight=720}startDraw(){this._WasmCanvasApi.CreateVirtualCanvas(this._canvasToken,this._jsviewId,this.triggerRenderEventReciever.bind(this),this.imeControlEvent.bind(this)),this._WasmCanvasApi.UpdateDynamicSet(this._canvasToken,this._DynamicConfigSet.pack())}getCanvasToken(){return this._canvasToken}getForgeRT(){return this._WasmCanvasApi.GetForgeRTHandle(this._canvasToken)}enableFpsDisplay(t){this._DynamicConfigSet.fpsDisplay=t,this._WasmCanvasApi.UpdateDynamicSet(this._canvasToken,this._DynamicConfigSet.pack())}setMessageDispatcher(t){this._MessageDispatcher=t}triggerRenderEventReciever(){this._MessageDispatcher?.notify("JscRender","")}imeControlEvent(t,e,s){o(window.originDocument,this._OnImeSyncBackInfoWrap,this._OnImeSyncViewStatusWrap,this._OnImeSyncActionWrap,t,e,s)}_OnImeSyncBackInfo(t,e,s,n,i,o){let a={type:"text",text:encodeURIComponent(e),selectStart:s,selectEnd:n,scrollLeft:i,scrollTop:o};this._MessageDispatcher?.notify("_JscIme_"+t,JSON.stringify(a))}_OnImeSyncViewStatus(t,e,s){let n={type:"vstatus",isVisible:e,softKeyShown:s};this._MessageDispatcher?.notify("_JscIme_"+t,JSON.stringify(n))}_OnImeSyncAction(t,e){let s={type:"action",action:e};this._MessageDispatcher?.notify("_JscIme_"+t,JSON.stringify(s))}}let r=null;t.JsViewId=1;const c=await async function(){window.global=window;const{default:s}=await import("./jsview-dom-browser-forge.min.js"),n=await s(e);n.jse$impl$WasmImpl.SetModule(n);const i=n.forge$dom$WasmPlatformDomBridge;return t.WasmBridge=i,n.WasmJscExports=n.forge$WasmJscExports,n}();let l=c.forge$WasmResProviderExports;l.initResInstance(1),c.WasmJscExports.InitJsc(1,window.JsvCoreApi.getJsContextId()),c.forge$front$ForgeCanvasApi.SetupGLContext("#forge-canvas");let h=null;function f(t){!async function(t){await async function(){const t=[import("./DroidSansFallback.ttf").then((async t=>(await fetch(t.default)).arrayBuffer())),import("./NotoColorEmoji.ttf").then((async t=>(await fetch(t.default)).arrayBuffer()))];await Promise.all(t).then((t=>{const e=new Uint32Array(t.length),s=new Uint32Array(t.length);for(let n=0;n<t.length;++n){const i=t[n];if(i){const t=new Uint8Array(i),o=c.malloc(i.byteLength);c.HEAPU8.set(t,o),e[n]=o,s[n]=i.byteLength}}const n=c.malloc(4*e.length);c.HEAPU32.set(e,n>>2);const i=c.malloc(4*s.length);c.HEAPU32.set(s,i>>2),l.SetFonts(1,n,i,t.length)}))}(),h=function(t,e){return r=new a(t,e),r}(c.forge$front$ForgeCanvasApi,1),window.JsvCoreApi.setForgeCanvasSingleton(h),h.startDraw();let e=h.getForgeRT();h.setMessageDispatcher(s);let n={frtNativeHandle:e,canvasNativeHandle:h.getCanvasToken()};t?.(n)}(t)}function p(){return s}window.JsvCode.BrowserPlatformDomBridge=t,window.JsvCode.MessageDispatcher=s,t.RegisterOriginDocument=function(t){console.log("RegisterOriginDocument in"),window.originDocument=t};export{p as getJMD,f as takeCanvas};
|
|
2
|
+
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* eslint-disable */ let e={sRenderBridge:null,sActivityManager:null,DesignMap:null};window.Forge=e;let t=function(e){},i=function(e){},n=function(e){},s=function(e){throw new Error(e)};class a{constructor(){this._EnqueueInfoList=[],this._EnqueueObjList=[],this._OnStartSyncCallback=[],this._AlterIdCandidateMap={}}RequestAlterId(e,t){this._AlterIdCandidateMap[e]=t}AddToQueue(e,t){this._EnqueueInfoList.push(t),this._EnqueueObjList.push(e)}HasUpdate(){return this._EnqueueInfoList.length>0}ReadSyncList(){if(this._OnStartSyncCallback.length>0){for(let e of this._OnStartSyncCallback)e();this._OnStartSyncCallback=[]}let e=this._EnqueueInfoList;return this.RenewSyncList(),e}AddStartSyncCallback(e){this._OnStartSyncCallback.push(e)}RenewSyncList(){if(this._EnqueueObjList)for(let e of this._EnqueueObjList)e.RenewSyncInfo(this,null);this._EnqueueInfoList=[],this._EnqueueObjList=[]}ProcAlterIds(e,t){for(let i=0;i<e.length;i++)if(this._AlterIdCandidateMap.hasOwnProperty(e[i])){let n=this._AlterIdCandidateMap[e[i]];n.OnAlterId(t[i]),n.RenewSyncInfo(this,null)}else console.error(`Error: ProcAlterIds not found proxyId=${e[i]}`);this._AlterIdCandidateMap={}}}class r{constructor(e,t=null,i=null){this._PrefSyncListRef=e,this.PrefSyncInfo=null,this._PrefTaskList=null,this._PrefEnqueued=!1,this._SuffSyncListRef=t,this.SuffSyncInfo=null,this._SuffTaskList=null,this._SuffEnqueued=!1,this.InitPackage(i),this.RenewSyncInfo(this._PrefSyncListRef,null),this.RenewSyncInfo(this._SuffSyncListRef,null)}AddStartSyncCallback(e){this._PrefSyncListRef.AddStartSyncCallback(e)}CallToNative(t,i,n=!1){let s={fn:t,a:i};return n?(this._SuffTaskList.push(s),this._SuffEnqueued||(this._SuffSyncListRef.AddToQueue(this,this.SuffSyncInfo),this._SuffEnqueued=!0)):(this._PrefTaskList.push(s),this._PrefEnqueued||(this._PrefSyncListRef.AddToQueue(this,this.PrefSyncInfo),this._PrefEnqueued=!0)),e.sRenderBridge.RequestSwap(),s}RequestAlterId(e,t=!1){t?this._SuffSyncListRef.RequestAlterId(e,this):this._PrefSyncListRef.RequestAlterId(e,this)}SuffCallToNative(e,t){return{fn:e,a:t}}AlterCallParams(e,t){e&&(e.a=t)}RenewSyncInfo(e,t){t||(t={}),this._PrefEnqueued=!1,this._SuffEnqueued=!1,e&&e==this._PrefSyncListRef&&(this._PrefTaskList=[],this.PrefSyncInfo={tl:this._PrefTaskList,...t}),e&&e==this._SuffSyncListRef&&(this._SuffTaskList=[],this.SuffSyncInfo={tl:this._SuffTaskList,...t})}InitPackage(e){}OnAlterId(e){}}let o=new a,l=new a;class h extends r{constructor(e){super(o,l,{id:e}),this._TextureRef=null,this._RenderTextureId=e}InitPackage(e){this._RenderTextureId=e.id}RenewSyncInfo(e,t){super.RenewSyncInfo(e,{tt:1,id:this._RenderTextureId})}NeedAlterId(e,t){this._TextureRef=e,super.RequestAlterId(this._RenderTextureId,t)}OnAlterId(e){this._RenderTextureId=e,this._TextureRef.TexId=e,this._TextureRef=null}}let c=new class extends r{constructor(){super(o,l)}RenewSyncInfo(e,t){super.RenewSyncInfo(e,{tt:0})}};let u=new class{constructor(){this._StoreArray=[1]}AddData(e){return this._StoreArray.push(e),this._StoreArray.length-1}TakeArray(){const e=this._StoreArray;return this._StoreArray=[1],e}PickArray(){return this._StoreArray}GetSize(){return this._StoreArray.length}ResetForNextSwap(){this._StoreArray=[1]}};let d=1;class _{constructor(e,t,i=!1){this._NativeSyncer=t,this.TexId=e,this._TextureReady=!1,this._TextureWidth=0,this._TextureHeight=0,this._InnerLoadCallback=null,this._CallbackMap={},this._DomDepends=i}GetTextureId(){return this.TexId}RequestSyncerAlterId(){this._NativeSyncer.NeedAlterId(this,this._DomDepends)}RegisterLoadImageCallback(e,t,i){if(null==t)return 0;if(this._TextureReady)return t({width:this._TextureWidth,height:this._TextureHeight},i),0;{this._RegisterInnerLoadCallback();const e=d++,n=this,s=(s,a,r)=>{t({width:s,height:a,extra:r?JSON.parse(r):null},i),delete n._CallbackMap[e]};this._CallbackMap[e]=s;const a=u.AddData(s);return this._NativeSyncer.CallToNative(1,[e,a],this._DomDepends),e}}UnregisterLoadImageCallback(e){e>0&&void 0!==this._CallbackMap[e]&&delete this._CallbackMap[e]}DispatchCommand(t,i){this._NativeSyncer.CallToNative(3,[t,i],this._DomDepends),e.sRenderBridge.RequestSwap()}_RegisterInnerLoadCallback(){if(null==this._InnerLoadCallback){const e=this;this._InnerLoadCallback=(t,i,n)=>{e._TextureReady=!0,e._TextureWidth=t,e._TextureHeight=i};const t=u.AddData(this._InnerLoadCallback);this._NativeSyncer.CallToNative(1,[d++,t],this._DomDepends)}}EnableBackgroundLoad(){this._TextureReady||(this._RegisterInnerLoadCallback(),this._NativeSyncer.CallToNative(4,null,this._DomDepends))}DisableBackgroundLoad(){this._NativeSyncer.CallToNative(5,null,this._DomDepends)}RequestToUnload(){this._NativeSyncer.CallToNative(6,null,this._DomDepends)}DisableAutoRecycle(){this._NativeSyncer.CallToNative(7,null,this._DomDepends)}}class S extends _{constructor(e,t,i=!1){super(e,t,i),this._GifTextureInfo=null}registerOnStart(e){this._EnableGifTextureInfo();let t=this._GifTextureInfo,i=++t.IdGen;if(t.StartMapCount++,t.StartMapCount>0&&0==t.GlobalStartCallbackId){t.GlobalStartCallbackId=i;const e=()=>{for(let e in t.OnStartMap)t.OnStartMap[e]?.()},n=u.AddData(e);this._NativeSyncer.CallToNative(10,[t.GlobalStartCallbackId,n],this._DomDepends)}return t.OnStartMap[i]=e,i}unregisterOnStart(e){if(!this._GifTextureInfo)return;let t=this._GifTextureInfo;t.OnStartMap.hasOwnProperty(e)&&t.StartMapCount--,0==t.StartMapCount&&0!=t.GlobalStartCallbackId&&(this._NativeSyncer.CallToNative(11,[t.GlobalStartCallbackId],this._DomDepends),t.GlobalStartCallbackId=0)}registerOnEnd(e){this._EnableGifTextureInfo();let t=this._GifTextureInfo,i=++t.IdGen;if(t.EndMapCount++,t.EndMapCount>0&&0==t.GlobalEndCallbackId){t.GlobalEndCallbackId=i;const e=()=>{for(let e in t.OnEndMap)t.OnEndMap[e]?.()},n=u.AddData(e);this._NativeSyncer.CallToNative(12,[t.GlobalEndCallbackId,n],this._DomDepends)}return t.OnEndMap[i]=e,i}unregisterOnEnd(e){if(!this._GifTextureInfo)return;let t=this._GifTextureInfo;t.OnEndMap.hasOwnProperty(e)&&t.EndMapCount--,0==t.EndMapCount&&0!=t.GlobalEndCallbackId&&(this._NativeSyncer.CallToNative(13,[t.GlobalEndCallbackId],this._DomDepends),t.GlobalEndCallbackId=0)}_EnableGifTextureInfo(){this._GifTextureInfo||(this._GifTextureInfo={IdGen:1,GlobalStartCallbackId:0,OnStartMap:{},StartMapCount:0,GlobalEndCallbackId:0,OnEndMap:{},EndMapCount:0})}}class p extends S{constructor(e,t){super(e,t,!0)}}let y=window.NativeGetIdGroupIntf();const v=10;class m{constructor(e){this._GroupType=e,this._TeamReadIndex=0,this._TeamFillIndex=0,this._Teams=new Array(v),this._ValidTeamsCount=0;for(let e=0;e<v;e++)this._Teams[e]={start:0,end:0,expired:!0}}genId(){this._Teams[this._TeamReadIndex].expired&&this._reserveNativeIds();let e=this._Teams[this._TeamReadIndex],t=e.start;return e.start++,e.start>e.end&&(e.expired=!0,this._TeamReadIndex=(this._TeamReadIndex+1)%v,this._ValidTeamsCount--),t}_reserveNativeIds(){let e=20*(v-this._ValidTeamsCount);if(e>0){let t=y.GetIdArray(this._GroupType,e);if(t){let e=JSON.parse(t);this._commitNativeIds(e[0],e[1])}}}_commitNativeIds(e,t){let i=t-e+1,n=Math.floor(i/20),s=e;for(let e=0;e<n;e++){let e=this._Teams[this._TeamFillIndex];e.start=s,e.end=s+20-1,e.expired=!1,this._TeamFillIndex=(this._TeamFillIndex+1)%v,s=e.end+1}this._ValidTeamsCount+=n,this._ValidTeamsCount>v&&console.error(`team over size to ${this._ValidTeamsCount}`)}}let C=new class{constructor(){this._ViewGroup=new m(0),this._TextureGroup=new m(1),this._AnimationGroup=new m(2),this._SensorGroup=new m(3)}genViewId(){return this._ViewGroup.genId()}genTextureId(){return this._TextureGroup.genId()}genAnimationId(){return this._AnimationGroup.genId()}genSensorId(){return this._SensorGroup.genId()}};var f,I,T;!function(e){e.RGBA_8888="RGBA_8888",e.RGBA_4444="RGBA_4444",e.RGBA_5551="RGBA_5551",e.RGB_565="RGB_565",e.RGB_ETC1="RGB_ETC1",e.RGBA_ETC1="RGBA_ETC1"}(f||(f={})),function(e){e.L=1,e.M=0,e.Q=3,e.H=2}(I||(I={})),function(e){e.AUTO=0,e.SYNC=1,e.ASYNC=2}(T||(T={}));class g{constructor(){this._NativeSyncer=c}GetId(){return 0}GetColorTexture(e){let t=C.genTextureId();this._NativeSyncer.CallToNative(1,[e,t]);let i=new _(t,new h(t));return i.RequestSyncerAlterId(),i}GetImage(e,t,i){return this.GetImage2(e,t,null,null,i)}GetImage2(e,t,i,s=f.RGBA_8888,a="",r=!1){if(!e||0==e.length)return n("GetImage2, url is not setted!"),null;let o=C.genTextureId(),l=0,c=0;i&&(l=i.width,c=i.height),s||(s=f.RGBA_8888),a||(a="");let u=null!=r&&r;this._NativeSyncer.CallToNative(2,[e,l,c,s,a,u,o]);let d=new _(o,new h(o));return d.RequestSyncerAlterId(),d}GetQRCodeTexture(e,t,i,n=T.AUTO,s=I.Q,a="#ffffff",r="#000000",o=-1){let l=C.genTextureId();return this._NativeSyncer.CallToNative(3,[e,t,i,s,a,r,o,n,l]),new _(l,new h(l))}GetDownloadTexture(e,t,i){if(!e)return n("GetDownloadTexture, url is null!"),null;let s=C.genTextureId();return this._NativeSyncer.CallToNative(4,[e,t,i,s]),new _(s,new h(s))}GetDomProxyTexture(e){let t=C.genTextureId();return this._NativeSyncer.CallToNative(5,[e,t],!0),new p(t,new h(t))}GetCanvasTexture(e,t){let i=C.genTextureId();return this._NativeSyncer.CallToNative(6,[e,t,i],!1),new _(i,new h(i))}GetPluginTexture(e,t){let i=C.genTextureId();return this._NativeSyncer.CallToNative(7,[e,t,i],!1),new _(i,new h(i))}GetCapturedTexture(){let e=C.genTextureId();return this._NativeSyncer.CallToNative(8,[e],!1),new _(e,new h(e))}}let N=new class{constructor(){this._count=1}get count(){return this._count}update(){this._count<Number.MAX_SAFE_INTEGER?++this._count:this._count=1}},A=new a,R=new a;let w=new class extends r{constructor(){super(A,R)}RenewSyncInfo(e){super.RenewSyncInfo(e,{tt:0})}};class b extends r{constructor(e){super(A,R,{id:e}),this._AnimId=e}InitPackage(e){this._AnimId=e.id}RenewSyncInfo(e){super.RenewSyncInfo(e,{tt:1,id:this._AnimId})}}let E=new a,D=new a;class x extends r{constructor(e){super(E,D,{id:e}),this._ViewId=e}InitPackage(e){this._ViewId=e.id}RenewSyncInfo(e){super.RenewSyncInfo(e,{tt:1,id:this._ViewId})}}let F=new class extends r{constructor(){super(E,D)}RenewSyncInfo(e){super.RenewSyncInfo(e,{tt:0})}},P=new a;class L extends r{constructor(e){super(null,P,{id:e}),this._SensorId=e}InitPackage(e){this._SensorId=e.id}RenewSyncInfo(e,t){super.RenewSyncInfo(e,{tt:1,id:this._SensorId})}}let k=new class extends r{constructor(){super(null,P)}RenewSyncInfo(e,t){super.RenewSyncInfo(e,{tt:0})}};var O=null,G=null;class V{constructor(){this._ScreenInfo={width:160,height:90,x:2/160,y:2/90,perspective:2/160,scaleRatio:1,designedWidth:1280},this.SwapCurrentTime=Date.now(),this.SwapCurrentCount=0,this._WillSwapCallbacks=new Map,this._DoWillSwapCallback=this._OnWillSwap.bind(this),this._NativeForgeRT={hdl:null},this._ApiLinkStatusReady=!0,this._SwapTimer=-1,this._OnRequesting=!1,this._OnRequestSeq=1,this._ApiLinkStatusReady=!1,this._InitNativeBridge(),this._EnableRequestSwap=!1,this._CommandParamsCache=[],this._NewSwapSeq=1,this._ForgeFrontRender.OnScreenHide&&window.JsView?.onVisibilityChange((e=>{'{"status":"hide"}'===e&&this._ForgeFrontRender.OnScreenHide()}))}_InitNativeBridge(){void 0!==global.NativeSendImpactSensorSyncData&&global.NativeSendImpactSensorSyncData.bind(this._NativeForgeRT),void 0!==global.NativeSetStepFpsSwitch&&(O=global.NativeSetStepFpsSwitch.bind(this._NativeForgeRT)),void 0!==global.NativeSetGlobalConfig&&(G=global.NativeSetGlobalConfig.bind(this._NativeForgeRT)),this._ForgeFrontRender=global.NativeGetRenderIntf(),this._ForgeFrontRender.RegisterSwapFunc((()=>{this.RequestSwap()})),this._DoRequestSwap=this._DoRequestSwap.bind(this),this._ForgeFrontRender.RegisterPreDomSyncFunc((()=>{this._ProcPreDomSync()})),this._ForgeFrontRender.RegisterOnScreenInfo(this._OnScreenInfoChange.bind(this))}SetStepFpsSwitch(e){this._ApiLinkStatusReady?O&&O(e):(console.warn("SetStepFpsSwitch(): API link status no ready!"),this._CommandParamsCache.push((()=>{this.SetStepFpsSwitch(e)})))}SetGlobalConfig(e){if(this._ApiLinkStatusReady){if(G){let t=JSON.stringify(e);console.log("SetGlobalConfig set with "+t),G(t),console.log("SetGlobalConfig set done")}}else console.warn("SetGlobalConfig(): API link status no ready!"),this._CommandParamsCache.push((()=>{this.SetGlobalConfig(e)}))}_PerformCachedCommand(){if(this._CommandParamsCache.length>0){for(let e=0;e<this._CommandParamsCache.length;e++)this._CommandParamsCache[e]();this._CommandParamsCache=[]}}RequestSwap(){this._OnRequesting?this._NewSwapSeq++:(this._OnRequesting=!0,this._NewSwapSeq++,this._OnRequestSeq++,this._PromiseRequestSwap(this._OnRequestSeq))}_PromiseRequestSwap(e){let t=this,i=this._NewSwapSeq;Promise.resolve().then((()=>{i==t._NewSwapSeq?t.InstantPerformSwap():e==this._OnRequestSeq&&t._PromiseRequestSwap(e)}))}NotifyNetTypeStatus(e,t){}EnableRequestSwap(e){this._EnableRequestSwap=e,this._ForgeFrontRender.EnableRequestSwap(e)}InstantPerformSwap(){this._OnRequesting&&(this._OnRequesting=!1,this._OnRequestSeq++,this._DoRequestSwap(!1))}_ProcSyncerList(e,t,i,n,s){let a=null,r=null,o=null,l=null,h=null;if(e.HasUpdate()&&(o=e.ReadSyncList()),t.HasUpdate()&&(r=t.ReadSyncList()),i.HasUpdate()&&(a=i.ReadSyncList()),n?.HasUpdate()&&(l=n.ReadSyncList()),null==a&&null==r&&null==o&&null==l||(h=this._ForgeFrontRender.SyncForgeJsCall(JSON.stringify({TexSync:o,AnimSync:r,ViewSync:a,SensorSync:l}),s)),h){let t;this._OnRequesting=!1,t=JSON.parse(h).TexSyncRet,t&&this._ProcTextureSyncRet(e,t)}}_ProcPreDomSync(){this._ProcSyncerList(o,A,E,null,u.PickArray())}_DoRequestSwap(e){if(!this._EnableRequestSwap)return void(this._OnRequesting=!1);N.update();let t=u.GetSize();if(this._ProcSyncerList(o,A,E,null,u.PickArray()),this._WillSwapCallbacks.size>0&&this._WillSwapCallbacks.forEach(this._DoWillSwapCallback),this._ProcSyncerList(l,R,D,P,u.PickArray()),t==u.GetSize())u.ResetForNextSwap();else{let e=u.GetSize();e>50&&console.warn("Warning: temp sync store kept with large size = "+e)}e=!!e,this._OnRequesting=!1,this.SwapCurrentTime=Date.now(),this.SwapCurrentCount++,this._ForgeFrontRender.DoRequestSwap(e)}GetScreenInfo(){return this._ScreenInfo}SetForgeRtHandler(e){this._NativeForgeRT.hdl=e,this._ApiLinkStatusReady=!0,this._ForgeFrontRender.SetForgeRtHandler(e),this._PerformCachedCommand()}InitScreenBuffer(e,t){isNaN(e)&&(e=1),isNaN(t)&&(t=1280);var i=t*e,n=i/16*9;this._ScreenInfo.width=Math.floor(i),this._ScreenInfo.height=Math.floor(n),this._ScreenInfo.x=2/this._ScreenInfo.width,this._ScreenInfo.y=2/this._ScreenInfo.height,this._ScreenInfo.perspective=this._ScreenInfo.x,this._ScreenInfo.scaleRatio=e,this._ScreenInfo.designedWidth=t}InitNativeScreenBuffer(){if(this._ApiLinkStatusReady){var e=JSON.stringify({displayScaleRatio:this._ScreenInfo.scaleRatio,designedMapWidth:this._ScreenInfo.designedWidth});this._ForgeFrontRender.InitScreenBuffer(e)}else console.info("InitNativeScreenBuffer(): API link status no ready!")}SyncBackStatus(e,t){this._ForgeFrontRender.SyncBackStatus(e,t)}TakeAndSyncBackStatus(){1==this._ForgeFrontRender.TakeAndSyncBackStatus()&&this.RequestSwap()}_OnScreenInfoChange(e,t,i,n,s){this._ScreenInfo.width=e,this._ScreenInfo.height=t,this._ScreenInfo.x=i,this._ScreenInfo.y=n,this._ScreenInfo.perspective=s}HasPendingRenderBreak(){return!!this._ApiLinkStatusReady&&this._ForgeFrontRender.HasPendingRenderBreak()}FinishRenderBreak(e){this._ApiLinkStatusReady?this._ForgeFrontRender.FinishRenderBreak(e):(console.warn("FinishRenderBreak(): API link status no ready, delay"),this._CommandParamsCache.push((()=>{this._ForgeFrontRender.FinishRenderBreak(e)})))}AddWillSwapListener(e,t){this._WillSwapCallbacks.set(e,t)}AddSwappedOnceObserver(e){this._ApiLinkStatusReady?this._ForgeFrontRender.AddSwappedOnceObserver(e):(console.warn("AddSwappedOnceObserver(): API link status no ready, delay"),this._CommandParamsCache.push((()=>{this._ForgeFrontRender.AddSwappedOnceObserver(e)})))}ActiveComponent(e){this._ApiLinkStatusReady?this._ForgeFrontRender.ActiveComponent(e):(console.warn("ActiveComponent(): API link status no ready, delay"),this._CommandParamsCache.push((()=>{this._ForgeFrontRender.ActiveComponent(e)})))}ShutdownComponents(e){this._ApiLinkStatusReady?this._ForgeFrontRender.ShutdownComponents(e):(console.warn("ShutdownComponents(): API link status no ready, delay"),this._CommandParamsCache.push((()=>{this._ForgeFrontRender.ShutdownComponents(e)})))}SetPlatformMsgDisp(e){this._PlatformMessageDispatch=e}GetPlatformMsgDisp(){return this._PlatformMessageDispatch}GetTextToolsApi(){return this._ForgeFrontRender.TextToolApi}_OnWillSwap(e){e()}_ProcTextureSyncRet(e,t){let i;i=t.idAlter,i&&e.ProcAlterIds(i.proxy,i.real)}}class M{constructor(){this._DisableKeyGuard=!1,this._LastEventTime=0,this._IsActivte=!1,this._BaseTime=0,this._BaseRemoteTime=0,this._SupportGetTimeFromApi=!1,this._IsSystemKeyDelaySuit=!1,this._ExpiredKeyCount=0,this._LastValidKeyTime=0,this._UseTimeFromApi=void 0!==window.jRuntimeBridge?.getSystemUptimeMillis,this._UseTimeFromApi&&(this._SupportGetTimeFromApi=!0,this._GetTimeFromApi())}SetTranslateDelay(e){M.sKeyTranslateDelay=e}CheckKey(e){if(!e.timeStamp||this._DisableKeyGuard)return!1;this._IsActivte=!0;const t=Date.now(),n=e.timeStamp;!this._SupportGetTimeFromApi&&n-this._LastEventTime>3e3&&(this._BaseTime=t,this._BaseRemoteTime=n,this._LastEventTime=n);let s=t-this._BaseTime;(s<0||s>5e3)&&(this._UseTimeFromApi?this._GetTimeFromApi():(this._BaseTime=t,this._BaseRemoteTime=n),s=0);return s+this._BaseRemoteTime-n>M.CONST_MAX_PASSING_GAP&&Math.abs(this._LastValidKeyTime-n)<M.CONST_MIN_VALID_KEY_GAP&&!e.repeat?(!this._IsSystemKeyDelaySuit&&this._SupportGetTimeFromApi&&(this._ExpiredKeyCount++,this._ExpiredKeyCount>50&&i("More than 50 keys are expired...")),!0):(this._IsSystemKeyDelaySuit||(this._IsSystemKeyDelaySuit=!0),this._LastValidKeyTime=n,!1)}toggleKeyGuard(){this._DisableKeyGuard=!this._DisableKeyGuard}IsActive(){return this._IsActivte}_GetTimeFromApi(){this._BaseTime=Date.now(),this._BaseRemoteTime=window.jRuntimeBridge.getSystemUptimeMillis()-M.sKeyTranslateDelay}}M.CONST_MAX_PASSING_GAP=20,M.CONST_MIN_VALID_KEY_GAP=180,M.sKeyTranslateDelay=5;let B,q=new M;class W{constructor(s,a,r){var o;if(this._MainActivity=null,this._DesignedMapWidth=1280,this._KeyLock=!1,this._CanvasHandler=0,o=4,console.log.bind(console),o>0&&console.error.bind(console),o>1&&(t=console.error.bind(console)),o>2&&(i=console.warn.bind(console)),o>3&&(n=console.log.bind(console)),o>4&&console.debug.bind(console),this._TextureManager=new g,this._RenderBridge=new V,e.sRenderBridge=this._RenderBridge,isNaN(r)&&(r=1280),this._DesignedMapWidth=r,this._KeyLock=!1,this._InitRenderer(s,a,r),this._EventHandlers={keyProc:null,keyUpProc:null},this._RegisterKeyListener(this._EventHandlers),this._InstantSwapPromiseCallback=this._RenderBridge.InstantPerformSwap.bind(this._RenderBridge),null!=s){this._CanvasHandler=s.canvasNativeHandle;for(let e in this._EventHandlers)s[e]=this._EventHandlers[e]}e.sActivityManager=this,console.log("manager done")}GetTextureManager(){return this._TextureManager}DelayedActivateCanvas(e){if(0==this._CanvasHandler){this._CanvasHandler=e.canvasNativeHandle,this._EnableNativeBridge(e);for(let t in this._EventHandlers)e[t]=this._EventHandlers[t];this._RenderBridge.InitNativeScreenBuffer(),this._RenderBridge.RequestSwap()}else t("Error: already activated")}GetCanvasHandler(){return this._CanvasHandler}StartActivity(e){this._MainActivity=e}_InitRenderer(e,t,i){this._EnableNativeBridge(e),this._RenderBridge.InitScreenBuffer(t,i),this._RenderBridge.InitNativeScreenBuffer()}_EnableNativeBridge(e){null!=e&&(this._RenderBridge.SetForgeRtHandler(e.frtNativeHandle),e.renderBridge=this._RenderBridge,this._RenderBridge.EnableRequestSwap(!0))}_KeyProcDown(e){if(this._KeyLock)return!0;var t=!0;if(this._MainActivity){if(q.CheckKey(e))return console.log("keyEventGuard ignore keys"),!1;q.IsActive()&&this._RenderBridge.InstantPerformSwap(),t=!this._MainActivity.DispatchKeyDown(e),this._RenderBridge.TakeAndSyncBackStatus()}return t}_KeyProcUp(e){if(this._KeyLock)return!0;var t=!0;return this._MainActivity&&(t=!this._MainActivity.DispatchKeyUp(e),this._RenderBridge.TakeAndSyncBackStatus()),t}_RegisterKeyListener(e){e.keyProc=this._KeyProcDown.bind(this),e.keyUpProc=this._KeyProcUp.bind(this)}}class K{constructor(){this._ActivityManager=null}Init(e){let t=1280,i=1;try{if(H){let e=H();"number"==typeof e.width&&(t=e.width),"number"==typeof e.displayScale&&(i=e.displayScale)}}catch(e){console.log("Note: DesignMap failed")}this._ActivityManager=new W(e,i,t),U?U(this._ActivityManager):console.error("FATAL: no found entry")}getActivityManager(){return this._ActivityManager}}let U=null,H=null;class J{constructor(e){this.PageName=e,this._FocusChild=null,this._LatestFocusChild=null,this.SubPages=[],this._ParentPage=null,this._KeyLock=!1}OnRenderFrame(){t("OnRenderFrame() MUST override")}OnKeyDown(e){return!1}OnKeyUp(e){return!1}DispatchKeyDown(e){if(this._KeyLock)return!0;let t=!1;return this._FocusChild&&(t=this._FocusChild.DispatchKeyDown(e)),t||(t=this.OnKeyDown(e)),t}OnCustomEvent(e){return!1}BubbleCustomEvent(e){this.OnCustomEvent(e)||this._ParentPage&&this._ParentPage.BubbleCustomEvent(e)}DispatchKeyUp(e){if(this._KeyLock)return!0;let t=!1;return this._FocusChild&&(t=this._FocusChild.DispatchKeyUp(e)),t||(t=this.OnKeyUp(e)),t}PrintLastFocusPage(){let e="------"+this.PageName+"\n",t=this._ParentPage;return t&&(e+=t.PrintLastFocusPage()),e}IsFocus(){return!this._ParentPage||this._ParentPage._FocusChild==this}_IsLeafInChain(){return this.IsFocus()&&!this._FocusChild}SetParent(e){null!=e?(this._ParentPage=e,e.SubPages.push(this)):s("ERROR: parent is null")}SetParentPage(e){this.SetParent(e)}OnRemoveFromTree(){if(this._ParentPage=null,this.SubPages&&this.SubPages.length>0){for(let e of this.SubPages)e.OnRemoveFromTree();this.SubPages=[]}}RemoveSubPage(e){e==this._FocusChild&&(this._FocusChild=null),e==this._LatestFocusChild&&(this._LatestFocusChild=null);for(let t=0;t<this.SubPages.length;t++)if(e==this.SubPages[t]){this.SubPages.splice(t,1);break}}ClearSubPages(){this.SubPages=[],this._FocusChild=null,this._LatestFocusChild=null}GetParentPage(){return this._ParentPage}Focus(e=!1){if(this.IsFocus()){if(!e)return void n("requestFocus(): Already focused name="+this.PageName);if(this._IsLeafInChain())return void n("requestFocus(): Already focused name="+this.PageName)}if(j)return void z.push(this);if(j=!0,this._ParentPage){let t,i=[],n=this;for(;n._ParentPage&&!n.IsFocus();)i.push(n),n=n._ParentPage;t=e&&0==i.length?this._FocusChild:i[i.length-1]._ParentPage?._FocusChild;let a=[];for(;t;)a.push(t),t=t._FocusChild;for(let e=a.length-1;e>=0;e--)a[e]._BlurInternal();for(let e=i.length-1;e>=0;e--)i[e]._FocusInternal();if(e)this._LatestFocusChild=null;else{let e=i[0];for(;e._LatestFocusChild&&null==e._FocusChild;)e._LatestFocusChild._FocusInternal(),e=e._FocusChild,e||s("ERROR: focus chain is broken")}}j=!1;let t=z.length;if(t>0){let e=z;z=[];for(let i=0;i<t;i++)e[i].Focus()}}ReturnFocusToParent(){this._ParentPage&&(this.IsFocus()&&this._ParentPage.Focus(!0),this._ParentPage._FocusChild==this&&(this._ParentPage._FocusChild=null),this._ParentPage._LatestFocusChild==this&&(this._ParentPage._LatestFocusChild=null))}_FocusInternal(){this._ParentPage?(this._ParentPage._FocusChild=this,this._ParentPage._LatestFocusChild=this,this.OnFocus()):t("No dispatcher")}_BlurInternal(){this._ParentPage?this._ParentPage._FocusChild==this?(this._ParentPage._FocusChild=null,this.OnBlur()):i("Not focus yet, page name="+this.PageName):t("No dispacher")}GetFocusChild(){return this._FocusChild}OnFocus(){i("No overrided Page OnFocus event, page name="+this.PageName)}OnBlur(){i("No overrided Page OnBlur event, page name="+this.PageName)}KeyLock(){this._KeyLock=!0}UnKeyLock(){this._KeyLock=!1}}let j=!1,z=[];var Y;!function(e){e.VIEW_COMMAND=0,e.TEXTURE_COMMAND=1,e.ANIM_COMMAND=2,e.SYNC_COMMAND=3,e.APIC_PLAY=0,e.APIC_STOP=1,e.GET_BOUNDING_RECT=0,e.FILTER_VIEW_WAVE=1,e.TRANSLATE_FRAME_ALT_SPEED=0,e.FREE_MOVE_RUN_CMDPACKS=1,e.EXE_DEFAULT=0,e.EXE_AFTER_RENDER=1}(Y||(Y={}));const X=(e,t)=>{let i=0,n=0,s=0;return isNaN(e)||(i|=1,n=e),isNaN(t)||(i|=2,s=t),{e:i,x:n,y:s}};var Q,$,Z;!function(e){e.ActEvent_ActFinish=1,e.ActEvent_Speed_X_Revert=2,e.ActEvent_Speed_Y_Revert=3,e.ActEvent_ActReject=4,e.ActEvent_ActDragStart=5,e.ActEvent_ActDragEnd=6,e.ActEvent_ActFlingStart=7,e.ActEvent_ActFlingProgress=8,e.ActEvent_ActFlingEnd=9,e.ActEvent_ActTouchDown=10,e.ActEvent_ActTouchRelease=11,e.ActEvent_ActFlingCancel=12,e.ActEvent_ActFlingDrop=13,e.ActEvent_MovementSync=14}(Q||(Q={})),function(e){e.GroupType_ActionAssoc=10,e.GroupType_Fling=11,e.GroupType_Invalid_Ext=65535}($||($={})),function(e){e.FLING_ON_PROGRESS_INTERVAL=200}(Z||(Z={}));const ee=(e,t)=>{e.gtype=t.g,e.once=t.m?0:1;let i=t.s;i&&(e.name=i),e.brk=t.brk?1:0};const te=51;function ie(e){return e?JSON.stringify(e.Package()):null}let ne=new class{constructor(){this._NativeSyncer=w}CreateTranslate(e,t,i,n,s,a,r){s!=1/0&&null!=s||(console.warn("translate animation duration invalid="+s),s=0),this._NativeSyncer.CallToNative(1,[e,t,i,n,s,ie(a),r])}CreateRotate(e,t,i,n,s,a,r){s!=1/0&&null!=s||(console.warn("rotate animation duration invalid="+s),s=0),this._NativeSyncer.CallToNative(2,[e,t,i.x,i.y,i.z,n.x,n.y,n.z,s,ie(a),r])}CreateScale(e,t,i,n,s,a,r,o,l,h,c){l!=1/0&&null!=l||(console.warn("scale animation duration invalid="+l),l=0),this._NativeSyncer.CallToNative(3,[e,t,i,n,s,a,r,o,l,ie(h),c])}CreateTranslateFrame(e,t,i,n,s,a,r,o){this._NativeSyncer.CallToNative(5,[e,t,i,n,!!s,a,r,o])}CreateCssKeyframe(e,t,i,n,s,a){t!=1/0&&null!=t||(console.warn("css animation duration invalid="+t),t=0),this._NativeSyncer.CallToNative(6,[e,t,i,n,s,a])}CreateFreeMoveAnimation(e,t,i,n){this._NativeSyncer.CallToNative(7,[e,t?u.AddData(t):0,i,n?1:0])}CreateShaderAnimation(e,t,i){this._NativeSyncer.CallToNative(8,[e,t,i])}};class se{constructor(){this.AnimNativeId=C.genAnimationId(),this._NativeSyncer=new b(this.AnimNativeId),this._ListenerObj=null,this._ListenerStatusCallback=null}SetAnimationListener(e){this._OnNewListener(e)}AddAnimationListener(e){this._ListenerObj&&e.AddInherit(this._ListenerObj),this._OnNewListener(e)}RemoveAnimationListener(){this._ListenerObj=null}Enable(e){this._NativeSyncer.CallToNative(2,[e])}EnableInfinite(){return this._NativeSyncer.CallToNative(3,null),this}SetRepeat(e){return this._NativeSyncer.CallToNative(5,[e]),this}EnableDelay(e){return this._NativeSyncer.CallToNative(4,[e]),this}SetStartPos(e){return e>=0&&e<=1?this._NativeSyncer.CallToNative(6,[e]):console.warn("Warning: SetStartPos() out of range"),this}_OnNewListener(e){let t=!0;if(this._ListenerObj&&(t=this._ListenerObj.ListenerEnabledFlags==e.ListenerEnabledFlags),this._ListenerObj=e,null!=this._ListenerObj&&(null==this._ListenerStatusCallback||!t)){let e=this;this._ListenerStatusCallback=t=>{e._ListenerObj?.InvokeFromNativeForge(t)};let t=u.AddData(this._ListenerStatusCallback);this._NativeSyncer.CallToNative(1,[t,this._ListenerObj.ListenerEnabledFlags])}}}var ae,re;!function(e){e.ReleaseAfterEndCallback=1,e.KeepTransform=2,e.AckFinalProgress=4,e.AckRepeat=8}(ae||(ae={})),function(e){e.AltSpeed=(e,t,i)=>{let n={S60:Math.floor(100*t/55)/100,T:i};e?.DispatchAnimCommand(Y.TRANSLATE_FRAME_ALT_SPEED,JSON.stringify(n))},e.RunFreeMoveCmdPacks=(e,t)=>{e?.DispatchAnimCommand(Y.FREE_MOVE_RUN_CMDPACKS,JSON.stringify(t))}}(re||(re={}));class oe{constructor(){this._MaskType="COMMON"}Type(){return this._MaskType}ToSyncJsonObj(e){return e||(e={}),e.typ=this._MaskType,e}}let le=new class{constructor(){this._InnerViews={},this._ViewToken=0}add(e){let t=e.view.ViewId;return this._InnerViews.hasOwnProperty(t)&&(this._InnerViews[t]=e),t}remove(e){this._InnerViews[e]&&delete this._InnerViews[e]}get(e){return this._InnerViews[e]}clear(){this._InnerViews={},this._ViewToken=0}};class he{constructor(){this.SensorId=C.genViewId(),this._NativeSync=new L(this.SensorId),this.CreateSensor()}CreateSensor(){}CreateTypedSensor(e){k.CallToNative(1,[this.SensorId,e],!0)}Recycle(){this._NativeSync.CallToNative(1,null,!0)}}class ce{constructor(e,t,i,n){this.Texture=e,this.MaskSetting=t,void 0===n&&(n=!0),this.HasAlpha=n}ToSyncJsonObj(e=void 0){return e||(e={}),e.texId=this.Texture?this.Texture.TexId:0,e.alpha=this.HasAlpha,this.MaskSetting?e.mask=this.MaskSetting.ToSyncJsonObj():e.mask=null,e}}var ue;!function(e){var t,i,n;(t=e.ControlType||(e.ControlType={})).DoKeepInRender=1,t.RecycleKeptView=2,(i=e.SyncedType||(e.SyncedType={})).Synced=0,i.NotSynced=1,i.RequestKeepInRender=2,i.OnKeepingInRender=3,i.RecycleKeeping=4,(n=e.TextureCoordAnchor||(e.TextureCoordAnchor={})).LeftTop=1,n.CenterTop=2,n.RightTop=3,n.LeftMiddle=4,n.Center=5,n.RightMiddle=6,n.LeftBottom=7,n.CenterBottom=8,n.RightBottom=9}(ue||(ue={}));let de=new class{constructor(){this._NativeSyncer=F}CreateNativeView(e,t,i){this._NativeSyncer.CallToNative(1,[e,t],i)}CreateJsRootView(e){this._NativeSyncer.CallToNative(2,[e])}CreateDomProxyView(e,t,i){this._NativeSyncer.CallToNative(3,[e,t,i?1:0],!0)}};class _e{constructor(e,t,i=!1){this.Visibility=void 0,this._NativeSyncer=new x(e),this.ViewId=e,this.TextureSetting=null,this._CallTextureSet=null,this._DomDepends=i,this._GetBCRCallback=null,this.CreateView(t)}CreateView(e=void 0){}ResetTexture(e=null){if(!this._CallTextureSet){this._CallTextureSet=this._NativeSyncer.CallToNative(1,null,this._DomDepends);let e=this;this._NativeSyncer.AddStartSyncCallback((()=>{this.TextureSetting?e._NativeSyncer.AlterCallParams(e._CallTextureSet,[e.TextureSetting.ToSyncJsonObj()]):e._NativeSyncer.AlterCallParams(e._CallTextureSet,[null]),e._CallTextureSet=null}))}this.TextureSetting=e}BindedPageBase(e){}SetVisibility(e){if("INHERIT"!==e&&void 0!==e||(e="VISIBLE"),this.Visibility!=e){this.Visibility=e;let t=0;switch(e){case"VISIBLE":t=1;break;case"GONE":t=2;break;case"HIDDEN":t=3;break;default:return void console.error("unknown visible type="+e)}this._NativeSyncer.CallToNative(2,[t],this._DomDepends)}}AddView(e,t){let i={x:0,y:0,width:0,height:0};t&&(i=this._FormatLayoutParams(t)),this._NativeSyncer.CallToNative(3,[e.ViewId,t?1:0,i.x,i.y,i.width,i.height],this._DomDepends)}ClearViews(){this._NativeSyncer.CallToNative(4,null,this._DomDepends)}ResetTextureCssTransform(e,t){e=e||"",t=t||"",this._NativeSyncer.CallToNative(5,[e,t],this._DomDepends)}SetTextureCoord(e,t,i,n,s=ue.TextureCoordAnchor.Center){this._NativeSyncer.CallToNative(9,[e,t,i,n,s],this._DomDepends)}ResetLayoutParams(e){let t;null!=e?(t=this._FormatLayoutParams(e),this._NativeSyncer.CallToNative(6,[t.x,t.y,t.width,t.height],this._DomDepends)):s("ResetLayoutParams(): new params is null")}_FormatLayoutParams(e){return{x:isNaN(e.x)?0:e.x,y:isNaN(e.y)?0:e.y,width:isNaN(e.width)?0:e.width,height:isNaN(e.height)?0:e.height}}GetBoundingClientRect(){return new Promise(((e,t)=>{null!=this._GetBCRCallback&&(this._GetBCRCallback=null),this._GetBCRCallback=i=>{null!=this._GetBCRCallback&&(this._GetBCRCallback=null);const n=JSON.parse(i);0==n.status?e(n.data):t(n.error)};const i=u.AddData(this._GetBCRCallback);this._NativeSyncer.CallToNative(12,[i],this._DomDepends)}))}StartAnimation(e,t,i){let n=e?e.AnimNativeId:0;this._NativeSyncer.CallToNative(7,[n,isNaN(i)?0:i],this._DomDepends)}StopAnimation(){this._NativeSyncer.CallToNative(8,null,this._DomDepends)}DispatchAnimCommand(e,t){this._NativeSyncer.CallToNative(13,[e,t],this._DomDepends)}StartTextureAnimation(e){let t=e?e.AnimNativeId:0;this._NativeSyncer.CallToNative(10,[t],this._DomDepends)}StopTextureAnimation(){this._NativeSyncer.CallToNative(11,null,this._DomDepends)}DragEnables(e){this._NativeSyncer.CallToNative(14,[e],this._DomDepends)}SetTapListener(e=void 0){if(null!=e){const t=u.AddData(e);this._NativeSyncer.CallToNative(15,[t],this._DomDepends)}else this._NativeSyncer.CallToNative(15,[0],this._DomDepends)}EnableAutoSize(){this._NativeSyncer.CallToNative(16,[],this._DomDepends)}RegisterFlexAssigned(e=void 0){if(null!=e){const t=u.AddData(e);this._NativeSyncer.CallToNative(17,[t],this._DomDepends)}else this._NativeSyncer.CallToNative(17,[0],this._DomDepends)}EnableVisibleTestRect(){this._NativeSyncer.CallToNative(18,[],this._DomDepends)}Capture2Texture(e,t=void 0){if(!e)return void console.error("Error: Capture2Texture need target texture");let i=e.GetTextureId();if(!t)return void console.error("Error: Capture2Texture need callback");const n=u.AddData(t);this._NativeSyncer.CallToNative(19,[i,n],this._DomDepends)}}class Se extends _e{constructor(e=null){!e||e instanceof ce||s("ERROR:LayoutView need TextureSetting as parameter"),super(C.genViewId(),{DomDepends:!1}),this.Visibility="VISIBLE",e&&this.ResetTexture(e)}CreateView(e){de.CreateNativeView(this.ViewId,0,e.DomDepends)}}function pe(e){let t=[];if(e instanceof Array)for(let i of e)i instanceof _e&&t.push(i.ViewId);return t}class ye extends he{constructor(e,t,i,n){super(),this.InitSet(e,t,i,n)}CreateSensor(){this.CreateTypedSensor(3)}InitSet(e,t,i,n){let s=0;i&&(s=u.AddData((e=>{1==e?i.OnBeginContact?.():2==e&&i.OnEndContact?.()}))),this._NativeSync.CallToNative(20,[e.ViewId,t.ViewId,s,n?n.SensorId:0],!0)}}let ve={StartTrace:(e,t,i,n)=>new ye(e,t,i,n),Callback:class{constructor(e,t){this.OnBeginContact=e,this.OnEndContact=t}UpdateImpactCallback(e){this.OnBeginContact=e}UpdateLeaveCallback(e){this.OnEndContact=e}},AutoFroze:class extends he{constructor(e,t){super(),this.InitSet(),this._UpdatePreImpactList(pe(e)),this._UpdateOnImpactList(pe(t)),this._FreshAutoRecycleRef()}CreateSensor(){this.CreateTypedSensor(2)}InitSet(){this._NativeSync.CallToNative(25,null,!0)}UpdatePreImpactList(e){this._UpdatePreImpactList(pe(e)),this._FreshAutoRecycleRef()}UpdateOnImpactList(e){this._UpdateOnImpactList(pe(e)),this._FreshAutoRecycleRef()}_UpdatePreImpactList(e){this._NativeSync.CallToNative(26,[...e],!0)}_UpdateOnImpactList(e){this._NativeSync.CallToNative(27,[...e],!0)}_FreshAutoRecycleRef(){this._NativeSync.CallToNative(28,null,!0)}}};var me;!function(e){e[e.NONE=0]="NONE",e[e.TEXT=1]="TEXT",e[e.PASSWORD=2]="PASSWORD",e[e.TEXT_AREA=3]="TEXT_AREA",e[e.CONTENT_EDITABLE=4]="CONTENT_EDITABLE",e[e.SEARCH=5]="SEARCH",e[e.URL=6]="URL",e[e.EMAIL=7]="EMAIL",e[e.TELEPHONE=8]="TELEPHONE",e[e.NUMBER=9]="NUMBER"}(me||(me={}));var Ce,fe;!function(e){var t;(t=e.UniformType||(e.UniformType={}))[t.FLOAT=1]="FLOAT"}(Ce||(Ce={})),function(e){var t,i;(t=e.Type||(e.Type={}))[t.GRAY_DOWN=1]="GRAY_DOWN",t[t.WAVE=2]="WAVE",(i=e.Wave||(e.Wave={}))[i.CIRCLE_WAVE=1]="CIRCLE_WAVE",i[i.RECTANGLE_WAVE=2]="RECTANGLE_WAVE"}(fe||(fe={}));let Ie=0;class Te{constructor(){this.sourceList=[]}addSource(e,t,i,n,s){n=n??{type:fe.Wave.CIRCLE_WAVE},s=s??{timeDecay:3,distanceDecay:10,speed:100,frequency:8,waveNum:2};const a=++Ie;let r=0,o=0,l=0;return n.type==fe.Wave.RECTANGLE_WAVE&&(r=n.width,o=n.height,l=n.radius),this.sourceList.push(a,e,t,i,r,o,l,s.timeDecay,s.distanceDecay,s.speed,s.frequency,s.waveNum),a}getSourceList(){const e=this.sourceList;return this.sourceList=[],e}}class ge extends _e{constructor(e,t){super(C.genViewId(),{DomElementId:e,UseMaskView:t},!0),this.Visibility="VISIBLE"}CreateView(e){de.CreateDomProxyView(this.ViewId,e.DomElementId,e.UseMaskView)}RegisterOnProxyReady(e){e?.()}}function Ne(e){return isNaN(e)?0:parseInt(e)}function Ae(e){return{fontFamily:e.fontFamily?e.fontFamily:xe.sDefaultFont,fontSize:Ne(e.fontSize),italic:"italic"===e.fontStyle,bold:"bold"===e.fontWeight}}function Re(){return e.sRenderBridge.GetTextToolsApi()}function we(e,t){let i=Ae(t);return Re().GetTextWidth(e,JSON.stringify(i))}function be(e,t){let i=Ae(t);const n=Re().GetOneLineTextDrawWidth(e,JSON.stringify(i)),s={totalWidth:n[0],sliceInfo:[]};for(let e=1;e<n.length;e+=3)s.sliceInfo.push({start:n[e],end:n[e+1],width:n[4]});return s}function Ee(e,t,i,n,s,a){let r;if(e>0)r=Re().GetCursorPosition(e,t,null,null,null,1);else{let o=Ae(n),l=function(e){let t=Ne(e.height),i=Ne(e.lineHeight),n="string"==typeof e.wordWrap?e.wordWrap:"none";return"nowrap"==e.whiteSpace&&(n="none"),{width:Ne(e.width),height:t,textAlign:"string"==typeof e.textAlign?e.textAlign:"left",lineHeight:0==i?t:i,wordWrap:n,textOverflow:"string"==typeof e.textOverflow?e.textOverflow:"clip"}}(s);r=Re().GetCursorPosition(e,t,i,JSON.stringify(o),JSON.stringify(l),a?1:0)}return r}function De(e){Re().RemoveCursorTextCache(e)}var xe;!function(e){e.sDefaultFont="黑体",e.sDefaultFontSize=30,e.sDefaultFontColor="#FFFFFF",e.sDefaultBackgroundColor="rgba(0, 0, 0, 0)",e.GetTextWidth=we,e.GetOneLineTextDrawWidth=be,e.GetCursorPosition=Ee,e.RemoveCursorTextCache=De}(xe||(xe={}));let Fe=e;Fe.Run=function(e){return B=new K,B.Init(e),B},Fe.InitStarter=function(t,i){e.DesignMap=i,U=t,H=i},Fe.NewDomProxyView=function(e,t){return new ge(e,t)},Fe.sFrameCount=N,Fe.NativeConstant=Y,Fe.PageBase=J,Fe.ReactActivity=class extends J{constructor(e,t){super(e),this._TextureManager=t.GetTextureManager()}GetTextureManager(){return this._TextureManager}SetContentView(e,t){this._ContentView=e,this._ContentViewSize=t}},Fe.ViewTextureMask=class extends oe{constructor(e){super(),this._MaskType="TEXTURE",this.ImageTexture=e}ToSyncJsonObj(e){return e||(e={}),e.texId=this.ImageTexture.TexId,super.ToSyncJsonObj(e)}},Fe.ViewRoundCornerMask=class extends oe{constructor(e,t,i,n){super(),this._MaskType="CORNER",this._TopLeft=e,this._TopRight=isNaN(t)?e:t,this._BottomLeft=isNaN(i)?e:i,this._BottomRight=isNaN(n)?e:n}ToSyncJsonObj(e){return e||(e={}),e.tl=this._TopLeft,e.tr=this._TopRight,e.bl=this._BottomLeft,e.br=this._BottomRight,super.ToSyncJsonObj(e)}},Fe.sViewStore=le,Fe.ViewInfo=class{constructor(e,t){this.view=e,this.layout_params=t}},Fe.LayoutView=Se,Fe.AutoStretchView=class extends Se{constructor(e=null){super(e)}CreateView(e){de.CreateNativeView(this.ViewId,12,e.DomDepends)}},Fe.EditControlView=class extends Se{constructor(t=null){super(t),this._AppListeners=null,this._ImeSyncFunc=this._ImeEventListener.bind(this),this._MsgToken="_JscIme_"+this.ViewId,e.sRenderBridge.GetPlatformMsgDisp().subscribe(this._MsgToken,this._ImeSyncFunc)}CreateView(e){de.CreateNativeView(this.ViewId,5,e.DomDepends)}releaseResource(){e.sRenderBridge.GetPlatformMsgDisp().unsubscribe(this._MsgToken,this._ImeSyncFunc)}setEditorStyle(e,t,i,n){this._NativeSyncer.CallToNative(5005,[e,t,i,n],this._DomDepends)}showIme(e,t,i,n,s){e!=me.NONE?(void 0!==i&&null!=i||(i=t.length>0?t.length:0),i<0?i=0:i>t.length&&(i=t.length>0?t.length:0),this._NativeSyncer.CallToNative(5001,[e,encodeURIComponent(t),i,n,s],this._DomDepends)):console.log("showIme inputType error")}hideIme(){this._NativeSyncer.CallToNative(5002,null,this._DomDepends)}updateCursorOffset(e,t,i,n){this._NativeSyncer.CallToNative(5003,[e,t,i,n],this._DomDepends)}addImeEventListener(e){this._AppListeners=e}_OnStatusFromPlatform(e){this._NativeSyncer.CallToNative(5006,[e],this._DomDepends)}_ImeEventListener(e){if(e){var t=JSON.parse(e);if("text"==t.type){var i=t.text;let e=t.selectStart,n=t.scrollLeft,s=t.scrollTop;this._AppListeners?.OnTextChanged(decodeURIComponent(i),e,n,s)}else if("vstatus"==t.type){let e=t.isVisible?1:0;this._OnStatusFromPlatform(e),this._AppListeners?.OnStatusChanged(e)}else if("action"==t.type){var n=t.action;this._AppListeners?.OnEditAction(n)}}else console.log("EditControlView","_ImeEventListener input_data error")}},Fe.FilterView=class extends Se{constructor(e=null,t){super(e),this._Type=t??fe.Type.GRAY_DOWN,this._NativeSyncer.CallToNative(10002,[this._Type,[]],this._DomDepends)}CreateView(e){de.CreateNativeView(this.ViewId,10,e.DomDepends)}FilterSwitch(e){this._NativeSyncer.CallToNative(10001,[e],this._DomDepends)}AddWaveSourceList(e){if(this._Type==fe.Type.WAVE){const t={T:1,L:e.getSourceList()};this.DispatchCommand(Y.FILTER_VIEW_WAVE,JSON.stringify(t))}else console.error("FilterView error: add wave source while filter view type is GRAY_DOWN.")}AddWaveSourceSingle(e,t,i,n={type:fe.Wave.CIRCLE_WAVE},s={timeDecay:3,distanceDecay:10,speed:100,frequency:8,waveNum:2}){if(this._Type==fe.Type.WAVE){const a=new Te,r=a.addSource(e,t,i,n,s);return this.AddWaveSourceList(a),r}return console.error("FilterView error: add wave source while filter view type is GRAY_DOWN."),-1}RemoveSource(e){if(this._Type==fe.Type.WAVE){const t={T:2,L:e instanceof Array?e:[e]};this.DispatchCommand(Y.FILTER_VIEW_WAVE,JSON.stringify(t))}else console.error("FilterView error: remove wave source while filter view type is GRAY_DOWN.")}DispatchCommand(e,t){t&&this._NativeSyncer.CallToNative(10003,[e,t],this._DomDepends)}},Fe.FragShaderView=class extends Se{constructor(e=null){super(e)}CreateView(e){de.CreateNativeView(this.ViewId,11,e.DomDepends)}SetShaderInfo(e,t,i,n){const s={shaderStr:e,uniformParams:t,textureParams:i};let a=0;null!=n&&(a=u.AddData(n)),this._NativeSyncer.CallToNative(7001,[JSON.stringify(s),a],this._DomDepends)}},Fe.NativeSharedView=class extends Se{constructor(e){super(e),this._JsContextId=window.JsView?window.JsView.getJsContextId():0,this._TrackId=null,this.SetTrackId(this._JsContextId+"_"+this.ViewId)}CreateView(e){de.CreateNativeView(this.ViewId,9,e.DomDepends)}GetTrackId(){return this._TrackId}SetTrackId(e){this._TrackId=e,this._NativeSyncer.CallToNative(10101,[this._TrackId],this._DomDepends)}SetOverSize(e){this._NativeSyncer.CallToNative(10102,[isNaN(e)?0:e],this._DomDepends)}},Fe.NinePatchView=class extends Se{CreateView(e){de.CreateNativeView(this.ViewId,4,e.DomDepends)}SetRepeat(e,t){this._NativeSyncer.CallToNative(4001,[e,t],this._DomDepends)}SetPadding(e,t){this._NativeSyncer.CallToNative(4002,[e,t],this._DomDepends)}SetImageDspSize(e,t){this._NativeSyncer.CallToNative(4003,[e,t],this._DomDepends)}SetDesignMapWidth(e){this._NativeSyncer.CallToNative(4004,[e],this._DomDepends)}EnableAlphaMix(e){this._NativeSyncer.CallToNative(4005,[e.TexId],this._DomDepends)}},Fe.PreloadView=class extends Se{constructor(e=null){super(e)}CreateView(e){de.CreateNativeView(this.ViewId,7,e.DomDepends)}},Fe.SprayView=class extends Se{constructor(e=null){super(e)}SetSprayInfo(e,t,i,n,s,a,r,o,l,h,c,u,d,_,S,p,y,v,m,C,f,I,T){this._NativeSyncer.CallToNative(6001,[e,t,i,n,s,a,r,o,l,h,c,u,d,_,!!S,!!p,!!y,v,m,C,f,I,T],this._DomDepends)}CreateView(e){de.CreateNativeView(this.ViewId,6,e.DomDepends)}},Fe.TextInputType=me,Fe.FilterViewType=fe,Fe.TextureSetting=ce,Fe.ExternalTextureSetting=ce,Fe.TextUtils=xe,Fe.VisibleSensor=class extends he{constructor(e,t=null){super(),this.InitSet(e,t)}CreateSensor(){this.CreateTypedSensor(1)}InitSet(e,t){let i=0;t&&(i=u.AddData(((e,i,n,s)=>{t(1==e,1==i,1==n,1==s)}))),this._NativeSync.CallToNative(11,[e.ViewId,i],!0)}ResetArea(e){"number"!=typeof e.horizon&&(console.log("horizon not set, default to 1.0"),e.horizon=1),"number"!=typeof e.vertical&&(console.log("vertical not set, default to 1.0"),e.vertical=1),this._NativeSync.CallToNative(12,[e.horizon,e.vertical],!0)}Enable(e){this._NativeSync.CallToNative(13,[!!e],!0)}ResetContainer(e){let t;t=e?e.ViewId:0,this._NativeSync.CallToNative(14,[t],!0)}},Fe.EnvBlockerSensor=class extends he{constructor(e){super(),this.InitSet(e)}CreateSensor(){this.CreateTypedSensor(4)}InitSet(e){this._NativeSync.CallToNative(30,[e.ViewId],!0)}ResetTopGID(e){this._ResetSideGID(0,e)}ResetBottomGID(e){this._ResetSideGID(1,e)}ResetLeftGID(e){this._ResetSideGID(2,e)}ResetRightGID(e){this._ResetSideGID(3,e)}_ResetSideGID(e,t){this._NativeSync.CallToNative(31,[e,isNaN(t)?0:parseInt(t)],!0)}Enable(e){this._NativeSync.CallToNative(32,[e],!0)}},Fe.sImpactSensorManager=ve,Fe.TextureInstantLoad=T,Fe.QRCodeLevel=I,Fe.ColorSpace=f,Fe.TextureManager=g,Fe.FreeMoveExternType=$,Fe.AnimationListener=class{constructor(e,t,i){this.ListenerEnabledFlags=0,this.InvokeAnimationStart=e,this._OnAnimationStart=e,e&&(this.ListenerEnabledFlags|=1),this.InvokeAnimationEnd=t,this._OnAnimationEnd=t,t&&(this.ListenerEnabledFlags|=2),this.InvokeViewNoVisible=i,this._OnViewNoVisible=i,i&&(this.ListenerEnabledFlags|=4),this.InvokeAnimRepeat=null,this._OnAnimRepeat=null,this.InvokeAnimFinal=null,this._OnAnimFinal=null,this._AttachedGroup=null,this._InheritListener=[]}OnStart(e){return this.InvokeAnimationStart=this._OnAnimationStart=e,e?this.ListenerEnabledFlags|=1:this.ListenerEnabledFlags&=30,this}OnEnd(e){return this.InvokeAnimationEnd=this._OnAnimationEnd=e,e?this.ListenerEnabledFlags|=2:this.ListenerEnabledFlags&=29,this}OnRepeat(e){return this.InvokeAnimRepeat=this._OnAnimRepeat=e,e?this.ListenerEnabledFlags|=8:this.ListenerEnabledFlags&=23,this}OnFinalProgress(e){return this.InvokeAnimFinal=this._OnAnimFinal=e,e?this.ListenerEnabledFlags|=16:this.ListenerEnabledFlags&=15,this}AddInherit(e){if(e){if(0==this._InheritListener.length){var t=this;this.InvokeAnimationStart=function(){t._OnAnimationStart&&t._OnAnimationStart();for(var e=0;e<t._InheritListener.length;e++)t._InheritListener[e].InvokeAnimationStart?.()},this.InvokeAnimationEnd=function(e){t._OnAnimationEnd&&t._OnAnimationEnd(e);for(var i=0;i<t._InheritListener.length;i++)t._InheritListener[i].InvokeAnimationEnd?.(e)},this.InvokeViewNoVisible=function(){t._OnViewNoVisible&&t._OnViewNoVisible();for(var e=0;e<t._InheritListener.length;e++)t._InheritListener[e].InvokeViewNoVisible?.()},this.InvokeAnimFinal=function(e){t._OnAnimFinal&&t._OnAnimFinal(e);for(var i=0;i<t._InheritListener.length;i++)t._InheritListener[i].InvokeAnimFinal?.(e)},this.InvokeAnimRepeat=function(e){t._OnAnimRepeat&&t._OnAnimRepeat(e);for(var i=0;i<t._InheritListener.length;i++)t._InheritListener[i].InvokeAnimRepeat?.(e)},this.ListenerEnabledFlags=31}this._InheritListener.push(e)}}InvokeFromNativeForge(e){switch(e.type){case"end":this.InvokeAnimationEnd?.(1==e.normalEnd);break;case"novisible":this.InvokeViewNoVisible?.();break;case"final":this.InvokeAnimFinal?.(e.progress);break;case"repeat":this.InvokeAnimRepeat?.(e.timesCount)}}},Fe.AnimFireCommand=re,Fe.AnimationEnable=ae,Fe.TranslateAnimation=class extends se{constructor(e,t,i,n,s,a){super(),ne.CreateTranslate(e,t,i,n,s,a,this.AnimNativeId)}},Fe.RotateAnimation=class extends se{constructor(e,t,i,n,s,a){super(),ne.CreateRotate(e,t,i,n,s,a,this.AnimNativeId)}},Fe.ScaleAnimation=class extends se{constructor(e,t,i,n,s,a,r,o,l=200,h=200){super(),ne.CreateScale(e,t,i,n,s,a,l,h,r,o,this.AnimNativeId)}},Fe.TranslateFrameAnimation=class extends se{constructor(e,t,i,n,s,a){super();let r=Math.floor(100*i/55)/100;ne.CreateTranslateFrame(e,t,r,r,n,s,a,this.AnimNativeId)}},Fe.CssKeyframeAnimation=class extends se{constructor(e,t,i,n,s){super(),ne.CreateCssKeyframe(e,t,i,n,s,this.AnimNativeId)}},Fe.ShaderAnimation=class extends se{constructor(e,t){super(),ne.CreateShaderAnimation(e,t,this.AnimNativeId)}},Fe.FreeMoveAnimation=class extends se{constructor(e,t,i){super(),this._EchoCallback=e,ne.CreateFreeMoveAnimation(this.AnimNativeId,e,t,i)}},Fe.FreeMoveActEvtType=Q,Fe.FreeMoveCmdPackBuilder=class{static InitActCmdPack(e,t,i,n){return{t:1,cmds:n,tkn:isNaN(i)?0:i,spd:isNaN(e)?0:e,acc:isNaN(t)?0:t}}static InitStateCmdPack(e){return{t:2,cmd:e}}},Fe.FreeMoveConditionSet=class{static AppendSubCmd(e,t){const i="cmds";e.hasOwnProperty("cmdPacks")?console.error("Error: conflict with command pack list"):(e.hasOwnProperty(i)||(e[i]=[]),e[i]?.push(t))}static SetCmdList(e,t){t instanceof Array&&(e.hasOwnProperty("cmdPacks")?console.error("Error: conflict with command pack list"):e.cmds=t)}static SetCmdPackList(e,t){t instanceof Array&&(e.hasOwnProperty("cmds")?console.error("Error: conflict with sub-command list"):e.cmdPacks=t)}static InitCommonInfo(){return{g:0,m:!1,s:null,brk:!1}}static UpdateCommonInfo(e,t,i,n,s){e.g=t??0,e.m=i??!1,e.s=n??null,e.brk=s}static ReachPosition(e,t,i){let n=X(e,t),s={subt:1,react:1,e:n.e,xv:n.x,yv:n.y};return ee(s,i),s}static AcrossPosition(e,t,i){let n=X(e,t),s={subt:1,react:2,e:n.e,xv:n.x,yv:n.y};return ee(s,i),s}static BoxPosition(e,t,i,n,s){let a=0,r=0,o=0,l=0,h=0;isNaN(e)||(a=e,h|=1),isNaN(t)||(r=t,h|=2),isNaN(i)||(o=i,h|=4),isNaN(n)||(l=n,h|=8);let c={subt:1,react:7,de:h,lv:a,tv:r,rv:o,bv:l};return ee(c,s),c}static StartMove(e,t){return this.OnMovement(t,1,1,e)}static OnMovement(e,t,i,n){let s={subt:1,react:9,xv:t,yv:i,e:n};return ee(s,e),s}static OffsetPosition(e,t,i,n,s){let a=0,r=0,o=0,l=0,h=0;isNaN(e)||(a=e,h|=1),isNaN(t)||(r=t,h|=2),isNaN(i)||(o=i,h|=4),isNaN(n)||(l=n,h|=8);let c={subt:1,react:8,de:h,lv:a,tv:r,rv:o,bv:l};return ee(c,s),c}static WallPosition(e,t,i,n){let s,a=X(t,i);switch(e){case"left":s=4;break;case"top":s=3;break;case"right":s=5;break;case"bottom":s=6;break;default:return console.error("WallPosition undefined direction",e),null}let r={subt:1,react:s,e:a.e,xv:a.x,yv:a.y};return ee(r,n),r}static ReachSpeed(e,t,i){let n=X(e,t),s={subt:2,react:1,e:n.e,xv:n.x,yv:n.y};return ee(s,i),s}static AcrossSpeed(e,t,i){let n=X(e,t),s={subt:2,react:2,e:n.e,xv:n.x,yv:n.y};return ee(s,i),s}static TouchCount(e,t){let i={subt:5,react:2,tct:t};return ee(i,e),i}static OnNexusEvent(e,t,i){let n={subt:3,nexus:e,etyp:t};return ee(n,i),n}static OnDragStart(e,t){let i={subt:3,nexus:t,etyp:Q.ActEvent_ActDragStart};return ee(i,e),i}static OnDragEnd(e,t){let i={subt:3,nexus:t,etyp:Q.ActEvent_ActDragEnd};return ee(i,e),i}static OnTouchDown(e,t){let i={subt:3,nexus:t,etyp:Q.ActEvent_ActTouchDown};return ee(i,e),i}static OnTouchRelease(e,t){let i={subt:3,nexus:t,etyp:Q.ActEvent_ActTouchRelease};return ee(i,e),i}static OnFlingStart(e,t){let i={subt:3,nexus:t,etyp:Q.ActEvent_ActFlingStart};return ee(i,e),i}static OnFlingProgress(e,t){let i={subt:3,nexus:t,etyp:Q.ActEvent_ActFlingProgress};return ee(i,e),i}static OnFlingEnd(e,t){let i={subt:3,nexus:t,etyp:Q.ActEvent_ActFlingEnd};return ee(i,e),i}static OnFlingCancel(e,t){let i={subt:3,nexus:t,etyp:Q.ActEvent_ActFlingCancel};return ee(i,e),i}static OnFlingDrop(e,t){let i={subt:3,nexus:t,etyp:Q.ActEvent_ActFlingDrop};return ee(i,e),i}static OnHitBlock(e,t){let i={subt:4,blkGid:e};return ee(i,t),i}static OnNextTick(e,t){let i={subt:5,react:1,tgap:e};return t.m=!1,ee(i,t),i}static MovementSyncNexus(e,t){let i={subt:3,nexus:t,etyp:Q.ActEvent_MovementSync};return ee(i,e),i}},Fe.FreeMoveActionBuilder=class{static SetSpeed(e,t){let i=X(e,t);return{typ:2,set:{xv:i.x,yv:i.y,xye:i.e}}}static SetAccel(e,t){let i=X(e,t);return{typ:7,set:{xye:i.e,xv:i.x,yv:i.y}}}static AltSpeed(e,t,i){if(!i)return null;let n=X(e,t);return{typ:5,set:{xv:n.x,yv:n.y,xye:n.e,tim:Math.floor(i)}}}static StopMoving(){return{typ:3}}static StopMovingExact(){return{typ:9}}static BrakeToPos(e,t){let i=X(e,t);return{typ:4,set:{xv:Math.floor(i.x),yv:Math.floor(i.y),xye:i.e}}}static SetArrowSpeed(e,t,i,n){let s=X(e,t),a=X(i,n);return{typ:6,set:{xye:s.e,xv:Math.floor(s.x),yv:Math.floor(s.y),xye1:a.e,xv1:a.x,yv1:a.y}}}static TeleportTo(e,t,i){let n=X(e,t);return{typ:8,set:{xye:n.e,xv:Math.floor(n.x),yv:Math.floor(n.y),isAbs:!i}}}static AckMovementSync(e,t,i,n,s,a){return{typ:10,set:{hstart:e,hend:t,vstart:i,vend:n,xye:s,st:a}}}},Fe.FreeMoveStateBuilder=class{static FireEcho(e){return{typ:52,set:{tkn:e}}}static FireNexusEvent(e,t){return isNaN(t)||0==t?null:{typ:55,set:{etyp:isNaN(e)?0:e,nexus:t}}}static NewCondition(e){return{typ:te,set:{sub:1,set:e}}}static DelActionAssocCondition(){return{typ:te,set:{sub:5}}}static RemoveAllCondtions(){return{typ:te,set:{sub:6}}}static RemoveByGroup(e){return{typ:te,set:{sub:4,gt:e}}}static ActiveCondition(e,t){return{typ:te,set:{sub:2,gt:isNaN(e)||e<=0?$.GroupType_Invalid_Ext:e,sn:t}}}static DeactiveCondition(e,t){return{typ:te,set:{sub:3,gt:isNaN(e)||e<=0?$.GroupType_Invalid_Ext:e,sn:t}}}static SetOffsetPos(e,t){let i=X(e,t);return{typ:53,set:{xv:Math.floor(i.x),yv:Math.floor(i.y),xye:i.e}}}static SetPos(e,t){let i=X(e,t);return{typ:54,set:{xv:Math.floor(i.x),yv:Math.floor(i.y),xye:i.e}}}static TouchLockSwitch(e,t,i=-1){return{typ:59,set:{il:e,dir:t,ut:i}}}static SetTouchAttractChild(e){return{typ:60,set:{cid:e?e.AnimNativeId:0}}}static SetHitWallOverflow(){return{typ:56}}static RevertWithHitBlock(){return{typ:57}}static StartMovementSync(e,t,i,n,s,a){return{typ:61,set:{hstart:t,hend:i,vstart:n,vend:s,xye:a,nexus:e}}}static StopMovementSync(){return{typ:62}}};
|
|
2
|
+
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* eslint-disable */ var e,r=(e=import.meta.url,async function(r={}){function t(){return A.buffer!=D.buffer&&G(),D}function n(){return A.buffer!=D.buffer&&G(),R}function a(){return A.buffer!=D.buffer&&G(),I}function o(){return A.buffer!=D.buffer&&G(),O}function i(){return A.buffer!=D.buffer&&G(),W}function s(){return A.buffer!=D.buffer&&G(),B}function l(){return A.buffer!=D.buffer&&G(),N}function u(){return A.buffer!=D.buffer&&G(),z}var c,d,f=r,m=new Promise(((e,r)=>{c=e,d=r})),h="object"==typeof window,p="function"==typeof importScripts,v="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node&&"renderer"!=process.type,g=p&&self.name?.startsWith("em-pthread");if(v){const{createRequire:ki}=await import("module");let Ci=import.meta.url;Ci.startsWith("data:")&&(Ci="/");var y=ki(Ci),w=y("worker_threads");global.Worker=w.Worker,p=!w.isMainThread,g=p&&"em-pthread"==w.workerData}var _,b,E=Object.assign({},f),k="./this.program",C=(e,r)=>{throw r},x="";if(v){var S=y("fs"),P=y("path");import.meta.url.startsWith("data:")||(x=P.dirname(y("url").fileURLToPath(import.meta.url))+"/"),b=e=>(e=de(e)?new URL(e):P.normalize(e),S.readFileSync(e)),_=(e,r=!0)=>(e=de(e)?new URL(e):P.normalize(e),new Promise(((t,n)=>{S.readFile(e,r?void 0:"utf8",((e,a)=>{e?n(e):t(r?a.buffer:a)}))}))),!f.thisProgram&&process.argv.length>1&&(k=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),C=(e,r)=>{throw process.exitCode=e,r}}else(h||p)&&(p?x=self.location.href:"undefined"!=typeof document&&document.currentScript&&(x=document.currentScript.src),e&&(x=e),x=x.startsWith("blob:")?"":x.substr(0,x.replace(/[?#].*/,"").lastIndexOf("/")+1),v||(p&&(b=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),_=e=>de(e)?new Promise(((r,t)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?r(n.response):t(n.status)},n.onerror=t,n.send(null)})):fetch(e,{credentials:"same-origin"}).then((e=>e.ok?e.arrayBuffer():Promise.reject(new Error(e.status+" : "+e.url))))));var T=console.log.bind(console),$=console.error.bind(console);v&&(T=(...e)=>S.writeSync(1,e.join(" ")+"\n"),$=(...e)=>S.writeSync(2,e.join(" ")+"\n"));var F=f.print||T,j=f.printErr||$;Object.assign(f,E),E=null,f.arguments&&f.arguments,f.thisProgram&&(k=f.thisProgram);var A,M,L,D,R,I,O,W,B,N,z,U=f.wasmBinary,H=!1;function G(){var e=A.buffer;f.HEAP8=D=new Int8Array(e),f.HEAP16=I=new Int16Array(e),f.HEAPU8=R=new Uint8Array(e),f.HEAPU16=O=new Uint16Array(e),f.HEAP32=W=new Int32Array(e),f.HEAPU32=B=new Uint32Array(e),f.HEAPF32=N=new Float32Array(e),f.HEAPF64=z=new Float64Array(e)}if(g){var V;if(v){var q=w.parentPort;q.on("message",(e=>onmessage({data:e}))),Object.assign(globalThis,{self:global,importScripts:()=>{},postMessage:e=>q.postMessage(e)})}var X=!1;function xi(...e){var r=e.join(" ");v?S.writeSync(2,r+"\n"):console.error(r)}function Si(...e){var r=e.join(" ");postMessage({cmd:"alert",text:r,threadId:Xo()})}function Pi(e){try{var r=e.data,t=r.cmd;if("load"===t){let e=[];self.onmessage=r=>e.push(r),self.startWorker=r=>{postMessage({cmd:"loaded"});for(let r of e)Pi(r);self.onmessage=Pi};for(const e of r.handlers)f[e]&&!f[e].proxy||(f[e]=(...r)=>{postMessage({cmd:"callHandler",handler:e,args:r})},"print"==e&&(F=f[e]),"printErr"==e&&(j=f[e]));A=r.wasmMemory,G(),V(r.wasmModule)}else if("run"===t){Le(r.pthread_ptr),Jo(r.pthread_ptr,0,0,1,0,0),Ae.receiveObjectTransfer(r),Ae.threadInitTLS(),qt(r.pthread_ptr),X||(Qo(),X=!0);try{Ie(r.start_routine,r.arg)}catch(e){if("unwind"!=e)throw e}}else"setimmediate"===r.target||("checkMailbox"===t?X&&Xt():t&&(j(`worker: received unknown command ${t}`),j(r)))}catch(e){throw ei(),e}}f.printErr||(j=xi),self.alert=Si,f.instantiateWasm=(e,r)=>new Promise(((e,t)=>{V=t=>{var n=new WebAssembly.Instance(t,pe());r(n),e()}})),self.onunhandledrejection=e=>{throw e.reason||e},self.onmessage=Pi}if(!g){if(f.wasmMemory)A=f.wasmMemory;else{var Y=f.INITIAL_MEMORY||16777216;A=new WebAssembly.Memory({initial:Y/65536,maximum:32768,shared:!0})}G()}var K=[],Q=[],Z=[];function J(){g||(f.noFSInit||ur.initialized||ur.init(),ur.ignorePermissions=!1,Me(Q))}function ee(e){K.unshift(e)}function re(e){Z.unshift(e)}var te=0,ne=null;function ae(e){te++,f.monitorRunDependencies?.(te)}function oe(e){if(te--,f.monitorRunDependencies?.(te),0==te&&ne){var r=ne;ne=null,r()}}function ie(e){f.onAbort?.(e),j(e="Aborted("+e+")"),H=!0,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw d(r),r}var se,le,ue,ce=e=>e.startsWith("data:application/octet-stream;base64,"),de=e=>e.startsWith("file://");function fe(){if(f.locateFile){var e="jsview-dom-browser-forge.1385.f80e.wasm";return ce(e)?e:(r=e,f.locateFile?f.locateFile(r,x):x+r)}var r;return new URL("jsview-dom-browser-forge.1385.f80e.wasm",import.meta.url).href}function me(e){if(e==se&&U)return new Uint8Array(U);if(b)return b(e);throw"both async and sync fetching of the wasm failed"}function he(e,r,t){return function(e){return U?Promise.resolve().then((()=>me(e))):_(e).then((e=>new Uint8Array(e)),(()=>me(e)))}(e).then((e=>WebAssembly.instantiate(e,r))).then(t,(e=>{j(`failed to asynchronously prepare wasm: ${e}`),ie(e)}))}function pe(){return{env:No={__assert_fail:Ue,__cxa_throw:Ge,__pthread_create_js:qe,__syscall_fcntl64:dr,__syscall_fstat64:fr,__syscall_ioctl:mr,__syscall_lstat64:hr,__syscall_newfstatat:pr,__syscall_openat:vr,__syscall_stat64:gr,_abort_js:br,_embind_register_bigint:Er,_embind_register_bool:jr,_embind_register_class:st,_embind_register_class_class_function:ht,_embind_register_emval:bt,_embind_register_float:Ct,_embind_register_function:xt,_embind_register_integer:Pt,_embind_register_memory_view:Tt,_embind_register_std_string:Ft,_embind_register_std_wstring:Ot,_embind_register_void:Wt,_emscripten_fetch_free:Bt,_emscripten_fetch_get_response_headers:Nt,_emscripten_fetch_get_response_headers_length:zt,_emscripten_get_now_is_monotonic:Ut,_emscripten_init_main_thread_js:Ht,_emscripten_notify_mailbox_postmessage:Yt,_emscripten_receive_on_main_thread_js:Qt,_emscripten_thread_cleanup:Zt,_emscripten_thread_mailbox_await:qt,_emscripten_thread_set_strongref:Jt,_emscripten_throw_longjmp:en,_emval_as:nn,_emval_call:on,_emval_call_method:un,_emval_decref:gt,_emval_get_global:dn,_emval_get_method_caller:fn,_emval_get_property:mn,_emval_incref:hn,_emval_instanceof:pn,_emval_is_number:vn,_emval_is_string:gn,_emval_new_array:yn,_emval_new_cstring:wn,_emval_new_object:_n,_emval_run_destructors:bn,_emval_set_property:En,_emval_take_value:kn,_emval_typeof:Cn,_mmap_js:xn,_munmap_js:Sn,_tzset_js:Pn,emscripten_asm_const_int:Fn,emscripten_async_call:Bn,emscripten_check_blocking_allowed:Nn,emscripten_date_now:zn,emscripten_exit_with_live_runtime:Un,emscripten_get_now:Dn,emscripten_log:Yn,emscripten_resize_heap:Qn,emscripten_set_main_loop:Zn,emscripten_start_fetch:oa,emscripten_webgl_create_context:da,emscripten_webgl_make_context_current:fa,environ_get:pa,environ_sizes_get:va,exit:je,fd_close:ga,fd_pread:wa,fd_read:_a,fd_seek:ba,fd_write:ka,glActiveTexture:Pa,glAttachShader:Ta,glBindBuffer:$a,glBindFramebuffer:Fa,glBindRenderbuffer:ja,glBindTexture:Aa,glBlendFunc:Ma,glBufferData:La,glBufferSubData:Da,glCheckFramebufferStatus:Ra,glClear:Ia,glClearColor:Oa,glClearStencil:Wa,glColorMask:Ba,glCompileShader:Na,glCompressedTexImage2D:za,glCreateProgram:Ua,glCreateShader:Ha,glDeleteBuffers:Ga,glDeleteFramebuffers:Va,glDeleteProgram:qa,glDeleteRenderbuffers:Xa,glDeleteShader:Ya,glDeleteTextures:Ka,glDisable:Qa,glDrawArrays:Za,glEnable:Ja,glEnableVertexAttribArray:eo,glFramebufferRenderbuffer:ro,glFramebufferTexture2D:to,glGenBuffers:no,glGenFramebuffers:ao,glGenRenderbuffers:oo,glGenTextures:io,glGetAttribLocation:so,glGetIntegerv:lo,glGetProgramiv:uo,glGetShaderInfoLog:co,glGetShaderiv:fo,glGetUniformLocation:ho,glLinkProgram:po,glPixelStorei:vo,glRenderbufferStorage:go,glScissor:yo,glShaderSource:wo,glStencilFunc:_o,glStencilMask:bo,glStencilOp:Eo,glTexImage2D:xo,glTexParameteri:So,glUniform1f:To,glUniform1fv:Fo,glUniform1i:jo,glUniform2f:Ao,glUniform3f:Mo,glUniform4f:Lo,glUniformMatrix4fv:Do,glUseProgram:Ro,glVertexAttribPointer:Io,glViewport:Oo,invoke_ii:ui,invoke_iii:ci,invoke_iiii:di,invoke_iiiii:wi,invoke_iiiiii:pi,invoke_iiiiiii:gi,invoke_iiiiiiiiii:_i,invoke_v:bi,invoke_vi:fi,invoke_vii:hi,invoke_viii:mi,invoke_viiii:vi,invoke_viiiii:yi,memory:A},wasi_snapshot_preview1:No}}var ve={1935700:()=>{throw new Error(oss.str())}};function ge(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var ye=e=>{e.terminate(),e.onmessage=e=>{}},we=e=>{var r=Ae.pthreads[e];Ae.returnWorkerToPool(r)},_e=e=>{var r=Ae.getNewWorker();if(!r)return 6;Ae.runningWorkers.push(r),Ae.pthreads[e.pthread_ptr]=r,r.pthread_ptr=e.pthread_ptr;var t={cmd:"run",start_routine:e.startRoutine,arg:e.arg,pthread_ptr:e.pthread_ptr};return v&&r.unref(),r.postMessage(t,e.transferList),0},be=0,Ee=()=>Oe||be>0,ke=()=>li(),Ce=e=>ii(e),xe=(e,r)=>r+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*r:NaN,Se=(e,r,t,...n)=>{for(var a=n.length,o=ke(),i=si(8*a),s=i>>3,l=0;l<n.length;l++){var c=n[l];u()[s+l]=c}var d=ri(e,r,a,i,t);return Ce(o),d};function Pe(e){if(g)return Se(0,0,1,e);L=e,Ee()||(Ae.terminateAllThreads(),f.onExit?.(e),H=!0),C(e,new ge(e))}var Te=e=>{if(e instanceof ge||"unwind"==e)return L;C(1,e)};function $e(e){if(g)return Se(1,0,0,e);je(e)}var Fe,je=(e,r)=>{if(L=e,g)throw $e(e),"unwind";Pe(e)},Ae={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],pthreads:{},init(){g||Ae.initMainThread()},initMainThread(){for(var e=8;e--;)Ae.allocateUnusedWorker();ee((()=>{ae(),Ae.loadWasmModuleToAllWorkers((()=>oe()))}))},terminateAllThreads:()=>{for(var e of Ae.runningWorkers)ye(e);for(var e of Ae.unusedWorkers)ye(e);Ae.unusedWorkers=[],Ae.runningWorkers=[],Ae.pthreads=[]},returnWorkerToPool:e=>{var r=e.pthread_ptr;delete Ae.pthreads[r],Ae.unusedWorkers.push(e),Ae.runningWorkers.splice(Ae.runningWorkers.indexOf(e),1),e.pthread_ptr=0,ti(r)},receiveObjectTransfer(e){},threadInitTLS(){Ae.tlsInitFunctions.forEach((e=>e()))},loadWasmModuleToWorker:e=>new Promise((r=>{e.onmessage=t=>{var n=t.data,a=n.cmd;if(n.targetThread&&n.targetThread!=Xo()){var o=Ae.pthreads[n.targetThread];o?o.postMessage(n,n.transferList):j(`Internal error! Worker sent a message "${a}" to target pthread ${n.targetThread}, but that thread no longer exists!`)}else"checkMailbox"===a?Xt():"spawnThread"===a?_e(n):"cleanupThread"===a?we(n.thread):"loaded"===a?(e.loaded=!0,v&&!e.pthread_ptr&&e.unref(),r(e)):"alert"===a?alert(`Thread ${n.threadId}: ${n.text}`):"setimmediate"===n.target?e.postMessage(n):"callHandler"===a?f[n.handler](...n.args):a&&j(`worker sent an unknown command ${a}`)},e.onerror=e=>{throw j(`worker sent an error! ${e.filename}:${e.lineno}: ${e.message}`),e},v&&(e.on("message",(r=>e.onmessage({data:r}))),e.on("error",(r=>e.onerror(r))));var t=[];for(var n of["onExit","onAbort","print","printErr"])f.propertyIsEnumerable(n)&&t.push(n);e.postMessage({cmd:"load",handlers:t,wasmMemory:A,wasmModule:M})})),loadWasmModuleToAllWorkers(e){if(g)return e();Promise.all(Ae.unusedWorkers.map(Ae.loadWasmModuleToWorker)).then(e)},allocateUnusedWorker(){var e;e=new Worker(new URL("jsview-dom-browser-forge.worker.min.js",import.meta.url),{type:"module",workerData:"em-pthread",name:"em-pthread"}),Ae.unusedWorkers.push(e)},getNewWorker:()=>(0==Ae.unusedWorkers.length&&(Ae.allocateUnusedWorker(),Ae.loadWasmModuleToWorker(Ae.unusedWorkers[0])),Ae.unusedWorkers.pop())},Me=e=>{e.forEach((e=>e(f)))},Le=e=>{G();var r=s()[e+52>>2],t=s()[e+56>>2];oi(r,r-t),Ce(r)},De=[],Re=e=>{var r=De[e];return r||(e>=De.length&&(De.length=e+1),De[e]=r=Fe.get(e)),r},Ie=(e,r)=>{be=0,Oe=0,function(e){Ee()?L=e:ni(e)}(Re(e)(r))},Oe=f.noExitRuntime||!0,We=e=>Ae.tlsInitFunctions.push(e),Be="undefined"!=typeof TextDecoder?new TextDecoder:void 0,Ne=(e,r=0,t=NaN)=>{for(var n=r+t,a=r;e[a]&&!(a>=n);)++a;if(a-r>16&&e.buffer&&Be)return Be.decode(e.buffer instanceof SharedArrayBuffer?e.slice(r,a):e.subarray(r,a));for(var o="";r<a;){var i=e[r++];if(128&i){var s=63&e[r++];if(192!=(224&i)){var l=63&e[r++];if((i=224==(240&i)?(15&i)<<12|s<<6|l:(7&i)<<18|s<<12|l<<6|63&e[r++])<65536)o+=String.fromCharCode(i);else{var u=i-65536;o+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else o+=String.fromCharCode((31&i)<<6|s)}else o+=String.fromCharCode(i)}return o},ze=(e,r)=>e?Ne(n(),e,r):"",Ue=(e,r,t,n)=>{ie(`Assertion failed: ${ze(e)}, at: `+[r?ze(r):"unknown filename",t,n?ze(n):"unknown function"])};class He{constructor(e){this.excPtr=e,this.ptr=e-24}set_type(e){s()[this.ptr+4>>2]=e}get_type(){return s()[this.ptr+4>>2]}set_destructor(e){s()[this.ptr+8>>2]=e}get_destructor(){return s()[this.ptr+8>>2]}set_caught(e){e=e?1:0,t()[this.ptr+12]=e}get_caught(){return 0!=t()[this.ptr+12]}set_rethrown(e){e=e?1:0,t()[this.ptr+13]=e}get_rethrown(){return 0!=t()[this.ptr+13]}init(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r)}set_adjusted_ptr(e){s()[this.ptr+16>>2]=e}get_adjusted_ptr(){return s()[this.ptr+16>>2]}}var Ge=(e,r,t)=>{throw new He(e).init(r,t),e};function Ve(e,r,t,n){return g?Se(2,0,1,e,r,t,n):qe(e,r,t,n)}var qe=(e,r,t,n)=>{if("undefined"==typeof SharedArrayBuffer)return 6;var a=[];if(g&&0===a.length)return Ve(e,r,t,n);var o={startRoutine:t,pthread_ptr:e,arg:n,transferList:a};return g?(o.cmd="spawnThread",postMessage(o,a),0):_e(o)};function Xe(){var e=i()[+cr.varargs>>2];return cr.varargs+=4,e}var Ye=Xe,Ke={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,r)=>{for(var t=0,n=e.length-1;n>=0;n--){var a=e[n];"."===a?e.splice(n,1):".."===a?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:e=>{var r=Ke.isAbs(e),t="/"===e.substr(-1);return(e=Ke.normalizeArray(e.split("/").filter((e=>!!e)),!r).join("/"))||r||(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=Ke.splitPath(e),t=r[0],n=r[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:e=>{if("/"===e)return"/";var r=(e=(e=Ke.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===r?e:e.substr(r+1)},join:(...e)=>Ke.normalize(e.join("/")),join2:(e,r)=>Ke.normalize(e+"/"+r)},Qe=e=>(Qe=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>(e.set(crypto.getRandomValues(new Uint8Array(e.byteLength))),e);if(v)try{var e=y("crypto");if(e.randomFillSync)return r=>e.randomFillSync(r);var r=e.randomBytes;return e=>(e.set(r(e.byteLength)),e)}catch(e){}ie("initRandomDevice")})())(e),Ze={resolve:(...e)=>{for(var r="",t=!1,n=e.length-1;n>=-1&&!t;n--){var a=n>=0?e[n]:ur.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");if(!a)return"";r=a+"/"+r,t=Ke.isAbs(a)}return(t?"/":"")+(r=Ke.normalizeArray(r.split("/").filter((e=>!!e)),!t).join("/"))||"."},relative:(e,r)=>{function t(e){for(var r=0;r<e.length&&""===e[r];r++);for(var t=e.length-1;t>=0&&""===e[t];t--);return r>t?[]:e.slice(r,t-r+1)}e=Ze.resolve(e).substr(1),r=Ze.resolve(r).substr(1);for(var n=t(e.split("/")),a=t(r.split("/")),o=Math.min(n.length,a.length),i=o,s=0;s<o;s++)if(n[s]!==a[s]){i=s;break}var l=[];for(s=i;s<n.length;s++)l.push("..");return(l=l.concat(a.slice(i))).join("/")}},Je=[],er=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n<=127?r++:n<=2047?r+=2:n>=55296&&n<=57343?(r+=4,++t):r+=3}return r},rr=(e,r,t,n)=>{if(!(n>0))return 0;for(var a=t,o=t+n-1,i=0;i<e.length;++i){var s=e.charCodeAt(i);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++i)),s<=127){if(t>=o)break;r[t++]=s}else if(s<=2047){if(t+1>=o)break;r[t++]=192|s>>6,r[t++]=128|63&s}else if(s<=65535){if(t+2>=o)break;r[t++]=224|s>>12,r[t++]=128|s>>6&63,r[t++]=128|63&s}else{if(t+3>=o)break;r[t++]=240|s>>18,r[t++]=128|s>>12&63,r[t++]=128|s>>6&63,r[t++]=128|63&s}}return r[t]=0,t-a};function tr(e,r,t){var n=t>0?t:er(e)+1,a=new Array(n),o=rr(e,a,0,a.length);return r&&(a.length=o),a}var nr={ttys:[],init(){},shutdown(){},register(e,r){nr.ttys[e]={input:[],output:[],ops:r},ur.registerDevice(e,nr.stream_ops)},stream_ops:{open(e){var r=nr.ttys[e.node.rdev];if(!r)throw new ur.ErrnoError(43);e.tty=r,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,r,t,n,a){if(!e.tty||!e.tty.ops.get_char)throw new ur.ErrnoError(60);for(var o=0,i=0;i<n;i++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new ur.ErrnoError(29)}if(void 0===s&&0===o)throw new ur.ErrnoError(6);if(null==s)break;o++,r[t+i]=s}return o&&(e.node.timestamp=Date.now()),o},write(e,r,t,n,a){if(!e.tty||!e.tty.ops.put_char)throw new ur.ErrnoError(60);try{for(var o=0;o<n;o++)e.tty.ops.put_char(e.tty,r[t+o])}catch(e){throw new ur.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),o}},default_tty_ops:{get_char:e=>(()=>{if(!Je.length){var e=null;if(v){var r=Buffer.alloc(256),t=0,n=process.stdin.fd;try{t=S.readSync(n,r,0,256)}catch(e){if(!e.toString().includes("EOF"))throw e;t=0}t>0&&(e=r.slice(0,t).toString("utf-8"))}else"undefined"!=typeof window&&"function"==typeof window.prompt&&null!==(e=window.prompt("Input: "))&&(e+="\n");if(!e)return null;Je=tr(e,!0)}return Je.shift()})(),put_char(e,r){null===r||10===r?(F(Ne(e.output)),e.output=[]):0!=r&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(F(Ne(e.output)),e.output=[])},ioctl_tcgets:e=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),ioctl_tcsets:(e,r,t)=>0,ioctl_tiocgwinsz:e=>[24,80]},default_tty1_ops:{put_char(e,r){null===r||10===r?(j(Ne(e.output)),e.output=[]):0!=r&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(j(Ne(e.output)),e.output=[])}}},ar=(e,r)=>Math.ceil(e/r)*r,or=e=>{e=ar(e,65536);var r=Zo(65536,e);return r&&((e,r)=>{n().fill(0,e,e+r)})(r,e),r},ir={ops_table:null,mount:e=>ir.createNode(null,"/",16895,0),createNode(e,r,t,n){if(ur.isBlkdev(t)||ur.isFIFO(t))throw new ur.ErrnoError(63);ir.ops_table||={dir:{node:{getattr:ir.node_ops.getattr,setattr:ir.node_ops.setattr,lookup:ir.node_ops.lookup,mknod:ir.node_ops.mknod,rename:ir.node_ops.rename,unlink:ir.node_ops.unlink,rmdir:ir.node_ops.rmdir,readdir:ir.node_ops.readdir,symlink:ir.node_ops.symlink},stream:{llseek:ir.stream_ops.llseek}},file:{node:{getattr:ir.node_ops.getattr,setattr:ir.node_ops.setattr},stream:{llseek:ir.stream_ops.llseek,read:ir.stream_ops.read,write:ir.stream_ops.write,allocate:ir.stream_ops.allocate,mmap:ir.stream_ops.mmap,msync:ir.stream_ops.msync}},link:{node:{getattr:ir.node_ops.getattr,setattr:ir.node_ops.setattr,readlink:ir.node_ops.readlink},stream:{}},chrdev:{node:{getattr:ir.node_ops.getattr,setattr:ir.node_ops.setattr},stream:ur.chrdev_stream_ops}};var a=ur.createNode(e,r,t,n);return ur.isDir(a.mode)?(a.node_ops=ir.ops_table.dir.node,a.stream_ops=ir.ops_table.dir.stream,a.contents={}):ur.isFile(a.mode)?(a.node_ops=ir.ops_table.file.node,a.stream_ops=ir.ops_table.file.stream,a.usedBytes=0,a.contents=null):ur.isLink(a.mode)?(a.node_ops=ir.ops_table.link.node,a.stream_ops=ir.ops_table.link.stream):ur.isChrdev(a.mode)&&(a.node_ops=ir.ops_table.chrdev.node,a.stream_ops=ir.ops_table.chrdev.stream),a.timestamp=Date.now(),e&&(e.contents[r]=a,e.timestamp=a.timestamp),a},getFileDataAsTypedArray:e=>e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0),expandFileStorage(e,r){var t=e.contents?e.contents.length:0;if(!(t>=r)){r=Math.max(r,t*(t<1048576?2:1.125)>>>0),0!=t&&(r=Math.max(r,256));var n=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,r){if(e.usedBytes!=r)if(0==r)e.contents=null,e.usedBytes=0;else{var t=e.contents;e.contents=new Uint8Array(r),t&&e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}},node_ops:{getattr(e){var r={};return r.dev=ur.isChrdev(e.mode)?e.id:1,r.ino=e.id,r.mode=e.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=e.rdev,ur.isDir(e.mode)?r.size=4096:ur.isFile(e.mode)?r.size=e.usedBytes:ur.isLink(e.mode)?r.size=e.link.length:r.size=0,r.atime=new Date(e.timestamp),r.mtime=new Date(e.timestamp),r.ctime=new Date(e.timestamp),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr(e,r){void 0!==r.mode&&(e.mode=r.mode),void 0!==r.timestamp&&(e.timestamp=r.timestamp),void 0!==r.size&&ir.resizeFileStorage(e,r.size)},lookup(e,r){throw ur.genericErrors[44]},mknod:(e,r,t,n)=>ir.createNode(e,r,t,n),rename(e,r,t){if(ur.isDir(e.mode)){var n;try{n=ur.lookupNode(r,t)}catch(e){}if(n)for(var a in n.contents)throw new ur.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=t,r.contents[t]=e,r.timestamp=e.parent.timestamp},unlink(e,r){delete e.contents[r],e.timestamp=Date.now()},rmdir(e,r){var t=ur.lookupNode(e,r);for(var n in t.contents)throw new ur.ErrnoError(55);delete e.contents[r],e.timestamp=Date.now()},readdir(e){var r=[".",".."];for(var t of Object.keys(e.contents))r.push(t);return r},symlink(e,r,t){var n=ir.createNode(e,r,41471,0);return n.link=t,n},readlink(e){if(!ur.isLink(e.mode))throw new ur.ErrnoError(28);return e.link}},stream_ops:{read(e,r,t,n,a){var o=e.node.contents;if(a>=e.node.usedBytes)return 0;var i=Math.min(e.node.usedBytes-a,n);if(i>8&&o.subarray)r.set(o.subarray(a,a+i),t);else for(var s=0;s<i;s++)r[t+s]=o[a+s];return i},write(e,r,n,a,o,i){if(r.buffer===t().buffer&&(i=!1),!a)return 0;var s=e.node;if(s.timestamp=Date.now(),r.subarray&&(!s.contents||s.contents.subarray)){if(i)return s.contents=r.subarray(n,n+a),s.usedBytes=a,a;if(0===s.usedBytes&&0===o)return s.contents=r.slice(n,n+a),s.usedBytes=a,a;if(o+a<=s.usedBytes)return s.contents.set(r.subarray(n,n+a),o),a}if(ir.expandFileStorage(s,o+a),s.contents.subarray&&r.subarray)s.contents.set(r.subarray(n,n+a),o);else for(var l=0;l<a;l++)s.contents[o+l]=r[n+l];return s.usedBytes=Math.max(s.usedBytes,o+a),a},llseek(e,r,t){var n=r;if(1===t?n+=e.position:2===t&&ur.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new ur.ErrnoError(28);return n},allocate(e,r,t){ir.expandFileStorage(e.node,r+t),e.node.usedBytes=Math.max(e.node.usedBytes,r+t)},mmap(e,r,n,a,o){if(!ur.isFile(e.node.mode))throw new ur.ErrnoError(43);var i,s,l=e.node.contents;if(2&o||!l||l.buffer!==t().buffer){if(s=!0,!(i=or(r)))throw new ur.ErrnoError(48);l&&((n>0||n+r<l.length)&&(l=l.subarray?l.subarray(n,n+r):Array.prototype.slice.call(l,n,n+r)),t().set(l,i))}else s=!1,i=l.byteOffset;return{ptr:i,allocated:s}},msync:(e,r,t,n,a)=>(ir.stream_ops.write(e,r,0,n,t,!1),0)}},sr=f.preloadPlugins||[],lr=(e,r)=>{var t=0;return e&&(t|=365),r&&(t|=146),t},ur={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:class{constructor(e){this.name="ErrnoError",this.errno=e}},genericErrors:{},filesystems:null,syncFSRequests:0,readFiles:{},FSStream:class{constructor(){this.shared={}}get object(){return this.node}set object(e){this.node=e}get isRead(){return 1!=(2097155&this.flags)}get isWrite(){return!!(2097155&this.flags)}get isAppend(){return 1024&this.flags}get flags(){return this.shared.flags}set flags(e){this.shared.flags=e}get position(){return this.shared.position}set position(e){this.shared.position=e}},FSNode:class{constructor(e,r,t,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=ur.nextInode++,this.name=r,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n,this.readMode=365,this.writeMode=146}get read(){return(this.mode&this.readMode)===this.readMode}set read(e){e?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(e){e?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return ur.isDir(this.mode)}get isDevice(){return ur.isChrdev(this.mode)}},lookupPath(e,r={}){if(!(e=Ze.resolve(e)))return{path:"",node:null};if((r=Object.assign({follow_mount:!0,recurse_count:0},r)).recurse_count>8)throw new ur.ErrnoError(32);for(var t=e.split("/").filter((e=>!!e)),n=ur.root,a="/",o=0;o<t.length;o++){var i=o===t.length-1;if(i&&r.parent)break;if(n=ur.lookupNode(n,t[o]),a=Ke.join2(a,t[o]),ur.isMountpoint(n)&&(!i||i&&r.follow_mount)&&(n=n.mounted.root),!i||r.follow)for(var s=0;ur.isLink(n.mode);){var l=ur.readlink(a);if(a=Ze.resolve(Ke.dirname(a),l),n=ur.lookupPath(a,{recurse_count:r.recurse_count+1}).node,s++>40)throw new ur.ErrnoError(32)}}return{path:a,node:n}},getPath(e){for(var r;;){if(ur.isRoot(e)){var t=e.mount.mountpoint;return r?"/"!==t[t.length-1]?`${t}/${r}`:t+r:t}r=r?`${e.name}/${r}`:e.name,e=e.parent}},hashName(e,r){for(var t=0,n=0;n<r.length;n++)t=(t<<5)-t+r.charCodeAt(n)|0;return(e+t>>>0)%ur.nameTable.length},hashAddNode(e){var r=ur.hashName(e.parent.id,e.name);e.name_next=ur.nameTable[r],ur.nameTable[r]=e},hashRemoveNode(e){var r=ur.hashName(e.parent.id,e.name);if(ur.nameTable[r]===e)ur.nameTable[r]=e.name_next;else for(var t=ur.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode(e,r){var t=ur.mayLookup(e);if(t)throw new ur.ErrnoError(t);for(var n=ur.hashName(e.id,r),a=ur.nameTable[n];a;a=a.name_next){var o=a.name;if(a.parent.id===e.id&&o===r)return a}return ur.lookup(e,r)},createNode(e,r,t,n){var a=new ur.FSNode(e,r,t,n);return ur.hashAddNode(a),a},destroyNode(e){ur.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>!(49152&~e),flagsToPermissionString(e){var r=["r","w","rw"][3&e];return 512&e&&(r+="w"),r},nodePermissions:(e,r)=>ur.ignorePermissions||(!r.includes("r")||292&e.mode)&&(!r.includes("w")||146&e.mode)&&(!r.includes("x")||73&e.mode)?0:2,mayLookup(e){if(!ur.isDir(e.mode))return 54;var r=ur.nodePermissions(e,"x");return r||(e.node_ops.lookup?0:2)},mayCreate(e,r){try{return ur.lookupNode(e,r),20}catch(e){}return ur.nodePermissions(e,"wx")},mayDelete(e,r,t){var n;try{n=ur.lookupNode(e,r)}catch(e){return e.errno}var a=ur.nodePermissions(e,"wx");if(a)return a;if(t){if(!ur.isDir(n.mode))return 54;if(ur.isRoot(n)||ur.getPath(n)===ur.cwd())return 10}else if(ur.isDir(n.mode))return 31;return 0},mayOpen:(e,r)=>e?ur.isLink(e.mode)?32:ur.isDir(e.mode)&&("r"!==ur.flagsToPermissionString(r)||512&r)?31:ur.nodePermissions(e,ur.flagsToPermissionString(r)):44,MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=ur.MAX_OPEN_FDS;e++)if(!ur.streams[e])return e;throw new ur.ErrnoError(33)},getStreamChecked(e){var r=ur.getStream(e);if(!r)throw new ur.ErrnoError(8);return r},getStream:e=>ur.streams[e],createStream:(e,r=-1)=>(e=Object.assign(new ur.FSStream,e),-1==r&&(r=ur.nextfd()),e.fd=r,ur.streams[r]=e,e),closeStream(e){ur.streams[e]=null},dupStream(e,r=-1){var t=ur.createStream(e,r);return t.stream_ops?.dup?.(t),t},chrdev_stream_ops:{open(e){var r=ur.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open?.(e)},llseek(){throw new ur.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,r)=>e<<8|r,registerDevice(e,r){ur.devices[e]={stream_ops:r}},getDevice:e=>ur.devices[e],getMounts(e){for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push(...n.mounts)}return r},syncfs(e,r){"function"==typeof e&&(r=e,e=!1),ur.syncFSRequests++,ur.syncFSRequests>1&&j(`warning: ${ur.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=ur.getMounts(ur.root.mount),n=0;function a(e){return ur.syncFSRequests--,r(e)}function o(e){if(e)return o.errored?void 0:(o.errored=!0,a(e));++n>=t.length&&a(null)}t.forEach((r=>{if(!r.type.syncfs)return o(null);r.type.syncfs(r,e,o)}))},mount(e,r,t){var n,a="/"===t,o=!t;if(a&&ur.root)throw new ur.ErrnoError(10);if(!a&&!o){var i=ur.lookupPath(t,{follow_mount:!1});if(t=i.path,n=i.node,ur.isMountpoint(n))throw new ur.ErrnoError(10);if(!ur.isDir(n.mode))throw new ur.ErrnoError(54)}var s={type:e,opts:r,mountpoint:t,mounts:[]},l=e.mount(s);return l.mount=s,s.root=l,a?ur.root=l:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),l},unmount(e){var r=ur.lookupPath(e,{follow_mount:!1});if(!ur.isMountpoint(r.node))throw new ur.ErrnoError(28);var t=r.node,n=t.mounted,a=ur.getMounts(n);Object.keys(ur.nameTable).forEach((e=>{for(var r=ur.nameTable[e];r;){var t=r.name_next;a.includes(r.mount)&&ur.destroyNode(r),r=t}})),t.mounted=null;var o=t.mount.mounts.indexOf(n);t.mount.mounts.splice(o,1)},lookup:(e,r)=>e.node_ops.lookup(e,r),mknod(e,r,t){var n=ur.lookupPath(e,{parent:!0}).node,a=Ke.basename(e);if(!a||"."===a||".."===a)throw new ur.ErrnoError(28);var o=ur.mayCreate(n,a);if(o)throw new ur.ErrnoError(o);if(!n.node_ops.mknod)throw new ur.ErrnoError(63);return n.node_ops.mknod(n,a,r,t)},create:(e,r)=>(r=void 0!==r?r:438,r&=4095,r|=32768,ur.mknod(e,r,0)),mkdir:(e,r)=>(r=void 0!==r?r:511,r&=1023,r|=16384,ur.mknod(e,r,0)),mkdirTree(e,r){for(var t=e.split("/"),n="",a=0;a<t.length;++a)if(t[a]){n+="/"+t[a];try{ur.mkdir(n,r)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,r,t)=>(void 0===t&&(t=r,r=438),r|=8192,ur.mknod(e,r,t)),symlink(e,r){if(!Ze.resolve(e))throw new ur.ErrnoError(44);var t=ur.lookupPath(r,{parent:!0}).node;if(!t)throw new ur.ErrnoError(44);var n=Ke.basename(r),a=ur.mayCreate(t,n);if(a)throw new ur.ErrnoError(a);if(!t.node_ops.symlink)throw new ur.ErrnoError(63);return t.node_ops.symlink(t,n,e)},rename(e,r){var t,n,a=Ke.dirname(e),o=Ke.dirname(r),i=Ke.basename(e),s=Ke.basename(r);if(t=ur.lookupPath(e,{parent:!0}).node,n=ur.lookupPath(r,{parent:!0}).node,!t||!n)throw new ur.ErrnoError(44);if(t.mount!==n.mount)throw new ur.ErrnoError(75);var l,u=ur.lookupNode(t,i),c=Ze.relative(e,o);if("."!==c.charAt(0))throw new ur.ErrnoError(28);if("."!==(c=Ze.relative(r,a)).charAt(0))throw new ur.ErrnoError(55);try{l=ur.lookupNode(n,s)}catch(e){}if(u!==l){var d=ur.isDir(u.mode),f=ur.mayDelete(t,i,d);if(f)throw new ur.ErrnoError(f);if(f=l?ur.mayDelete(n,s,d):ur.mayCreate(n,s))throw new ur.ErrnoError(f);if(!t.node_ops.rename)throw new ur.ErrnoError(63);if(ur.isMountpoint(u)||l&&ur.isMountpoint(l))throw new ur.ErrnoError(10);if(n!==t&&(f=ur.nodePermissions(t,"w")))throw new ur.ErrnoError(f);ur.hashRemoveNode(u);try{t.node_ops.rename(u,n,s),u.parent=n}catch(e){throw e}finally{ur.hashAddNode(u)}}},rmdir(e){var r=ur.lookupPath(e,{parent:!0}).node,t=Ke.basename(e),n=ur.lookupNode(r,t),a=ur.mayDelete(r,t,!0);if(a)throw new ur.ErrnoError(a);if(!r.node_ops.rmdir)throw new ur.ErrnoError(63);if(ur.isMountpoint(n))throw new ur.ErrnoError(10);r.node_ops.rmdir(r,t),ur.destroyNode(n)},readdir(e){var r=ur.lookupPath(e,{follow:!0}).node;if(!r.node_ops.readdir)throw new ur.ErrnoError(54);return r.node_ops.readdir(r)},unlink(e){var r=ur.lookupPath(e,{parent:!0}).node;if(!r)throw new ur.ErrnoError(44);var t=Ke.basename(e),n=ur.lookupNode(r,t),a=ur.mayDelete(r,t,!1);if(a)throw new ur.ErrnoError(a);if(!r.node_ops.unlink)throw new ur.ErrnoError(63);if(ur.isMountpoint(n))throw new ur.ErrnoError(10);r.node_ops.unlink(r,t),ur.destroyNode(n)},readlink(e){var r=ur.lookupPath(e).node;if(!r)throw new ur.ErrnoError(44);if(!r.node_ops.readlink)throw new ur.ErrnoError(28);return Ze.resolve(ur.getPath(r.parent),r.node_ops.readlink(r))},stat(e,r){var t=ur.lookupPath(e,{follow:!r}).node;if(!t)throw new ur.ErrnoError(44);if(!t.node_ops.getattr)throw new ur.ErrnoError(63);return t.node_ops.getattr(t)},lstat:e=>ur.stat(e,!0),chmod(e,r,t){var n;if(!(n="string"==typeof e?ur.lookupPath(e,{follow:!t}).node:e).node_ops.setattr)throw new ur.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&r|-4096&n.mode,timestamp:Date.now()})},lchmod(e,r){ur.chmod(e,r,!0)},fchmod(e,r){var t=ur.getStreamChecked(e);ur.chmod(t.node,r)},chown(e,r,t,n){var a;if(!(a="string"==typeof e?ur.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new ur.ErrnoError(63);a.node_ops.setattr(a,{timestamp:Date.now()})},lchown(e,r,t){ur.chown(e,r,t,!0)},fchown(e,r,t){var n=ur.getStreamChecked(e);ur.chown(n.node,r,t)},truncate(e,r){if(r<0)throw new ur.ErrnoError(28);var t;if(!(t="string"==typeof e?ur.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new ur.ErrnoError(63);if(ur.isDir(t.mode))throw new ur.ErrnoError(31);if(!ur.isFile(t.mode))throw new ur.ErrnoError(28);var n=ur.nodePermissions(t,"w");if(n)throw new ur.ErrnoError(n);t.node_ops.setattr(t,{size:r,timestamp:Date.now()})},ftruncate(e,r){var t=ur.getStreamChecked(e);if(!(2097155&t.flags))throw new ur.ErrnoError(28);ur.truncate(t.node,r)},utime(e,r,t){var n=ur.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(r,t)})},open(e,r,t){if(""===e)throw new ur.ErrnoError(44);var n;if(t=64&(r="string"==typeof r?(e=>{var r={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===r)throw new Error(`Unknown file open mode: ${e}`);return r})(r):r)?4095&(t=void 0===t?438:t)|32768:0,"object"==typeof e)n=e;else{e=Ke.normalize(e);try{n=ur.lookupPath(e,{follow:!(131072&r)}).node}catch(e){}}var a=!1;if(64&r)if(n){if(128&r)throw new ur.ErrnoError(20)}else n=ur.mknod(e,t,0),a=!0;if(!n)throw new ur.ErrnoError(44);if(ur.isChrdev(n.mode)&&(r&=-513),65536&r&&!ur.isDir(n.mode))throw new ur.ErrnoError(54);if(!a){var o=ur.mayOpen(n,r);if(o)throw new ur.ErrnoError(o)}512&r&&!a&&ur.truncate(n,0),r&=-131713;var i=ur.createStream({node:n,path:ur.getPath(n),flags:r,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return i.stream_ops.open&&i.stream_ops.open(i),!f.logReadFiles||1&r||e in ur.readFiles||(ur.readFiles[e]=1),i},close(e){if(ur.isClosed(e))throw new ur.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{ur.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek(e,r,t){if(ur.isClosed(e))throw new ur.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new ur.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new ur.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read(e,r,t,n,a){if(n<0||a<0)throw new ur.ErrnoError(28);if(ur.isClosed(e))throw new ur.ErrnoError(8);if(1==(2097155&e.flags))throw new ur.ErrnoError(8);if(ur.isDir(e.node.mode))throw new ur.ErrnoError(31);if(!e.stream_ops.read)throw new ur.ErrnoError(28);var o=void 0!==a;if(o){if(!e.seekable)throw new ur.ErrnoError(70)}else a=e.position;var i=e.stream_ops.read(e,r,t,n,a);return o||(e.position+=i),i},write(e,r,t,n,a,o){if(n<0||a<0)throw new ur.ErrnoError(28);if(ur.isClosed(e))throw new ur.ErrnoError(8);if(!(2097155&e.flags))throw new ur.ErrnoError(8);if(ur.isDir(e.node.mode))throw new ur.ErrnoError(31);if(!e.stream_ops.write)throw new ur.ErrnoError(28);e.seekable&&1024&e.flags&&ur.llseek(e,0,2);var i=void 0!==a;if(i){if(!e.seekable)throw new ur.ErrnoError(70)}else a=e.position;var s=e.stream_ops.write(e,r,t,n,a,o);return i||(e.position+=s),s},allocate(e,r,t){if(ur.isClosed(e))throw new ur.ErrnoError(8);if(r<0||t<=0)throw new ur.ErrnoError(28);if(!(2097155&e.flags))throw new ur.ErrnoError(8);if(!ur.isFile(e.node.mode)&&!ur.isDir(e.node.mode))throw new ur.ErrnoError(43);if(!e.stream_ops.allocate)throw new ur.ErrnoError(138);e.stream_ops.allocate(e,r,t)},mmap(e,r,t,n,a){if(2&n&&!(2&a)&&2!=(2097155&e.flags))throw new ur.ErrnoError(2);if(1==(2097155&e.flags))throw new ur.ErrnoError(2);if(!e.stream_ops.mmap)throw new ur.ErrnoError(43);if(!r)throw new ur.ErrnoError(28);return e.stream_ops.mmap(e,r,t,n,a)},msync:(e,r,t,n,a)=>e.stream_ops.msync?e.stream_ops.msync(e,r,t,n,a):0,ioctl(e,r,t){if(!e.stream_ops.ioctl)throw new ur.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile(e,r={}){if(r.flags=r.flags||0,r.encoding=r.encoding||"binary","utf8"!==r.encoding&&"binary"!==r.encoding)throw new Error(`Invalid encoding type "${r.encoding}"`);var t,n=ur.open(e,r.flags),a=ur.stat(e).size,o=new Uint8Array(a);return ur.read(n,o,0,a,0),"utf8"===r.encoding?t=Ne(o):"binary"===r.encoding&&(t=o),ur.close(n),t},writeFile(e,r,t={}){t.flags=t.flags||577;var n=ur.open(e,t.flags,t.mode);if("string"==typeof r){var a=new Uint8Array(er(r)+1),o=rr(r,a,0,a.length);ur.write(n,a,0,o,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(r))throw new Error("Unsupported data type");ur.write(n,r,0,r.byteLength,void 0,t.canOwn)}ur.close(n)},cwd:()=>ur.currentPath,chdir(e){var r=ur.lookupPath(e,{follow:!0});if(null===r.node)throw new ur.ErrnoError(44);if(!ur.isDir(r.node.mode))throw new ur.ErrnoError(54);var t=ur.nodePermissions(r.node,"x");if(t)throw new ur.ErrnoError(t);ur.currentPath=r.path},createDefaultDirectories(){ur.mkdir("/tmp"),ur.mkdir("/home"),ur.mkdir("/home/web_user")},createDefaultDevices(){ur.mkdir("/dev"),ur.registerDevice(ur.makedev(1,3),{read:()=>0,write:(e,r,t,n,a)=>n}),ur.mkdev("/dev/null",ur.makedev(1,3)),nr.register(ur.makedev(5,0),nr.default_tty_ops),nr.register(ur.makedev(6,0),nr.default_tty1_ops),ur.mkdev("/dev/tty",ur.makedev(5,0)),ur.mkdev("/dev/tty1",ur.makedev(6,0));var e=new Uint8Array(1024),r=0,t=()=>(0===r&&(r=Qe(e).byteLength),e[--r]);ur.createDevice("/dev","random",t),ur.createDevice("/dev","urandom",t),ur.mkdir("/dev/shm"),ur.mkdir("/dev/shm/tmp")},createSpecialDirectories(){ur.mkdir("/proc");var e=ur.mkdir("/proc/self");ur.mkdir("/proc/self/fd"),ur.mount({mount(){var r=ur.createNode(e,"fd",16895,73);return r.node_ops={lookup(e,r){var t=+r,n=ur.getStreamChecked(t),a={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return a.parent=a,a}},r}},{},"/proc/self/fd")},createStandardStreams(e,r,t){e?ur.createDevice("/dev","stdin",e):ur.symlink("/dev/tty","/dev/stdin"),r?ur.createDevice("/dev","stdout",null,r):ur.symlink("/dev/tty","/dev/stdout"),t?ur.createDevice("/dev","stderr",null,t):ur.symlink("/dev/tty1","/dev/stderr"),ur.open("/dev/stdin",0),ur.open("/dev/stdout",1),ur.open("/dev/stderr",1)},staticInit(){[44].forEach((e=>{ur.genericErrors[e]=new ur.ErrnoError(e),ur.genericErrors[e].stack="<generic error, no stack>"})),ur.nameTable=new Array(4096),ur.mount(ir,{},"/"),ur.createDefaultDirectories(),ur.createDefaultDevices(),ur.createSpecialDirectories(),ur.filesystems={MEMFS:ir}},init(e,r,t){ur.initialized=!0,e??=f.stdin,r??=f.stdout,t??=f.stderr,ur.createStandardStreams(e,r,t)},quit(){ur.initialized=!1;for(var e=0;e<ur.streams.length;e++){var r=ur.streams[e];r&&ur.close(r)}},findObject(e,r){var t=ur.analyzePath(e,r);return t.exists?t.object:null},analyzePath(e,r){try{e=(n=ur.lookupPath(e,{follow:!r})).path}catch(e){}var t={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=ur.lookupPath(e,{parent:!0});t.parentExists=!0,t.parentPath=n.path,t.parentObject=n.node,t.name=Ke.basename(e),n=ur.lookupPath(e,{follow:!r}),t.exists=!0,t.path=n.path,t.object=n.node,t.name=n.node.name,t.isRoot="/"===n.path}catch(e){t.error=e.errno}return t},createPath(e,r,t,n){e="string"==typeof e?e:ur.getPath(e);for(var a=r.split("/").reverse();a.length;){var o=a.pop();if(o){var i=Ke.join2(e,o);try{ur.mkdir(i)}catch(e){}e=i}}return i},createFile(e,r,t,n,a){var o=Ke.join2("string"==typeof e?e:ur.getPath(e),r),i=lr(n,a);return ur.create(o,i)},createDataFile(e,r,t,n,a,o){var i=r;e&&(e="string"==typeof e?e:ur.getPath(e),i=r?Ke.join2(e,r):e);var s=lr(n,a),l=ur.create(i,s);if(t){if("string"==typeof t){for(var u=new Array(t.length),c=0,d=t.length;c<d;++c)u[c]=t.charCodeAt(c);t=u}ur.chmod(l,146|s);var f=ur.open(l,577);ur.write(f,t,0,t.length,0,o),ur.close(f),ur.chmod(l,s)}},createDevice(e,r,t,n){var a=Ke.join2("string"==typeof e?e:ur.getPath(e),r),o=lr(!!t,!!n);ur.createDevice.major??=64;var i=ur.makedev(ur.createDevice.major++,0);return ur.registerDevice(i,{open(e){e.seekable=!1},close(e){n?.buffer?.length&&n(10)},read(e,r,n,a,o){for(var i=0,s=0;s<a;s++){var l;try{l=t()}catch(e){throw new ur.ErrnoError(29)}if(void 0===l&&0===i)throw new ur.ErrnoError(6);if(null==l)break;i++,r[n+s]=l}return i&&(e.node.timestamp=Date.now()),i},write(e,r,t,a,o){for(var i=0;i<a;i++)try{n(r[t+i])}catch(e){throw new ur.ErrnoError(29)}return a&&(e.node.timestamp=Date.now()),i}}),ur.mkdev(a,o,i)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");try{e.contents=b(e.url),e.usedBytes=e.contents.length}catch(e){throw new ur.ErrnoError(29)}},createLazyFile(e,r,n,a,o){class i{constructor(){this.lengthKnown=!1,this.chunks=[]}get(e){if(!(e>this.length-1||e<0)){var r=e%this.chunkSize,t=e/this.chunkSize|0;return this.getter(t)[r]}}setDataGetter(e){this.getter=e}cacheLength(){var e=new XMLHttpRequest;if(e.open("HEAD",n,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+n+". Status: "+e.status);var r,t=Number(e.getResponseHeader("Content-length")),a=(r=e.getResponseHeader("Accept-Ranges"))&&"bytes"===r,o=(r=e.getResponseHeader("Content-Encoding"))&&"gzip"===r,i=1048576;a||(i=t);var s=this;s.setDataGetter((e=>{var r=e*i,a=(e+1)*i-1;if(a=Math.min(a,t-1),void 0===s.chunks[e]&&(s.chunks[e]=((e,r)=>{if(e>r)throw new Error("invalid range ("+e+", "+r+") or no bytes requested!");if(r>t-1)throw new Error("only "+t+" bytes available! programmer error!");var a=new XMLHttpRequest;if(a.open("GET",n,!1),t!==i&&a.setRequestHeader("Range","bytes="+e+"-"+r),a.responseType="arraybuffer",a.overrideMimeType&&a.overrideMimeType("text/plain; charset=x-user-defined"),a.send(null),!(a.status>=200&&a.status<300||304===a.status))throw new Error("Couldn't load "+n+". Status: "+a.status);return void 0!==a.response?new Uint8Array(a.response||[]):tr(a.responseText||"",!0)})(r,a)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!o&&t||(i=t=1,t=this.getter(0).length,i=t,F("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=t,this._chunkSize=i,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if("undefined"!=typeof XMLHttpRequest){if(!p)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var s={isDevice:!1,contents:new i}}else s={isDevice:!1,url:n};var l=ur.createFile(e,r,s,a,o);s.contents?l.contents=s.contents:s.url&&(l.contents=null,l.url=s.url),Object.defineProperties(l,{usedBytes:{get:function(){return this.contents.length}}});var u={};function c(e,r,t,n,a){var o=e.node.contents;if(a>=o.length)return 0;var i=Math.min(o.length-a,n);if(o.slice)for(var s=0;s<i;s++)r[t+s]=o[a+s];else for(s=0;s<i;s++)r[t+s]=o.get(a+s);return i}return Object.keys(l.stream_ops).forEach((e=>{var r=l.stream_ops[e];u[e]=(...e)=>(ur.forceLoadFile(l),r(...e))})),u.read=(e,r,t,n,a)=>(ur.forceLoadFile(l),c(e,r,t,n,a)),u.mmap=(e,r,n,a,o)=>{ur.forceLoadFile(l);var i=or(r);if(!i)throw new ur.ErrnoError(48);return c(e,t(),i,r,n),{ptr:i,allocated:!0}},l.stream_ops=u,l}},cr={DEFAULT_POLLMASK:5,calculateAt(e,r,t){if(Ke.isAbs(r))return r;var n;if(n=-100===e?ur.cwd():cr.getStreamFromFD(e).path,0==r.length){if(!t)throw new ur.ErrnoError(44);return n}return Ke.join2(n,r)},doStat(e,r,t){var n=e(r);i()[t>>2]=n.dev,i()[t+4>>2]=n.mode,s()[t+8>>2]=n.nlink,i()[t+12>>2]=n.uid,i()[t+16>>2]=n.gid,i()[t+20>>2]=n.rdev,ue=[n.size>>>0,(le=n.size,+Math.abs(le)>=1?le>0?+Math.floor(le/4294967296)>>>0:~~+Math.ceil((le-+(~~le>>>0))/4294967296)>>>0:0)],i()[t+24>>2]=ue[0],i()[t+28>>2]=ue[1],i()[t+32>>2]=4096,i()[t+36>>2]=n.blocks;var a=n.atime.getTime(),o=n.mtime.getTime(),l=n.ctime.getTime();return ue=[Math.floor(a/1e3)>>>0,(le=Math.floor(a/1e3),+Math.abs(le)>=1?le>0?+Math.floor(le/4294967296)>>>0:~~+Math.ceil((le-+(~~le>>>0))/4294967296)>>>0:0)],i()[t+40>>2]=ue[0],i()[t+44>>2]=ue[1],s()[t+48>>2]=a%1e3*1e3*1e3,ue=[Math.floor(o/1e3)>>>0,(le=Math.floor(o/1e3),+Math.abs(le)>=1?le>0?+Math.floor(le/4294967296)>>>0:~~+Math.ceil((le-+(~~le>>>0))/4294967296)>>>0:0)],i()[t+56>>2]=ue[0],i()[t+60>>2]=ue[1],s()[t+64>>2]=o%1e3*1e3*1e3,ue=[Math.floor(l/1e3)>>>0,(le=Math.floor(l/1e3),+Math.abs(le)>=1?le>0?+Math.floor(le/4294967296)>>>0:~~+Math.ceil((le-+(~~le>>>0))/4294967296)>>>0:0)],i()[t+72>>2]=ue[0],i()[t+76>>2]=ue[1],s()[t+80>>2]=l%1e3*1e3*1e3,ue=[n.ino>>>0,(le=n.ino,+Math.abs(le)>=1?le>0?+Math.floor(le/4294967296)>>>0:~~+Math.ceil((le-+(~~le>>>0))/4294967296)>>>0:0)],i()[t+88>>2]=ue[0],i()[t+92>>2]=ue[1],0},doMsync(e,r,t,a,o){if(!ur.isFile(r.node.mode))throw new ur.ErrnoError(43);if(2&a)return 0;var i=n().slice(e,e+t);ur.msync(r,i,o,t,a)},getStreamFromFD:e=>ur.getStreamChecked(e),varargs:void 0,getStr:e=>ze(e)};function dr(e,r,t){if(g)return Se(3,0,1,e,r,t);cr.varargs=t;try{var n=cr.getStreamFromFD(e);switch(r){case 0:if((o=Xe())<0)return-28;for(;ur.streams[o];)o++;return ur.dupStream(n,o).fd;case 1:case 2:case 13:case 14:return 0;case 3:return n.flags;case 4:var o=Xe();return n.flags|=o,0;case 12:return o=Ye(),a()[o+0>>1]=2,0}return-28}catch(e){if(void 0===ur||"ErrnoError"!==e.name)throw e;return-e.errno}}function fr(e,r){if(g)return Se(4,0,1,e,r);try{var t=cr.getStreamFromFD(e);return cr.doStat(ur.stat,t.path,r)}catch(e){if(void 0===ur||"ErrnoError"!==e.name)throw e;return-e.errno}}function mr(e,r,n){if(g)return Se(5,0,1,e,r,n);cr.varargs=n;try{var o=cr.getStreamFromFD(e);switch(r){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return o.tty?0:-59;case 21505:if(!o.tty)return-59;if(o.tty.ops.ioctl_tcgets){var s=o.tty.ops.ioctl_tcgets(o),l=Ye();i()[l>>2]=s.c_iflag||0,i()[l+4>>2]=s.c_oflag||0,i()[l+8>>2]=s.c_cflag||0,i()[l+12>>2]=s.c_lflag||0;for(var u=0;u<32;u++)t()[l+u+17]=s.c_cc[u]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!o.tty)return-59;if(o.tty.ops.ioctl_tcsets){l=Ye();var c=i()[l>>2],d=i()[l+4>>2],f=i()[l+8>>2],m=i()[l+12>>2],h=[];for(u=0;u<32;u++)h.push(t()[l+u+17]);return o.tty.ops.ioctl_tcsets(o.tty,r,{c_iflag:c,c_oflag:d,c_cflag:f,c_lflag:m,c_cc:h})}return 0;case 21519:return o.tty?(l=Ye(),i()[l>>2]=0,0):-59;case 21520:return o.tty?-28:-59;case 21531:return l=Ye(),ur.ioctl(o,r,l);case 21523:if(!o.tty)return-59;if(o.tty.ops.ioctl_tiocgwinsz){var p=o.tty.ops.ioctl_tiocgwinsz(o.tty);l=Ye(),a()[l>>1]=p[0],a()[l+2>>1]=p[1]}return 0;default:return-28}}catch(e){if(void 0===ur||"ErrnoError"!==e.name)throw e;return-e.errno}}function hr(e,r){if(g)return Se(6,0,1,e,r);try{return e=cr.getStr(e),cr.doStat(ur.lstat,e,r)}catch(e){if(void 0===ur||"ErrnoError"!==e.name)throw e;return-e.errno}}function pr(e,r,t,n){if(g)return Se(7,0,1,e,r,t,n);try{r=cr.getStr(r);var a=256&n,o=4096&n;return n&=-6401,r=cr.calculateAt(e,r,o),cr.doStat(a?ur.lstat:ur.stat,r,t)}catch(e){if(void 0===ur||"ErrnoError"!==e.name)throw e;return-e.errno}}function vr(e,r,t,n){if(g)return Se(8,0,1,e,r,t,n);cr.varargs=n;try{r=cr.getStr(r),r=cr.calculateAt(e,r);var a=n?Xe():0;return ur.open(r,t,a).fd}catch(e){if(void 0===ur||"ErrnoError"!==e.name)throw e;return-e.errno}}function gr(e,r){if(g)return Se(9,0,1,e,r);try{return e=cr.getStr(e),cr.doStat(ur.stat,e,r)}catch(e){if(void 0===ur||"ErrnoError"!==e.name)throw e;return-e.errno}}var yr,wr,_r,br=()=>{ie("")},Er=(e,r,t,n,a)=>{},kr=e=>{for(var r="",t=e;n()[t];)r+=yr[n()[t++]];return r},Cr={},xr={},Sr={},Pr=e=>{throw new wr(e)},Tr=e=>{throw new _r(e)},$r=(e,r,t)=>{function n(r){var n=t(r);n.length!==e.length&&Tr("Mismatched type converter count");for(var a=0;a<e.length;++a)Fr(e[a],n[a])}e.forEach((e=>Sr[e]=r));var a=new Array(r.length),o=[],i=0;r.forEach(((e,r)=>{xr.hasOwnProperty(e)?a[r]=xr[e]:(o.push(e),Cr.hasOwnProperty(e)||(Cr[e]=[]),Cr[e].push((()=>{a[r]=xr[e],++i===o.length&&n(a)})))})),0===o.length&&n(a)};function Fr(e,r,t={}){return function(e,r,t={}){var n=r.name;if(e||Pr(`type "${n}" must have a positive integer typeid pointer`),xr.hasOwnProperty(e)){if(t.ignoreDuplicateRegistrations)return;Pr(`Cannot register type '${n}' twice`)}if(xr[e]=r,delete Sr[e],Cr.hasOwnProperty(e)){var a=Cr[e];delete Cr[e],a.forEach((e=>e()))}}(e,r,t)}var jr=(e,r,t,a)=>{Fr(e,{name:r=kr(r),fromWireType:function(e){return!!e},toWireType:function(e,r){return r?t:a},argPackAdvance:8,readValueFromPointer:function(e){return this.fromWireType(n()[e])},destructorFunction:null})},Ar=e=>{Pr(e.$$.ptrType.registeredClass.name+" instance already deleted")},Mr=!1,Lr=e=>{},Dr=e=>{e.count.value-=1,0===e.count.value&&(e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)})(e)},Rr=(e,r,t)=>{if(r===t)return e;if(void 0===t.baseClass)return null;var n=Rr(e,r,t.baseClass);return null===n?null:t.downcast(n)},Ir={},Or={},Wr=(e,r)=>(r=((e,r)=>{for(void 0===r&&Pr("ptr should not be undefined");e.baseClass;)r=e.upcast(r),e=e.baseClass;return r})(e,r),Or[r]),Br=(e,r)=>(r.ptrType&&r.ptr||Tr("makeClassHandle requires ptr and ptrType"),!!r.smartPtrType!=!!r.smartPtr&&Tr("Both smartPtrType and smartPtr must be specified"),r.count={value:1},zr(Object.create(e,{$$:{value:r,writable:!0}})));function Nr(e){var r=this.getPointee(e);if(!r)return this.destructor(e),null;var t=Wr(this.registeredClass,r);if(void 0!==t){if(0===t.$$.count.value)return t.$$.ptr=r,t.$$.smartPtr=e,t.clone();var n=t.clone();return this.destructor(e),n}function a(){return this.isSmartPointer?Br(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:r,smartPtrType:this,smartPtr:e}):Br(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var o,i=this.registeredClass.getActualType(r),s=Ir[i];if(!s)return a.call(this);o=this.isConst?s.constPointerType:s.pointerType;var l=Rr(r,this.registeredClass,o.registeredClass);return null===l?a.call(this):this.isSmartPointer?Br(o.registeredClass.instancePrototype,{ptrType:o,ptr:l,smartPtrType:this,smartPtr:e}):Br(o.registeredClass.instancePrototype,{ptrType:o,ptr:l})}var zr=e=>"undefined"==typeof FinalizationRegistry?(zr=e=>e,e):(Mr=new FinalizationRegistry((e=>{Dr(e.$$)})),zr=e=>{var r=e.$$;if(r.smartPtr){var t={$$:r};Mr.register(e,t,e)}return e},Lr=e=>Mr.unregister(e),zr(e)),Ur=[];function Hr(){}var Gr=(e,r)=>Object.defineProperty(r,"name",{value:e}),Vr=(e,r,t)=>{if(void 0===e[r].overloadTable){var n=e[r];e[r]=function(...n){return e[r].overloadTable.hasOwnProperty(n.length)||Pr(`Function '${t}' called with an invalid number of arguments (${n.length}) - expects one of (${e[r].overloadTable})!`),e[r].overloadTable[n.length].apply(this,n)},e[r].overloadTable=[],e[r].overloadTable[n.argCount]=n}},qr=(e,r,t)=>{f.hasOwnProperty(e)?((void 0===t||void 0!==f[e].overloadTable&&void 0!==f[e].overloadTable[t])&&Pr(`Cannot register public name '${e}' twice`),Vr(f,e,e),f[e].overloadTable.hasOwnProperty(t)&&Pr(`Cannot register multiple overloads of a function with the same number of arguments (${t})!`),f[e].overloadTable[t]=r):(f[e]=r,f[e].argCount=t)};function Xr(e,r,t,n,a,o,i,s){this.name=e,this.constructor=r,this.instancePrototype=t,this.rawDestructor=n,this.baseClass=a,this.getActualType=o,this.upcast=i,this.downcast=s,this.pureVirtualFunctions=[]}var Yr=(e,r,t)=>{for(;r!==t;)r.upcast||Pr(`Expected null or instance of ${t.name}, got an instance of ${r.name}`),e=r.upcast(e),r=r.baseClass;return e};function Kr(e,r){if(null===r)return this.isReference&&Pr(`null is not a valid ${this.name}`),0;r.$$||Pr(`Cannot pass "${Et(r)}" as a ${this.name}`),r.$$.ptr||Pr(`Cannot pass deleted object as a pointer of type ${this.name}`);var t=r.$$.ptrType.registeredClass;return Yr(r.$$.ptr,t,this.registeredClass)}function Qr(e,r){var t;if(null===r)return this.isReference&&Pr(`null is not a valid ${this.name}`),this.isSmartPointer?(t=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,t),t):0;r&&r.$$||Pr(`Cannot pass "${Et(r)}" as a ${this.name}`),r.$$.ptr||Pr(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&r.$$.ptrType.isConst&&Pr(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);var n=r.$$.ptrType.registeredClass;if(t=Yr(r.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===r.$$.smartPtr&&Pr("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:r.$$.smartPtrType===this?t=r.$$.smartPtr:Pr(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:t=r.$$.smartPtr;break;case 2:if(r.$$.smartPtrType===this)t=r.$$.smartPtr;else{var a=r.clone();t=this.rawShare(t,wt.toHandle((()=>a.delete()))),null!==e&&e.push(this.rawDestructor,t)}break;default:Pr("Unsupporting sharing policy")}return t}function Zr(e,r){if(null===r)return this.isReference&&Pr(`null is not a valid ${this.name}`),0;r.$$||Pr(`Cannot pass "${Et(r)}" as a ${this.name}`),r.$$.ptr||Pr(`Cannot pass deleted object as a pointer of type ${this.name}`),r.$$.ptrType.isConst&&Pr(`Cannot convert argument of type ${r.$$.ptrType.name} to parameter type ${this.name}`);var t=r.$$.ptrType.registeredClass;return Yr(r.$$.ptr,t,this.registeredClass)}function Jr(e){return this.fromWireType(s()[e>>2])}function et(e,r,t,n,a,o,i,s,l,u,c){this.name=e,this.registeredClass=r,this.isReference=t,this.isConst=n,this.isSmartPointer=a,this.pointeeType=o,this.sharingPolicy=i,this.rawGetPointee=s,this.rawConstructor=l,this.rawShare=u,this.rawDestructor=c,a||void 0!==r.baseClass?this.toWireType=Qr:n?(this.toWireType=Kr,this.destructorFunction=null):(this.toWireType=Zr,this.destructorFunction=null)}var rt,tt=(e,r,t)=>{f.hasOwnProperty(e)||Tr("Replacing nonexistent public symbol"),void 0!==f[e].overloadTable&&void 0!==t?f[e].overloadTable[t]=r:(f[e]=r,f[e].argCount=t)},nt=(e,r,t=[])=>e.includes("j")?((e,r,t)=>(e=e.replace(/p/g,"i"),(0,f["dynCall_"+e])(r,...t)))(e,r,t):Re(r)(...t),at=(e,r)=>{var t,n,a=(e=kr(e)).includes("j")?(t=e,n=r,(...e)=>nt(t,n,e)):Re(r);return"function"!=typeof a&&Pr(`unknown function pointer with signature ${e}: ${r}`),a},ot=e=>{var r=Ko(e),t=kr(r);return qo(r),t},it=(e,r)=>{var t=[],n={};throw r.forEach((function e(r){n[r]||xr[r]||(Sr[r]?Sr[r].forEach(e):(t.push(r),n[r]=!0))})),new rt(`${e}: `+t.map(ot).join([", "]))},st=(e,r,t,n,a,o,i,s,l,u,c,d,f)=>{c=kr(c),o=at(a,o),s&&=at(i,s),u&&=at(l,u),f=at(d,f);var m=(e=>{var r=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return r>=48&&r<=57?`_${e}`:e})(c);qr(m,(function(){it(`Cannot construct ${c} due to unbound types`,[n])})),$r([e,r,t],n?[n]:[],(r=>{var t,a;r=r[0],a=n?(t=r.registeredClass).instancePrototype:Hr.prototype;var i=Gr(c,(function(...e){if(Object.getPrototypeOf(this)!==l)throw new wr("Use 'new' to construct "+c);if(void 0===d.constructor_body)throw new wr(c+" has no accessible constructor");var r=d.constructor_body[e.length];if(void 0===r)throw new wr(`Tried to invoke ctor of ${c} with invalid number of parameters (${e.length}) - expected (${Object.keys(d.constructor_body).toString()}) parameters instead!`);return r.apply(this,e)})),l=Object.create(a,{constructor:{value:i}});i.prototype=l;var d=new Xr(c,i,l,f,t,o,s,u);d.baseClass&&(d.baseClass.__derivedClasses??=[],d.baseClass.__derivedClasses.push(d));var h=new et(c,d,!0,!1,!1),p=new et(c+"*",d,!1,!1,!1),v=new et(c+" const*",d,!1,!0,!1);return Ir[e]={pointerType:p,constPointerType:v},tt(m,i),[h,p,v]}))},lt=e=>{for(;e.length;){var r=e.pop();e.pop()(r)}};function ut(e){for(var r=1;r<e.length;++r)if(null!==e[r]&&void 0===e[r].destructorFunction)return!0;return!1}function ct(e,r){if(!(e instanceof Function))throw new TypeError(`new_ called with constructor type ${typeof e} which is not a function`);var t=Gr(e.name||"unknownFunctionName",(function(){}));t.prototype=e.prototype;var n=new t,a=e.apply(n,r);return a instanceof Object?a:n}function dt(e,r,t,n,a,o){var i=r.length;i<2&&Pr("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var s=null!==r[1]&&null!==t,l=ut(r),u="void"!==r[0].name,c=[e,Pr,n,a,lt,r[0],r[1]],d=0;d<i-2;++d)c.push(r[d+2]);if(!l)for(d=s?1:2;d<r.length;++d)null!==r[d].destructorFunction&&c.push(r[d].destructorFunction);let[f,m]=function(e,r,t,n){var a=ut(e),o=e.length-2,i=[],s=["fn"];r&&s.push("thisWired");for(var l=0;l<o;++l)i.push(`arg${l}`),s.push(`arg${l}Wired`);i=i.join(","),s=s.join(",");var u=`return function (${i}) {\n`;a&&(u+="var destructors = [];\n");var c=a?"destructors":"null",d=["humanName","throwBindingError","invoker","fn","runDestructors","retType","classParam"];for(r&&(u+=`var thisWired = classParam['toWireType'](${c}, this);\n`),l=0;l<o;++l)u+=`var arg${l}Wired = argType${l}['toWireType'](${c}, arg${l});\n`,d.push(`argType${l}`);if(u+=(t||n?"var rv = ":"")+`invoker(${s});\n`,a)u+="runDestructors(destructors);\n";else for(l=r?1:2;l<e.length;++l){var f=1===l?"thisWired":"arg"+(l-2)+"Wired";null!==e[l].destructorFunction&&(u+=`${f}_dtor(${f});\n`,d.push(`${f}_dtor`))}return t&&(u+="var ret = retType['fromWireType'](rv);\nreturn ret;\n"),[d,u+="}\n"]}(r,s,u,o);f.push(m);var h=ct(Function,f)(...c);return Gr(e,h)}var ft=(e,r)=>{for(var t=[],n=0;n<e;n++)t.push(s()[r+4*n>>2]);return t},mt=e=>{const r=(e=e.trim()).indexOf("(");return-1!==r?e.substr(0,r):e},ht=(e,r,t,n,a,o,i,s,l)=>{var u=ft(t,n);r=kr(r),r=mt(r),o=at(a,o),$r([],[e],(e=>{var n=`${(e=e[0]).name}.${r}`;function a(){it(`Cannot call ${n} due to unbound types`,u)}r.startsWith("@@")&&(r=Symbol[r.substring(2)]);var l=e.registeredClass.constructor;return void 0===l[r]?(a.argCount=t-1,l[r]=a):(Vr(l,r,n),l[r].overloadTable[t-1]=a),$r([],u,(a=>{var u=[a[0],null].concat(a.slice(1)),c=dt(n,u,null,o,i,s);if(void 0===l[r].overloadTable?(c.argCount=t-1,l[r]=c):l[r].overloadTable[t-1]=c,e.registeredClass.__derivedClasses)for(const t of e.registeredClass.__derivedClasses)t.constructor.hasOwnProperty(r)||(t.constructor[r]=c);return[]})),[]}))},pt=[],vt=[],gt=e=>{e>9&&0==--vt[e+1]&&(vt[e]=void 0,pt.push(e))},yt=()=>vt.length/2-5-pt.length,wt={toValue:e=>(e||Pr("Cannot use deleted val. handle = "+e),vt[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const r=pt.pop()||vt.length;return vt[r]=e,vt[r+1]=1,r}}}},_t={name:"emscripten::val",fromWireType:e=>{var r=wt.toValue(e);return gt(e),r},toWireType:(e,r)=>wt.toHandle(r),argPackAdvance:8,readValueFromPointer:Jr,destructorFunction:null},bt=e=>Fr(e,_t),Et=e=>{if(null===e)return"null";var r=typeof e;return"object"===r||"array"===r||"function"===r?e.toString():""+e},kt=(e,r)=>{switch(r){case 4:return function(e){return this.fromWireType(l()[e>>2])};case 8:return function(e){return this.fromWireType(u()[e>>3])};default:throw new TypeError(`invalid float width (${r}): ${e}`)}},Ct=(e,r,t)=>{Fr(e,{name:r=kr(r),fromWireType:e=>e,toWireType:(e,r)=>r,argPackAdvance:8,readValueFromPointer:kt(r,t),destructorFunction:null})},xt=(e,r,t,n,a,o,i,s)=>{var l=ft(r,t);e=kr(e),e=mt(e),a=at(n,a),qr(e,(function(){it(`Cannot call ${e} due to unbound types`,l)}),r-1),$r([],l,(t=>{var n=[t[0],null].concat(t.slice(1));return tt(e,dt(e,n,null,a,o,i),r-1),[]}))},St=(e,r,l)=>{switch(r){case 1:return l?e=>t()[e]:e=>n()[e];case 2:return l?e=>a()[e>>1]:e=>o()[e>>1];case 4:return l?e=>i()[e>>2]:e=>s()[e>>2];default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},Pt=(e,r,t,n,a)=>{r=kr(r);var o=e=>e;if(0===n){var i=32-8*t;o=e=>e<<i>>>i}var s=r.includes("unsigned");Fr(e,{name:r,fromWireType:o,toWireType:s?function(e,r){return this.name,r>>>0}:function(e,r){return this.name,r},argPackAdvance:8,readValueFromPointer:St(r,t,0!==n),destructorFunction:null})},Tt=(e,r,n)=>{var a=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][r];function o(e){var r=s()[e>>2],n=s()[e+4>>2];return new a(t().buffer,n,r)}Fr(e,{name:n=kr(n),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},$t=(e,r,t)=>rr(e,n(),r,t),Ft=(e,r)=>{var t="std::string"===(r=kr(r));Fr(e,{name:r,fromWireType(e){var r,a=s()[e>>2],o=e+4;if(t)for(var i=o,l=0;l<=a;++l){var u=o+l;if(l==a||0==n()[u]){var c=ze(i,u-i);void 0===r?r=c:(r+=String.fromCharCode(0),r+=c),i=u+1}}else{var d=new Array(a);for(l=0;l<a;++l)d[l]=String.fromCharCode(n()[o+l]);r=d.join("")}return qo(e),r},toWireType(e,r){var a;r instanceof ArrayBuffer&&(r=new Uint8Array(r));var o="string"==typeof r;o||r instanceof Uint8Array||r instanceof Uint8ClampedArray||r instanceof Int8Array||Pr("Cannot pass non-string to std::string"),a=t&&o?er(r):r.length;var i=Vo(4+a+1),l=i+4;if(s()[i>>2]=a,t&&o)$t(r,l,a+1);else if(o)for(var u=0;u<a;++u){var c=r.charCodeAt(u);c>255&&(qo(l),Pr("String has UTF-16 code units that do not fit in 8 bits")),n()[l+u]=c}else for(u=0;u<a;++u)n()[l+u]=r[u];return null!==e&&e.push(qo,i),i},argPackAdvance:8,readValueFromPointer:Jr,destructorFunction(e){qo(e)}})},jt="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,At=(e,r)=>{for(var t=e,i=t>>1,s=i+r/2;!(i>=s)&&o()[i];)++i;if((t=i<<1)-e>32&&jt)return jt.decode(n().slice(e,t));for(var l="",u=0;!(u>=r/2);++u){var c=a()[e+2*u>>1];if(0==c)break;l+=String.fromCharCode(c)}return l},Mt=(e,r,t)=>{if(t??=2147483647,t<2)return 0;for(var n=r,o=(t-=2)<2*e.length?t/2:e.length,i=0;i<o;++i){var s=e.charCodeAt(i);a()[r>>1]=s,r+=2}return a()[r>>1]=0,r-n},Lt=e=>2*e.length,Dt=(e,r)=>{for(var t=0,n="";!(t>=r/4);){var a=i()[e+4*t>>2];if(0==a)break;if(++t,a>=65536){var o=a-65536;n+=String.fromCharCode(55296|o>>10,56320|1023&o)}else n+=String.fromCharCode(a)}return n},Rt=(e,r,t)=>{if(t??=2147483647,t<4)return 0;for(var n=r,a=n+t-4,o=0;o<e.length;++o){var s=e.charCodeAt(o);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++o)),i()[r>>2]=s,(r+=4)+4>a)break}return i()[r>>2]=0,r-n},It=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n>=55296&&n<=57343&&++t,r+=4}return r},Ot=(e,r,t)=>{var n,a,i,l;t=kr(t),2===r?(n=At,a=Mt,l=Lt,i=e=>o()[e>>1]):4===r&&(n=Dt,a=Rt,l=It,i=e=>s()[e>>2]),Fr(e,{name:t,fromWireType:e=>{for(var t,a=s()[e>>2],o=e+4,l=0;l<=a;++l){var u=e+4+l*r;if(l==a||0==i(u)){var c=n(o,u-o);void 0===t?t=c:(t+=String.fromCharCode(0),t+=c),o=u+r}}return qo(e),t},toWireType:(e,n)=>{"string"!=typeof n&&Pr(`Cannot pass non-string to C++ string type ${t}`);var o=l(n),i=Vo(4+o+r);return s()[i>>2]=o/r,a(n,i+4,o+r),null!==e&&e.push(qo,i),i},argPackAdvance:8,readValueFromPointer:Jr,destructorFunction(e){qo(e)}})},Wt=(e,r)=>{Fr(e,{isVoid:!0,name:r=kr(r),argPackAdvance:0,fromWireType:()=>{},toWireType:(e,r)=>{}})};function Bt(e){if(ea.xhrs.has(e)){var r=ea.xhrs.get(e);ea.xhrs.free(e),r.readyState>0&&r.readyState<4&&r.abort()}}function Nt(e,r,t){var n=ea.xhrs.get(e).getAllResponseHeaders(),a=er(n)+1;return $t(n,r,t),Math.min(a,t)}function zt(e){return er(ea.xhrs.get(e).getAllResponseHeaders())+1}var Ut=()=>1,Ht=e=>{Jo(e,!p,1,!h,65536,!1),Ae.threadInitTLS()},Gt=()=>{if(!Ee())try{g?ni(L):je(L)}catch(e){Te(e)}},Vt=e=>{if(!H)try{e(),Gt()}catch(e){Te(e)}},qt=e=>{if("function"==typeof Atomics.waitAsync){Atomics.waitAsync(i(),e>>2,e).value.then(Xt);var r=e+128;Atomics.store(i(),r>>2,1)}},Xt=()=>{var e=Xo();e&&(qt(e),Vt(ai))},Yt=(e,r)=>{if(e==r)setTimeout(Xt);else if(g)postMessage({targetThread:e,cmd:"checkMailbox"});else{var t=Ae.pthreads[e];if(!t)return;t.postMessage({cmd:"checkMailbox"})}},Kt=[],Qt=(e,r,t,n,a)=>{Kt.length=n;for(var o=a>>3,i=0;i<n;i++)Kt[i]=u()[o+i];var s=r?ve[r]:Ho[e];Ae.currentProxiedOperationCallerThread=t;var l=s(...Kt);return Ae.currentProxiedOperationCallerThread=0,l},Zt=e=>{g?postMessage({cmd:"cleanupThread",thread:e}):we(e)},Jt=e=>{v&&Ae.pthreads[e].ref()},en=()=>{throw 1/0},rn=(e,r)=>{var t=xr[e];return void 0===t&&Pr(`${r} has unknown type ${ot(e)}`),t},tn=(e,r,t)=>{var n=[],a=e.toWireType(n,t);return n.length&&(s()[r>>2]=wt.toHandle(n)),a},nn=(e,r,t)=>(e=wt.toValue(e),r=rn(r,"emval::as"),tn(r,t,e)),an=[],on=(e,r,t,n)=>(e=an[e])(null,r=wt.toValue(r),t,n),sn={},ln=e=>{var r=sn[e];return void 0===r?kr(e):r},un=(e,r,t,n,a)=>(e=an[e])(r=wt.toValue(r),r[t=ln(t)],n,a),cn=()=>"object"==typeof globalThis?globalThis:Function("return this")(),dn=e=>0===e?wt.toHandle(cn()):(e=ln(e),wt.toHandle(cn()[e])),fn=(e,r,t)=>{var n=((e,r)=>{for(var t=new Array(e),n=0;n<e;++n)t[n]=rn(s()[r+4*n>>2],"parameter "+n);return t})(e,r),a=n.shift();e--;var o="return function (obj, func, destructorsRef, args) {\n",i=0,l=[];0===t&&l.push("obj");for(var u=["retType"],c=[a],d=0;d<e;++d)l.push("arg"+d),u.push("argType"+d),c.push(n[d]),o+=` var arg${d} = argType${d}.readValueFromPointer(args${i?"+"+i:""});\n`,i+=n[d].argPackAdvance;o+=` var rv = ${1===t?"new func":"func.call"}(${l.join(", ")});\n`,a.isVoid||(u.push("emval_returnValue"),c.push(tn),o+=" return emval_returnValue(retType, destructorsRef, rv);\n"),o+="};\n",u.push(o);var f,m,h=ct(Function,u)(...c),p=`methodCaller<(${n.map((e=>e.name)).join(", ")}) => ${a.name}>`;return f=Gr(p,h),m=an.length,an.push(f),m},mn=(e,r)=>(e=wt.toValue(e),r=wt.toValue(r),wt.toHandle(e[r])),hn=e=>{e>9&&(vt[e+1]+=1)},pn=(e,r)=>(e=wt.toValue(e))instanceof(r=wt.toValue(r)),vn=e=>"number"==typeof(e=wt.toValue(e)),gn=e=>"string"==typeof(e=wt.toValue(e)),yn=()=>wt.toHandle([]),wn=e=>wt.toHandle(ln(e)),_n=()=>wt.toHandle({}),bn=e=>{var r=wt.toValue(e);lt(r),gt(e)},En=(e,r,t)=>{e=wt.toValue(e),r=wt.toValue(r),t=wt.toValue(t),e[r]=t},kn=(e,r)=>{var t=(e=rn(e,"_emval_take_value")).readValueFromPointer(r);return wt.toHandle(t)},Cn=e=>(e=wt.toValue(e),wt.toHandle(typeof e));function xn(e,r,t,n,a,o,l,u){if(g)return Se(10,0,1,e,r,t,n,a,o,l,u);var c=xe(a,o);try{if(isNaN(c))return 61;var d=cr.getStreamFromFD(n),f=ur.mmap(d,e,c,r,t),m=f.ptr;return i()[l>>2]=f.allocated,s()[u>>2]=m,0}catch(e){if(void 0===ur||"ErrnoError"!==e.name)throw e;return-e.errno}}function Sn(e,r,t,n,a,o,i){if(g)return Se(11,0,1,e,r,t,n,a,o,i);var s=xe(o,i);try{var l=cr.getStreamFromFD(a);2&t&&cr.doMsync(e,l,r,n,s)}catch(e){if(void 0===ur||"ErrnoError"!==e.name)throw e;return-e.errno}}var Pn=(e,r,t,n)=>{var a=(new Date).getFullYear(),o=new Date(a,0,1),l=new Date(a,6,1),u=o.getTimezoneOffset(),c=l.getTimezoneOffset(),d=Math.max(u,c);s()[e>>2]=60*d,i()[r>>2]=Number(u!=c);var f=e=>{var r=e>=0?"-":"+",t=Math.abs(e);return`UTC${r}${String(Math.floor(t/60)).padStart(2,"0")}${String(t%60).padStart(2,"0")}`},m=f(u),h=f(c);c<u?($t(m,t,17),$t(h,n,17)):($t(m,n,17),$t(h,t,17))},Tn=[],$n=(e,r,t)=>{var a=((e,r)=>{var t;for(Tn.length=0;t=n()[e++];){var a=105!=t;r+=(a&=112!=t)&&r%8?4:0,Tn.push(112==t?s()[r>>2]:105==t?i()[r>>2]:u()[r>>3]),r+=a?8:4}return Tn})(r,t);return ve[e](...a)},Fn=(e,r,t)=>$n(e,r,t),jn=()=>{be+=1},An=()=>{be-=1},Mn=(e,r)=>(jn(),setTimeout((()=>{An(),Vt(e)}),r)),Ln=(e,r)=>{if(In.timingMode=e,In.timingValue=r,!In.func)return 1;if(In.running||(jn(),In.running=!0),0==e)In.scheduler=function(){var e=0|Math.max(0,In.tickStartTime+r-Dn());setTimeout(In.runner,e)},In.method="timeout";else if(1==e)In.scheduler=function(){In.requestAnimationFrame(In.runner)},In.method="rAF";else if(2==e){if(void 0===In.setImmediate)if("undefined"==typeof setImmediate){var t=[],n="setimmediate";addEventListener("message",(e=>{e.data!==n&&e.data.target!==n||(e.stopPropagation(),t.shift()())}),!0),In.setImmediate=e=>{t.push(e),p?(f.setImmediates??=[],f.setImmediates.push(e),postMessage({target:n})):postMessage(n,"*")}}else In.setImmediate=setImmediate;In.scheduler=function(){In.setImmediate(In.runner)},In.method="immediate"}return 0},Dn=()=>performance.timeOrigin+performance.now(),Rn=(e,r,t,n,a)=>{In.func=e,In.arg=n;var o=In.currentlyRunningMainloop;function i(){return!(o<In.currentlyRunningMainloop&&(An(),Gt(),1))}if(In.running=!1,In.runner=function(){if(!H)if(In.queue.length>0){var r=In.queue.shift();if(r.func(r.arg),In.remainingBlockers){var t=In.remainingBlockers,n=t%1==0?t-1:Math.floor(t);r.counted?In.remainingBlockers=n:(n+=.5,In.remainingBlockers=(8*t+n)/9)}if(In.updateStatus(),!i())return;setTimeout(In.runner,0)}else i()&&(In.currentFrameNumber=In.currentFrameNumber+1|0,1==In.timingMode&&In.timingValue>1&&In.currentFrameNumber%In.timingValue!=0?In.scheduler():(0==In.timingMode&&(In.tickStartTime=Dn()),In.runIter(e),i()&&In.scheduler()))},a||(r&&r>0?Ln(0,1e3/r):Ln(1,1),In.scheduler()),t)throw"unwind"},In={running:!1,scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],preMainLoop:[],postMainLoop:[],pause(){In.scheduler=null,In.currentlyRunningMainloop++},resume(){In.currentlyRunningMainloop++;var e=In.timingMode,r=In.timingValue,t=In.func;In.func=null,Rn(t,0,!1,In.arg,!0),Ln(e,r),In.scheduler()},updateStatus(){if(f.setStatus){var e=f.statusMessage||"Please wait...",r=In.remainingBlockers??0,t=In.expectedBlockers??0;r?r<t?f.setStatus("{message} ({expected - remaining}/{expected})"):f.setStatus(e):f.setStatus("")}},init(){f.preMainLoop&&In.preMainLoop.push(f.preMainLoop),f.postMainLoop&&In.postMainLoop.push(f.postMainLoop)},runIter(e){if(!H){for(var r of In.preMainLoop)if(!1===r())return;for(var t of(Vt(e),In.postMainLoop))t()}},nextRAF:0,fakeRequestAnimationFrame(e){var r=Date.now();if(0===In.nextRAF)In.nextRAF=r+1e3/60;else for(;r+2>=In.nextRAF;)In.nextRAF+=1e3/60;var t=Math.max(In.nextRAF-r,0);setTimeout(e,t)},requestAnimationFrame(e){"function"!=typeof requestAnimationFrame?(0,In.fakeRequestAnimationFrame)(e):requestAnimationFrame(e)}},On=e=>{On.shown||={},On.shown[e]||(On.shown[e]=1,v&&(e="warning: "+e),j(e))},Wn={useWebGL:!1,isFullscreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init(){if(!Wn.initted){Wn.initted=!0;var e={canHandle:function(e){return!f.noImageDecoding&&/\.(jpg|jpeg|png|bmp|webp)$/i.test(e)},handle:function(e,r,t,n){var a=new Blob([e],{type:Wn.getMimetype(r)});a.size!==e.length&&(a=new Blob([new Uint8Array(e).buffer],{type:Wn.getMimetype(r)}));var o=URL.createObjectURL(a),i=new Image;i.onload=()=>{var r=document.createElement("canvas");r.width=i.width,r.height=i.height,r.getContext("2d").drawImage(i,0,0),URL.revokeObjectURL(o),t?.(e)},i.onerror=e=>{j(`Image ${o} could not be decoded`),n?.()},i.src=o}};sr.push(e);var r={canHandle:function(e){return!f.noAudioDecoding&&e.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},handle:function(e,r,t,n){var a=!1;function o(r){a||(a=!0,t?.(e))}var i=new Blob([e],{type:Wn.getMimetype(r)}),s=URL.createObjectURL(i),l=new Audio;l.addEventListener("canplaythrough",(()=>o()),!1),l.onerror=function(t){a||(j(`warning: browser could not fully decode audio ${r}, trying slower base64 approach`),l.src="data:audio/x-"+r.substr(-3)+";base64,"+function(e){for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t="",n=0,a=0,o=0;o<e.length;o++)for(n=n<<8|e[o],a+=8;a>=6;){var i=n>>a-6&63;a-=6,t+=r[i]}return 2==a?(t+=r[(3&n)<<4],t+="=="):4==a&&(t+=r[(15&n)<<2],t+="="),t}(e),o())},l.src=s,Mn((()=>{o()}),1e4)}};sr.push(r);var t=f.canvas;t&&(t.requestPointerLock=t.requestPointerLock||t.mozRequestPointerLock||t.webkitRequestPointerLock||t.msRequestPointerLock||(()=>{}),t.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||(()=>{}),t.exitPointerLock=t.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",n,!1),document.addEventListener("mozpointerlockchange",n,!1),document.addEventListener("webkitpointerlockchange",n,!1),document.addEventListener("mspointerlockchange",n,!1),f.elementPointerLock&&t.addEventListener("click",(e=>{!Wn.pointerLock&&f.canvas.requestPointerLock&&(f.canvas.requestPointerLock(),e.preventDefault())}),!1))}function n(){Wn.pointerLock=document.pointerLockElement===f.canvas||document.mozPointerLockElement===f.canvas||document.webkitPointerLockElement===f.canvas||document.msPointerLockElement===f.canvas}},createContext(e,r,t,n){if(r&&f.ctx&&e==f.canvas)return f.ctx;var a,o;if(r){var i={antialias:!1,alpha:!1,majorVersion:1};if(n)for(var s in n)i[s]=n[s];void 0!==ia&&(o=ia.createContext(e,i))&&(a=ia.getContext(o).GLctx)}else a=e.getContext("2d");return a?(t&&(f.ctx=a,r&&ia.makeContextCurrent(o),Wn.useWebGL=r,Wn.moduleContextCreatedCallbacks.forEach((e=>e())),Wn.init()),a):null},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen(e,r){Wn.lockPointer=e,Wn.resizeCanvas=r,void 0===Wn.lockPointer&&(Wn.lockPointer=!0),void 0===Wn.resizeCanvas&&(Wn.resizeCanvas=!1);var t=f.canvas;function n(){Wn.isFullscreen=!1;var e=t.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e?(t.exitFullscreen=Wn.exitFullscreen,Wn.lockPointer&&t.requestPointerLock(),Wn.isFullscreen=!0,Wn.resizeCanvas?Wn.setFullscreenCanvasSize():Wn.updateCanvasDimensions(t)):(e.parentNode.insertBefore(t,e),e.parentNode.removeChild(e),Wn.resizeCanvas?Wn.setWindowedCanvasSize():Wn.updateCanvasDimensions(t)),f.onFullScreen?.(Wn.isFullscreen),f.onFullscreen?.(Wn.isFullscreen)}Wn.fullscreenHandlersInstalled||(Wn.fullscreenHandlersInstalled=!0,document.addEventListener("fullscreenchange",n,!1),document.addEventListener("mozfullscreenchange",n,!1),document.addEventListener("webkitfullscreenchange",n,!1),document.addEventListener("MSFullscreenChange",n,!1));var a=document.createElement("div");t.parentNode.insertBefore(a,t),a.appendChild(t),a.requestFullscreen=a.requestFullscreen||a.mozRequestFullScreen||a.msRequestFullscreen||(a.webkitRequestFullscreen?()=>a.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):null)||(a.webkitRequestFullScreen?()=>a.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT):null),a.requestFullscreen()},exitFullscreen:()=>!!Wn.isFullscreen&&((document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||(()=>{})).apply(document,[]),!0),safeSetTimeout:(e,r)=>Mn(e,r),getMimetype:e=>({jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]),getUserMedia(e){window.getUserMedia||=navigator.getUserMedia||navigator.mozGetUserMedia,window.getUserMedia(e)},getMovementX:e=>e.movementX||e.mozMovementX||e.webkitMovementX||0,getMovementY:e=>e.movementY||e.mozMovementY||e.webkitMovementY||0,getMouseWheelDelta(e){var r=0;switch(e.type){case"DOMMouseScroll":r=e.detail/3;break;case"mousewheel":r=e.wheelDelta/120;break;case"wheel":switch(r=e.deltaY,e.deltaMode){case 0:r/=100;break;case 1:r/=3;break;case 2:r*=80;break;default:throw"unrecognized mouse wheel delta mode: "+e.deltaMode}break;default:throw"unrecognized mouse wheel event: "+e.type}return r},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseCoords(e,r){var t=f.canvas.getBoundingClientRect(),n=f.canvas.width,a=f.canvas.height,o=void 0!==window.scrollX?window.scrollX:window.pageXOffset,i=void 0!==window.scrollY?window.scrollY:window.pageYOffset,s=e-(o+t.left),l=r-(i+t.top);return{x:s*=n/t.width,y:l*=a/t.height}},setMouseCoords(e,r){const{x:t,y:n}=Wn.calculateMouseCoords(e,r);Wn.mouseMovementX=t-Wn.mouseX,Wn.mouseMovementY=n-Wn.mouseY,Wn.mouseX=t,Wn.mouseY=n},calculateMouseEvent(e){if(Wn.pointerLock)"mousemove"!=e.type&&"mozMovementX"in e?Wn.mouseMovementX=Wn.mouseMovementY=0:(Wn.mouseMovementX=Wn.getMovementX(e),Wn.mouseMovementY=Wn.getMovementY(e)),Wn.mouseX+=Wn.mouseMovementX,Wn.mouseY+=Wn.mouseMovementY;else{if("touchstart"===e.type||"touchend"===e.type||"touchmove"===e.type){var r=e.touch;if(void 0===r)return;var t=Wn.calculateMouseCoords(r.pageX,r.pageY);if("touchstart"===e.type)Wn.lastTouches[r.identifier]=t,Wn.touches[r.identifier]=t;else if("touchend"===e.type||"touchmove"===e.type){var n=Wn.touches[r.identifier];n||=t,Wn.lastTouches[r.identifier]=n,Wn.touches[r.identifier]=t}return}Wn.setMouseCoords(e.pageX,e.pageY)}},resizeListeners:[],updateResizeListeners(){var e=f.canvas;Wn.resizeListeners.forEach((r=>r(e.width,e.height)))},setCanvasSize(e,r,t){var n=f.canvas;Wn.updateCanvasDimensions(n,e,r),t||Wn.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize(){if("undefined"!=typeof SDL){var e=s()[SDL.screen>>2];e|=8388608,i()[SDL.screen>>2]=e}Wn.updateCanvasDimensions(f.canvas),Wn.updateResizeListeners()},setWindowedCanvasSize(){if("undefined"!=typeof SDL){var e=s()[SDL.screen>>2];e&=-8388609,i()[SDL.screen>>2]=e}Wn.updateCanvasDimensions(f.canvas),Wn.updateResizeListeners()},updateCanvasDimensions(e,r,t){r&&t?(e.widthNative=r,e.heightNative=t):(r=e.widthNative,t=e.heightNative);var n=r,a=t;if(f.forcedAspectRatio&&f.forcedAspectRatio>0&&(n/a<f.forcedAspectRatio?n=Math.round(a*f.forcedAspectRatio):a=Math.round(n/f.forcedAspectRatio)),(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e.parentNode&&"undefined"!=typeof screen){var o=Math.min(screen.width/n,screen.height/a);n=Math.round(n*o),a=Math.round(a*o)}Wn.resizeCanvas?(e.width!=n&&(e.width=n),e.height!=a&&(e.height=a),void 0!==e.style&&(e.style.removeProperty("width"),e.style.removeProperty("height"))):(e.width!=r&&(e.width=r),e.height!=t&&(e.height=t),void 0!==e.style&&(n!=r||a!=t?(e.style.setProperty("width",n+"px","important"),e.style.setProperty("height",a+"px","important")):(e.style.removeProperty("width"),e.style.removeProperty("height"))))}},Bn=(e,r,t)=>{function n(){Re(e)(r)}t>=0||v?Mn(n,t):(e=>{jn(),In.requestAnimationFrame((()=>{An(),Vt(e)}))})(n)},Nn=()=>{},zn=()=>Date.now(),Un=()=>{throw jn(),"unwind"},Hn=(e,r)=>(e>>>0)+4294967296*r,Gn=(e,r)=>{if(e<=0)return e;var t=r<=32?Math.abs(1<<r-1):Math.pow(2,r-1);return e>=t&&(r<=32||e>t)&&(e=-2*t+e),e},Vn=(e,r)=>e>=0?e:r<=32?2*Math.abs(1<<r-1)+e:Math.pow(2,r)+e,qn=e=>{for(var r=e;n()[r];)++r;return r-e};function Xn(e){var r=(new Error).stack.toString(),t=r.lastIndexOf("_emscripten_log"),n=r.lastIndexOf("_emscripten_get_callstack"),a=r.indexOf("\n",Math.max(t,n))+1;r=r.slice(a),8&e&&"undefined"==typeof emscripten_source_map&&(On('Source map information is not available, emscripten_log with EM_LOG_C_STACK will be ignored. Build with "--pre-js $EMSCRIPTEN/src/emscripten-source-map.min.js" linker flag to add source map loading to code.'),e^=8,e|=16);var o=r.split("\n");r="";var i=new RegExp("\\s*(.*?)@(.*?):([0-9]+):([0-9]+)"),s=new RegExp("\\s*(.*?)@(.*):(.*)(:(.*))?"),l=new RegExp("\\s*at (.*?) \\((.*):(.*):(.*)\\)");for(var u in o){var c=o[u],d="",f="",m=0,h=0,p=l.exec(c);if(p&&5==p.length)d=p[1],f=p[2],m=p[3],h=p[4];else{if(!((p=i.exec(c)||s.exec(c))&&p.length>=4)){r+=c+"\n";continue}d=p[1],f=p[2],m=p[3],h=0|p[4]}var v=!1;if(8&e){var g=emscripten_source_map.originalPositionFor({line:m,column:h});v=g?.source,v&&(64&e&&(g.source=g.source.substring(g.source.replace(/\\/g,"/").lastIndexOf("/")+1)),r+=` at ${d} (${g.source}:${g.line}:${g.column})\n`)}(16&e||!v)&&(64&e&&(f=f.substring(f.replace(/\\/g,"/").lastIndexOf("/")+1)),r+=(v?` = ${d}`:` at ${d}`)+` (${f}:${m}:${h})\n`)}return r=r.replace(/\s+$/,"")}var Yn=(e,r,a)=>{var o=((e,r)=>{var a=e,o=r;function s(e){var r;return o=function(e,r){return"double"!==r&&"i64"!==r||7&e&&(e+=4),e}(o,e),"double"===e?(r=u()[o>>3],o+=8):"i64"==e?(r=[i()[o>>2],i()[o+4>>2]],o+=8):(e="i32",r=i()[o>>2],o+=4),r}for(var l,c,d,f,m=[];;){var h=a;if(0===(l=t()[a]))break;if(c=t()[a+1],37==l){var p=!1,v=!1,g=!1,y=!1,w=!1;e:for(;;){switch(c){case 43:p=!0;break;case 45:v=!0;break;case 35:g=!0;break;case 48:if(y)break e;y=!0;break;case 32:w=!0;break;default:break e}a++,c=t()[a+1]}var _=0;if(42==c)_=s("i32"),a++,c=t()[a+1];else for(;c>=48&&c<=57;)_=10*_+(c-48),a++,c=t()[a+1];var b,E=!1,k=-1;if(46==c){if(k=0,E=!0,a++,42==(c=t()[a+1]))k=s("i32"),a++;else for(;;){var C=t()[a+1];if(C<48||C>57)break;k=10*k+(C-48),a++}c=t()[a+1]}switch(k<0&&(k=6,E=!1),String.fromCharCode(c)){case"h":104==t()[a+2]?(a++,b=1):b=2;break;case"l":108==t()[a+2]?(a++,b=8):b=4;break;case"L":case"q":case"j":b=8;break;case"z":case"t":case"I":b=4;break;default:b=null}switch(b&&a++,c=t()[a+1],String.fromCharCode(c)){case"d":case"i":case"u":case"o":case"x":case"X":case"p":var x=100==c||105==c;if(d=s("i"+8*(b=b||4)),8==b&&(d=117==c?(d[0]>>>0)+4294967296*(d[1]>>>0):Hn(d[0],d[1])),b<=4){var S=Math.pow(256,b)-1;d=(x?Gn:Vn)(d&S,8*b)}var P=Math.abs(d),T="";if(100==c||105==c)j=Gn(d,8*b).toString(10);else if(117==c)j=Vn(d,8*b).toString(10),d=Math.abs(d);else if(111==c)j=(g?"0":"")+P.toString(8);else if(120==c||88==c){if(T=g&&0!=d?"0x":"",d<0){d=-d,j=(P-1).toString(16);for(var $=[],F=0;F<j.length;F++)$.push((15-parseInt(j[F],16)).toString(16));for(j=$.join("");j.length<2*b;)j="f"+j}else j=P.toString(16);88==c&&(T=T.toUpperCase(),j=j.toUpperCase())}else 112==c&&(0===P?j="(nil)":(T="0x",j=P.toString(16)));if(E)for(;j.length<k;)j="0"+j;for(d>=0&&(p?T="+"+T:w&&(T=" "+T)),"-"==j.charAt(0)&&(T="-"+T,j=j.substr(1));T.length+j.length<_;)v?j+=" ":y?j="0"+j:T=" "+T;(j=T+j).split("").forEach((e=>m.push(e.charCodeAt(0))));break;case"f":case"F":case"e":case"E":case"g":case"G":var j;if(d=s("double"),isNaN(d))j="nan",y=!1;else if(isFinite(d)){var A=!1,M=Math.min(k,20);if(103==c||71==c){A=!0,k=k||1;var L=parseInt(d.toExponential(M).split("e")[1],10);k>L&&L>=-4?(c=(103==c?"f":"F").charCodeAt(0),k-=L+1):(c=(103==c?"e":"E").charCodeAt(0),k--),M=Math.min(k,20)}101==c||69==c?(j=d.toExponential(M),/[eE][-+]\d$/.test(j)&&(j=j.slice(0,-1)+"0"+j.slice(-1))):102!=c&&70!=c||(j=d.toFixed(M),0===d&&((f=d)<0||0===f&&1/f==-1/0)&&(j="-"+j));var D=j.split("e");if(A&&!g)for(;D[0].length>1&&D[0].includes(".")&&("0"==D[0].slice(-1)||"."==D[0].slice(-1));)D[0]=D[0].slice(0,-1);else for(g&&-1==j.indexOf(".")&&(D[0]+=".");k>M++;)D[0]+="0";j=D[0]+(D.length>1?"e"+D[1]:""),69==c&&(j=j.toUpperCase()),d>=0&&(p?j="+"+j:w&&(j=" "+j))}else j=(d<0?"-":"")+"inf",y=!1;for(;j.length<_;)v?j+=" ":j=!y||"-"!=j[0]&&"+"!=j[0]?(y?"0":" ")+j:j[0]+"0"+j.slice(1);c<97&&(j=j.toUpperCase()),j.split("").forEach((e=>m.push(e.charCodeAt(0))));break;case"s":var R=s("i8*"),I=R?qn(R):6;if(E&&(I=Math.min(I,k)),!v)for(;I<_--;)m.push(32);if(R)for(F=0;F<I;F++)m.push(n()[R++]);else m=m.concat(tr("(null)".substr(0,I),!0));if(v)for(;I<_--;)m.push(32);break;case"c":for(v&&m.push(s("i8"));--_>0;)m.push(32);v||m.push(s("i8"));break;case"n":var O=s("i32*");i()[O>>2]=m.length;break;case"%":m.push(l);break;default:for(F=h;F<a+2;F++)m.push(t()[F])}a+=2}else m.push(l),a+=1}return m})(r,a);((e,r)=>{24&e&&(r=r.replace(/\s+$/,""),r+=(r.length>0?"\n":"")+Xn(e)),1&e?4&e?console.error(r):2&e?console.warn(r):512&e?console.info(r):256&e?console.debug(r):console.log(r):6&e?j(r):F(r)})(e,Ne(o))},Kn=e=>{var r=(e-A.buffer.byteLength+65535)/65536|0;try{return A.grow(r),G(),1}catch(e){}},Qn=e=>{var r=n().length;if((e>>>=0)<=r)return!1;var t=2147483648;if(e>t)return!1;for(var a=1;a<=4;a*=2){var o=r*(1+.2/a);o=Math.min(o,e+100663296);var i=Math.min(t,ar(Math.max(e,o),65536));if(Kn(i))return!0}return!1},Zn=(e,r,t)=>{var n=Re(e);Rn(n,r,t)};class Jn{constructor(){this.allocated=[void 0],this.freelist=[]}get(e){return this.allocated[e]}has(e){return void 0!==this.allocated[e]}allocate(e){var r=this.freelist.pop()||this.allocated.length;return this.allocated[r]=e,r}free(e){this.allocated[e]=void 0,this.freelist.push(e)}}var ea={openDatabase(e,r,t,n){try{var a=indexedDB.open(e,r)}catch(e){return n(e)}a.onupgradeneeded=e=>{var r=e.target.result;r.objectStoreNames.contains("FILES")&&r.deleteObjectStore("FILES"),r.createObjectStore("FILES")},a.onsuccess=e=>t(e.target.result),a.onerror=n},init(){ea.xhrs=new Jn,g||(ae(),ea.openDatabase("emscripten_filesystem",1,(e=>{ea.dbInstance=e,oe()}),(()=>{ea.dbInstance=!1,oe()})))}};function ra(e,r,t,o,i){var l=s()[e+8>>2];if(l){var u=ze(l),c=e+108,d=ze(c+0);d||="GET";var f=s()[c+56>>2],m=s()[c+68>>2],h=s()[c+72>>2],p=s()[c+76>>2],v=s()[c+80>>2],g=s()[c+84>>2],y=s()[c+88>>2],w=s()[c+52>>2],_=!!(1&w),b=!!(2&w),E=!!(64&w),k=m?ze(m):void 0,C=h?ze(h):void 0,x=new XMLHttpRequest;if(x.withCredentials=!!n()[c+60],x.open(d,u,!E,k,C),E||(x.timeout=f),x.url_=u,x.responseType="arraybuffer",v){var S=ze(v);x.overrideMimeType(S)}if(p)for(;;){var P=s()[p>>2];if(!P)break;var T=s()[p+4>>2];if(!T)break;p+=8;var $=ze(P),F=ze(T);x.setRequestHeader($,F)}var j=ea.xhrs.allocate(x);s()[e>>2]=j;var A=g&&y?n().slice(g,g+y):null;x.onload=n=>{ea.xhrs.has(j)&&(M(),x.status>=200&&x.status<300?r?.(e,x,n):t?.(e,x,n))},x.onerror=r=>{ea.xhrs.has(j)&&(M(),t?.(e,x,r))},x.ontimeout=r=>{ea.xhrs.has(j)&&t?.(e,x,r)},x.onprogress=r=>{if(ea.xhrs.has(j)){var t=_&&b&&x.response?x.response.byteLength:0,i=0;t>0&&_&&b&&(i=Vo(t),n().set(new Uint8Array(x.response),i)),s()[e+12>>2]=i,na(e+16,t),na(e+24,r.loaded-t),na(e+32,r.total),a()[e+40>>1]=x.readyState,x.readyState>=3&&0===x.status&&r.loaded>0&&(x.status=200),a()[e+42>>1]=x.status,x.statusText&&$t(x.statusText,e+44,64),o?.(e,x,r),i&&qo(i)}},x.onreadystatechange=r=>{ea.xhrs.has(j)?(a()[e+40>>1]=x.readyState,x.readyState>=2&&(a()[e+42>>1]=x.status),i?.(e,x,r)):An()};try{x.send(A)}catch(r){t?.(e,x,r)}}else t(e,0,"no url specified!");function M(){var r=0,t=0;x.response&&_&&0===s()[e+12>>2]&&(t=x.response.byteLength),t>0&&(r=Vo(t),n().set(new Uint8Array(x.response),r)),s()[e+12>>2]=r,na(e+16,t),na(e+24,0);var o=x.response?x.response.byteLength:0;o&&na(e+32,o),a()[e+40>>1]=x.readyState,a()[e+42>>1]=x.status,x.statusText&&$t(x.statusText,e+44,64)}}var ta,na=(e,r)=>{s()[e>>2]=r;var t=s()[e>>2];s()[e+4>>2]=(r-t)/4294967296};function aa(e,r,t,n,o){if(e){var i=r+108,l=s()[i+64>>2];l||=s()[r+8>>2];var u=ze(l);try{var c=e.transaction(["FILES"],"readwrite").objectStore("FILES").put(t,u);c.onsuccess=e=>{a()[r+40>>1]=4,a()[r+42>>1]=200,$t("OK",r+44,64),n(r,0,u)},c.onerror=e=>{a()[r+40>>1]=4,a()[r+42>>1]=413,$t("Payload Too Large",r+44,64),o(r,0,e)}}catch(e){o(r,0,e)}}else o(r,0,"IndexedDB not available!")}function oa(e,r,t,o,i){jn();var l=e+108,u=s()[l+36>>2],c=s()[l+40>>2],d=s()[l+44>>2],f=s()[l+48>>2],m=s()[l+52>>2],h=!!(64&m);function p(e){h?e():Vt(e)}var v=(e,t,n)=>{An(),p((()=>{u?Re(u)(e):r?.(e)}))},g=(e,r,t)=>{p((()=>{d?Re(d)(e):o?.(e)}))},y=(e,r,n)=>{An(),p((()=>{c?Re(c)(e):t?.(e)}))},w=(e,r,t)=>{p((()=>{f?Re(f)(e):i?.(e)}))},_=(e,t,n)=>{aa(ea.dbInstance,e,t.response,((e,t,n)=>{An(),p((()=>{u?Re(u)(e):r?.(e)}))}),((e,t,n)=>{An(),p((()=>{u?Re(u)(e):r?.(e)}))}))},b=ze(l+0),E=!!(16&m),k=!!(4&m),C=!!(32&m);if("EM_IDB_STORE"===b){var x=s()[l+84>>2],S=s()[l+88>>2];aa(ea.dbInstance,e,n().slice(x,x+S),v,y)}else if("EM_IDB_DELETE"===b)!function(e,r,t,n){if(e){var o=r+108,i=s()[o+64>>2];i||=s()[r+8>>2];var l=ze(i);try{var u=e.transaction(["FILES"],"readwrite").objectStore("FILES").delete(l);u.onsuccess=e=>{var n=e.target.result;s()[r+12>>2]=0,na(r+16,0),na(r+24,0),na(r+32,0),a()[r+40>>1]=4,a()[r+42>>1]=200,$t("OK",r+44,64),t(r,0,n)},u.onerror=e=>{a()[r+40>>1]=4,a()[r+42>>1]=404,$t("Not Found",r+44,64),n(r,0,e)}}catch(e){n(r,0,e)}}else n(r,0,"IndexedDB not available!")}(ea.dbInstance,e,v,y);else if(E){if(C)return 0;ra(e,k?_:v,y,g,w)}else!function(e,r,t,o){if(e){var i=r+108,l=s()[i+64>>2];l||=s()[r+8>>2];var u=ze(l);try{var c=e.transaction(["FILES"],"readonly").objectStore("FILES").get(u);c.onsuccess=e=>{if(e.target.result){var i=e.target.result,l=i.byteLength||i.length,u=Vo(l);n().set(new Uint8Array(i),u),s()[r+12>>2]=u,na(r+16,l),na(r+24,0),na(r+32,l),a()[r+40>>1]=4,a()[r+42>>1]=200,$t("OK",r+44,64),t(r,0,i)}else a()[r+40>>1]=4,a()[r+42>>1]=404,$t("Not Found",r+44,64),o(r,0,"no data")},c.onerror=e=>{a()[r+40>>1]=4,a()[r+42>>1]=404,$t("Not Found",r+44,64),o(r,0,e)}}catch(e){o(r,0,e)}}else o(r,0,"IndexedDB not available!")}(ea.dbInstance,e,v,C?y:k?(e,r,t)=>{ra(e,_,y,g,w)}:(e,r,t)=>{ra(e,v,y,g,w)});return e}var ia={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,unpackRowLength:0,recordError:e=>{ia.lastError||(ia.lastError=e)},getNewId:e=>{for(var r=ia.counter++,t=e.length;t<r;t++)e[t]=null;return r},genObject:(e,r,t,n)=>{for(var a=0;a<e;a++){var o=ta[t](),s=o&&ia.getNewId(n);o?(o.name=s,n[s]=o):ia.recordError(1282),i()[r+4*a>>2]=s}},getSource:(e,r,t,n)=>{for(var a="",o=0;o<r;++o){var i=n?s()[n+4*o>>2]:void 0;a+=ze(s()[t+4*o>>2],i)}return a},createContext:(e,r)=>{if(!e.getContextSafariWebGL2Fixed){function n(r,t){var n=e.getContextSafariWebGL2Fixed(r,t);return"webgl"==r==n instanceof WebGLRenderingContext?n:null}e.getContextSafariWebGL2Fixed=e.getContext,e.getContext=n}var t=e.getContext("webgl",r);return t?ia.registerContext(t,r):0},registerContext:(e,r)=>{var t=Vo(8);s()[t+4>>2]=Xo();var n={handle:t,attributes:r,version:r.majorVersion,GLctx:e};return e.canvas&&(e.canvas.GLctxObject=n),ia.contexts[t]=n,(void 0===r.enableExtensionsByDefault||r.enableExtensionsByDefault)&&ia.initExtensions(n),t},makeContextCurrent:e=>(ia.currentContext=ia.contexts[e],f.ctx=ta=ia.currentContext?.GLctx,!(e&&!ta)),getContext:e=>ia.contexts[e],deleteContext:e=>{ia.currentContext===ia.contexts[e]&&(ia.currentContext=null),"object"==typeof sa&&sa.removeAllHandlersOnTarget(ia.contexts[e].GLctx.canvas),ia.contexts[e]&&ia.contexts[e].GLctx.canvas&&(ia.contexts[e].GLctx.canvas.GLctxObject=void 0),qo(ia.contexts[e].handle),ia.contexts[e]=null},initExtensions:e=>{if(e||=ia.currentContext,!e.initExtensionsDone){e.initExtensionsDone=!0;var r,t=e.GLctx;(r=t).multiDrawWebgl=r.getExtension("WEBGL_multi_draw"),(e=>{e.extPolygonOffsetClamp=e.getExtension("EXT_polygon_offset_clamp")})(t),(e=>{e.extClipControl=e.getExtension("EXT_clip_control")})(t),(e=>{e.webglPolygonMode=e.getExtension("WEBGL_polygon_mode")})(t),(e=>{var r=e.getExtension("ANGLE_instanced_arrays");r&&(e.vertexAttribDivisor=(e,t)=>r.vertexAttribDivisorANGLE(e,t),e.drawArraysInstanced=(e,t,n,a)=>r.drawArraysInstancedANGLE(e,t,n,a),e.drawElementsInstanced=(e,t,n,a,o)=>r.drawElementsInstancedANGLE(e,t,n,a,o))})(t),(e=>{var r=e.getExtension("OES_vertex_array_object");r&&(e.createVertexArray=()=>r.createVertexArrayOES(),e.deleteVertexArray=e=>r.deleteVertexArrayOES(e),e.bindVertexArray=e=>r.bindVertexArrayOES(e),e.isVertexArray=e=>r.isVertexArrayOES(e))})(t),(e=>{var r=e.getExtension("WEBGL_draw_buffers");r&&(e.drawBuffers=(e,t)=>r.drawBuffersWEBGL(e,t))})(t),t.disjointTimerQueryExt=t.getExtension("EXT_disjoint_timer_query"),(e=>{var r=["ANGLE_instanced_arrays","EXT_blend_minmax","EXT_disjoint_timer_query","EXT_frag_depth","EXT_shader_texture_lod","EXT_sRGB","OES_element_index_uint","OES_fbo_render_mipmap","OES_standard_derivatives","OES_texture_float","OES_texture_half_float","OES_texture_half_float_linear","OES_vertex_array_object","WEBGL_color_buffer_float","WEBGL_depth_texture","WEBGL_draw_buffers","EXT_clip_control","EXT_color_buffer_half_float","EXT_depth_clamp","EXT_float_blend","EXT_polygon_offset_clamp","EXT_texture_compression_bptc","EXT_texture_compression_rgtc","EXT_texture_filter_anisotropic","KHR_parallel_shader_compile","OES_texture_float_linear","WEBGL_blend_func_extended","WEBGL_compressed_texture_astc","WEBGL_compressed_texture_etc","WEBGL_compressed_texture_etc1","WEBGL_compressed_texture_s3tc","WEBGL_compressed_texture_s3tc_srgb","WEBGL_debug_renderer_info","WEBGL_debug_shaders","WEBGL_lose_context","WEBGL_multi_draw","WEBGL_polygon_mode"];return(e.getSupportedExtensions()||[]).filter((e=>r.includes(e)))})(t).forEach((e=>{e.includes("lose_context")||e.includes("debug")||t.getExtension(e)}))}}},sa={removeAllEventListeners(){for(;sa.eventHandlers.length;)sa._removeHandler(sa.eventHandlers.length-1);sa.deferredCalls=[]},inEventHandler:0,deferredCalls:[],deferCall(e,r,t){function n(e,r){if(e.length!=r.length)return!1;for(var t in e)if(e[t]!=r[t])return!1;return!0}for(var a of sa.deferredCalls)if(a.targetFunction==e&&n(a.argsList,t))return;sa.deferredCalls.push({targetFunction:e,precedence:r,argsList:t}),sa.deferredCalls.sort(((e,r)=>e.precedence<r.precedence))},removeDeferredCalls(e){sa.deferredCalls=sa.deferredCalls.filter((r=>r.targetFunction!=e))},canPerformEventHandlerRequests:()=>navigator.userActivation?navigator.userActivation.isActive:sa.inEventHandler&&sa.currentEventHandler.allowsDeferredCalls,runDeferredCalls(){if(sa.canPerformEventHandlerRequests()){var e=sa.deferredCalls;for(var r of(sa.deferredCalls=[],e))r.targetFunction(...r.argsList)}},eventHandlers:[],removeAllHandlersOnTarget:(e,r)=>{for(var t=0;t<sa.eventHandlers.length;++t)sa.eventHandlers[t].target!=e||r&&r!=sa.eventHandlers[t].eventTypeString||sa._removeHandler(t--)},_removeHandler(e){var r=sa.eventHandlers[e];r.target.removeEventListener(r.eventTypeString,r.eventListenerFunc,r.useCapture),sa.eventHandlers.splice(e,1)},registerOrRemoveHandler(e){if(!e.target)return-4;if(e.callbackfunc)e.eventListenerFunc=function(r){++sa.inEventHandler,sa.currentEventHandler=e,sa.runDeferredCalls(),e.handlerFunc(r),sa.runDeferredCalls(),--sa.inEventHandler},e.target.addEventListener(e.eventTypeString,e.eventListenerFunc,e.useCapture),sa.eventHandlers.push(e);else for(var r=0;r<sa.eventHandlers.length;++r)sa.eventHandlers[r].target==e.target&&sa.eventHandlers[r].eventTypeString==e.eventTypeString&&sa._removeHandler(r--);return 0},getTargetThreadForEventCallback(e){switch(e){case 1:return 0;case 2:return Ae.currentProxiedOperationCallerThread;default:return e}},getNodeNameForTarget:e=>e?e==window?"#window":e==screen?"#screen":e?.nodeName||"":"",fullscreenEnabled:()=>document.fullscreenEnabled||document.webkitFullscreenEnabled},la=["default","low-power","high-performance"],ua=[0,"undefined"!=typeof document?document:0,"undefined"!=typeof window?window:0],ca=e=>{var r;return e=(r=e)>2?ze(r):r,ua[e]||("undefined"!=typeof document?document.querySelector(e):void 0)},da=(e,r)=>{var n=r>>2,a=i()[n+2],o={alpha:!!t()[r+0],depth:!!t()[r+1],stencil:!!t()[r+2],antialias:!!t()[r+3],premultipliedAlpha:!!t()[r+4],preserveDrawingBuffer:!!t()[r+5],powerPreference:la[a],failIfMajorPerformanceCaveat:!!t()[r+12],majorVersion:i()[n+4],minorVersion:i()[n+5],enableExtensionsByDefault:t()[r+24],explicitSwapControl:t()[r+25],proxyContextToMainThread:i()[n+7],renderViaOffscreenBackBuffer:t()[r+32]},s=ca(e);return s?o.explicitSwapControl?0:ia.createContext(s,o):0},fa=e=>ia.makeContextCurrent(e)?0:-5,ma={},ha=()=>{if(!ha.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:k||"./this.program"};for(var r in ma)void 0===ma[r]?delete e[r]:e[r]=ma[r];var t=[];for(var r in e)t.push(`${r}=${e[r]}`);ha.strings=t}return ha.strings},pa=function(e,r){if(g)return Se(12,0,1,e,r);var n=0;return ha().forEach(((a,o)=>{var i=r+n;s()[e+4*o>>2]=i,((e,r)=>{for(var n=0;n<e.length;++n)t()[r++]=e.charCodeAt(n);t()[r]=0})(a,i),n+=a.length+1})),0},va=function(e,r){if(g)return Se(13,0,1,e,r);var t=ha();s()[e>>2]=t.length;var n=0;return t.forEach((e=>n+=e.length+1)),s()[r>>2]=n,0};function ga(e){if(g)return Se(14,0,1,e);try{var r=cr.getStreamFromFD(e);return ur.close(r),0}catch(e){if(void 0===ur||"ErrnoError"!==e.name)throw e;return e.errno}}var ya=(e,r,n,a)=>{for(var o=0,i=0;i<n;i++){var l=s()[r>>2],u=s()[r+4>>2];r+=8;var c=ur.read(e,t(),l,u,a);if(c<0)return-1;if(o+=c,c<u)break;void 0!==a&&(a+=c)}return o};function wa(e,r,t,n,a,o){if(g)return Se(15,0,1,e,r,t,n,a,o);var i=xe(n,a);try{if(isNaN(i))return 61;var l=cr.getStreamFromFD(e),u=ya(l,r,t,i);return s()[o>>2]=u,0}catch(e){if(void 0===ur||"ErrnoError"!==e.name)throw e;return e.errno}}function _a(e,r,t,n){if(g)return Se(16,0,1,e,r,t,n);try{var a=cr.getStreamFromFD(e),o=ya(a,r,t);return s()[n>>2]=o,0}catch(e){if(void 0===ur||"ErrnoError"!==e.name)throw e;return e.errno}}function ba(e,r,t,n,a){if(g)return Se(17,0,1,e,r,t,n,a);var o=xe(r,t);try{if(isNaN(o))return 61;var s=cr.getStreamFromFD(e);return ur.llseek(s,o,n),ue=[s.position>>>0,(le=s.position,+Math.abs(le)>=1?le>0?+Math.floor(le/4294967296)>>>0:~~+Math.ceil((le-+(~~le>>>0))/4294967296)>>>0:0)],i()[a>>2]=ue[0],i()[a+4>>2]=ue[1],s.getdents&&0===o&&0===n&&(s.getdents=null),0}catch(e){if(void 0===ur||"ErrnoError"!==e.name)throw e;return e.errno}}var Ea=(e,r,n,a)=>{for(var o=0,i=0;i<n;i++){var l=s()[r>>2],u=s()[r+4>>2];r+=8;var c=ur.write(e,t(),l,u,a);if(c<0)return-1;if(o+=c,c<u)break;void 0!==a&&(a+=c)}return o};function ka(e,r,t,n){if(g)return Se(18,0,1,e,r,t,n);try{var a=cr.getStreamFromFD(e),o=Ea(a,r,t);return s()[n>>2]=o,0}catch(e){if(void 0===ur||"ErrnoError"!==e.name)throw e;return e.errno}}var Ca,xa,Sa,Pa=e=>ta.activeTexture(e),Ta=(e,r)=>{ta.attachShader(ia.programs[e],ia.shaders[r])},$a=(e,r)=>{ta.bindBuffer(e,ia.buffers[r])},Fa=(e,r)=>{ta.bindFramebuffer(e,ia.framebuffers[r])},ja=(e,r)=>{ta.bindRenderbuffer(e,ia.renderbuffers[r])},Aa=(e,r)=>{ta.bindTexture(e,ia.textures[r])},Ma=(e,r)=>ta.blendFunc(e,r),La=(e,r,t,a)=>{ta.bufferData(e,t?n().subarray(t,t+r):r,a)},Da=(e,r,t,a)=>{ta.bufferSubData(e,r,n().subarray(a,a+t))},Ra=e=>ta.checkFramebufferStatus(e),Ia=e=>ta.clear(e),Oa=(e,r,t,n)=>ta.clearColor(e,r,t,n),Wa=e=>ta.clearStencil(e),Ba=(e,r,t,n)=>{ta.colorMask(!!e,!!r,!!t,!!n)},Na=e=>{ta.compileShader(ia.shaders[e])},za=(e,r,t,a,o,i,s,l)=>{ta.compressedTexImage2D(e,r,t,a,o,i,n().subarray(l,l+s))},Ua=()=>{var e=ia.getNewId(ia.programs),r=ta.createProgram();return r.name=e,r.maxUniformLength=r.maxAttributeLength=r.maxUniformBlockNameLength=0,r.uniformIdCounter=1,ia.programs[e]=r,e},Ha=e=>{var r=ia.getNewId(ia.shaders);return ia.shaders[r]=ta.createShader(e),r},Ga=(e,r)=>{for(var t=0;t<e;t++){var n=i()[r+4*t>>2],a=ia.buffers[n];a&&(ta.deleteBuffer(a),a.name=0,ia.buffers[n]=null)}},Va=(e,r)=>{for(var t=0;t<e;++t){var n=i()[r+4*t>>2],a=ia.framebuffers[n];a&&(ta.deleteFramebuffer(a),a.name=0,ia.framebuffers[n]=null)}},qa=e=>{if(e){var r=ia.programs[e];r?(ta.deleteProgram(r),r.name=0,ia.programs[e]=null):ia.recordError(1281)}},Xa=(e,r)=>{for(var t=0;t<e;t++){var n=i()[r+4*t>>2],a=ia.renderbuffers[n];a&&(ta.deleteRenderbuffer(a),a.name=0,ia.renderbuffers[n]=null)}},Ya=e=>{if(e){var r=ia.shaders[e];r?(ta.deleteShader(r),ia.shaders[e]=null):ia.recordError(1281)}},Ka=(e,r)=>{for(var t=0;t<e;t++){var n=i()[r+4*t>>2],a=ia.textures[n];a&&(ta.deleteTexture(a),a.name=0,ia.textures[n]=null)}},Qa=e=>ta.disable(e),Za=(e,r,t)=>{ta.drawArrays(e,r,t)},Ja=e=>ta.enable(e),eo=e=>{ta.enableVertexAttribArray(e)},ro=(e,r,t,n)=>{ta.framebufferRenderbuffer(e,r,t,ia.renderbuffers[n])},to=(e,r,t,n,a)=>{ta.framebufferTexture2D(e,r,t,ia.textures[n],a)},no=(e,r)=>{ia.genObject(e,r,"createBuffer",ia.buffers)},ao=(e,r)=>{ia.genObject(e,r,"createFramebuffer",ia.framebuffers)},oo=(e,r)=>{ia.genObject(e,r,"createRenderbuffer",ia.renderbuffers)},io=(e,r)=>{ia.genObject(e,r,"createTexture",ia.textures)},so=(e,r)=>ta.getAttribLocation(ia.programs[e],ze(r)),lo=(e,r)=>((e,r,n)=>{if(r){var a=void 0;switch(e){case 36346:a=1;break;case 36344:return void(0!=n&&1!=n&&ia.recordError(1280));case 36345:a=0;break;case 34466:var o=ta.getParameter(34467);a=o?o.length:0}if(void 0===a){var s=ta.getParameter(e);switch(typeof s){case"number":a=s;break;case"boolean":a=s?1:0;break;case"string":return void ia.recordError(1280);case"object":if(null===s)switch(e){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 34068:a=0;break;default:return void ia.recordError(1280)}else{if(s instanceof Float32Array||s instanceof Uint32Array||s instanceof Int32Array||s instanceof Array){for(var u=0;u<s.length;++u)switch(n){case 0:i()[r+4*u>>2]=s[u];break;case 2:l()[r+4*u>>2]=s[u];break;case 4:t()[r+u]=s[u]?1:0}return}try{a=0|s.name}catch(r){return ia.recordError(1280),void j(`GL_INVALID_ENUM in glGet${n}v: Unknown object returned from WebGL getParameter(${e})! (error: ${r})`)}}break;default:return ia.recordError(1280),void j(`GL_INVALID_ENUM in glGet${n}v: Native code calling glGet${n}v(${e}) and it returns ${s} of type ${typeof s}!`)}}switch(n){case 1:na(r,a);break;case 0:i()[r>>2]=a;break;case 2:l()[r>>2]=a;break;case 4:t()[r]=a?1:0}}else ia.recordError(1281)})(e,r,0),uo=(e,r,t)=>{if(t)if(e>=ia.counter)ia.recordError(1281);else if(e=ia.programs[e],35716==r){var n=ta.getProgramInfoLog(e);null===n&&(n="(unknown error)"),i()[t>>2]=n.length+1}else if(35719==r){if(!e.maxUniformLength)for(var a=ta.getProgramParameter(e,35718),o=0;o<a;++o)e.maxUniformLength=Math.max(e.maxUniformLength,ta.getActiveUniform(e,o).name.length+1);i()[t>>2]=e.maxUniformLength}else if(35722==r){if(!e.maxAttributeLength){var s=ta.getProgramParameter(e,35721);for(o=0;o<s;++o)e.maxAttributeLength=Math.max(e.maxAttributeLength,ta.getActiveAttrib(e,o).name.length+1)}i()[t>>2]=e.maxAttributeLength}else if(35381==r){if(!e.maxUniformBlockNameLength){var l=ta.getProgramParameter(e,35382);for(o=0;o<l;++o)e.maxUniformBlockNameLength=Math.max(e.maxUniformBlockNameLength,ta.getActiveUniformBlockName(e,o).length+1)}i()[t>>2]=e.maxUniformBlockNameLength}else i()[t>>2]=ta.getProgramParameter(e,r);else ia.recordError(1281)},co=(e,r,t,n)=>{var a=ta.getShaderInfoLog(ia.shaders[e]);null===a&&(a="(unknown error)");var o=r>0&&n?$t(a,n,r):0;t&&(i()[t>>2]=o)},fo=(e,r,t)=>{if(t)if(35716==r){var n=ta.getShaderInfoLog(ia.shaders[e]);null===n&&(n="(unknown error)");var a=n?n.length+1:0;i()[t>>2]=a}else if(35720==r){var o=ta.getShaderSource(ia.shaders[e]),s=o?o.length+1:0;i()[t>>2]=s}else i()[t>>2]=ta.getShaderParameter(ia.shaders[e],r);else ia.recordError(1281)},mo=e=>"]"==e.slice(-1)&&e.lastIndexOf("["),ho=(e,r)=>{if(r=ze(r),e=ia.programs[e]){(e=>{var r,t,n=e.uniformLocsById,a=e.uniformSizeAndIdsByName;if(!n){e.uniformLocsById=n={},e.uniformArrayNamesById={};var o=ta.getProgramParameter(e,35718);for(r=0;r<o;++r){var i=ta.getActiveUniform(e,r),s=i.name,l=i.size,u=mo(s),c=u>0?s.slice(0,u):s,d=e.uniformIdCounter;for(e.uniformIdCounter+=l,a[c]=[l,d],t=0;t<l;++t)n[d]=t,e.uniformArrayNamesById[d++]=c}}})(e);var t=e.uniformLocsById,n=0,a=r,o=mo(r);o>0&&(s=r.slice(o+1),n=parseInt(s)>>>0,a=r.slice(0,o));var i=e.uniformSizeAndIdsByName[a];if(i&&n<i[0]&&(t[n+=i[1]]=t[n]||ta.getUniformLocation(e,r)))return n}else ia.recordError(1281);var s;return-1},po=e=>{e=ia.programs[e],ta.linkProgram(e),e.uniformLocsById=0,e.uniformSizeAndIdsByName={}},vo=(e,r)=>{3317==e?ia.unpackAlignment=r:3314==e&&(ia.unpackRowLength=r),ta.pixelStorei(e,r)},go=(e,r,t,n)=>ta.renderbufferStorage(e,r,t,n),yo=(e,r,t,n)=>ta.scissor(e,r,t,n),wo=(e,r,t,n)=>{var a=ia.getSource(e,r,t,n);ta.shaderSource(ia.shaders[e],a)},_o=(e,r,t)=>ta.stencilFunc(e,r,t),bo=e=>ta.stencilMask(e),Eo=(e,r,t)=>ta.stencilOp(e,r,t),ko=(e,r)=>e>>>31-Math.clz32(r.BYTES_PER_ELEMENT),Co=(e,r,t,a,u,c)=>{var d=(e=>1==(e-=5120)?n():4==e?i():6==e?l():5==e||28922==e?s():o())(e),f=(e=>({5:3,6:4,8:2,29502:3,29504:4}[e-6402]||1))(r)*d.BYTES_PER_ELEMENT,m=((e,r,t)=>{var n,a,o=(ia.unpackRowLength||e)*t;return r*(n=o,a=ia.unpackAlignment,n+a-1&-a)})(t,a,f);return d.subarray(ko(u,d),ko(u+m,d))},xo=(e,r,t,n,a,o,i,s,l)=>{var u=l?Co(s,i,n,a,l):null;ta.texImage2D(e,r,t,n,a,o,i,s,u)},So=(e,r,t)=>ta.texParameteri(e,r,t),Po=e=>{var r=ta.currentProgram;if(r){var t=r.uniformLocsById[e];return"number"==typeof t&&(r.uniformLocsById[e]=t=ta.getUniformLocation(r,r.uniformArrayNamesById[e]+(t>0?`[${t}]`:""))),t}ia.recordError(1282)},To=(e,r)=>{ta.uniform1f(Po(e),r)},$o=[],Fo=(e,r,t)=>{if(r<=288)for(var n=$o[r],a=0;a<r;++a)n[a]=l()[t+4*a>>2];else n=l().subarray(t>>2,t+4*r>>2);ta.uniform1fv(Po(e),n)},jo=(e,r)=>{ta.uniform1i(Po(e),r)},Ao=(e,r,t)=>{ta.uniform2f(Po(e),r,t)},Mo=(e,r,t,n)=>{ta.uniform3f(Po(e),r,t,n)},Lo=(e,r,t,n,a)=>{ta.uniform4f(Po(e),r,t,n,a)},Do=(e,r,t,n)=>{if(r<=18){var a=$o[16*r],o=l();n>>=2,r*=16;for(var i=0;i<r;i+=16){var s=n+i;a[i]=o[s],a[i+1]=o[s+1],a[i+2]=o[s+2],a[i+3]=o[s+3],a[i+4]=o[s+4],a[i+5]=o[s+5],a[i+6]=o[s+6],a[i+7]=o[s+7],a[i+8]=o[s+8],a[i+9]=o[s+9],a[i+10]=o[s+10],a[i+11]=o[s+11],a[i+12]=o[s+12],a[i+13]=o[s+13],a[i+14]=o[s+14],a[i+15]=o[s+15]}}else a=l().subarray(n>>2,n+64*r>>2);ta.uniformMatrix4fv(Po(e),!!t,a)},Ro=e=>{e=ia.programs[e],ta.useProgram(e),ta.currentProgram=e},Io=(e,r,t,n,a,o)=>{ta.vertexAttribPointer(e,r,t,!!n,a,o)},Oo=(e,r,t,n)=>ta.viewport(e,r,t,n);Ae.init(),ur.createPreloadedFile=(e,r,t,n,a,o,i,s,l,u)=>{var c=r?Ze.resolve(Ke.join2(e,r)):e;function d(t){function d(t){u?.(),s||((e,r,t,n,a,o)=>{ur.createDataFile(e,r,t,n,a,o)})(e,r,t,n,a,l),o?.(),oe()}((e,r,t,n)=>{void 0!==Wn&&Wn.init();var a=!1;return sr.forEach((o=>{a||o.canHandle(r)&&(o.handle(e,r,t,n),a=!0)})),a})(t,c,d,(()=>{i?.(),oe()}))||d(t)}ae(),"string"==typeof t?((e,r,t,n)=>{var a=n?"":`al ${e}`;_(e).then((e=>{r(new Uint8Array(e)),a&&oe()}),(r=>{if(!t)throw`Loading data file "${e}" failed.`;t()})),a&&ae()})(t,d,i):d(t)},ur.staticInit(),(()=>{for(var e=new Array(256),r=0;r<256;++r)e[r]=String.fromCharCode(r);yr=e})(),wr=f.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},_r=f.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},Object.assign(Hr.prototype,{isAliasOf(e){if(!(this instanceof Hr))return!1;if(!(e instanceof Hr))return!1;var r=this.$$.ptrType.registeredClass,t=this.$$.ptr;e.$$=e.$$;for(var n=e.$$.ptrType.registeredClass,a=e.$$.ptr;r.baseClass;)t=r.upcast(t),r=r.baseClass;for(;n.baseClass;)a=n.upcast(a),n=n.baseClass;return r===n&&t===a},clone(){if(this.$$.ptr||Ar(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,r=zr(Object.create(Object.getPrototypeOf(this),{$$:{value:(e=this.$$,{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType})}}));return r.$$.count.value+=1,r.$$.deleteScheduled=!1,r},delete(){this.$$.ptr||Ar(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Pr("Object already scheduled for deletion"),Lr(this),Dr(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Ar(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Pr("Object already scheduled for deletion"),Ur.push(this),Ur.length,this.$$.deleteScheduled=!0,this}}),Object.assign(et.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){this.rawDestructor?.(e)},argPackAdvance:8,readValueFromPointer:Jr,fromWireType:Nr}),rt=f.UnboundTypeError=(Ca=Error,(Sa=Gr(xa="UnboundTypeError",(function(e){this.name=xa,this.message=e;var r=new Error(e).stack;void 0!==r&&(this.stack=this.toString()+"\n"+r.replace(/^Error(:[^\n]*)?\n/,""))}))).prototype=Object.create(Ca.prototype),Sa.prototype.constructor=Sa,Sa.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},Sa),vt.push(0,1,void 0,1,null,1,!0,1,!1,1),f.count_emval_handles=yt,f.requestAnimationFrame=In.requestAnimationFrame,f.pauseMainLoop=In.pause,f.resumeMainLoop=In.resume,In.init(),f.requestFullscreen=Wn.requestFullscreen,f.setCanvasSize=Wn.setCanvasSize,f.getUserMedia=Wn.getUserMedia,f.createContext=Wn.createContext,ea.init();for(var Wo=new Float32Array(288),Bo=0;Bo<=288;++Bo)$o[Bo]=Wo.subarray(0,Bo);var No,zo,Uo,Ho=[Pe,$e,Ve,dr,fr,mr,hr,pr,vr,gr,xn,Sn,pa,va,ga,wa,_a,ba,ka],Go=function(){var e,r,t,n,a=pe();function o(e,r){var t;return Go=e.exports,We(Go._emscripten_tls_init),Fe=Go.__indirect_function_table,t=Go.__wasm_call_ctors,Q.unshift(t),M=r,oe(),Go}if(ae(),f.instantiateWasm)try{return f.instantiateWasm(a,o)}catch(e){j(`Module.instantiateWasm callback failed with error: ${e}`),d(e)}return se??=fe(),(e=U,r=se,t=a,n=function(e){o(e.instance,e.module)},e||"function"!=typeof WebAssembly.instantiateStreaming||ce(r)||de(r)||v||"function"!=typeof fetch?he(r,t,n):fetch(r,{credentials:"same-origin"}).then((e=>WebAssembly.instantiateStreaming(e,t).then(n,(function(e){return j(`wasm streaming compile failed: ${e}`),j("falling back to ArrayBuffer instantiation"),he(r,t,n)}))))).catch(d),{}}(),Vo=e=>(Vo=Go.malloc)(e),qo=e=>(qo=Go.free)(e),Xo=()=>(Xo=Go.pthread_self)(),Yo=(e,r)=>(Yo=Go.setThrew)(e,r),Ko=e=>(Ko=Go.__getTypeName)(e),Qo=()=>(Qo=Go._embind_initialize_bindings)(),Zo=(e,r)=>(Zo=Go.emscripten_builtin_memalign)(e,r),Jo=(e,r,t,n,a,o)=>(Jo=Go._emscripten_thread_init)(e,r,t,n,a,o),ei=()=>(ei=Go._emscripten_thread_crashed)(),ri=(e,r,t,n,a)=>(ri=Go._emscripten_run_on_main_thread_js)(e,r,t,n,a),ti=e=>(ti=Go._emscripten_thread_free_data)(e),ni=e=>(ni=Go._emscripten_thread_exit)(e),ai=()=>(ai=Go._emscripten_check_mailbox)(),oi=(e,r)=>(oi=Go.emscripten_stack_set_limits)(e,r),ii=e=>(ii=Go._emscripten_stack_restore)(e),si=e=>(si=Go._emscripten_stack_alloc)(e),li=()=>(li=Go.emscripten_stack_get_current)();function ui(e,r){var t=ke();try{return Re(e)(r)}catch(e){if(Ce(t),e!==e+0)throw e;Yo(1,0)}}function ci(e,r,t){var n=ke();try{return Re(e)(r,t)}catch(e){if(Ce(n),e!==e+0)throw e;Yo(1,0)}}function di(e,r,t,n){var a=ke();try{return Re(e)(r,t,n)}catch(e){if(Ce(a),e!==e+0)throw e;Yo(1,0)}}function fi(e,r){var t=ke();try{Re(e)(r)}catch(e){if(Ce(t),e!==e+0)throw e;Yo(1,0)}}function mi(e,r,t,n){var a=ke();try{Re(e)(r,t,n)}catch(e){if(Ce(a),e!==e+0)throw e;Yo(1,0)}}function hi(e,r,t){var n=ke();try{Re(e)(r,t)}catch(e){if(Ce(n),e!==e+0)throw e;Yo(1,0)}}function pi(e,r,t,n,a,o){var i=ke();try{return Re(e)(r,t,n,a,o)}catch(e){if(Ce(i),e!==e+0)throw e;Yo(1,0)}}function vi(e,r,t,n,a){var o=ke();try{Re(e)(r,t,n,a)}catch(e){if(Ce(o),e!==e+0)throw e;Yo(1,0)}}function gi(e,r,t,n,a,o,i){var s=ke();try{return Re(e)(r,t,n,a,o,i)}catch(e){if(Ce(s),e!==e+0)throw e;Yo(1,0)}}function yi(e,r,t,n,a,o){var i=ke();try{Re(e)(r,t,n,a,o)}catch(e){if(Ce(i),e!==e+0)throw e;Yo(1,0)}}function wi(e,r,t,n,a){var o=ke();try{return Re(e)(r,t,n,a)}catch(e){if(Ce(o),e!==e+0)throw e;Yo(1,0)}}function _i(e,r,t,n,a,o,i,s,l,u){var c=ke();try{return Re(e)(r,t,n,a,o,i,s,l,u)}catch(e){if(Ce(c),e!==e+0)throw e;Yo(1,0)}}function bi(e){var r=ke();try{Re(e)()}catch(e){if(Ce(r),e!==e+0)throw e;Yo(1,0)}}function Ei(){if(!(te>0)){if(g)return c(f),J(),void startWorker(f);var e;!Uo&&(Uo=1,(e=f.preRun)&&("function"==typeof e&&(e=[e]),e.forEach(ee)),Me(K),te>0)||(f.setStatus?(f.setStatus("Running..."),setTimeout((()=>{setTimeout((()=>f.setStatus("")),1),r()}),1)):r())}function r(){zo||(zo=1,f.calledRun=1,H||(J(),c(f),f.onRuntimeInitialized?.(),function(){if(!g){var e=f.postRun;e&&("function"==typeof e&&(e=[e]),e.forEach(re)),Me(Z)}}()))}}if(f.dynCall_iiiji=(e,r,t,n,a,o)=>(f.dynCall_iiiji=Go.dynCall_iiiji)(e,r,t,n,a,o),f.dynCall_ji=(e,r)=>(f.dynCall_ji=Go.dynCall_ji)(e,r),f.dynCall_iiji=(e,r,t,n,a)=>(f.dynCall_iiji=Go.dynCall_iiji)(e,r,t,n,a),f.dynCall_iijjiii=(e,r,t,n,a,o,i,s,l)=>(f.dynCall_iijjiii=Go.dynCall_iijjiii)(e,r,t,n,a,o,i,s,l),f.dynCall_iij=(e,r,t,n)=>(f.dynCall_iij=Go.dynCall_iij)(e,r,t,n),f.dynCall_vijjjii=(e,r,t,n,a,o,i,s,l,u)=>(f.dynCall_vijjjii=Go.dynCall_vijjjii)(e,r,t,n,a,o,i,s,l,u),f.dynCall_viji=(e,r,t,n,a)=>(f.dynCall_viji=Go.dynCall_viji)(e,r,t,n,a),f.dynCall_vijiii=(e,r,t,n,a,o,i)=>(f.dynCall_vijiii=Go.dynCall_vijiii)(e,r,t,n,a,o,i),f.dynCall_viiiiij=(e,r,t,n,a,o,i,s)=>(f.dynCall_viiiiij=Go.dynCall_viiiiij)(e,r,t,n,a,o,i,s),f.dynCall_jiiiijiiiii=(e,r,t,n,a,o,i,s,l,u,c,d)=>(f.dynCall_jiiiijiiiii=Go.dynCall_jiiiijiiiii)(e,r,t,n,a,o,i,s,l,u,c,d),f.dynCall_viiij=(e,r,t,n,a,o)=>(f.dynCall_viiij=Go.dynCall_viiij)(e,r,t,n,a,o),f.dynCall_jii=(e,r,t)=>(f.dynCall_jii=Go.dynCall_jii)(e,r,t),f.dynCall_vij=(e,r,t,n)=>(f.dynCall_vij=Go.dynCall_vij)(e,r,t,n),f.dynCall_jiiiiii=(e,r,t,n,a,o,i)=>(f.dynCall_jiiiiii=Go.dynCall_jiiiiii)(e,r,t,n,a,o,i),f.dynCall_jiiiiji=(e,r,t,n,a,o,i,s)=>(f.dynCall_jiiiiji=Go.dynCall_jiiiiji)(e,r,t,n,a,o,i,s),f.dynCall_iijj=(e,r,t,n,a,o)=>(f.dynCall_iijj=Go.dynCall_iijj)(e,r,t,n,a,o),f.dynCall_viiiiiij=(e,r,t,n,a,o,i,s,l)=>(f.dynCall_viiiiiij=Go.dynCall_viiiiiij)(e,r,t,n,a,o,i,s,l),f.dynCall_iiij=(e,r,t,n,a)=>(f.dynCall_iiij=Go.dynCall_iiij)(e,r,t,n,a),f.dynCall_vjji=(e,r,t,n,a,o)=>(f.dynCall_vjji=Go.dynCall_vjji)(e,r,t,n,a,o),f.dynCall_jiji=(e,r,t,n,a)=>(f.dynCall_jiji=Go.dynCall_jiji)(e,r,t,n,a),f.dynCall_viijii=(e,r,t,n,a,o,i)=>(f.dynCall_viijii=Go.dynCall_viijii)(e,r,t,n,a,o,i),f.dynCall_iiiiij=(e,r,t,n,a,o,i)=>(f.dynCall_iiiiij=Go.dynCall_iiiiij)(e,r,t,n,a,o,i),f.dynCall_iiiiijj=(e,r,t,n,a,o,i,s,l)=>(f.dynCall_iiiiijj=Go.dynCall_iiiiijj)(e,r,t,n,a,o,i,s,l),f.dynCall_iiiiiijj=(e,r,t,n,a,o,i,s,l,u)=>(f.dynCall_iiiiiijj=Go.dynCall_iiiiiijj)(e,r,t,n,a,o,i,s,l,u),ne=function e(){zo||Ei(),zo||(ne=e)},f.preInit)for("function"==typeof f.preInit&&(f.preInit=[f.preInit]);f.preInit.length>0;)f.preInit.pop()();return Ei(),m}),t=globalThis.self?.name?.startsWith("em-pthread");"string"==typeof globalThis.process?.versions?.node&&(t="em-pthread"===(await import("worker_threads")).workerData),t&&r();export{r as default};
|