@cesdk/node 1.18.0-rc.0 → 1.18.0-rc.1
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/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(global,(()=>(()=>{var e={502:(e,t,r)=>{var n,o=(n=(n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||__filename,function(e={}){var t,o,i,a,s=e;if(void 0===globalThis.BigInt64Array){function u(e){return[0|Number(BigInt(e)&BigInt(4294967295)),0|Number(BigInt(e)>>32n)]}function l(e){return function t(r){var n;"number"==typeof r&&(r=new Uint32Array(2*r)),ArrayBuffer.isView(r)||(r.constructor&&"ArrayBuffer"===r.constructor.name?r=new Uint32Array(r):(n=r,r=new Uint32Array(2*r.length)));var o=new Proxy({slice:(e,n)=>(void 0===n&&(n=r.length),t(r.slice(2*e,2*n))),subarray:(e,n)=>t(r.subarray(2*e,2*n)),[Symbol.iterator]:function*(){for(var t=0;t<r.length/2;t++)yield e(r[2*t],r[2*t+1])},BYTES_PER_ELEMENT:2*r.BYTES_PER_ELEMENT,buffer:r.buffer,byteLength:r.byteLength,byteOffset:r.byteOffset,length:r.length/2,copyWithin:function(e,t,n){return r.copyWithin(2*e,2*t,2*n),o},set(e,t){if(void 0===t&&(t=0),2*(e.length+t)>r.length)throw new RangeError("offset is out of bounds");for(var n=0;n<e.length;n++){var o=u(e[n]);r.set(o,2*(t+n))}}},{get(t,n,o){if("string"!=typeof n||!/^\d+$/.test(n))return Reflect.get(t,n,o);var i=r[2*n],a=r[2*n+1];return e(i,a)},set(e,t,n,o){if("string"!=typeof t||!/^\d+$/.test(t))return Reflect.set(e,t,n,o);if("bigint"!=typeof n)throw new TypeError(`Cannot convert ${n} to a BigInt`);var i=u(n);return r.set(i,2*t),!0}});return n&&o.set(n),o}}globalThis.BigUint64Array=l((function(e,t){return BigInt(e)|BigInt(t)<<32n})),globalThis.BigInt64Array=l((function(e,t){return BigInt(e)|BigInt(t+2*(2147483648&t))<<32n}))}s.ready=new Promise(((e,r)=>{t=e,o=r})),s.expectedDataFileDownloads||(s.expectedDataFileDownloads=0),s.expectedDataFileDownloads++,s.ENVIRONMENT_IS_PTHREAD||s.$ww||function(e){"object"==typeof window?window.encodeURIComponent(window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/"):"undefined"==typeof process&&"undefined"!=typeof location&&encodeURIComponent(location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/");var t="cesdk.data";"function"!=typeof s.locateFilePackage||s.locateFile||(s.locateFile=s.locateFilePackage,k("warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)"));var n=s.locateFile?s.locateFile(t,""):t,o=e.remote_package_size,i=null,a=s.getPreloadedPackage?s.getPreloadedPackage(n,o):null;function u(){function t(e,t){if(!e)throw t+(new Error).stack}function r(e,t,r){this.start=e,this.end=t,this.audio=r}s.FS_createPath("/","ly.img.cesdk",!0,!0),s.FS_createPath("/ly.img.cesdk","fonts",!0,!0),s.FS_createPath("/ly.img.cesdk","icons",!0,!0),s.FS_createPath("/ly.img.cesdk","icu",!0,!0),s.FS_createPath("/ly.img.cesdk","presets",!0,!0),s.FS_createPath("/ly.img.cesdk","shaders",!0,!0),s.FS_createPath("/ly.img.cesdk/shaders","common",!0,!0),r.prototype={requests:{},open:function(e,t){this.name=t,this.requests[t]=this,s.addRunDependency(`fp ${this.name}`)},send:function(){},onload:function(){var e=this.byteArray.subarray(this.start,this.end);this.finish(e)},finish:function(e){s.FS_createDataFile(this.name,null,e,!0,!0,!0),s.removeRunDependency(`fp ${this.name}`),this.requests[this.name]=null}};for(var n=e.files,o=0;o<n.length;++o)new r(n[o].start,n[o].end,n[o].audio||0).open("GET",n[o].filename);function u(n){t(n,"Loading data file failed."),t(n.constructor.name===ArrayBuffer.name,"bad input to processPackageData");var o=new Uint8Array(n);r.prototype.byteArray=o;for(var i=e.files,a=0;a<i.length;++a)r.prototype.requests[i[a].filename].onload();s.removeRunDependency("datafile_cesdk.data")}s.addRunDependency("datafile_cesdk.data"),s.preloadResults||(s.preloadResults={}),s.preloadResults["cesdk.data"]={fromCache:!1},a?(u(a),a=null):i=u}a||function(e,t,n,o){if("object"!=typeof process||"object"!=typeof process.versions||"string"!=typeof process.versions.node){var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onprogress=function(r){var n=e,o=t;if(r.total&&(o=r.total),r.loaded){i.addedTotal?s.dataFileDownloads[n].loaded=r.loaded:(i.addedTotal=!0,s.dataFileDownloads||(s.dataFileDownloads={}),s.dataFileDownloads[n]={loaded:r.loaded,total:o});var a=0,u=0,l=0;for(var c in s.dataFileDownloads){var d=s.dataFileDownloads[c];a+=d.total,u+=d.loaded,l++}a=Math.ceil(a*s.expectedDataFileDownloads/l),s.setStatus&&s.setStatus(`Downloading data... (${u}/${a})`)}else s.dataFileDownloads||s.setStatus&&s.setStatus("Downloading data...")},i.onerror=function(t){throw new Error("NetworkError for: "+e)},i.onload=function(e){if(!(200==i.status||304==i.status||206==i.status||0==i.status&&i.response))throw new Error(i.statusText+" : "+i.responseURL);var t=i.response;n(t)},i.send(null)}else r(147).readFile(e,(function(e,t){var r;e?(r=e,console.error("package error:",r)):n(t.buffer)}))}(n,o,(function(e){i?(i(e),i=null):a=e})),s.calledRun?u():(s.preRun||(s.preRun=[]),s.preRun.push(u))}({files:[{filename:"/ly.img.cesdk/fonts/imgly_font_inter_semibold.otf",start:0,end:270760},{filename:"/ly.img.cesdk/icons/ErrorAudio.svg",start:270760,end:271672},{filename:"/ly.img.cesdk/icons/ErrorConnection.svg",start:271672,end:272620},{filename:"/ly.img.cesdk/icons/ErrorVideo.svg",start:272620,end:273473},{filename:"/ly.img.cesdk/icons/Move.svg",start:273473,end:274748},{filename:"/ly.img.cesdk/icons/RotateIndicator.svg",start:274748,end:275745},{filename:"/ly.img.cesdk/icu/icudt71l.dat",start:275745,end:710017},{filename:"/ly.img.cesdk/presets/.keep",start:710017,end:710017},{filename:"/ly.img.cesdk/shaders/adjustments.sksl",start:710017,end:713906},{filename:"/ly.img.cesdk/shaders/black_and_white_color_mixer.sksl",start:713906,end:720223},{filename:"/ly.img.cesdk/shaders/common/ubq_adjustments.sksl",start:720223,end:724814},{filename:"/ly.img.cesdk/shaders/common/ubq_color_conversions.sksl",start:724814,end:734799},{filename:"/ly.img.cesdk/shaders/common/ubq_constants.sksl",start:734799,end:735289},{filename:"/ly.img.cesdk/shaders/common/ubq_hue_constants.sksl",start:735289,end:738456},{filename:"/ly.img.cesdk/shaders/common/ubq_noise.sksl",start:738456,end:741094},{filename:"/ly.img.cesdk/shaders/cross_cut.sksl",start:741094,end:742041},{filename:"/ly.img.cesdk/shaders/dot_pattern.sksl",start:742041,end:742556},{filename:"/ly.img.cesdk/shaders/duotone_filter.sksl",start:742556,end:743520},{filename:"/ly.img.cesdk/shaders/extrude_blur.sksl",start:743520,end:745637},{filename:"/ly.img.cesdk/shaders/glow.sksl",start:745637,end:746604},{filename:"/ly.img.cesdk/shaders/half_tone.sksl",start:746604,end:747098},{filename:"/ly.img.cesdk/shaders/hsp_selective_adjustments.sksl",start:747098,end:760698},{filename:"/ly.img.cesdk/shaders/linocut.sksl",start:760698,end:761483},{filename:"/ly.img.cesdk/shaders/liquid.sksl",start:761483,end:761965},{filename:"/ly.img.cesdk/shaders/lut_filter.sksl",start:761965,end:764828},{filename:"/ly.img.cesdk/shaders/mask_color.sksl",start:764828,end:765333},{filename:"/ly.img.cesdk/shaders/mirror.sksl",start:765333,end:765787},{filename:"/ly.img.cesdk/shaders/outliner.sksl",start:765787,end:767424},{filename:"/ly.img.cesdk/shaders/pixelize.sksl",start:767424,end:767724},{filename:"/ly.img.cesdk/shaders/placeholder_overlay_lines.sksl",start:767724,end:768412},{filename:"/ly.img.cesdk/shaders/posterize.sksl",start:768412,end:768624},{filename:"/ly.img.cesdk/shaders/radial_pixel.sksl",start:768624,end:769187},{filename:"/ly.img.cesdk/shaders/sharpie.sksl",start:769187,end:771492},{filename:"/ly.img.cesdk/shaders/shifter.sksl",start:771492,end:772176},{filename:"/ly.img.cesdk/shaders/tiltshift.sksl",start:772176,end:772758},{filename:"/ly.img.cesdk/shaders/tv_glitch.sksl",start:772758,end:773476},{filename:"/ly.img.cesdk/shaders/vignette.sksl",start:773476,end:773848}],remote_package_size:773848}),"object"==typeof window&&"object"==typeof window.performance?s.performance=performance:"object"==typeof global&&"object"==typeof global.perf_hooks&&"object"==typeof global.perf_hooks.performance?s.performance=global.perf_hooks.performance:s.performance={mark:function(){},measure:function(){}},function(e){e[e.PENDING=0]="PENDING",e[e.FINISHED=1]="FINISHED",e[e.ALLOCATED=2]="ALLOCATED",e[e.ERROR=3]="ERROR"}(i||(i={})),function(e){e[e.GET=0]="GET",e[e.POST=1]="POST"}(a||(a={}));class c{constructor(e,t){this.state=i.PENDING,this.totalBytes=0,this.receivedLength=0,this.handle=e,this.uri=t}async readChunks(e){let t=0;const r=[],n=e=>{r.push(e),t+=e.length,this.receivedLength=t};if(null==e);else if("getReader"in e){const t=e.getReader();for(;;){const{done:e,value:r}=await t.read();if(e)break;n(r)}}else await new Promise(((t,r)=>{e.on("data",n),e.on("end",(()=>t())),e.on("error",(e=>r(e)))}));const o=new Uint8Array(t);let i=0;for(const e of r)o.set(e,i),i+=e.length;return this.finish(o)}isPending(){return this.state===i.PENDING}isError(){return this.state===i.ERROR}isFinished(){return this.state===i.FINISHED}isAllocated(){return this.state===i.ALLOCATED}allocate(){if(this.isAllocated())return this;if(this.isFinished()){const e=this.result.length,t=s._malloc(e);s.HEAPU8.set(this.result,t);const r=Object.assign(Object.assign({},this),{state:i.ALLOCATED,resultAddress:t,resultLength:e});return Object.assign(this,r),r}return null}finish(e){const t=Object.assign(Object.assign({},this),{state:i.FINISHED,result:e,totalBytes:e.length});return Object.assign(this,t)}fail(e){const t=Object.assign(Object.assign({},this),{state:i.ERROR,error:e});return Object.assign(this,t)}}s.emscripten_ubq_asyncFetchManager=new class{constructor(){this._nextHandle=0,this._nextHeaderHandle=0,this._processes=new Map,this._headers=new Map,this._fetchImpl=null}_fetch(e,t){return this._fetchImpl?this._fetchImpl(e,t):fetch(e,t)}setFetch(e){this._fetchImpl=e}getProcess(e){return this._processes.get(e)}deleteProcess(e){return this._processes.delete(e)}fetch(e,t,r,n,o,i,a,u,l){const d=s.UTF8ToString(t,r),f=this._nextHandle++,p=new c(f,d);return this._processes.set(f,p),d.match(/^file:/)?this._fetchFile(p).catch((e=>(p.fail(e),Promise.reject(e)))):this._fetchRemote(p,e,n,o,i,a,u,l).catch((e=>(p.fail(e),Promise.reject(e)))),p}async _fetchFile(e){if("undefined"!=typeof window)throw new Error("File URLs supported only in Node.JS");const t=r(147),{fileURLToPath:n}=r(310),o=t.createReadStream(n(e.uri));return e.readChunks(o)}async _fetchRemote(e,t,r,n,o,i,u,l){const c=s.UTF8ToString(u,l),d=this.getHeaders(r,n),f=t===a.POST?new Uint8Array(s.HEAPU8.buffer,o,i):void 0,p=await this._fetch(e.uri,{method:a[t],headers:d,body:f,mode:"cors",credentials:c});if(p.status>=200&&p.status<=209){let t=0;return p.headers.has("Content-Length")&&(t=+p.headers.get("Content-Length")),e.totalBytes=t,e.readChunks(p.body)}return e.fail(p.statusText)}getHeaders(e,t){const r={};for(let n=0;n<t;n++){const t=s.getValue(e+4*n,"i32"),o=this._headers.get(t);r[o.key]=o.value}return r}createHeader(e,t,r,n){const o=s.UTF8ToString(e,t),i=s.UTF8ToString(r,n),a=this._nextHeaderHandle++;return this._headers.set(a,{key:o,value:i}),a}deleteHeader(e){return this._headers.delete(e)}},s.emscripten_ubq_codec_videoDecoders=new Map,s.emscripten_ubq_codec_audioDecoders=new Map,s.emscripten_ubq_codec_videoEncoders=new Map,s.emscripten_ubq_codec_audioEncoders=new Map,s.emscripten_ubq_codec_videoDecoderNextHandle=1,s.emscripten_ubq_codec_audioDecoderNextHandle=1,s.emscripten_ubq_codec_videoEncoderNextHandle=1,s.emscripten_ubq_codec_audioEncoderNextHandle=1,s.emscripten_ubq_codec_createNativeResult=function(e){const t=s._malloc(8),r=s.HEAPU32.subarray(t/4,t/4+2);if(r[0]=e.handle?e.handle:e.code?e.code:0,e.error){const t=(new TextEncoder).encode(e.error),n=s._malloc(t.length+1),o=s.HEAPU8.subarray(n,n+t.length+1);for(let e=0;e<t.length;e++)o[e]=t[e];o[t.length]=0,r[1]=n}else r[1]=0;return t},s.emscripten_ubq_codec_createVideoDecoder=function(e,t){const r=new VideoDecoder({output:n=>{const o=r.textures;let i=!1;if((r.shouldDropFrames||r.decodedFrames<r.requestedFrame||r.decodeQueueSize>=o.length)&&(i=!0),!i){var a=s.ctx;const e=r.decodedFrames%o.length;a.bindTexture(a.TEXTURE_2D,o[e]),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,a.RGBA,a.UNSIGNED_BYTE,n)}n.close(),r.decodedFrames++,s.emscripten_ubq_codec_onOutputDecodedVideoFrame(e,r.decodedFrames,i,t)},error:e=>{r.unexpectedError=e,console.error(e)}});return r.decodedFrames=0,r.requestedFrame=0,r.shouldDropFrames=!1,r},s.emscripten_ubq_codec_createAudioDecoder=function(e,t,r){const n=new AudioDecoder({output:o=>{if(n.flushing)return void o.close();const i=s.HEAPF32.subarray(e/4,e/4+r),a=s.HEAPF32.subarray(t/4,t/4+r),u=1===o.numberOfChannels?0:1;if("f32-planar"===o.format){let e=n.writtenFrames%r;if(e+o.numberOfFrames<=r)o.copyTo(i.subarray(e),{planeIndex:0,frameCount:o.numberOfFrames}),o.copyTo(a.subarray(e),{planeIndex:u,frameCount:o.numberOfFrames});else{const t=r-e;o.copyTo(i.subarray(e),{planeIndex:0,frameCount:t}),o.copyTo(a.subarray(e),{planeIndex:u,frameCount:t}),o.copyTo(i,{planeIndex:0,frameOffset:t}),o.copyTo(a,{planeIndex:u,frameOffset:t})}n.writtenFrames+=o.numberOfFrames}else if("s16-planar"===o.format)if(1===o.numberOfChannels){const e=new Int16Array(o.numberOfFrames);o.copyTo(e,{planeIndex:0});for(let t=0;t<o.numberOfFrames;t++){const o=e[t]/32768;let s=n.writtenFrames%r;i[s]=o,a[s]=o,n.writtenFrames++}}else{const e=new Int16Array(o.numberOfFrames),t=new Int16Array(o.numberOfFrames);o.copyTo(e,{planeIndex:0}),o.copyTo(t,{planeIndex:1});for(let s=0;s<o.numberOfFrames;s++){let o=n.writtenFrames%r;i[o]=e[s]/32768,a[o]=t[s]/32768,n.writtenFrames++}}else if("s16"===o.format){const e=new Int16Array(o.numberOfFrames*o.numberOfChannels);if(o.copyTo(e,{planeIndex:0}),1===o.numberOfChannels)for(let t=0;t<o.numberOfFrames;t++){const o=e[t]/32768;let s=n.writtenFrames%r;i[s]=o,a[s]=o,n.writtenFrames++}else for(let t=0;t<o.numberOfFrames;t++){let s=n.writtenFrames%r;i[s]=e[t*o.numberOfChannels+0]/32768,a[s]=e[t*o.numberOfChannels+1]/32768,n.writtenFrames++}}else console.error("Unsupported audio format:",o.format);o.close()},error:e=>{n.unexpectedError=e,console.error(e)}});return n.writtenFrames=0,n},s.emscripten_ubq_settings_forceWebGL1=!1;var d,f,p,h=Object.assign({},s),m="./this.program",g=(e,t)=>{throw t},y="object"==typeof window,v="function"==typeof importScripts,b="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,w="";if(b){var E=r(147),_=r(17);w=v?_.dirname(w)+"/":__dirname+"/",d=(e,t)=>(e=oe(e)?new URL(e):_.normalize(e),E.readFileSync(e,t?void 0:"utf8")),p=e=>{var t=d(e,!0);return t.buffer||(t=new Uint8Array(t)),t},f=(e,t,r,n=!0)=>{e=oe(e)?new URL(e):_.normalize(e),E.readFile(e,n?void 0:"utf8",((e,o)=>{e?r(e):t(n?o.buffer:o)}))},!s.thisProgram&&process.argv.length>1&&(m=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),g=(e,t)=>{throw process.exitCode=e,t},s.inspect=()=>"[Emscripten Module object]"}else(y||v)&&(v?w=self.location.href:"undefined"!=typeof document&&document.currentScript&&(w=document.currentScript.src),n&&(w=n),w=0!==w.indexOf("blob:")?w.substr(0,w.replace(/[?#].*/,"").lastIndexOf("/")+1):"",d=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},v&&(p=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),f=(e,t,r)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?t(n.response):r()},n.onerror=r,n.send(null)});var C,S=s.print||console.log.bind(console),k=s.printErr||console.error.bind(console);Object.assign(s,h),h=null,s.arguments&&s.arguments,s.thisProgram&&(m=s.thisProgram),s.quit&&(g=s.quit),s.wasmBinary&&(C=s.wasmBinary);var x,P,T=s.noExitRuntime||!0;"object"!=typeof WebAssembly&&re("no native wasm support detected");var F,A,D,B,L,R,M,O,I,U,$,j,q=!1;function N(e,t){e||re(t)}function H(){var e=x.buffer;s.HEAP8=A=new Int8Array(e),s.HEAP16=B=new Int16Array(e),s.HEAP32=R=new Int32Array(e),s.HEAPU8=D=new Uint8Array(e),s.HEAPU16=L=new Uint16Array(e),s.HEAPU32=M=new Uint32Array(e),s.HEAPF32=O=new Float32Array(e),s.HEAPF64=$=new Float64Array(e),s.HEAP64=I=new BigInt64Array(e),s.HEAPU64=U=new BigUint64Array(e)}var V=[],W=[],G=[],z=[];function Y(){return T||!1}var X,K,Q=0,Z=null,J=null;function ee(e){Q++,s.monitorRunDependencies&&s.monitorRunDependencies(Q)}function te(e){if(Q--,s.monitorRunDependencies&&s.monitorRunDependencies(Q),0==Q&&(null!==Z&&(clearInterval(Z),Z=null),J)){var t=J;J=null,t()}}function re(e){s.onAbort&&s.onAbort(e),k(e="Aborted("+e+")"),q=!0,F=1,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw o(t),t}function ne(e){return e.startsWith("data:application/octet-stream;base64,")}function oe(e){return e.startsWith("file://")}function ie(e){if(e==X&&C)return new Uint8Array(C);if(p)return p(e);throw"both async and sync fetching of the wasm failed"}function ae(e,t,r){return function(e){return C||!y&&!v||"function"!=typeof fetch?Promise.resolve().then((()=>ie(e))):fetch(e,{credentials:"same-origin"}).then((t=>{if(!t.ok)throw"failed to load wasm binary file at '"+e+"'";return t.arrayBuffer()})).catch((()=>ie(e)))}(e).then((e=>WebAssembly.instantiate(e,t))).then((e=>e)).then(r,(e=>{k("failed to asynchronously prepare wasm: "+e),re(e)}))}ne(X="cesdk.wasm")||(K=X,X=s.locateFile?s.locateFile(K,w):w+K);var se={2354136:(e,t,r,n,o)=>"undefined"==typeof window||void 0===(window.AudioContext||window.webkitAudioContext)?0:(void 0===window.miniaudio&&(window.miniaudio={referenceCount:0},window.miniaudio.device_type={},window.miniaudio.device_type.playback=e,window.miniaudio.device_type.capture=t,window.miniaudio.device_type.duplex=r,window.miniaudio.device_state={},window.miniaudio.device_state.stopped=n,window.miniaudio.device_state.started=o,miniaudio.devices=[],miniaudio.track_device=function(e){for(var t=0;t<miniaudio.devices.length;++t)if(null==miniaudio.devices[t])return miniaudio.devices[t]=e,t;return miniaudio.devices.push(e),miniaudio.devices.length-1},miniaudio.untrack_device_by_index=function(e){for(miniaudio.devices[e]=null;miniaudio.devices.length>0&&null==miniaudio.devices[miniaudio.devices.length-1];)miniaudio.devices.pop()},miniaudio.untrack_device=function(e){for(var t=0;t<miniaudio.devices.length;++t)if(miniaudio.devices[t]==e)return miniaudio.untrack_device_by_index(t)},miniaudio.get_device_by_index=function(e){return miniaudio.devices[e]},miniaudio.unlock_event_types=["touchstart","touchend","click"],miniaudio.unlock=function(){for(var e=0;e<miniaudio.devices.length;++e){var t=miniaudio.devices[e];null!=t&&null!=t.webaudio&&2===t.state&&t.webaudio.resume()}miniaudio.unlock_event_types.map((function(e){document.removeEventListener(e,miniaudio.unlock,!0)}))},miniaudio.unlock_event_types.map((function(e){document.addEventListener(e,miniaudio.unlock,!0)}))),window.miniaudio.referenceCount+=1,1),2356126:()=>{void 0!==window.miniaudio&&(window.miniaudio.referenceCount-=1,0===window.miniaudio.referenceCount&&delete window.miniaudio)},2356290:()=>void 0!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia,2356394:()=>{try{var e=new(window.AudioContext||window.webkitAudioContext),t=e.sampleRate;return e.close(),t}catch(e){return 0}},2356565:(e,t,r,n,o,i)=>{var a=e,u=t,l=r,c=n,d=o,f=i;if(void 0===window.miniaudio)return-1;var p={},h={};a==window.miniaudio.device_type.playback&&(h.sampleRate=l),p.webaudio=new(window.AudioContext||window.webkitAudioContext)(h),p.webaudio.suspend(),p.state=window.miniaudio.device_state.stopped;var m=0,g=u;return a!=window.miniaudio.device_type.playback&&(m=u),p.scriptNode=p.webaudio.createScriptProcessor(c,m,g),p.scriptNode.onaudioprocess=function(e){if(null!=p.intermediaryBufferView&&0!=p.intermediaryBufferView.length||(p.intermediaryBufferView=new Float32Array(s.HEAPF32.buffer,d,c*u)),a==miniaudio.device_type.capture||a==miniaudio.device_type.duplex){for(var t=0;t<u;t+=1)for(var r=e.inputBuffer.getChannelData(t),n=p.intermediaryBufferView,o=0;o<c;o+=1)n[o*u+t]=r[o];Kn(f,c,d)}if(a==miniaudio.device_type.playback||a==miniaudio.device_type.duplex)for(Qn(f,c,d),t=0;t<e.outputBuffer.numberOfChannels;++t){var i=e.outputBuffer.getChannelData(t);for(n=p.intermediaryBufferView,o=0;o<c;o+=1)i[o]=n[o*u+t]}else for(t=0;t<e.outputBuffer.numberOfChannels;++t)e.outputBuffer.getChannelData(t).fill(0)},a!=miniaudio.device_type.capture&&a!=miniaudio.device_type.duplex||navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(e){p.streamNode=p.webaudio.createMediaStreamSource(e),p.streamNode.connect(p.scriptNode),p.scriptNode.connect(p.webaudio.destination)})).catch((function(e){console.log("Failed to get user media: "+e)})),a==miniaudio.device_type.playback&&p.scriptNode.connect(p.webaudio.destination),miniaudio.track_device(p)},2359348:e=>miniaudio.get_device_by_index(e).webaudio.sampleRate,2359414:e=>{var t=miniaudio.get_device_by_index(e);void 0!==t.scriptNode&&(t.scriptNode.onaudioprocess=function(e){},t.scriptNode.disconnect(),t.scriptNode=void 0),void 0!==t.streamNode&&(t.streamNode.disconnect(),t.streamNode=void 0),t.webaudio.close(),t.webaudio=void 0},2359779:e=>{miniaudio.untrack_device_by_index(e)},2359822:e=>{var t=miniaudio.get_device_by_index(e);t.webaudio.resume(),t.state=miniaudio.device_state.started},2359947:e=>{var t=miniaudio.get_device_by_index(e);t.webaudio.suspend(),t.state=miniaudio.device_state.stopped},2360073:()=>!!globalThis.ubq_browserTabHidden,2360119:()=>A.length};function ue(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var le=e=>{for(;e.length>0;)e.shift()(s)},ce=[],de=0;function fe(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){M[this.ptr+4>>2]=e},this.get_type=function(){return M[this.ptr+4>>2]},this.set_destructor=function(e){M[this.ptr+8>>2]=e},this.get_destructor=function(){return M[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,A[this.ptr+12>>0]=e},this.get_caught=function(){return 0!=A[this.ptr+12>>0]},this.set_rethrown=function(e){e=e?1:0,A[this.ptr+13>>0]=e},this.get_rethrown=function(){return 0!=A[this.ptr+13>>0]},this.init=function(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t)},this.set_adjusted_ptr=function(e){M[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return M[this.ptr+16>>2]},this.get_exception_ptr=function(){if(uo(this.get_type()))return M[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}var pe=e=>{var t=de;if(!t)return Zn(0),0;var r=new fe(t);r.set_adjusted_ptr(t);var n=r.get_type();if(!n)return Zn(0),t;for(var o in e){var i=e[o];if(0===i||i===n)break;var a=r.ptr+16;if(so(i,n,a))return Zn(i),t}return Zn(n),t},he={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,t)=>{for(var r=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:e=>{var t=he.isAbs(e),r="/"===e.substr(-1);return(e=he.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=he.splitPath(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:e=>{if("/"===e)return"/";var t=(e=(e=he.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments);return he.normalize(e.join("/"))},join2:(e,t)=>he.normalize(e+"/"+t)},me=e=>(me=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>crypto.getRandomValues(e);if(b)try{var e=r(113);if(e.randomFillSync)return t=>e.randomFillSync(t);var t=e.randomBytes;return e=>(e.set(t(e.byteLength)),e)}catch(e){}re("initRandomDevice")})())(e),ge={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:Te.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,t=he.isAbs(n)}return(t?"/":"")+(e=he.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||"."},relative:(e,t)=>{function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=ge.resolve(e).substr(1),t=ge.resolve(t).substr(1);for(var n=r(e.split("/")),o=r(t.split("/")),i=Math.min(n.length,o.length),a=i,s=0;s<i;s++)if(n[s]!==o[s]){a=s;break}var u=[];for(s=a;s<n.length;s++)u.push("..");return(u=u.concat(o.slice(a))).join("/")}},ye="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,ve=(e,t,r)=>{for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.buffer&&ye)return ye.decode(e.subarray(t,o));for(var i="";t<o;){var a=e[t++];if(128&a){var s=63&e[t++];if(192!=(224&a)){var u=63&e[t++];if((a=224==(240&a)?(15&a)<<12|s<<6|u:(7&a)<<18|s<<12|u<<6|63&e[t++])<65536)i+=String.fromCharCode(a);else{var l=a-65536;i+=String.fromCharCode(55296|l>>10,56320|1023&l)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i},be=[],we=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n<=127?t++:n<=2047?t+=2:n>=55296&&n<=57343?(t+=4,++r):t+=3}return t},Ee=(e,t,r,n)=>{if(!(n>0))return 0;for(var o=r,i=r+n-1,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),s<=127){if(r>=i)break;t[r++]=s}else if(s<=2047){if(r+1>=i)break;t[r++]=192|s>>6,t[r++]=128|63&s}else if(s<=65535){if(r+2>=i)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|63&s}else{if(r+3>=i)break;t[r++]=240|s>>18,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}}return t[r]=0,r-o};function _e(e,t,r){var n=r>0?r:we(e)+1,o=new Array(n),i=Ee(e,o,0,o.length);return t&&(o.length=i),o}var Ce={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){Ce.ttys[e]={input:[],output:[],ops:t},Te.registerDevice(e,Ce.stream_ops)},stream_ops:{open:function(e){var t=Ce.ttys[e.node.rdev];if(!t)throw new Te.ErrnoError(43);e.tty=t,e.seekable=!1},close:function(e){e.tty.ops.fsync(e.tty)},fsync:function(e){e.tty.ops.fsync(e.tty)},read:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.get_char)throw new Te.ErrnoError(60);for(var i=0,a=0;a<n;a++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new Te.ErrnoError(29)}if(void 0===s&&0===i)throw new Te.ErrnoError(6);if(null==s)break;i++,t[r+a]=s}return i&&(e.node.timestamp=Date.now()),i},write:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.put_char)throw new Te.ErrnoError(60);try{for(var i=0;i<n;i++)e.tty.ops.put_char(e.tty,t[r+i])}catch(e){throw new Te.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(e){return(()=>{if(!be.length){var e=null;if(b){var t=Buffer.alloc(256),r=0,n=process.stdin.fd;try{r=E.readSync(n,t,0,256,-1)}catch(e){if(!e.toString().includes("EOF"))throw e;r=0}e=r>0?t.slice(0,r).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\n");if(!e)return null;be=_e(e,!0)}return be.shift()})()},put_char:function(e,t){null===t||10===t?(S(ve(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync:function(e){e.output&&e.output.length>0&&(S(ve(e.output,0)),e.output=[])},ioctl_tcgets:function(e){return{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:function(e,t,r){return 0},ioctl_tiocgwinsz:function(e){return[24,80]}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(k(ve(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync:function(e){e.output&&e.output.length>0&&(k(ve(e.output,0)),e.output=[])}}},Se=e=>{e=((e,t)=>65536*Math.ceil(e/65536))(e);var t=eo(65536,e);return t?((e,t)=>(D.fill(0,e,e+t),e))(t,e):0},ke={ops_table:null,mount:e=>ke.createNode(null,"/",16895,0),createNode(e,t,r,n){if(Te.isBlkdev(r)||Te.isFIFO(r))throw new Te.ErrnoError(63);ke.ops_table||(ke.ops_table={dir:{node:{getattr:ke.node_ops.getattr,setattr:ke.node_ops.setattr,lookup:ke.node_ops.lookup,mknod:ke.node_ops.mknod,rename:ke.node_ops.rename,unlink:ke.node_ops.unlink,rmdir:ke.node_ops.rmdir,readdir:ke.node_ops.readdir,symlink:ke.node_ops.symlink},stream:{llseek:ke.stream_ops.llseek}},file:{node:{getattr:ke.node_ops.getattr,setattr:ke.node_ops.setattr},stream:{llseek:ke.stream_ops.llseek,read:ke.stream_ops.read,write:ke.stream_ops.write,allocate:ke.stream_ops.allocate,mmap:ke.stream_ops.mmap,msync:ke.stream_ops.msync}},link:{node:{getattr:ke.node_ops.getattr,setattr:ke.node_ops.setattr,readlink:ke.node_ops.readlink},stream:{}},chrdev:{node:{getattr:ke.node_ops.getattr,setattr:ke.node_ops.setattr},stream:Te.chrdev_stream_ops}});var o=Te.createNode(e,t,r,n);return Te.isDir(o.mode)?(o.node_ops=ke.ops_table.dir.node,o.stream_ops=ke.ops_table.dir.stream,o.contents={}):Te.isFile(o.mode)?(o.node_ops=ke.ops_table.file.node,o.stream_ops=ke.ops_table.file.stream,o.usedBytes=0,o.contents=null):Te.isLink(o.mode)?(o.node_ops=ke.ops_table.link.node,o.stream_ops=ke.ops_table.link.stream):Te.isChrdev(o.mode)&&(o.node_ops=ke.ops_table.chrdev.node,o.stream_ops=ke.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[t]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:e=>e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0),expandFileStorage(e,t){var r=e.contents?e.contents.length:0;if(!(r>=t)){t=Math.max(t,r*(r<1048576?2:1.125)>>>0),0!=r&&(t=Math.max(t,256));var n=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,t){if(e.usedBytes!=t)if(0==t)e.contents=null,e.usedBytes=0;else{var r=e.contents;e.contents=new Uint8Array(t),r&&e.contents.set(r.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr(e){var t={};return t.dev=Te.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,Te.isDir(e.mode)?t.size=4096:Te.isFile(e.mode)?t.size=e.usedBytes:Te.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&ke.resizeFileStorage(e,t.size)},lookup(e,t){throw Te.genericErrors[44]},mknod:(e,t,r,n)=>ke.createNode(e,t,r,n),rename(e,t,r){if(Te.isDir(e.mode)){var n;try{n=Te.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new Te.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=r,t.contents[r]=e,t.timestamp=e.parent.timestamp,e.parent=t},unlink(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir(e,t){var r=Te.lookupNode(e,t);for(var n in r.contents)throw new Te.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir(e){var t=[".",".."];for(var r in e.contents)e.contents.hasOwnProperty(r)&&t.push(r);return t},symlink(e,t,r){var n=ke.createNode(e,t,41471,0);return n.link=r,n},readlink(e){if(!Te.isLink(e.mode))throw new Te.ErrnoError(28);return e.link}},stream_ops:{read(e,t,r,n,o){var i=e.node.contents;if(o>=e.node.usedBytes)return 0;var a=Math.min(e.node.usedBytes-o,n);if(a>8&&i.subarray)t.set(i.subarray(o,o+a),r);else for(var s=0;s<a;s++)t[r+s]=i[o+s];return a},write(e,t,r,n,o,i){if(t.buffer===A.buffer&&(i=!1),!n)return 0;var a=e.node;if(a.timestamp=Date.now(),t.subarray&&(!a.contents||a.contents.subarray)){if(i)return a.contents=t.subarray(r,r+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===o)return a.contents=t.slice(r,r+n),a.usedBytes=n,n;if(o+n<=a.usedBytes)return a.contents.set(t.subarray(r,r+n),o),n}if(ke.expandFileStorage(a,o+n),a.contents.subarray&&t.subarray)a.contents.set(t.subarray(r,r+n),o);else for(var s=0;s<n;s++)a.contents[o+s]=t[r+s];return a.usedBytes=Math.max(a.usedBytes,o+n),n},llseek(e,t,r){var n=t;if(1===r?n+=e.position:2===r&&Te.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new Te.ErrnoError(28);return n},allocate(e,t,r){ke.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap(e,t,r,n,o){if(!Te.isFile(e.node.mode))throw new Te.ErrnoError(43);var i,a,s=e.node.contents;if(2&o||s.buffer!==A.buffer){if((r>0||r+t<s.length)&&(s=s.subarray?s.subarray(r,r+t):Array.prototype.slice.call(s,r,r+t)),a=!0,!(i=Se(t)))throw new Te.ErrnoError(48);A.set(s,i)}else a=!1,i=s.byteOffset;return{ptr:i,allocated:a}},msync:(e,t,r,n,o)=>(ke.stream_ops.write(e,t,0,n,r,!1),0)}},xe=s.preloadPlugins||[];function Pe(e,t){var r=0;return e&&(r|=365),t&&(r|=146),r}var Te={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(e,t={})=>{if(!(e=ge.resolve(e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new Te.ErrnoError(32);for(var r=e.split("/").filter((e=>!!e)),n=Te.root,o="/",i=0;i<r.length;i++){var a=i===r.length-1;if(a&&t.parent)break;if(n=Te.lookupNode(n,r[i]),o=he.join2(o,r[i]),Te.isMountpoint(n)&&(!a||a&&t.follow_mount)&&(n=n.mounted.root),!a||t.follow)for(var s=0;Te.isLink(n.mode);){var u=Te.readlink(o);if(o=ge.resolve(he.dirname(o),u),n=Te.lookupPath(o,{recurse_count:t.recurse_count+1}).node,s++>40)throw new Te.ErrnoError(32)}}return{path:o,node:n}},getPath:e=>{for(var t;;){if(Te.isRoot(e)){var r=e.mount.mountpoint;return t?"/"!==r[r.length-1]?`${r}/${t}`:r+t:r}t=t?`${e.name}/${t}`:e.name,e=e.parent}},hashName:(e,t)=>{for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>0)%Te.nameTable.length},hashAddNode:e=>{var t=Te.hashName(e.parent.id,e.name);e.name_next=Te.nameTable[t],Te.nameTable[t]=e},hashRemoveNode:e=>{var t=Te.hashName(e.parent.id,e.name);if(Te.nameTable[t]===e)Te.nameTable[t]=e.name_next;else for(var r=Te.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode:(e,t)=>{var r=Te.mayLookup(e);if(r)throw new Te.ErrnoError(r,e);for(var n=Te.hashName(e.id,t),o=Te.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===t)return o}return Te.lookup(e,t)},createNode:(e,t,r,n)=>{var o=new Te.FSNode(e,t,r,n);return Te.hashAddNode(o),o},destroyNode:e=>{Te.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==(49152&e),flagsToPermissionString:e=>{var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:(e,t)=>Te.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2,mayLookup:e=>Te.nodePermissions(e,"x")||(e.node_ops.lookup?0:2),mayCreate:(e,t)=>{try{return Te.lookupNode(e,t),20}catch(e){}return Te.nodePermissions(e,"wx")},mayDelete:(e,t,r)=>{var n;try{n=Te.lookupNode(e,t)}catch(e){return e.errno}var o=Te.nodePermissions(e,"wx");if(o)return o;if(r){if(!Te.isDir(n.mode))return 54;if(Te.isRoot(n)||Te.getPath(n)===Te.cwd())return 10}else if(Te.isDir(n.mode))return 31;return 0},mayOpen:(e,t)=>e?Te.isLink(e.mode)?32:Te.isDir(e.mode)&&("r"!==Te.flagsToPermissionString(t)||512&t)?31:Te.nodePermissions(e,Te.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd:()=>{for(var e=0;e<=Te.MAX_OPEN_FDS;e++)if(!Te.streams[e])return e;throw new Te.ErrnoError(33)},getStreamChecked:e=>{var t=Te.getStream(e);if(!t)throw new Te.ErrnoError(8);return t},getStream:e=>Te.streams[e],createStream:(e,t=-1)=>(Te.FSStream||(Te.FSStream=function(){this.shared={}},Te.FSStream.prototype={},Object.defineProperties(Te.FSStream.prototype,{object:{get(){return this.node},set(e){this.node=e}},isRead:{get(){return 1!=(2097155&this.flags)}},isWrite:{get(){return 0!=(2097155&this.flags)}},isAppend:{get(){return 1024&this.flags}},flags:{get(){return this.shared.flags},set(e){this.shared.flags=e}},position:{get(){return this.shared.position},set(e){this.shared.position=e}}})),e=Object.assign(new Te.FSStream,e),-1==t&&(t=Te.nextfd()),e.fd=t,Te.streams[t]=e,e),closeStream:e=>{Te.streams[e]=null},chrdev_stream_ops:{open:e=>{var t=Te.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:()=>{throw new Te.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice:(e,t)=>{Te.devices[e]={stream_ops:t}},getDevice:e=>Te.devices[e],getMounts:e=>{for(var t=[],r=[e];r.length;){var n=r.pop();t.push(n),r.push.apply(r,n.mounts)}return t},syncfs:(e,t)=>{"function"==typeof e&&(t=e,e=!1),Te.syncFSRequests++,Te.syncFSRequests>1&&k(`warning: ${Te.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var r=Te.getMounts(Te.root.mount),n=0;function o(e){return Te.syncFSRequests--,t(e)}function i(e){if(e)return i.errored?void 0:(i.errored=!0,o(e));++n>=r.length&&o(null)}r.forEach((t=>{if(!t.type.syncfs)return i(null);t.type.syncfs(t,e,i)}))},mount:(e,t,r)=>{var n,o="/"===r,i=!r;if(o&&Te.root)throw new Te.ErrnoError(10);if(!o&&!i){var a=Te.lookupPath(r,{follow_mount:!1});if(r=a.path,n=a.node,Te.isMountpoint(n))throw new Te.ErrnoError(10);if(!Te.isDir(n.mode))throw new Te.ErrnoError(54)}var s={type:e,opts:t,mountpoint:r,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,o?Te.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:e=>{var t=Te.lookupPath(e,{follow_mount:!1});if(!Te.isMountpoint(t.node))throw new Te.ErrnoError(28);var r=t.node,n=r.mounted,o=Te.getMounts(n);Object.keys(Te.nameTable).forEach((e=>{for(var t=Te.nameTable[e];t;){var r=t.name_next;o.includes(t.mount)&&Te.destroyNode(t),t=r}})),r.mounted=null;var i=r.mount.mounts.indexOf(n);r.mount.mounts.splice(i,1)},lookup:(e,t)=>e.node_ops.lookup(e,t),mknod:(e,t,r)=>{var n=Te.lookupPath(e,{parent:!0}).node,o=he.basename(e);if(!o||"."===o||".."===o)throw new Te.ErrnoError(28);var i=Te.mayCreate(n,o);if(i)throw new Te.ErrnoError(i);if(!n.node_ops.mknod)throw new Te.ErrnoError(63);return n.node_ops.mknod(n,o,t,r)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,Te.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,Te.mknod(e,t,0)),mkdirTree:(e,t)=>{for(var r=e.split("/"),n="",o=0;o<r.length;++o)if(r[o]){n+="/"+r[o];try{Te.mkdir(n,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,r)=>(void 0===r&&(r=t,t=438),t|=8192,Te.mknod(e,t,r)),symlink:(e,t)=>{if(!ge.resolve(e))throw new Te.ErrnoError(44);var r=Te.lookupPath(t,{parent:!0}).node;if(!r)throw new Te.ErrnoError(44);var n=he.basename(t),o=Te.mayCreate(r,n);if(o)throw new Te.ErrnoError(o);if(!r.node_ops.symlink)throw new Te.ErrnoError(63);return r.node_ops.symlink(r,n,e)},rename:(e,t)=>{var r,n,o=he.dirname(e),i=he.dirname(t),a=he.basename(e),s=he.basename(t);if(r=Te.lookupPath(e,{parent:!0}).node,n=Te.lookupPath(t,{parent:!0}).node,!r||!n)throw new Te.ErrnoError(44);if(r.mount!==n.mount)throw new Te.ErrnoError(75);var u,l=Te.lookupNode(r,a),c=ge.relative(e,i);if("."!==c.charAt(0))throw new Te.ErrnoError(28);if("."!==(c=ge.relative(t,o)).charAt(0))throw new Te.ErrnoError(55);try{u=Te.lookupNode(n,s)}catch(e){}if(l!==u){var d=Te.isDir(l.mode),f=Te.mayDelete(r,a,d);if(f)throw new Te.ErrnoError(f);if(f=u?Te.mayDelete(n,s,d):Te.mayCreate(n,s))throw new Te.ErrnoError(f);if(!r.node_ops.rename)throw new Te.ErrnoError(63);if(Te.isMountpoint(l)||u&&Te.isMountpoint(u))throw new Te.ErrnoError(10);if(n!==r&&(f=Te.nodePermissions(r,"w")))throw new Te.ErrnoError(f);Te.hashRemoveNode(l);try{r.node_ops.rename(l,n,s)}catch(e){throw e}finally{Te.hashAddNode(l)}}},rmdir:e=>{var t=Te.lookupPath(e,{parent:!0}).node,r=he.basename(e),n=Te.lookupNode(t,r),o=Te.mayDelete(t,r,!0);if(o)throw new Te.ErrnoError(o);if(!t.node_ops.rmdir)throw new Te.ErrnoError(63);if(Te.isMountpoint(n))throw new Te.ErrnoError(10);t.node_ops.rmdir(t,r),Te.destroyNode(n)},readdir:e=>{var t=Te.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new Te.ErrnoError(54);return t.node_ops.readdir(t)},unlink:e=>{var t=Te.lookupPath(e,{parent:!0}).node;if(!t)throw new Te.ErrnoError(44);var r=he.basename(e),n=Te.lookupNode(t,r),o=Te.mayDelete(t,r,!1);if(o)throw new Te.ErrnoError(o);if(!t.node_ops.unlink)throw new Te.ErrnoError(63);if(Te.isMountpoint(n))throw new Te.ErrnoError(10);t.node_ops.unlink(t,r),Te.destroyNode(n)},readlink:e=>{var t=Te.lookupPath(e).node;if(!t)throw new Te.ErrnoError(44);if(!t.node_ops.readlink)throw new Te.ErrnoError(28);return ge.resolve(Te.getPath(t.parent),t.node_ops.readlink(t))},stat:(e,t)=>{var r=Te.lookupPath(e,{follow:!t}).node;if(!r)throw new Te.ErrnoError(44);if(!r.node_ops.getattr)throw new Te.ErrnoError(63);return r.node_ops.getattr(r)},lstat:e=>Te.stat(e,!0),chmod:(e,t,r)=>{var n;if(!(n="string"==typeof e?Te.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new Te.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod:(e,t)=>{Te.chmod(e,t,!0)},fchmod:(e,t)=>{var r=Te.getStreamChecked(e);Te.chmod(r.node,t)},chown:(e,t,r,n)=>{var o;if(!(o="string"==typeof e?Te.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new Te.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(e,t,r)=>{Te.chown(e,t,r,!0)},fchown:(e,t,r)=>{var n=Te.getStreamChecked(e);Te.chown(n.node,t,r)},truncate:(e,t)=>{if(t<0)throw new Te.ErrnoError(28);var r;if(!(r="string"==typeof e?Te.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new Te.ErrnoError(63);if(Te.isDir(r.mode))throw new Te.ErrnoError(31);if(!Te.isFile(r.mode))throw new Te.ErrnoError(28);var n=Te.nodePermissions(r,"w");if(n)throw new Te.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate:(e,t)=>{var r=Te.getStreamChecked(e);if(0==(2097155&r.flags))throw new Te.ErrnoError(28);Te.truncate(r.node,t)},utime:(e,t,r)=>{var n=Te.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open:(e,t,r)=>{if(""===e)throw new Te.ErrnoError(44);var n;if(r=void 0===r?438:r,r=64&(t="string"==typeof t?function(e){var t={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===t)throw new Error(`Unknown file open mode: ${e}`);return t}(t):t)?4095&r|32768:0,"object"==typeof e)n=e;else{e=he.normalize(e);try{n=Te.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var o=!1;if(64&t)if(n){if(128&t)throw new Te.ErrnoError(20)}else n=Te.mknod(e,r,0),o=!0;if(!n)throw new Te.ErrnoError(44);if(Te.isChrdev(n.mode)&&(t&=-513),65536&t&&!Te.isDir(n.mode))throw new Te.ErrnoError(54);if(!o){var i=Te.mayOpen(n,t);if(i)throw new Te.ErrnoError(i)}512&t&&!o&&Te.truncate(n,0),t&=-131713;var a=Te.createStream({node:n,path:Te.getPath(n),flags:t,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return a.stream_ops.open&&a.stream_ops.open(a),!s.logReadFiles||1&t||(Te.readFiles||(Te.readFiles={}),e in Te.readFiles||(Te.readFiles[e]=1)),a},close:e=>{if(Te.isClosed(e))throw new Te.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{Te.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek:(e,t,r)=>{if(Te.isClosed(e))throw new Te.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new Te.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new Te.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read:(e,t,r,n,o)=>{if(n<0||o<0)throw new Te.ErrnoError(28);if(Te.isClosed(e))throw new Te.ErrnoError(8);if(1==(2097155&e.flags))throw new Te.ErrnoError(8);if(Te.isDir(e.node.mode))throw new Te.ErrnoError(31);if(!e.stream_ops.read)throw new Te.ErrnoError(28);var i=void 0!==o;if(i){if(!e.seekable)throw new Te.ErrnoError(70)}else o=e.position;var a=e.stream_ops.read(e,t,r,n,o);return i||(e.position+=a),a},write:(e,t,r,n,o,i)=>{if(n<0||o<0)throw new Te.ErrnoError(28);if(Te.isClosed(e))throw new Te.ErrnoError(8);if(0==(2097155&e.flags))throw new Te.ErrnoError(8);if(Te.isDir(e.node.mode))throw new Te.ErrnoError(31);if(!e.stream_ops.write)throw new Te.ErrnoError(28);e.seekable&&1024&e.flags&&Te.llseek(e,0,2);var a=void 0!==o;if(a){if(!e.seekable)throw new Te.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,t,r,n,o,i);return a||(e.position+=s),s},allocate:(e,t,r)=>{if(Te.isClosed(e))throw new Te.ErrnoError(8);if(t<0||r<=0)throw new Te.ErrnoError(28);if(0==(2097155&e.flags))throw new Te.ErrnoError(8);if(!Te.isFile(e.node.mode)&&!Te.isDir(e.node.mode))throw new Te.ErrnoError(43);if(!e.stream_ops.allocate)throw new Te.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap:(e,t,r,n,o)=>{if(0!=(2&n)&&0==(2&o)&&2!=(2097155&e.flags))throw new Te.ErrnoError(2);if(1==(2097155&e.flags))throw new Te.ErrnoError(2);if(!e.stream_ops.mmap)throw new Te.ErrnoError(43);return e.stream_ops.mmap(e,t,r,n,o)},msync:(e,t,r,n,o)=>e.stream_ops.msync?e.stream_ops.msync(e,t,r,n,o):0,munmap:e=>0,ioctl:(e,t,r)=>{if(!e.stream_ops.ioctl)throw new Te.ErrnoError(59);return e.stream_ops.ioctl(e,t,r)},readFile:(e,t={})=>{if(t.flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error(`Invalid encoding type "${t.encoding}"`);var r,n=Te.open(e,t.flags),o=Te.stat(e).size,i=new Uint8Array(o);return Te.read(n,i,0,o,0),"utf8"===t.encoding?r=ve(i,0):"binary"===t.encoding&&(r=i),Te.close(n),r},writeFile:(e,t,r={})=>{r.flags=r.flags||577;var n=Te.open(e,r.flags,r.mode);if("string"==typeof t){var o=new Uint8Array(we(t)+1),i=Ee(t,o,0,o.length);Te.write(n,o,0,i,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");Te.write(n,t,0,t.byteLength,void 0,r.canOwn)}Te.close(n)},cwd:()=>Te.currentPath,chdir:e=>{var t=Te.lookupPath(e,{follow:!0});if(null===t.node)throw new Te.ErrnoError(44);if(!Te.isDir(t.node.mode))throw new Te.ErrnoError(54);var r=Te.nodePermissions(t.node,"x");if(r)throw new Te.ErrnoError(r);Te.currentPath=t.path},createDefaultDirectories:()=>{Te.mkdir("/tmp"),Te.mkdir("/home"),Te.mkdir("/home/web_user")},createDefaultDevices:()=>{Te.mkdir("/dev"),Te.registerDevice(Te.makedev(1,3),{read:()=>0,write:(e,t,r,n,o)=>n}),Te.mkdev("/dev/null",Te.makedev(1,3)),Ce.register(Te.makedev(5,0),Ce.default_tty_ops),Ce.register(Te.makedev(6,0),Ce.default_tty1_ops),Te.mkdev("/dev/tty",Te.makedev(5,0)),Te.mkdev("/dev/tty1",Te.makedev(6,0));var e=new Uint8Array(1024),t=0,r=()=>(0===t&&(t=me(e).byteLength),e[--t]);Te.createDevice("/dev","random",r),Te.createDevice("/dev","urandom",r),Te.mkdir("/dev/shm"),Te.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{Te.mkdir("/proc");var e=Te.mkdir("/proc/self");Te.mkdir("/proc/self/fd"),Te.mount({mount:()=>{var t=Te.createNode(e,"fd",16895,73);return t.node_ops={lookup:(e,t)=>{var r=+t,n=Te.getStreamChecked(r),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},t}},{},"/proc/self/fd")},createStandardStreams:()=>{s.stdin?Te.createDevice("/dev","stdin",s.stdin):Te.symlink("/dev/tty","/dev/stdin"),s.stdout?Te.createDevice("/dev","stdout",null,s.stdout):Te.symlink("/dev/tty","/dev/stdout"),s.stderr?Te.createDevice("/dev","stderr",null,s.stderr):Te.symlink("/dev/tty1","/dev/stderr"),Te.open("/dev/stdin",0),Te.open("/dev/stdout",1),Te.open("/dev/stderr",1)},ensureErrnoError:()=>{Te.ErrnoError||(Te.ErrnoError=function(e,t){this.name="ErrnoError",this.node=t,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},Te.ErrnoError.prototype=new Error,Te.ErrnoError.prototype.constructor=Te.ErrnoError,[44].forEach((e=>{Te.genericErrors[e]=new Te.ErrnoError(e),Te.genericErrors[e].stack="<generic error, no stack>"})))},staticInit:()=>{Te.ensureErrnoError(),Te.nameTable=new Array(4096),Te.mount(ke,{},"/"),Te.createDefaultDirectories(),Te.createDefaultDevices(),Te.createSpecialDirectories(),Te.filesystems={MEMFS:ke}},init:(e,t,r)=>{Te.init.initialized=!0,Te.ensureErrnoError(),s.stdin=e||s.stdin,s.stdout=t||s.stdout,s.stderr=r||s.stderr,Te.createStandardStreams()},quit:()=>{Te.init.initialized=!1;for(var e=0;e<Te.streams.length;e++){var t=Te.streams[e];t&&Te.close(t)}},findObject:(e,t)=>{var r=Te.analyzePath(e,t);return r.exists?r.object:null},analyzePath:(e,t)=>{try{e=(n=Te.lookupPath(e,{follow:!t})).path}catch(e){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=Te.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=he.basename(e),n=Te.lookupPath(e,{follow:!t}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot="/"===n.path}catch(e){r.error=e.errno}return r},createPath:(e,t,r,n)=>{e="string"==typeof e?e:Te.getPath(e);for(var o=t.split("/").reverse();o.length;){var i=o.pop();if(i){var a=he.join2(e,i);try{Te.mkdir(a)}catch(e){}e=a}}return a},createFile:(e,t,r,n,o)=>{var i=he.join2("string"==typeof e?e:Te.getPath(e),t),a=Pe(n,o);return Te.create(i,a)},createDataFile:(e,t,r,n,o,i)=>{var a=t;e&&(e="string"==typeof e?e:Te.getPath(e),a=t?he.join2(e,t):e);var s=Pe(n,o),u=Te.create(a,s);if(r){if("string"==typeof r){for(var l=new Array(r.length),c=0,d=r.length;c<d;++c)l[c]=r.charCodeAt(c);r=l}Te.chmod(u,146|s);var f=Te.open(u,577);Te.write(f,r,0,r.length,0,i),Te.close(f),Te.chmod(u,s)}return u},createDevice:(e,t,r,n)=>{var o=he.join2("string"==typeof e?e:Te.getPath(e),t),i=Pe(!!r,!!n);Te.createDevice.major||(Te.createDevice.major=64);var a=Te.makedev(Te.createDevice.major++,0);return Te.registerDevice(a,{open:e=>{e.seekable=!1},close:e=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(e,t,n,o,i)=>{for(var a=0,s=0;s<o;s++){var u;try{u=r()}catch(e){throw new Te.ErrnoError(29)}if(void 0===u&&0===a)throw new Te.ErrnoError(6);if(null==u)break;a++,t[n+s]=u}return a&&(e.node.timestamp=Date.now()),a},write:(e,t,r,o,i)=>{for(var a=0;a<o;a++)try{n(t[r+a])}catch(e){throw new Te.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),a}}),Te.mkdev(o,i,a)},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.");if(!d)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=_e(d(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new Te.ErrnoError(29)}},createLazyFile:(e,t,r,n,o)=>{function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,r=e/this.chunkSize|0;return this.getter(r)[t]}},i.prototype.setDataGetter=function(e){this.getter=e},i.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",r,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+r+". Status: "+e.status);var t,n=Number(e.getResponseHeader("Content-length")),o=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,i=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,a=1048576;o||(a=n);var s=this;s.setDataGetter((e=>{var t=e*a,o=(e+1)*a-1;if(o=Math.min(o,n-1),void 0===s.chunks[e]&&(s.chunks[e]=((e,t)=>{if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",r,!1),n!==a&&o.setRequestHeader("Range","bytes="+e+"-"+t),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+r+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):_e(o.responseText||"",!0)})(t,o)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!i&&n||(a=n=1,n=this.getter(0).length,a=n,S("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!v)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a=new i;Object.defineProperties(a,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:a}}else s={isDevice:!1,url:r};var u=Te.createFile(e,t,s,n,o);s.contents?u.contents=s.contents:s.url&&(u.contents=null,u.url=s.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var l={};function c(e,t,r,n,o){var i=e.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,n);if(i.slice)for(var s=0;s<a;s++)t[r+s]=i[o+s];else for(s=0;s<a;s++)t[r+s]=i.get(o+s);return a}return Object.keys(u.stream_ops).forEach((e=>{var t=u.stream_ops[e];l[e]=function(){return Te.forceLoadFile(u),t.apply(null,arguments)}})),l.read=(e,t,r,n,o)=>(Te.forceLoadFile(u),c(e,t,r,n,o)),l.mmap=(e,t,r,n,o)=>{Te.forceLoadFile(u);var i=Se(t);if(!i)throw new Te.ErrnoError(48);return c(e,A,i,t,r),{ptr:i,allocated:!0}},u.stream_ops=l,u}},Fe=(e,t)=>e?ve(D,e,t):"",Ae={DEFAULT_POLLMASK:5,calculateAt:function(e,t,r){if(he.isAbs(t))return t;var n;if(n=-100===e?Te.cwd():Ae.getStreamFromFD(e).path,0==t.length){if(!r)throw new Te.ErrnoError(44);return n}return he.join2(n,t)},doStat:function(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&he.normalize(t)!==he.normalize(Te.getPath(e.node)))return-54;throw e}R[r>>2]=n.dev,R[r+4>>2]=n.mode,M[r+8>>2]=n.nlink,R[r+12>>2]=n.uid,R[r+16>>2]=n.gid,R[r+20>>2]=n.rdev,I[r+24>>3]=BigInt(n.size),R[r+32>>2]=4096,R[r+36>>2]=n.blocks;var o=n.atime.getTime(),i=n.mtime.getTime(),a=n.ctime.getTime();return I[r+40>>3]=BigInt(Math.floor(o/1e3)),M[r+48>>2]=o%1e3*1e3,I[r+56>>3]=BigInt(Math.floor(i/1e3)),M[r+64>>2]=i%1e3*1e3,I[r+72>>3]=BigInt(Math.floor(a/1e3)),M[r+80>>2]=a%1e3*1e3,I[r+88>>3]=BigInt(n.ino),0},doMsync:function(e,t,r,n,o){if(!Te.isFile(t.node.mode))throw new Te.ErrnoError(43);if(2&n)return 0;var i=D.slice(e,e+r);Te.msync(t,i,o,r,n)},varargs:void 0,get:()=>(Ae.varargs+=4,R[Ae.varargs-4>>2]),getStr:e=>Fe(e),getStreamFromFD:function(e){return Te.getStreamChecked(e)}},De={};function Be(e){for(;e.length;){var t=e.pop();e.pop()(t)}}function Le(e){return this.fromWireType(R[e>>2])}var Re={},Me={},Oe={},Ie=void 0;function Ue(e){throw new Ie(e)}function $e(e,t,r){function n(t){var n=r(t);n.length!==e.length&&Ue("Mismatched type converter count");for(var o=0;o<e.length;++o)Ge(e[o],n[o])}e.forEach((function(e){Oe[e]=t}));var o=new Array(t.length),i=[],a=0;t.forEach(((e,t)=>{Me.hasOwnProperty(e)?o[t]=Me[e]:(i.push(e),Re.hasOwnProperty(e)||(Re[e]=[]),Re[e].push((()=>{o[t]=Me[e],++a===i.length&&n(o)})))})),0===i.length&&n(o)}var je={};function qe(e){if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e}var Ne=void 0;function He(e){for(var t="",r=e;D[r];)t+=Ne[D[r++]];return t}var Ve=void 0;function We(e){throw new Ve(e)}function Ge(e,t,r={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(e,t,r={}){var n=t.name;if(e||We(`type "${n}" must have a positive integer typeid pointer`),Me.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;We(`Cannot register type '${n}' twice`)}if(Me[e]=t,delete Oe[e],Re.hasOwnProperty(e)){var o=Re[e];delete Re[e],o.forEach((e=>e()))}}(e,t,r)}function ze(e,t,r){switch(t){case 0:return r?function(e){return A[e]}:function(e){return D[e]};case 1:return r?function(e){return B[e>>1]}:function(e){return L[e>>1]};case 2:return r?function(e){return R[e>>2]}:function(e){return M[e>>2]};case 3:return r?function(e){return I[e>>3]}:function(e){return U[e>>3]};default:throw new TypeError("Unknown integer type: "+e)}}function Ye(e){switch(e){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError(`Unknown type size: ${e}`)}}function Xe(e){We(e.$$.ptrType.registeredClass.name+" instance already deleted")}var Ke=!1;function Qe(e){}function Ze(e){e.count.value-=1,0===e.count.value&&function(e){e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)}(e)}function Je(e,t,r){if(t===r)return e;if(void 0===r.baseClass)return null;var n=Je(e,t,r.baseClass);return null===n?null:r.downcast(n)}var et={};var tt=[];function rt(){for(;tt.length;){var e=tt.pop();e.$$.deleteScheduled=!1,e.delete()}}var nt=void 0;var ot={};function it(e,t){return t.ptrType&&t.ptr||Ue("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&Ue("Both smartPtrType and smartPtr must be specified"),t.count={value:1},at(Object.create(e,{$$:{value:t}}))}var at=function(e){return"undefined"==typeof FinalizationRegistry?(at=e=>e,e):(Ke=new FinalizationRegistry((e=>{Ze(e.$$)})),at=e=>{var t=e.$$;if(t.smartPtr){var r={$$:t};Ke.register(e,r,e)}return e},Qe=e=>Ke.unregister(e),at(e))};function st(){}function ut(e){if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=48&&t<=57?`_${e}`:e}function lt(e,t){return{[e=ut(e)]:function(){return t.apply(this,arguments)}}[e]}function ct(e,t,r){if(void 0===e[t].overloadTable){var n=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||We(`Function '${r}' called with an invalid number of arguments (${arguments.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[arguments.length].apply(this,arguments)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}}function dt(e,t,r){s.hasOwnProperty(e)?((void 0===r||void 0!==s[e].overloadTable&&void 0!==s[e].overloadTable[r])&&We(`Cannot register public name '${e}' twice`),ct(s,e,e),s.hasOwnProperty(r)&&We(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),s[e].overloadTable[r]=t):(s[e]=t,void 0!==r&&(s[e].numArguments=r))}function ft(e,t,r,n,o,i,a,s){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=o,this.getActualType=i,this.upcast=a,this.downcast=s,this.pureVirtualFunctions=[]}function pt(e,t,r){for(;t!==r;)t.upcast||We(`Expected null or instance of ${r.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e}function ht(e,t){if(null===t)return this.isReference&&We(`null is not a valid ${this.name}`),0;t.$$||We(`Cannot pass "${qe(t)}" as a ${this.name}`),t.$$.ptr||We(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=t.$$.ptrType.registeredClass;return pt(t.$$.ptr,r,this.registeredClass)}function mt(e,t){var r;if(null===t)return this.isReference&&We(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,r),r):0;t.$$||We(`Cannot pass "${qe(t)}" as a ${this.name}`),t.$$.ptr||We(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&We(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);var n=t.$$.ptrType.registeredClass;if(r=pt(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&We("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:We(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:r=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)r=t.$$.smartPtr;else{var o=t.clone();r=this.rawShare(r,Dt.toHandle((function(){o.delete()}))),null!==e&&e.push(this.rawDestructor,r)}break;default:We("Unsupporting sharing policy")}return r}function gt(e,t){if(null===t)return this.isReference&&We(`null is not a valid ${this.name}`),0;t.$$||We(`Cannot pass "${qe(t)}" as a ${this.name}`),t.$$.ptr||We(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&We(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass;return pt(t.$$.ptr,r,this.registeredClass)}function yt(e,t,r,n,o,i,a,s,u,l,c){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=o,this.pointeeType=i,this.sharingPolicy=a,this.rawGetPointee=s,this.rawConstructor=u,this.rawShare=l,this.rawDestructor=c,o||void 0!==t.baseClass?this.toWireType=mt:n?(this.toWireType=ht,this.destructorFunction=null):(this.toWireType=gt,this.destructorFunction=null)}function vt(e,t,r){s.hasOwnProperty(e)||Ue("Replacing nonexistant public symbol"),void 0!==s[e].overloadTable&&void 0!==r?s[e].overloadTable[r]=t:(s[e]=t,s[e].argCount=r)}var bt=[],wt=e=>{var t=bt[e];return t||(e>=bt.length&&(bt.length=e+1),bt[e]=t=j.get(e)),t};function Et(e,t){e=He(e);var r=wt(t);return"function"!=typeof r&&We(`unknown function pointer with signature ${e}: ${t}`),r}var _t=void 0;function Ct(e){var t=Jn(e),r=He(t);return Yn(t),r}function St(e,t){var r=[],n={};throw t.forEach((function e(t){n[t]||Me[t]||(Oe[t]?Oe[t].forEach(e):(r.push(t),n[t]=!0))})),new _t(`${e}: `+r.map(Ct).join([", "]))}function kt(e,t){for(var r=[],n=0;n<e;n++)r.push(M[t+4*n>>2]);return r}function xt(e,t){if(!(e instanceof Function))throw new TypeError(`new_ called with constructor type ${typeof e} which is not a function`);var r=lt(e.name||"unknownFunctionName",(function(){}));r.prototype=e.prototype;var n=new r,o=e.apply(n,t);return o instanceof Object?o:n}function Pt(e,t,r,n,o,i){var a=t.length;a<2&&We("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var s=null!==t[1]&&null!==r,u=!1,l=1;l<t.length;++l)if(null!==t[l]&&void 0===t[l].destructorFunction){u=!0;break}var c="void"!==t[0].name,d="",f="";for(l=0;l<a-2;++l)d+=(0!==l?", ":"")+"arg"+l,f+=(0!==l?", ":"")+"arg"+l+"Wired";var p=`\n return function ${ut(e)}(${d}) {\n if (arguments.length !== ${a-2}) {\n throwBindingError('function ${e} called with ${arguments.length} arguments, expected ${a-2} args!');\n }`;u&&(p+="var destructors = [];\n");var h=u?"destructors":"null",m=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],g=[We,n,o,Be,t[0],t[1]];for(s&&(p+="var thisWired = classParam.toWireType("+h+", this);\n"),l=0;l<a-2;++l)p+="var arg"+l+"Wired = argType"+l+".toWireType("+h+", arg"+l+"); // "+t[l+2].name+"\n",m.push("argType"+l),g.push(t[l+2]);if(s&&(f="thisWired"+(f.length>0?", ":"")+f),p+=(c||i?"var rv = ":"")+"invoker(fn"+(f.length>0?", ":"")+f+");\n",u)p+="runDestructors(destructors);\n";else for(l=s?1:2;l<t.length;++l){var y=1===l?"thisWired":"arg"+(l-2)+"Wired";null!==t[l].destructorFunction&&(p+=y+"_dtor("+y+"); // "+t[l].name+"\n",m.push(y+"_dtor"),g.push(t[l].destructorFunction))}return c&&(p+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),p+="}\n",m.push(p),xt(Function,m).apply(null,g)}function Tt(){this.allocated=[void 0],this.freelist=[]}var Ft=new Tt;function At(e){e>=Ft.reserved&&0==--Ft.get(e).refcount&&Ft.free(e)}var Dt={toValue:e=>(e||We("Cannot use deleted val. handle = "+e),Ft.get(e).value),toHandle:e=>{switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return Ft.allocate({refcount:1,value:e})}}};function Bt(e,t,r){switch(t){case 0:return function(e){var t=r?A:D;return this.fromWireType(t[e])};case 1:return function(e){var t=r?B:L;return this.fromWireType(t[e>>1])};case 2:return function(e){var t=r?R:M;return this.fromWireType(t[e>>2])};default:throw new TypeError("Unknown integer type: "+e)}}function Lt(e,t){var r=Me[e];return void 0===r&&We(t+" has unknown type "+Ct(e)),r}function Rt(e,t){switch(t){case 2:return function(e){return this.fromWireType(O[e>>2])};case 3:return function(e){return this.fromWireType($[e>>3])};default:throw new TypeError("Unknown float type: "+e)}}var Mt=(e,t,r)=>Ee(e,D,t,r),Ot="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,It=(e,t)=>{for(var r=e,n=r>>1,o=n+t/2;!(n>=o)&&L[n];)++n;if((r=n<<1)-e>32&&Ot)return Ot.decode(D.subarray(e,r));for(var i="",a=0;!(a>=t/2);++a){var s=B[e+2*a>>1];if(0==s)break;i+=String.fromCharCode(s)}return i},Ut=(e,t,r)=>{if(void 0===r&&(r=2147483647),r<2)return 0;for(var n=t,o=(r-=2)<2*e.length?r/2:e.length,i=0;i<o;++i){var a=e.charCodeAt(i);B[t>>1]=a,t+=2}return B[t>>1]=0,t-n},$t=e=>2*e.length,jt=(e,t)=>{for(var r=0,n="";!(r>=t/4);){var o=R[e+4*r>>2];if(0==o)break;if(++r,o>=65536){var i=o-65536;n+=String.fromCharCode(55296|i>>10,56320|1023&i)}else n+=String.fromCharCode(o)}return n},qt=(e,t,r)=>{if(void 0===r&&(r=2147483647),r<4)return 0;for(var n=t,o=n+r-4,i=0;i<e.length;++i){var a=e.charCodeAt(i);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++i)),R[t>>2]=a,(t+=4)+4>o)break}return R[t>>2]=0,t-n},Nt=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&++r,t+=4}return t};function Ht(e,t){for(var r=new Array(e),n=0;n<e;++n)r[n]=Lt(M[t+4*n>>2],"parameter "+n);return r}var Vt={};function Wt(e){var t=Vt[e];return void 0===t?He(e):t}var Gt=[];function zt(){return"object"==typeof globalThis?globalThis:Function("return this")()}var Yt=[],Xt={};function Kt(e){return e<-9007199254740992||e>9007199254740992?NaN:Number(e)}var Qt,Zt=e=>e%4==0&&(e%100!=0||e%400==0),Jt=[0,31,60,91,121,152,182,213,244,274,305,335],er=[0,31,59,90,120,151,181,212,243,273,304,334],tr=e=>(Zt(e.getFullYear())?Jt:er)[e.getMonth()]+e.getDate()-1,rr=e=>{var t=we(e)+1,r=zn(t);return r&&Mt(e,r,t),r};function nr(e,t){if(ur.mainLoop.timingMode=e,ur.mainLoop.timingValue=t,!ur.mainLoop.func)return 1;if(ur.mainLoop.running||(ur.mainLoop.running=!0),0==e)ur.mainLoop.scheduler=function(){var e=0|Math.max(0,ur.mainLoop.tickStartTime+t-Qt());setTimeout(ur.mainLoop.runner,e)},ur.mainLoop.method="timeout";else if(1==e)ur.mainLoop.scheduler=function(){ur.requestAnimationFrame(ur.mainLoop.runner)},ur.mainLoop.method="rAF";else if(2==e){if("undefined"==typeof setImmediate){var r=[],n="setimmediate";addEventListener("message",(e=>{e.data!==n&&e.data.target!==n||(e.stopPropagation(),r.shift()())}),!0),setImmediate=function(e){r.push(e),v?(void 0===s.setImmediates&&(s.setImmediates=[]),s.setImmediates.push(e),postMessage({target:n})):postMessage(n,"*")}}ur.mainLoop.scheduler=function(){setImmediate(ur.mainLoop.runner)},ur.mainLoop.method="immediate"}return 0}Qt=()=>performance.now();var or=e=>{if(e instanceof ue||"unwind"==e)return F;g(1,e)},ir=(e,t)=>{var r;F=e,F=r=e,Y()||(s.onExit&&s.onExit(r),q=!0),g(r,new ue(r))},ar=e=>{if(!q)try{e(),(()=>{if(!Y())try{ir(F)}catch(e){or(e)}})()}catch(e){or(e)}},sr=(e,t)=>setTimeout((()=>{ar(e)}),t),ur={mainLoop:{running:!1,scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function(){ur.mainLoop.scheduler=null,ur.mainLoop.currentlyRunningMainloop++},resume:function(){ur.mainLoop.currentlyRunningMainloop++;var e=ur.mainLoop.timingMode,t=ur.mainLoop.timingValue,r=ur.mainLoop.func;ur.mainLoop.func=null,function(e,t,r,n,o){N(!ur.mainLoop.func,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),ur.mainLoop.func=e,ur.mainLoop.arg=n;var i=ur.mainLoop.currentlyRunningMainloop;function a(){return!(i<ur.mainLoop.currentlyRunningMainloop)}ur.mainLoop.running=!1,ur.mainLoop.runner=function(){if(!q)if(ur.mainLoop.queue.length>0){var t=Date.now(),r=ur.mainLoop.queue.shift();if(r.func(r.arg),ur.mainLoop.remainingBlockers){var n=ur.mainLoop.remainingBlockers,o=n%1==0?n-1:Math.floor(n);r.counted?ur.mainLoop.remainingBlockers=o:(o+=.5,ur.mainLoop.remainingBlockers=(8*n+o)/9)}if(S('main loop blocker "'+r.name+'" took '+(Date.now()-t)+" ms"),ur.mainLoop.updateStatus(),!a())return;setTimeout(ur.mainLoop.runner,0)}else a()&&(ur.mainLoop.currentFrameNumber=ur.mainLoop.currentFrameNumber+1|0,1==ur.mainLoop.timingMode&&ur.mainLoop.timingValue>1&&ur.mainLoop.currentFrameNumber%ur.mainLoop.timingValue!=0?ur.mainLoop.scheduler():(0==ur.mainLoop.timingMode&&(ur.mainLoop.tickStartTime=Qt()),ur.mainLoop.runIter(e),a()&&("object"==typeof SDL&&SDL.audio&&SDL.audio.queueNewAudioData&&SDL.audio.queueNewAudioData(),ur.mainLoop.scheduler())))}}(r,0,0,ur.mainLoop.arg),nr(e,t),ur.mainLoop.scheduler()},updateStatus:function(){if(s.setStatus){var e=s.statusMessage||"Please wait...",t=ur.mainLoop.remainingBlockers,r=ur.mainLoop.expectedBlockers;t?t<r?s.setStatus(e+" ("+(r-t)+"/"+r+")"):s.setStatus(e):s.setStatus("")}},runIter:function(e){if(!q){if(s.preMainLoop&&!1===s.preMainLoop())return;ar(e),s.postMainLoop&&s.postMainLoop()}}},isFullscreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init:function(){if(!ur.initted){ur.initted=!0;var e={canHandle:function(e){return!s.noImageDecoding&&/\.(jpg|jpeg|png|bmp)$/i.test(e)},handle:function(e,t,r,n){var o=new Blob([e],{type:ur.getMimetype(t)});o.size!==e.length&&(o=new Blob([new Uint8Array(e).buffer],{type:ur.getMimetype(t)}));var i=URL.createObjectURL(o),a=new Image;a.onload=()=>{N(a.complete,"Image "+t+" could not be decoded");var n=document.createElement("canvas");n.width=a.width,n.height=a.height,n.getContext("2d").drawImage(a,0,0),jn[t]=n,URL.revokeObjectURL(i),r&&r(e)},a.onerror=e=>{S("Image "+i+" could not be decoded"),n&&n()},a.src=i}};xe.push(e);var t={canHandle:function(e){return!s.noAudioDecoding&&e.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},handle:function(e,t,r,n){var o=!1;function i(n){o||(o=!0,qn[t]=n,r&&r(e))}var a=new Blob([e],{type:ur.getMimetype(t)}),s=URL.createObjectURL(a),u=new Audio;u.addEventListener("canplaythrough",(()=>i(u)),!1),u.onerror=function(r){o||(k("warning: browser could not fully decode audio "+t+", trying slower base64 approach"),u.src="data:audio/x-"+t.substr(-3)+";base64,"+function(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r="",n=0,o=0,i=0;i<e.length;i++)for(n=n<<8|e[i],o+=8;o>=6;){var a=n>>o-6&63;o-=6,r+=t[a]}return 2==o?(r+=t[(3&n)<<4],r+="=="):4==o&&(r+=t[(15&n)<<2],r+="="),r}(e),i(u))},u.src=s,sr((()=>{i(u)}),1e4)}};xe.push(t);var r=s.canvas;r&&(r.requestPointerLock=r.requestPointerLock||r.mozRequestPointerLock||r.webkitRequestPointerLock||r.msRequestPointerLock||(()=>{}),r.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||(()=>{}),r.exitPointerLock=r.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",n,!1),document.addEventListener("mozpointerlockchange",n,!1),document.addEventListener("webkitpointerlockchange",n,!1),document.addEventListener("mspointerlockchange",n,!1),s.elementPointerLock&&r.addEventListener("click",(e=>{!ur.pointerLock&&s.canvas.requestPointerLock&&(s.canvas.requestPointerLock(),e.preventDefault())}),!1))}function n(){ur.pointerLock=document.pointerLockElement===s.canvas||document.mozPointerLockElement===s.canvas||document.webkitPointerLockElement===s.canvas||document.msPointerLockElement===s.canvas}},createContext:function(e,t,r,n){if(t&&s.ctx&&e==s.canvas)return s.ctx;var o,i;if(t){var a={antialias:!1,alpha:!1,majorVersion:"undefined"!=typeof WebGL2RenderingContext?2:1};if(n)for(var u in n)a[u]=n[u];void 0!==gr&&(i=gr.createContext(e,a))&&(o=gr.getContext(i).GLctx)}else o=e.getContext("2d");return o?(r&&(t||N(void 0===$n,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),s.ctx=o,t&&gr.makeContextCurrent(i),s.useWebGL=t,ur.moduleContextCreatedCallbacks.forEach((e=>e())),ur.init()),o):null},destroyContext:function(e,t,r){},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen:function(e,t){ur.lockPointer=e,ur.resizeCanvas=t,void 0===ur.lockPointer&&(ur.lockPointer=!0),void 0===ur.resizeCanvas&&(ur.resizeCanvas=!1);var r=s.canvas;function n(){ur.isFullscreen=!1;var e=r.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e?(r.exitFullscreen=ur.exitFullscreen,ur.lockPointer&&r.requestPointerLock(),ur.isFullscreen=!0,ur.resizeCanvas?ur.setFullscreenCanvasSize():ur.updateCanvasDimensions(r)):(e.parentNode.insertBefore(r,e),e.parentNode.removeChild(e),ur.resizeCanvas?ur.setWindowedCanvasSize():ur.updateCanvasDimensions(r)),s.onFullScreen&&s.onFullScreen(ur.isFullscreen),s.onFullscreen&&s.onFullscreen(ur.isFullscreen)}ur.fullscreenHandlersInstalled||(ur.fullscreenHandlersInstalled=!0,document.addEventListener("fullscreenchange",n,!1),document.addEventListener("mozfullscreenchange",n,!1),document.addEventListener("webkitfullscreenchange",n,!1),document.addEventListener("MSFullscreenChange",n,!1));var o=document.createElement("div");r.parentNode.insertBefore(o,r),o.appendChild(r),o.requestFullscreen=o.requestFullscreen||o.mozRequestFullScreen||o.msRequestFullscreen||(o.webkitRequestFullscreen?()=>o.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):null)||(o.webkitRequestFullScreen?()=>o.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT):null),o.requestFullscreen()},exitFullscreen:function(){return!!ur.isFullscreen&&((document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||(()=>{})).apply(document,[]),!0)},nextRAF:0,fakeRequestAnimationFrame:function(e){var t=Date.now();if(0===ur.nextRAF)ur.nextRAF=t+1e3/60;else for(;t+2>=ur.nextRAF;)ur.nextRAF+=1e3/60;var r=Math.max(ur.nextRAF-t,0);setTimeout(e,r)},requestAnimationFrame:function(e){"function"!=typeof requestAnimationFrame?(0,ur.fakeRequestAnimationFrame)(e):requestAnimationFrame(e)},safeSetTimeout:function(e,t){return sr(e,t)},safeRequestAnimationFrame:function(e){return ur.requestAnimationFrame((()=>{ar(e)}))},getMimetype:function(e){return{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:function(e){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(e)},getMovementX:function(e){return e.movementX||e.mozMovementX||e.webkitMovementX||0},getMovementY:function(e){return e.movementY||e.mozMovementY||e.webkitMovementY||0},getMouseWheelDelta:function(e){var t=0;switch(e.type){case"DOMMouseScroll":t=e.detail/3;break;case"mousewheel":t=e.wheelDelta/120;break;case"wheel":switch(t=e.deltaY,e.deltaMode){case 0:t/=100;break;case 1:t/=3;break;case 2:t*=80;break;default:throw"unrecognized mouse wheel delta mode: "+e.deltaMode}break;default:throw"unrecognized mouse wheel event: "+e.type}return t},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent:function(e){if(ur.pointerLock)"mousemove"!=e.type&&"mozMovementX"in e?ur.mouseMovementX=ur.mouseMovementY=0:(ur.mouseMovementX=ur.getMovementX(e),ur.mouseMovementY=ur.getMovementY(e)),"undefined"!=typeof SDL?(ur.mouseX=SDL.mouseX+ur.mouseMovementX,ur.mouseY=SDL.mouseY+ur.mouseMovementY):(ur.mouseX+=ur.mouseMovementX,ur.mouseY+=ur.mouseMovementY);else{var t=s.canvas.getBoundingClientRect(),r=s.canvas.width,n=s.canvas.height,o=void 0!==window.scrollX?window.scrollX:window.pageXOffset,i=void 0!==window.scrollY?window.scrollY:window.pageYOffset;if("touchstart"===e.type||"touchend"===e.type||"touchmove"===e.type){var a=e.touch;if(void 0===a)return;var u=a.pageX-(o+t.left),l=a.pageY-(i+t.top),c={x:u*=r/t.width,y:l*=n/t.height};if("touchstart"===e.type)ur.lastTouches[a.identifier]=c,ur.touches[a.identifier]=c;else if("touchend"===e.type||"touchmove"===e.type){var d=ur.touches[a.identifier];d||(d=c),ur.lastTouches[a.identifier]=d,ur.touches[a.identifier]=c}return}var f=e.pageX-(o+t.left),p=e.pageY-(i+t.top);f*=r/t.width,p*=n/t.height,ur.mouseMovementX=f-ur.mouseX,ur.mouseMovementY=p-ur.mouseY,ur.mouseX=f,ur.mouseY=p}},resizeListeners:[],updateResizeListeners:function(){var e=s.canvas;ur.resizeListeners.forEach((t=>t(e.width,e.height)))},setCanvasSize:function(e,t,r){var n=s.canvas;ur.updateCanvasDimensions(n,e,t),r||ur.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize:function(){if("undefined"!=typeof SDL){var e=M[SDL.screen>>2];e|=8388608,R[SDL.screen>>2]=e}ur.updateCanvasDimensions(s.canvas),ur.updateResizeListeners()},setWindowedCanvasSize:function(){if("undefined"!=typeof SDL){var e=M[SDL.screen>>2];e&=-8388609,R[SDL.screen>>2]=e}ur.updateCanvasDimensions(s.canvas),ur.updateResizeListeners()},updateCanvasDimensions:function(e,t,r){t&&r?(e.widthNative=t,e.heightNative=r):(t=e.widthNative,r=e.heightNative);var n=t,o=r;if(s.forcedAspectRatio&&s.forcedAspectRatio>0&&(n/o<s.forcedAspectRatio?n=Math.round(o*s.forcedAspectRatio):o=Math.round(n/s.forcedAspectRatio)),(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e.parentNode&&"undefined"!=typeof screen){var i=Math.min(screen.width/n,screen.height/o);n=Math.round(n*i),o=Math.round(o*i)}ur.resizeCanvas?(e.width!=n&&(e.width=n),e.height!=o&&(e.height=o),void 0!==e.style&&(e.style.removeProperty("width"),e.style.removeProperty("height"))):(e.width!=t&&(e.width=t),e.height!=r&&(e.height=r),void 0!==e.style&&(n!=t||o!=r?(e.style.setProperty("width",n+"px","important"),e.style.setProperty("height",o+"px","important")):(e.style.removeProperty("width"),e.style.removeProperty("height"))))}},lr={errorCode:12288,defaultDisplayInitialized:!1,currentContext:0,currentReadSurface:0,currentDrawSurface:0,contextAttributes:{alpha:!1,depth:!1,stencil:!1,antialias:!1},stringCache:{},setErrorCode:function(e){lr.errorCode=e},chooseConfig:function(e,t,r,n,o){if(62e3!=e)return lr.setErrorCode(12296),0;if(t)for(;;){var i=R[t>>2];if(12321==i){var a=R[t+4>>2];lr.contextAttributes.alpha=a>0}else if(12325==i){var s=R[t+4>>2];lr.contextAttributes.depth=s>0}else if(12326==i){var u=R[t+4>>2];lr.contextAttributes.stencil=u>0}else if(12337==i){var l=R[t+4>>2];lr.contextAttributes.antialias=l>0}else if(12338==i)l=R[t+4>>2],lr.contextAttributes.antialias=1==l;else if(12544==i){var c=R[t+4>>2];lr.contextAttributes.lowLatency=12547!=c}else if(12344==i)break;t+=8}return r&&n||o?(o&&(R[o>>2]=1),r&&n>0&&(R[r>>2]=62002),lr.setErrorCode(12288),1):(lr.setErrorCode(12300),0)}};function cr(e){var t=e.getExtension("ANGLE_instanced_arrays");if(t)return e.vertexAttribDivisor=function(e,r){t.vertexAttribDivisorANGLE(e,r)},e.drawArraysInstanced=function(e,r,n,o){t.drawArraysInstancedANGLE(e,r,n,o)},e.drawElementsInstanced=function(e,r,n,o,i){t.drawElementsInstancedANGLE(e,r,n,o,i)},1}function dr(e){var t=e.getExtension("OES_vertex_array_object");if(t)return e.createVertexArray=function(){return t.createVertexArrayOES()},e.deleteVertexArray=function(e){t.deleteVertexArrayOES(e)},e.bindVertexArray=function(e){t.bindVertexArrayOES(e)},e.isVertexArray=function(e){return t.isVertexArrayOES(e)},1}function fr(e){var t=e.getExtension("WEBGL_draw_buffers");if(t)return e.drawBuffers=function(e,r){t.drawBuffersWEBGL(e,r)},1}function pr(e){return!!(e.dibvbi=e.getExtension("WEBGL_draw_instanced_base_vertex_base_instance"))}function hr(e){return!!(e.mdibvbi=e.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance"))}function mr(e){return!!(e.multiDrawWebgl=e.getExtension("WEBGL_multi_draw"))}var gr={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:[],offscreenCanvases:{},queries:[],samplers:[],transformFeedbacks:[],syncs:[],stringCache:{},stringiCache:{},unpackAlignment:4,recordError:function(e){gr.lastError||(gr.lastError=e)},getNewId:function(e){for(var t=gr.counter++,r=e.length;r<t;r++)e[r]=null;return t},getSource:function(e,t,r,n){for(var o="",i=0;i<t;++i){var a=n?R[n+4*i>>2]:-1;o+=Fe(R[r+4*i>>2],a<0?void 0:a)}return o},createContext:function(e,t){e.getContextSafariWebGL2Fixed||(e.getContextSafariWebGL2Fixed=e.getContext,e.getContext=function(t,r){var n=e.getContextSafariWebGL2Fixed(t,r);return"webgl"==t==n instanceof WebGLRenderingContext?n:null});var r=t.majorVersion>1?e.getContext("webgl2",t):e.getContext("webgl",t);return r?gr.registerContext(r,t):0},registerContext:function(e,t){var r=gr.getNewId(gr.contexts),n={handle:r,attributes:t,version:t.majorVersion,GLctx:e};return e.canvas&&(e.canvas.GLctxObject=n),gr.contexts[r]=n,(void 0===t.enableExtensionsByDefault||t.enableExtensionsByDefault)&&gr.initExtensions(n),r},makeContextCurrent:function(e){return gr.currentContext=gr.contexts[e],s.ctx=$n=gr.currentContext&&gr.currentContext.GLctx,!(e&&!$n)},getContext:function(e){return gr.contexts[e]},deleteContext:function(e){gr.currentContext===gr.contexts[e]&&(gr.currentContext=null),"object"==typeof Pn&&Pn.removeAllHandlersOnTarget(gr.contexts[e].GLctx.canvas),gr.contexts[e]&&gr.contexts[e].GLctx.canvas&&(gr.contexts[e].GLctx.canvas.GLctxObject=void 0),gr.contexts[e]=null},initExtensions:function(e){if(e||(e=gr.currentContext),!e.initExtensionsDone){e.initExtensionsDone=!0;var t=e.GLctx;cr(t),dr(t),fr(t),pr(t),hr(t),e.version>=2&&(t.disjointTimerQueryExt=t.getExtension("EXT_disjoint_timer_query_webgl2")),(e.version<2||!t.disjointTimerQueryExt)&&(t.disjointTimerQueryExt=t.getExtension("EXT_disjoint_timer_query")),mr(t),(t.getSupportedExtensions()||[]).forEach((function(e){e.includes("lose_context")||e.includes("debug")||t.getExtension(e)}))}}},yr=[];function vr(e){$n.bindVertexArray(gr.vaos[e])}var br=vr,wr=vr;function Er(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2];$n.deleteVertexArray(gr.vaos[n]),gr.vaos[n]=null}}var _r=Er,Cr=Er;function Sr(e,t,r,n){$n.drawArraysInstanced(e,t,r,n)}var kr=Sr,xr=Sr,Pr=Sr,Tr=Sr,Fr=Sr,Ar=[];function Dr(e,t){for(var r=Ar[e],n=0;n<e;n++)r[n]=R[t+4*n>>2];$n.drawBuffers(r)}var Br=Dr,Lr=Dr,Rr=Dr;function Mr(e,t,r,n){$n.drawElements(e,t,r,n)}var Or=Mr;function Ir(e,t,r,n,o){$n.drawElementsInstanced(e,t,r,n,o)}var Ur=Ir,$r=Ir,jr=Ir,qr=Ir,Nr=Ir;function Hr(e,t,r,n){for(var o=0;o<e;o++){var i=$n[r](),a=i&&gr.getNewId(n);i?(i.name=a,n[a]=i):gr.recordError(1282),R[t+4*o>>2]=a}}function Vr(e,t){Hr(e,t,"createVertexArray",gr.vaos)}var Wr=Vr,Gr=Vr;function zr(e,t,r,n,o,i,a,s){t=gr.programs[t];var u=$n[e](t,r);if(u){var l=s&&Mt(u.name,s,n);o&&(R[o>>2]=l),i&&(R[i>>2]=u.size),a&&(R[a>>2]=u.type)}}function Yr(e,t){M[e>>2]=t,M[e+4>>2]=(t-M[e>>2])/4294967296}function Xr(e,t,r){if(t){var n=void 0;switch(e){case 36346:n=1;break;case 36344:return void(0!=r&&1!=r&&gr.recordError(1280));case 34814:case 36345:n=0;break;case 34466:var o=$n.getParameter(34467);n=o?o.length:0;break;case 33309:if(gr.currentContext.version<2)return void gr.recordError(1282);n=2*($n.getSupportedExtensions()||[]).length;break;case 33307:case 33308:if(gr.currentContext.version<2)return void gr.recordError(1280);n=33307==e?3:0}if(void 0===n){var i=$n.getParameter(e);switch(typeof i){case"number":n=i;break;case"boolean":n=i?1:0;break;case"string":return void gr.recordError(1280);case"object":if(null===i)switch(e){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 36662:case 36663:case 35053:case 35055:case 36010:case 35097:case 35869:case 32874:case 36389:case 35983:case 35368:case 34068:n=0;break;default:return void gr.recordError(1280)}else{if(i instanceof Float32Array||i instanceof Uint32Array||i instanceof Int32Array||i instanceof Array){for(var a=0;a<i.length;++a)switch(r){case 0:R[t+4*a>>2]=i[a];break;case 2:O[t+4*a>>2]=i[a];break;case 4:A[t+a>>0]=i[a]?1:0}return}try{n=0|i.name}catch(t){return gr.recordError(1280),void k("GL_INVALID_ENUM in glGet"+r+"v: Unknown object returned from WebGL getParameter("+e+")! (error: "+t+")")}}break;default:return gr.recordError(1280),void k("GL_INVALID_ENUM in glGet"+r+"v: Native code calling glGet"+r+"v("+e+") and it returns "+i+" of type "+typeof i+"!")}}switch(r){case 1:Yr(t,n);break;case 0:R[t>>2]=n;break;case 2:O[t>>2]=n;break;case 4:A[t>>0]=n?1:0}}else gr.recordError(1281)}function Kr(e,t,r,n){if(r){var o,i=$n.getIndexedParameter(e,t);switch(typeof i){case"boolean":o=i?1:0;break;case"number":o=i;break;case"object":if(null===i)switch(e){case 35983:case 35368:o=0;break;default:return void gr.recordError(1280)}else{if(!(i instanceof WebGLBuffer))return void gr.recordError(1280);o=0|i.name}break;default:return void gr.recordError(1280)}switch(n){case 1:Yr(r,o);break;case 0:R[r>>2]=o;break;case 2:O[r>>2]=o;break;case 4:A[r>>0]=o?1:0;break;default:throw"internal emscriptenWebGLGetIndexed() error, bad type: "+n}}else gr.recordError(1281)}function Qr(e,t,r){if(r){var n,o=gr.queries[e];Yr(r,"boolean"==typeof(n=gr.currentContext.version<2?$n.disjointTimerQueryExt.getQueryObjectEXT(o,t):$n.getQueryParameter(o,t))?n?1:0:n)}else gr.recordError(1281)}var Zr=Qr;function Jr(e,t,r){if(r){var n,o=gr.queries[e],i=$n.disjointTimerQueryExt.getQueryObjectEXT(o,t);n="boolean"==typeof i?i?1:0:i,R[r>>2]=n}else gr.recordError(1281)}var en=Jr,tn=Qr,rn=Jr;function nn(e){return"]"==e.slice(-1)&&e.lastIndexOf("[")}function on(e){var t,r,n=e.uniformLocsById,o=e.uniformSizeAndIdsByName;if(!n)for(e.uniformLocsById=n={},e.uniformArrayNamesById={},t=0;t<$n.getProgramParameter(e,35718);++t){var i=$n.getActiveUniform(e,t),a=i.name,s=i.size,u=nn(a),l=u>0?a.slice(0,u):a,c=e.uniformIdCounter;for(e.uniformIdCounter+=s,o[l]=[s,c],r=0;r<s;++r)n[c]=r,e.uniformArrayNamesById[c++]=l}}function an(e){var t=$n.currentProgram;if(t){var r=t.uniformLocsById[e];return"number"==typeof r&&(t.uniformLocsById[e]=r=$n.getUniformLocation(t,t.uniformArrayNamesById[e]+(r>0?"["+r+"]":""))),r}gr.recordError(1282)}function sn(e,t,r,n){if(r){on(e=gr.programs[e]);var o=$n.getUniform(e,an(t));if("number"==typeof o||"boolean"==typeof o)switch(n){case 0:R[r>>2]=o;break;case 2:O[r>>2]=o}else for(var i=0;i<o.length;i++)switch(n){case 0:R[r+4*i>>2]=o[i];break;case 2:O[r+4*i>>2]=o[i]}}else gr.recordError(1281)}function un(e,t,r,n){if(r){var o=$n.getVertexAttrib(e,t);if(34975==t)R[r>>2]=o&&o.name;else if("number"==typeof o||"boolean"==typeof o)switch(n){case 0:R[r>>2]=o;break;case 2:O[r>>2]=o;break;case 5:R[r>>2]=Math.fround(o)}else for(var i=0;i<o.length;i++)switch(n){case 0:R[r+4*i>>2]=o[i];break;case 2:O[r+4*i>>2]=o[i];break;case 5:R[r+4*i>>2]=Math.fround(o[i])}}else gr.recordError(1281)}function ln(e,t,r){un(e,t,r,0)}var cn=ln,dn=ln;function fn(e){var t=gr.vaos[e];return t?$n.isVertexArray(t):0}var pn=fn,hn=fn;function mn(e){return 0==(e-=5120)?A:1==e?D:2==e?B:4==e?R:6==e?O:5==e||28922==e||28520==e||30779==e||30782==e?M:L}function gn(e){return 31-Math.clz32(e.BYTES_PER_ELEMENT)}function yn(e,t,r,n,o,i){var a=mn(e),s=gn(a),u=1<<s,l=function(e){return{5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4}[e-6402]||1}(t)*u,c=function(e,t,r,n){var o;return t*(e*r+(o=n)-1&-o)}(r,n,l,gr.unpackAlignment);return a.subarray(o>>s,o+c>>s)}var vn=[],bn=[];function wn(e,t){$n.vertexAttribDivisor(e,t)}var En=wn,_n=wn,Cn=wn,Sn=wn,kn=wn,xn=e=>{var t=e-x.buffer.byteLength+65535>>>16;try{return x.grow(t),H(),1}catch(e){}},Pn={inEventHandler:0,removeAllEventListeners:function(){for(var e=Pn.eventHandlers.length-1;e>=0;--e)Pn._removeHandler(e);Pn.eventHandlers=[],Pn.deferredCalls=[]},registerRemoveEventListeners:function(){Pn.removeEventListenersRegistered||(G.push(Pn.removeAllEventListeners),Pn.removeEventListenersRegistered=!0)},deferredCalls:[],deferCall:function(e,t,r){function n(e,t){if(e.length!=t.length)return!1;for(var r in e)if(e[r]!=t[r])return!1;return!0}for(var o in Pn.deferredCalls){var i=Pn.deferredCalls[o];if(i.targetFunction==e&&n(i.argsList,r))return}Pn.deferredCalls.push({targetFunction:e,precedence:t,argsList:r}),Pn.deferredCalls.sort((function(e,t){return e.precedence<t.precedence}))},removeDeferredCalls:function(e){for(var t=0;t<Pn.deferredCalls.length;++t)Pn.deferredCalls[t].targetFunction==e&&(Pn.deferredCalls.splice(t,1),--t)},canPerformEventHandlerRequests:function(){return navigator.userActivation?navigator.userActivation.isActive:Pn.inEventHandler&&Pn.currentEventHandler.allowsDeferredCalls},runDeferredCalls:function(){if(Pn.canPerformEventHandlerRequests())for(var e=0;e<Pn.deferredCalls.length;++e){var t=Pn.deferredCalls[e];Pn.deferredCalls.splice(e,1),--e,t.targetFunction.apply(null,t.argsList)}},eventHandlers:[],removeAllHandlersOnTarget:function(e,t){for(var r=0;r<Pn.eventHandlers.length;++r)Pn.eventHandlers[r].target!=e||t&&t!=Pn.eventHandlers[r].eventTypeString||Pn._removeHandler(r--)},_removeHandler:function(e){var t=Pn.eventHandlers[e];t.target.removeEventListener(t.eventTypeString,t.eventListenerFunc,t.useCapture),Pn.eventHandlers.splice(e,1)},registerOrRemoveHandler:function(e){if(!e.target)return-4;var t=function(t){++Pn.inEventHandler,Pn.currentEventHandler=e,Pn.runDeferredCalls(),e.handlerFunc(t),Pn.runDeferredCalls(),--Pn.inEventHandler};if(e.callbackfunc)e.eventListenerFunc=t,e.target.addEventListener(e.eventTypeString,t,e.useCapture),Pn.eventHandlers.push(e),Pn.registerRemoveEventListeners();else for(var r=0;r<Pn.eventHandlers.length;++r)Pn.eventHandlers[r].target==e.target&&Pn.eventHandlers[r].eventTypeString==e.eventTypeString&&Pn._removeHandler(r--);return 0},getNodeNameForTarget:function(e){return e?e==window?"#window":e==screen?"#screen":e&&e.nodeName?e.nodeName:"":""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}},Tn=["default","low-power","high-performance"],Fn=[0,"undefined"!=typeof document?document:0,"undefined"!=typeof window?window:0];var An,Dn,Bn={},Ln=()=>{if(!Ln.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",_:m||"./this.program"};for(var t in Bn)void 0===Bn[t]?delete e[t]:e[t]=Bn[t];var r=[];for(var t in e)r.push(`${t}=${e[t]}`);Ln.strings=r}return Ln.strings},Rn=(e,t,r,n)=>{for(var o=0,i=0;i<r;i++){var a=M[t>>2],s=M[t+4>>2];t+=8;var u=Te.read(e,A,a,s,n);if(u<0)return-1;if(o+=u,u<s)break;void 0!==n&&(n+=u)}return o},Mn=[31,29,31,30,31,30,31,31,30,31,30,31],On=[31,28,31,30,31,30,31,31,30,31,30,31],In=(e,t)=>{A.set(e,t)},Un=function(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=Te.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n};Object.defineProperties(Un.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return Te.isDir(this.mode)}},isDevice:{get:function(){return Te.isChrdev(this.mode)}}}),Te.FSNode=Un,Te.createPreloadedFile=function(e,t,r,n,o,i,a,s,u,l){var c=t?ge.resolve(he.join2(e,t)):e;function d(r){function d(r){l&&l(),s||Te.createDataFile(e,t,r,n,o,u),i&&i(),te()}(function(e,t,r,n){void 0!==ur&&ur.init();var o=!1;return xe.forEach((function(i){o||i.canHandle(t)&&(i.handle(e,t,r,n),o=!0)})),o})(r,c,d,(()=>{a&&a(),te()}))||d(r)}ee(),"string"==typeof r?((e,t,r,n)=>{var o=`al ${e}`;f(e,(t=>{N(t,`Loading data file "${e}" failed (no arrayBuffer).`),d(new Uint8Array(t)),o&&te()}),(t=>{if(!r)throw`Loading data file "${e}" failed.`;r()})),o&&ee()})(r,0,a):d(r)},Te.staticInit(),s.FS_createPath=Te.createPath,s.FS_createDataFile=Te.createDataFile,s.FS_createPreloadedFile=Te.createPreloadedFile,s.FS_unlink=Te.unlink,s.FS_createLazyFile=Te.createLazyFile,s.FS_createDevice=Te.createDevice,Ie=s.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},function(){for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);Ne=e}(),Ve=s.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},st.prototype.isAliasOf=function(e){if(!(this instanceof st))return!1;if(!(e instanceof st))return!1;for(var t=this.$$.ptrType.registeredClass,r=this.$$.ptr,n=e.$$.ptrType.registeredClass,o=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return t===n&&r===o},st.prototype.clone=function(){if(this.$$.ptr||Xe(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,t=at(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 t.$$.count.value+=1,t.$$.deleteScheduled=!1,t},st.prototype.delete=function(){this.$$.ptr||Xe(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&We("Object already scheduled for deletion"),Qe(this),Ze(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},st.prototype.isDeleted=function(){return!this.$$.ptr},st.prototype.deleteLater=function(){return this.$$.ptr||Xe(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&We("Object already scheduled for deletion"),tt.push(this),1===tt.length&&nt&&nt(rt),this.$$.deleteScheduled=!0,this},s.getInheritedInstanceCount=function(){return Object.keys(ot).length},s.getLiveInheritedInstances=function(){var e=[];for(var t in ot)ot.hasOwnProperty(t)&&e.push(ot[t]);return e},s.flushPendingDeletes=rt,s.setDelayFunction=function(e){nt=e,tt.length&&nt&&nt(rt)},yt.prototype.getPointee=function(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},yt.prototype.destructor=function(e){this.rawDestructor&&this.rawDestructor(e)},yt.prototype.argPackAdvance=8,yt.prototype.readValueFromPointer=Le,yt.prototype.deleteObject=function(e){null!==e&&e.delete()},yt.prototype.fromWireType=function(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=function(e,t){return t=function(e,t){for(void 0===t&&We("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t}(e,t),ot[t]}(this.registeredClass,t);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var n=r.clone();return this.destructor(e),n}function o(){return this.isSmartPointer?it(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):it(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var i,a=this.registeredClass.getActualType(t),s=et[a];if(!s)return o.call(this);i=this.isConst?s.constPointerType:s.pointerType;var u=Je(t,this.registeredClass,i.registeredClass);return null===u?o.call(this):this.isSmartPointer?it(i.registeredClass.instancePrototype,{ptrType:i,ptr:u,smartPtrType:this,smartPtr:e}):it(i.registeredClass.instancePrototype,{ptrType:i,ptr:u})},_t=s.UnboundTypeError=(An=Error,(Dn=lt("UnboundTypeError",(function(e){this.name="UnboundTypeError",this.message=e;var t=new Error(e).stack;void 0!==t&&(this.stack=this.toString()+"\n"+t.replace(/^Error(:[^\n]*)?\n/,""))}))).prototype=Object.create(An.prototype),Dn.prototype.constructor=Dn,Dn.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},Dn),Object.assign(Tt.prototype,{get(e){return this.allocated[e]},has(e){return void 0!==this.allocated[e]},allocate(e){var t=this.freelist.pop()||this.allocated.length;return this.allocated[t]=e,t},free(e){this.allocated[e]=void 0,this.freelist.push(e)}}),Ft.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),Ft.reserved=Ft.allocated.length,s.count_emval_handles=function(){for(var e=0,t=Ft.reserved;t<Ft.allocated.length;++t)void 0!==Ft.allocated[t]&&++e;return e},s.requestFullscreen=function(e,t){ur.requestFullscreen(e,t)},s.requestAnimationFrame=function(e){ur.requestAnimationFrame(e)},s.setCanvasSize=function(e,t,r){ur.setCanvasSize(e,t,r)},s.pauseMainLoop=function(){ur.mainLoop.pause()},s.resumeMainLoop=function(){ur.mainLoop.resume()},s.getUserMedia=function(){ur.getUserMedia()},s.createContext=function(e,t,r,n){return ur.createContext(e,t,r,n)};for(var $n,jn={},qn={},Nn=0;Nn<32;++Nn)Ar.push(new Array(Nn));var Hn=new Float32Array(288);for(Nn=0;Nn<288;++Nn)vn[Nn]=Hn.subarray(0,Nn+1);var Vn=new Int32Array(288);for(Nn=0;Nn<288;++Nn)bn[Nn]=Vn.subarray(0,Nn+1);var Wn,Gn={Ga:function(e){var t=new fe(e);return t.get_caught()||t.set_caught(!0),t.set_rethrown(!1),ce.push(t),ao(t.excPtr),t.get_exception_ptr()},Fa:function(){to(0,0);var e=ce.pop();io(e.excPtr),de=0},m:()=>pe([]),Z:e=>pe([e]),h:function(e,t,r){throw new fe(e).init(t,r),de=e},K:function(e){throw de||(de=e),de},ba:function(e,t,r){Ae.varargs=r;try{var n=Ae.getStreamFromFD(e);switch(t){case 0:return(o=Ae.get())<0?-28:Te.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=Ae.get();return n.flags|=o,0;case 5:return o=Ae.get(),B[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return 28,R[Xn()>>2]=28,-1}}catch(e){if(void 0===Te||"ErrnoError"!==e.name)throw e;return-e.errno}},yb:function(e,t){try{var r=Ae.getStreamFromFD(e);return Ae.doStat(Te.stat,r.path,t)}catch(e){if(void 0===Te||"ErrnoError"!==e.name)throw e;return-e.errno}},Cb:function(e,t,r){Ae.varargs=r;try{var n=Ae.getStreamFromFD(e);switch(t){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return n.tty?0:-59;case 21505:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var o=n.tty.ops.ioctl_tcgets(n),i=Ae.get();R[i>>2]=o.c_iflag||0,R[i+4>>2]=o.c_oflag||0,R[i+8>>2]=o.c_cflag||0,R[i+12>>2]=o.c_lflag||0;for(var a=0;a<32;a++)A[i+a+17>>0]=o.c_cc[a]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){i=Ae.get();var s=R[i>>2],u=R[i+4>>2],l=R[i+8>>2],c=R[i+12>>2],d=[];for(a=0;a<32;a++)d.push(A[i+a+17>>0]);return n.tty.ops.ioctl_tcsets(n.tty,t,{c_iflag:s,c_oflag:u,c_cflag:l,c_lflag:c,c_cc:d})}return 0;case 21519:return n.tty?(i=Ae.get(),R[i>>2]=0,0):-59;case 21520:return n.tty?-28:-59;case 21531:return i=Ae.get(),Te.ioctl(n,t,i);case 21523:if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var f=n.tty.ops.ioctl_tiocgwinsz(n.tty);i=Ae.get(),B[i>>1]=f[0],B[i+2>>1]=f[1]}return 0;default:return-28}}catch(e){if(void 0===Te||"ErrnoError"!==e.name)throw e;return-e.errno}},ub:function(e,t){try{return e=Ae.getStr(e),Ae.doStat(Te.lstat,e,t)}catch(e){if(void 0===Te||"ErrnoError"!==e.name)throw e;return-e.errno}},vb:function(e,t,r,n){try{t=Ae.getStr(t);var o=256&n,i=4096&n;return n&=-6401,t=Ae.calculateAt(e,t,i),Ae.doStat(o?Te.lstat:Te.stat,t,r)}catch(e){if(void 0===Te||"ErrnoError"!==e.name)throw e;return-e.errno}},oa:function(e,t,r,n){Ae.varargs=n;try{t=Ae.getStr(t),t=Ae.calculateAt(e,t);var o=n?Ae.get():0;return Te.open(t,r,o).fd}catch(e){if(void 0===Te||"ErrnoError"!==e.name)throw e;return-e.errno}},wb:function(e,t){try{return e=Ae.getStr(e),Ae.doStat(Te.stat,e,t)}catch(e){if(void 0===Te||"ErrnoError"!==e.name)throw e;return-e.errno}},sa:function(e){var t=De[e];delete De[e];var r=t.elements,n=r.length,o=r.map((function(e){return e.getterReturnType})).concat(r.map((function(e){return e.setterArgumentType}))),i=t.rawConstructor,a=t.rawDestructor;$e([e],o,(function(e){return r.forEach(((t,r)=>{var o=e[r],i=t.getter,a=t.getterContext,s=e[r+n],u=t.setter,l=t.setterContext;t.read=e=>o.fromWireType(i(a,e)),t.write=(e,t)=>{var r=[];u(l,e,s.toWireType(r,t)),Be(r)}})),[{name:t.name,fromWireType:function(e){for(var t=new Array(n),o=0;o<n;++o)t[o]=r[o].read(e);return a(e),t},toWireType:function(e,o){if(n!==o.length)throw new TypeError(`Incorrect number of tuple elements for ${t.name}: expected=${n}, actual=${o.length}`);for(var s=i(),u=0;u<n;++u)r[u].write(s,o[u]);return null!==e&&e.push(a,s),s},argPackAdvance:8,readValueFromPointer:Le,destructorFunction:a}]}))},x:function(e){var t=je[e];delete je[e];var r=t.rawConstructor,n=t.rawDestructor,o=t.fields;$e([e],o.map((e=>e.getterReturnType)).concat(o.map((e=>e.setterArgumentType))),(e=>{var i={};return o.forEach(((t,r)=>{var n=t.fieldName,a=e[r],s=t.getter,u=t.getterContext,l=e[r+o.length],c=t.setter,d=t.setterContext;i[n]={read:e=>a.fromWireType(s(u,e)),write:(e,t)=>{var r=[];c(d,e,l.toWireType(r,t)),Be(r)}}})),[{name:t.name,fromWireType:function(e){var t={};for(var r in i)t[r]=i[r].read(e);return n(e),t},toWireType:function(e,t){for(var o in i)if(!(o in t))throw new TypeError(`Missing field: "${o}"`);var a=r();for(o in i)i[o].write(a,t[o]);return null!==e&&e.push(n,a),a},argPackAdvance:8,readValueFromPointer:Le,destructorFunction:n}]}))},wa:function(e,t,r,n,o){t=He(t);var i=Ye(r),a=-1!=t.indexOf("u");a&&(o=(1n<<64n)-1n),Ge(e,{name:t,fromWireType:function(e){return e},toWireType:function(e,r){if("bigint"!=typeof r&&"number"!=typeof r)throw new TypeError(`Cannot convert "${qe(r)}" to ${this.name}`);if(r<n||r>o)throw new TypeError(`Passing a number "${qe(r)}" from JS side to C/C++ side to an argument of type "${t}", which is outside the valid range [${n}, ${o}]!`);return r},argPackAdvance:8,readValueFromPointer:ze(t,i,!a),destructorFunction:null})},ie:function(e,t,r,n,o){var i=Ye(r);Ge(e,{name:t=He(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?n:o},argPackAdvance:8,readValueFromPointer:function(e){var n;if(1===r)n=A;else if(2===r)n=B;else{if(4!==r)throw new TypeError("Unknown boolean type size: "+t);n=R}return this.fromWireType(n[e>>i])},destructorFunction:null})},t:function(e,t,r,n,o,i,a,s,u,l,c,d,f){c=He(c),i=Et(o,i),s&&(s=Et(a,s)),l&&(l=Et(u,l)),f=Et(d,f);var p=ut(c);dt(p,(function(){St(`Cannot construct ${c} due to unbound types`,[n])})),$e([e,t,r],n?[n]:[],(function(t){var r,o;t=t[0],o=n?(r=t.registeredClass).instancePrototype:st.prototype;var a=lt(p,(function(){if(Object.getPrototypeOf(this)!==u)throw new Ve("Use 'new' to construct "+c);if(void 0===d.constructor_body)throw new Ve(c+" has no accessible constructor");var e=d.constructor_body[arguments.length];if(void 0===e)throw new Ve(`Tried to invoke ctor of ${c} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(d.constructor_body).toString()}) parameters instead!`);return e.apply(this,arguments)})),u=Object.create(o,{constructor:{value:a}});a.prototype=u;var d=new ft(c,a,u,f,r,i,s,l);d.baseClass&&(void 0===d.baseClass.__derivedClasses&&(d.baseClass.__derivedClasses=[]),d.baseClass.__derivedClasses.push(d));var h=new yt(c,d,!0,!1,!1),m=new yt(c+"*",d,!1,!1,!1),g=new yt(c+" const*",d,!1,!0,!1);return et[e]={pointerType:m,constPointerType:g},vt(p,a),[h,m,g]}))},v:function(e,t,r,n,o,i){var a=kt(t,r);o=Et(n,o),$e([],[e],(function(e){var r=`constructor ${(e=e[0]).name}`;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[t-1])throw new Ve(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${e.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.registeredClass.constructor_body[t-1]=()=>{St(`Cannot construct ${e.name} due to unbound types`,a)},$e([],a,(function(n){return n.splice(1,0,null),e.registeredClass.constructor_body[t-1]=Pt(r,n,null,o,i),[]})),[]}))},c:function(e,t,r,n,o,i,a,s,u){var l=kt(r,n);t=He(t),i=Et(o,i),$e([],[e],(function(e){var n=`${(e=e[0]).name}.${t}`;function o(){St(`Cannot call ${n} due to unbound types`,l)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(t);var c=e.registeredClass.instancePrototype,d=c[t];return void 0===d||void 0===d.overloadTable&&d.className!==e.name&&d.argCount===r-2?(o.argCount=r-2,o.className=e.name,c[t]=o):(ct(c,t,n),c[t].overloadTable[r-2]=o),$e([],l,(function(o){var s=Pt(n,o,e,i,a,u);return void 0===c[t].overloadTable?(s.argCount=r-2,c[t]=s):c[t].overloadTable[r-2]=s,[]})),[]}))},he:function(e,t){Ge(e,{name:t=He(t),fromWireType:function(e){var t=Dt.toValue(e);return At(e),t},toWireType:function(e,t){return Dt.toHandle(t)},argPackAdvance:8,readValueFromPointer:Le,destructorFunction:null})},T:function(e,t,r,n){var o=Ye(r);function i(){}t=He(t),i.values={},Ge(e,{name:t,constructor:i,fromWireType:function(e){return this.constructor.values[e]},toWireType:function(e,t){return t.value},argPackAdvance:8,readValueFromPointer:Bt(t,o,n),destructorFunction:null}),dt(t,i)},z:function(e,t,r){var n=Lt(e,"enum");t=He(t);var o=n.constructor,i=Object.create(n.constructor.prototype,{value:{value:r},constructor:{value:lt(`${n.name}_${t}`,(function(){}))}});o.values[r]=i,o[t]=i},va:function(e,t,r){var n=Ye(r);Ge(e,{name:t=He(t),fromWireType:function(e){return e},toWireType:function(e,t){return t},argPackAdvance:8,readValueFromPointer:Rt(t,n),destructorFunction:null})},J:function(e,t,r,n,o,i,a){var s=kt(t,r);e=He(e),o=Et(n,o),dt(e,(function(){St(`Cannot call ${e} due to unbound types`,s)}),t-1),$e([],s,(function(r){var n=[r[0],null].concat(r.slice(1));return vt(e,Pt(e,n,null,o,i,a),t-1),[]}))},P:function(e,t,r,n,o){t=He(t),-1===o&&(o=4294967295);var i=Ye(r),a=e=>e;if(0===n){var s=32-8*r;a=e=>e<<s>>>s}var u=t.includes("unsigned");Ge(e,{name:t,fromWireType:a,toWireType:u?function(e,t){return this.name,t>>>0}:function(e,t){return this.name,t},argPackAdvance:8,readValueFromPointer:ze(t,i,0!==n),destructorFunction:null})},B:function(e,t,r){var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][t];function o(e){var t=M,r=t[e>>=2],o=t[e+1];return new n(t.buffer,o,r)}Ge(e,{name:r=He(r),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},Ee:function(e,t,r,n,o,i,a,s,u,l,c,d){r=He(r),i=Et(o,i),s=Et(a,s),l=Et(u,l),d=Et(c,d),$e([e],[t],(function(e){return e=e[0],[new yt(r,e.registeredClass,!1,!1,!0,e,n,i,s,l,d)]}))},ua:function(e,t){var r="std::string"===(t=He(t));Ge(e,{name:t,fromWireType:function(e){var t,n=M[e>>2],o=e+4;if(r)for(var i=o,a=0;a<=n;++a){var s=o+a;if(a==n||0==D[s]){var u=Fe(i,s-i);void 0===t?t=u:(t+=String.fromCharCode(0),t+=u),i=s+1}}else{var l=new Array(n);for(a=0;a<n;++a)l[a]=String.fromCharCode(D[o+a]);t=l.join("")}return Yn(e),t},toWireType:function(e,t){var n;t instanceof ArrayBuffer&&(t=new Uint8Array(t));var o="string"==typeof t;o||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array||We("Cannot pass non-string to std::string"),n=r&&o?we(t):t.length;var i=zn(4+n+1),a=i+4;if(M[i>>2]=n,r&&o)Mt(t,a,n+1);else if(o)for(var s=0;s<n;++s){var u=t.charCodeAt(s);u>255&&(Yn(a),We("String has UTF-16 code units that do not fit in 8 bits")),D[a+s]=u}else for(s=0;s<n;++s)D[a+s]=t[s];return null!==e&&e.push(Yn,i),i},argPackAdvance:8,readValueFromPointer:Le,destructorFunction:function(e){Yn(e)}})},da:function(e,t,r){var n,o,i,a,s;r=He(r),2===t?(n=It,o=Ut,a=$t,i=()=>L,s=1):4===t&&(n=jt,o=qt,a=Nt,i=()=>M,s=2),Ge(e,{name:r,fromWireType:function(e){for(var r,o=M[e>>2],a=i(),u=e+4,l=0;l<=o;++l){var c=e+4+l*t;if(l==o||0==a[c>>s]){var d=n(u,c-u);void 0===r?r=d:(r+=String.fromCharCode(0),r+=d),u=c+t}}return Yn(e),r},toWireType:function(e,n){"string"!=typeof n&&We(`Cannot pass non-string to C++ string type ${r}`);var i=a(n),u=zn(4+i+t);return M[u>>2]=i>>s,o(n,u+4,i+t),null!==e&&e.push(Yn,u),u},argPackAdvance:8,readValueFromPointer:Le,destructorFunction:function(e){Yn(e)}})},ta:function(e,t,r,n,o,i){De[e]={name:He(t),rawConstructor:Et(r,n),rawDestructor:Et(o,i),elements:[]}},O:function(e,t,r,n,o,i,a,s,u){De[e].elements.push({getterReturnType:t,getter:Et(r,n),getterContext:o,setterArgumentType:i,setter:Et(a,s),setterContext:u})},y:function(e,t,r,n,o,i){je[e]={name:He(t),rawConstructor:Et(r,n),rawDestructor:Et(o,i),fields:[]}},i:function(e,t,r,n,o,i,a,s,u,l){je[e].fields.push({fieldName:He(t),getterReturnType:r,getter:Et(n,o),getterContext:i,setterArgumentType:a,setter:Et(s,u),setterContext:l})},je:function(e,t){Ge(e,{isVoid:!0,name:t=He(t),argPackAdvance:0,fromWireType:function(){},toWireType:function(e,t){}})},Ab:()=>!0,gb:()=>{throw 1/0},l:function(e,t,r){e=Dt.toValue(e),t=Lt(t,"emval::as");var n=[],o=Dt.toHandle(n);return M[r>>2]=o,t.toWireType(n,e)},s:function(e,t,r,n){e=Dt.toValue(e);for(var o=Ht(t,r),i=new Array(t),a=0;a<t;++a){var s=o[a];i[a]=s.readValueFromPointer(n),n+=s.argPackAdvance}var u=e.apply(void 0,i);return Dt.toHandle(u)},U:function(e,t,r,n,o){return(e=Gt[e])(t=Dt.toValue(t),r=Wt(r),function(e){var t=[];return M[e>>2]=Dt.toHandle(t),t}(n),o)},W:function(e,t,r,n){(e=Gt[e])(t=Dt.toValue(t),r=Wt(r),null,n)},b:At,be:function(e,t){return(e=Dt.toValue(e))==Dt.toValue(t)},D:function(e){return 0===e?Dt.toHandle(zt()):(e=Wt(e),Dt.toHandle(zt()[e]))},I:function(e,t){var r=Ht(e,t),n=r[0],o=n.name+"_$"+r.slice(1).map((function(e){return e.name})).join("_")+"$",i=Yt[o];if(void 0!==i)return i;for(var a=["retType"],s=[n],u="",l=0;l<e-1;++l)u+=(0!==l?", ":"")+"arg"+l,a.push("argType"+l),s.push(r[1+l]);var c,d,f="return function "+ut("methodCaller_"+o)+"(handle, name, destructors, args) {\n",p=0;for(l=0;l<e-1;++l)f+=" var arg"+l+" = argType"+l+".readValueFromPointer(args"+(p?"+"+p:"")+");\n",p+=r[l+1].argPackAdvance;for(f+=" var rv = handle[name]("+u+");\n",l=0;l<e-1;++l)r[l+1].deleteObject&&(f+=" argType"+l+".deleteObject(arg"+l+");\n");return n.isVoid||(f+=" return retType.toWireType(destructors, rv);\n"),f+="};\n",a.push(f),c=xt(Function,a).apply(null,s),d=Gt.length,Gt.push(c),i=d,Yt[o]=i,i},g:function(e,t){return e=Dt.toValue(e),t=Dt.toValue(t),Dt.toHandle(e[t])},d:function(e){e>4&&(Ft.get(e).refcount+=1)},Aa:function(e,t){return(e=Dt.toValue(e))instanceof Dt.toValue(t)},ca:function(e){return"number"==typeof(e=Dt.toValue(e))},L:function(e){return"string"==typeof(e=Dt.toValue(e))},xe:function(e,t,r,n){e=Dt.toValue(e);var o=Xt[t];return o||(o=function(e){for(var t="",r=0;r<e;++r)t+=(0!==r?", ":"")+"arg"+r;var n="return function emval_allocator_"+e+"(constructor, argTypes, args) {\n var HEAPU32 = getMemory();\n";for(r=0;r<e;++r)n+="var argType"+r+" = requireRegisteredType(HEAPU32[((argTypes)>>2)], 'parameter "+r+"');\nvar arg"+r+" = argType"+r+".readValueFromPointer(args);\nargs += argType"+r+"['argPackAdvance'];\nargTypes += 4;\n";return n+="var obj = new constructor("+t+");\nreturn valueToHandle(obj);\n}\n",new Function("requireRegisteredType","Module","valueToHandle","getMemory",n)(Lt,s,Dt.toHandle,(()=>M))}(t),Xt[t]=o),o(e,r,n)},N:function(){return Dt.toHandle([])},f:function(e){return Dt.toHandle(Wt(e))},H:function(){return Dt.toHandle({})},j:function(e){Be(Dt.toValue(e)),At(e)},u:function(e,t,r){e=Dt.toValue(e),t=Dt.toValue(t),r=Dt.toValue(r),e[t]=r},e:function(e,t){var r=(e=Lt(e,"_emval_take_value")).readValueFromPointer(t);return Dt.toHandle(r)},qe:function(e){throw Dt.toValue(e)},Mc:function(e){return e=Dt.toValue(e),Dt.toHandle(typeof e)},ob:function(e,t){e=Kt(e),t=Kt(t);var r=new Date(1e3*e);R[t>>2]=r.getUTCSeconds(),R[t+4>>2]=r.getUTCMinutes(),R[t+8>>2]=r.getUTCHours(),R[t+12>>2]=r.getUTCDate(),R[t+16>>2]=r.getUTCMonth(),R[t+20>>2]=r.getUTCFullYear()-1900,R[t+24>>2]=r.getUTCDay();var n=Date.UTC(r.getUTCFullYear(),0,1,0,0,0,0),o=(r.getTime()-n)/864e5|0;R[t+28>>2]=o},pb:function(e,t){e=Kt(e),t=Kt(t);var r=new Date(1e3*e);R[t>>2]=r.getSeconds(),R[t+4>>2]=r.getMinutes(),R[t+8>>2]=r.getHours(),R[t+12>>2]=r.getDate(),R[t+16>>2]=r.getMonth(),R[t+20>>2]=r.getFullYear()-1900,R[t+24>>2]=r.getDay();var n=0|tr(r);R[t+28>>2]=n,R[t+36>>2]=-60*r.getTimezoneOffset();var o=new Date(r.getFullYear(),0,1),i=new Date(r.getFullYear(),6,1).getTimezoneOffset(),a=o.getTimezoneOffset(),s=0|(i!=a&&r.getTimezoneOffset()==Math.min(a,i));R[t+32>>2]=s},qb:function(e){e=Kt(e);var t=(()=>{var t=new Date(R[e+20>>2]+1900,R[e+16>>2],R[e+12>>2],R[e+8>>2],R[e+4>>2],R[e>>2],0),r=R[e+32>>2],n=t.getTimezoneOffset(),o=new Date(t.getFullYear(),0,1),i=new Date(t.getFullYear(),6,1).getTimezoneOffset(),a=o.getTimezoneOffset(),s=Math.min(a,i);if(r<0)R[e+32>>2]=Number(i!=a&&s==n);else if(r>0!=(s==n)){var u=Math.max(a,i),l=r>0?s:u;t.setTime(t.getTime()+6e4*(l-n))}R[e+24>>2]=t.getDay();var c=0|tr(t);return R[e+28>>2]=c,R[e>>2]=t.getSeconds(),R[e+4>>2]=t.getMinutes(),R[e+8>>2]=t.getHours(),R[e+12>>2]=t.getDate(),R[e+16>>2]=t.getMonth(),R[e+20>>2]=t.getYear(),t.getTime()/1e3})();return BigInt(t)},lb:function(e,t,r,n,o,i,a){e=Kt(e),o=Kt(o),i=Kt(i),a=Kt(a);try{if(isNaN(o))return 61;var s=Ae.getStreamFromFD(n),u=Te.mmap(s,e,o,t,r),l=u.ptr;return R[i>>2]=u.allocated,M[a>>2]=l,0}catch(e){if(void 0===Te||"ErrnoError"!==e.name)throw e;return-e.errno}},nb:function(e,t,r,n,o,i){e=Kt(e),t=Kt(t),i=Kt(i);try{if(isNaN(i))return 61;var a=Ae.getStreamFromFD(o);2&r&&Ae.doMsync(e,a,t,n,i),Te.munmap(a)}catch(e){if(void 0===Te||"ErrnoError"!==e.name)throw e;return-e.errno}},hb:(e,t,r)=>{var n=(new Date).getFullYear(),o=new Date(n,0,1),i=new Date(n,6,1),a=o.getTimezoneOffset(),s=i.getTimezoneOffset(),u=Math.max(a,s);function l(e){var t=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return t?t[1]:"GMT"}M[e>>2]=60*u,R[t>>2]=Number(a!=s);var c=l(o),d=l(i),f=rr(c),p=rr(d);s<a?(M[r>>2]=f,M[r+4>>2]=p):(M[r>>2]=p,M[r+4>>2]=f)},a:()=>{re("")},ma:function(e,t,r,n,o){return lr.chooseConfig(e,t,r,n,o)},na:function(e,t,r,n){if(62e3!=e)return lr.setErrorCode(12296),0;for(var o=1;;){var i=R[n>>2];if(12440!=i){if(12344==i)break;return lr.setErrorCode(12292),0}o=R[n+4>>2],n+=8}return o<2||o>3?(lr.setErrorCode(12293),0):(lr.contextAttributes.majorVersion=o-1,lr.contextAttributes.minorVersion=0,lr.context=gr.createContext(s.canvas,lr.contextAttributes),0!=lr.context?(lr.setErrorCode(12288),gr.makeContextCurrent(lr.context),s.useWebGL=!0,ur.moduleContextCreatedCallbacks.forEach((function(e){e()})),gr.makeContextCurrent(null),62004):(lr.setErrorCode(12297),0))},_a:function(e,t,r,n){return 62e3!=e?(lr.setErrorCode(12296),0):62002!=t?(lr.setErrorCode(12293),0):(lr.setErrorCode(12288),62006)},gc:function(e,t){return 62e3!=e?(lr.setErrorCode(12296),0):62004!=t?(lr.setErrorCode(12294),0):(gr.deleteContext(lr.context),lr.setErrorCode(12288),lr.currentContext==t&&(lr.currentContext=0),1)},Xb:function(e,t){return 62e3!=e?(lr.setErrorCode(12296),0):62006!=t?(lr.setErrorCode(12301),1):(lr.currentReadSurface==t&&(lr.currentReadSurface=0),lr.currentDrawSurface==t&&(lr.currentDrawSurface=0),lr.setErrorCode(12288),1)},R:function(e,t,r,n){if(62e3!=e)return lr.setErrorCode(12296),0;if(62002!=t)return lr.setErrorCode(12293),0;if(!n)return lr.setErrorCode(12300),0;switch(lr.setErrorCode(12288),r){case 12320:return R[n>>2]=lr.contextAttributes.alpha?32:24,1;case 12321:return R[n>>2]=lr.contextAttributes.alpha?8:0,1;case 12322:case 12323:case 12324:return R[n>>2]=8,1;case 12325:return R[n>>2]=lr.contextAttributes.depth?24:0,1;case 12326:return R[n>>2]=lr.contextAttributes.stencil?8:0,1;case 12327:case 12335:case 12340:return R[n>>2]=12344,1;case 12328:return R[n>>2]=62002,1;case 12329:case 12333:case 12334:case 12345:case 12346:case 12347:case 12349:case 12350:case 12354:return R[n>>2]=0,1;case 12330:case 12332:return R[n>>2]=4096,1;case 12331:return R[n>>2]=16777216,1;case 12337:return R[n>>2]=lr.contextAttributes.antialias?4:0,1;case 12338:return R[n>>2]=lr.contextAttributes.antialias?1:0,1;case 12339:case 12352:return R[n>>2]=4,1;case 12341:case 12342:case 12343:return R[n>>2]=-1,1;case 12348:return R[n>>2]=1,1;case 12351:return R[n>>2]=12430,1;default:return lr.setErrorCode(12292),0}},mb:function(e){return lr.setErrorCode(12288),62e3},ra:function(){return lr.errorCode},db:function(e,t,r){return 62e3!=e?(lr.setErrorCode(12296),0):(t&&(R[t>>2]=1),r&&(R[r>>2]=4),lr.defaultDisplayInitialized=!0,lr.setErrorCode(12288),1)},xb:function(e,t,r,n){return 62e3!=e?(lr.setErrorCode(12296),0):0!=n&&62004!=n?(lr.setErrorCode(12294),0):0!=r&&62006!=r||0!=t&&62006!=t?(lr.setErrorCode(12301),0):(gr.makeContextCurrent(n?lr.context:null),lr.currentContext=n,lr.currentDrawSurface=t,lr.currentReadSurface=r,lr.setErrorCode(12288),1)},rc:function(e,t){if(lr.defaultDisplayInitialized)if(s.ctx){if(!s.ctx.isContextLost())return lr.setErrorCode(12288),1;lr.setErrorCode(12302)}else lr.setErrorCode(12290);else lr.setErrorCode(12289);return 0},Mb:function(e){return 62e3!=e?(lr.setErrorCode(12296),0):(lr.currentContext=0,lr.currentReadSurface=0,lr.currentDrawSurface=0,lr.defaultDisplayInitialized=!1,lr.setErrorCode(12288),1)},G:(e,t,r)=>((e,t,r)=>{var n=((e,t)=>{var r;for(yr.length=0,t>>=2;r=D[e++];)t+=105!=r&t,yr.push(105==r?R[t]:(106==r?I:$)[t++>>1]),++t;return yr})(t,r);return se[e].apply(null,n)})(e,t,r),ue:e=>{console.error(Fe(e))},ve:e=>{console.log(Fe(e))},fa:e=>{console.warn(Fe(e))},$:function(){return Date.now()},ke:function(){},ib:()=>2147483648,zb:Qt,Uf:function(e){$n.activeTexture(e)},Vf:function(e,t){$n.attachShader(gr.programs[e],gr.shaders[t])},Xc:function(e,t){$n.beginQuery(e,gr.queries[t])},de:function(e,t){$n.disjointTimerQueryExt.beginQueryEXT(e,gr.queries[t])},Jc:function(e){$n.beginTransformFeedback(e)},Wf:function(e,t,r){$n.bindAttribLocation(gr.programs[e],t,Fe(r))},Xf:function(e,t){35051==e?$n.currentPixelPackBufferBinding=t:35052==e&&($n.currentPixelUnpackBufferBinding=t),$n.bindBuffer(e,gr.buffers[t])},Gc:function(e,t,r){$n.bindBufferBase(e,t,gr.buffers[r])},Hc:function(e,t,r,n,o){$n.bindBufferRange(e,t,gr.buffers[r],n,o)},We:function(e,t){$n.bindFramebuffer(e,gr.framebuffers[t])},Xe:function(e,t){$n.bindRenderbuffer(e,gr.renderbuffers[t])},Ge:function(e,t){$n.bindSampler(e,gr.samplers[t])},Yf:function(e,t){$n.bindTexture(e,gr.textures[t])},Ub:function(e,t){$n.bindTransformFeedback(e,gr.transformFeedbacks[t])},qf:br,tf:wr,Zf:function(e,t,r,n){$n.blendColor(e,t,r,n)},_f:function(e){$n.blendEquation(e)},Rd:function(e,t){$n.blendEquationSeparate(e,t)},$f:function(e,t){$n.blendFunc(e,t)},Qd:function(e,t,r,n){$n.blendFuncSeparate(e,t,r,n)},Qe:function(e,t,r,n,o,i,a,s,u,l){$n.blitFramebuffer(e,t,r,n,o,i,a,s,u,l)},ag:function(e,t,r,n){gr.currentContext.version>=2?r&&t?$n.bufferData(e,D,n,r,t):$n.bufferData(e,t,n):$n.bufferData(e,r?D.subarray(r,r+t):t,n)},bg:function(e,t,r,n){gr.currentContext.version>=2?r&&$n.bufferSubData(e,t,D,n,r):$n.bufferSubData(e,t,D.subarray(n,n+r))},Ye:function(e){return $n.checkFramebufferStatus(e)},cg:function(e){$n.clear(e)},jc:function(e,t,r,n){$n.clearBufferfi(e,t,r,n)},kc:function(e,t,r){$n.clearBufferfv(e,t,O,r>>2)},mc:function(e,t,r){$n.clearBufferiv(e,t,R,r>>2)},lc:function(e,t,r){$n.clearBufferuiv(e,t,M,r>>2)},dg:function(e,t,r,n){$n.clearColor(e,t,r,n)},Pd:function(e){$n.clearDepth(e)},eg:function(e){$n.clearStencil(e)},Ca:function(e,t,r){return r=Number(r),$n.clientWaitSync(gr.syncs[e],t,r)},fg:function(e,t,r,n){$n.colorMask(!!e,!!t,!!r,!!n)},gg:function(e){$n.compileShader(gr.shaders[e])},hg:function(e,t,r,n,o,i,a,s){gr.currentContext.version>=2?$n.currentPixelUnpackBufferBinding||!a?$n.compressedTexImage2D(e,t,r,n,o,i,a,s):$n.compressedTexImage2D(e,t,r,n,o,i,D,s,a):$n.compressedTexImage2D(e,t,r,n,o,i,s?D.subarray(s,s+a):null)},ad:function(e,t,r,n,o,i,a,s,u){$n.currentPixelUnpackBufferBinding?$n.compressedTexImage3D(e,t,r,n,o,i,a,s,u):$n.compressedTexImage3D(e,t,r,n,o,i,a,D,u,s)},ig:function(e,t,r,n,o,i,a,s,u){gr.currentContext.version>=2?$n.currentPixelUnpackBufferBinding||!s?$n.compressedTexSubImage2D(e,t,r,n,o,i,a,s,u):$n.compressedTexSubImage2D(e,t,r,n,o,i,a,D,u,s):$n.compressedTexSubImage2D(e,t,r,n,o,i,a,u?D.subarray(u,u+s):null)},$c:function(e,t,r,n,o,i,a,s,u,l,c){$n.currentPixelUnpackBufferBinding?$n.compressedTexSubImage3D(e,t,r,n,o,i,a,s,u,l,c):$n.compressedTexSubImage3D(e,t,r,n,o,i,a,s,u,D,c,l)},Oe:function(e,t,r,n,o){$n.copyBufferSubData(e,t,r,n,o)},Od:function(e,t,r,n,o,i,a,s){$n.copyTexImage2D(e,t,r,n,o,i,a,s)},jg:function(e,t,r,n,o,i,a,s){$n.copyTexSubImage2D(e,t,r,n,o,i,a,s)},bd:function(e,t,r,n,o,i,a,s,u){$n.copyTexSubImage3D(e,t,r,n,o,i,a,s,u)},kg:function(){var e=gr.getNewId(gr.programs),t=$n.createProgram();return t.name=e,t.maxUniformLength=t.maxAttributeLength=t.maxUniformBlockNameLength=0,t.uniformIdCounter=1,gr.programs[e]=t,e},lg:function(e){var t=gr.getNewId(gr.shaders);return gr.shaders[t]=$n.createShader(e),t},mg:function(e){$n.cullFace(e)},ng:function(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2],o=gr.buffers[n];o&&($n.deleteBuffer(o),o.name=0,gr.buffers[n]=null,n==$n.currentPixelPackBufferBinding&&($n.currentPixelPackBufferBinding=0),n==$n.currentPixelUnpackBufferBinding&&($n.currentPixelUnpackBufferBinding=0))}},Ze:function(e,t){for(var r=0;r<e;++r){var n=R[t+4*r>>2],o=gr.framebuffers[n];o&&($n.deleteFramebuffer(o),o.name=0,gr.framebuffers[n]=null)}},og:function(e){if(e){var t=gr.programs[e];t?($n.deleteProgram(t),t.name=0,gr.programs[e]=null):gr.recordError(1281)}},Zc:function(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2],o=gr.queries[n];o&&($n.deleteQuery(o),gr.queries[n]=null)}},fe:function(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2],o=gr.queries[n];o&&($n.disjointTimerQueryExt.deleteQueryEXT(o),gr.queries[n]=null)}},_e:function(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2],o=gr.renderbuffers[n];o&&($n.deleteRenderbuffer(o),o.name=0,gr.renderbuffers[n]=null)}},He:function(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2],o=gr.samplers[n];o&&($n.deleteSampler(o),o.name=0,gr.samplers[n]=null)}},pg:function(e){if(e){var t=gr.shaders[e];t?($n.deleteShader(t),gr.shaders[e]=null):gr.recordError(1281)}},Pe:function(e){if(e){var t=gr.syncs[e];t?($n.deleteSync(t),t.name=0,gr.syncs[e]=null):gr.recordError(1281)}},qg:function(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2],o=gr.textures[n];o&&($n.deleteTexture(o),o.name=0,gr.textures[n]=null)}},Tb:function(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2],o=gr.transformFeedbacks[n];o&&($n.deleteTransformFeedback(o),o.name=0,gr.transformFeedbacks[n]=null)}},rf:_r,uf:Cr,Nd:function(e){$n.depthFunc(e)},rg:function(e){$n.depthMask(!!e)},Md:function(e,t){$n.depthRange(e,t)},Ld:function(e,t){$n.detachShader(gr.programs[e],gr.shaders[t])},sg:function(e){$n.disable(e)},tg:function(e){$n.disableVertexAttribArray(e)},ug:function(e,t,r){$n.drawArrays(e,t,r)},of:kr,Ud:xr,Fb:Pr,mf:function(e,t,r,n,o){$n.dibvbi.drawArraysInstancedBaseInstanceWEBGL(e,t,r,n,o)},gd:Tr,Gb:Fr,kf:Br,ed:Lr,Vd:Rr,vg:Or,pf:Ur,Td:$r,Db:jr,nf:function(e,t,r,n,o,i,a){$n.dibvbi.drawElementsInstancedBaseVertexBaseInstanceWEBGL(e,t,r,n,o,i,a)},Eb:qr,fd:Nr,df:function(e,t,r,n,o,i){Mr(e,n,o,i)},wg:function(e){$n.enable(e)},xg:function(e){$n.enableVertexAttribArray(e)},Wc:function(e){$n.endQuery(e)},ce:function(e){$n.disjointTimerQueryExt.endQueryEXT(e)},Ic:function(){$n.endTransformFeedback()},Me:function(e,t){var r=$n.fenceSync(e,t);if(r){var n=gr.getNewId(gr.syncs);return r.name=n,gr.syncs[n]=r,n}return 0},yg:function(){$n.finish()},zg:function(){$n.flush()},$e:function(e,t,r,n){$n.framebufferRenderbuffer(e,t,r,gr.renderbuffers[n])},af:function(e,t,r,n,o){$n.framebufferTexture2D(e,t,r,gr.textures[n],o)},Nc:function(e,t,r,n,o){$n.framebufferTextureLayer(e,t,gr.textures[r],n,o)},Ag:function(e){$n.frontFace(e)},Bg:function(e,t){Hr(e,t,"createBuffer",gr.buffers)},bf:function(e,t){Hr(e,t,"createFramebuffer",gr.framebuffers)},_c:function(e,t){Hr(e,t,"createQuery",gr.queries)},ge:function(e,t){for(var r=0;r<e;r++){var n=$n.disjointTimerQueryExt.createQueryEXT();if(!n){for(gr.recordError(1282);r<e;)R[t+4*r++>>2]=0;return}var o=gr.getNewId(gr.queries);n.name=o,gr.queries[o]=n,R[t+4*r>>2]=o}},cf:function(e,t){Hr(e,t,"createRenderbuffer",gr.renderbuffers)},Ie:function(e,t){Hr(e,t,"createSampler",gr.samplers)},Cg:function(e,t){Hr(e,t,"createTexture",gr.textures)},Sb:function(e,t){Hr(e,t,"createTransformFeedback",gr.transformFeedbacks)},sf:Wr,vf:Gr,Se:function(e){$n.generateMipmap(e)},Kd:function(e,t,r,n,o,i,a){zr("getActiveAttrib",e,t,r,n,o,i,a)},Jd:function(e,t,r,n,o,i,a){zr("getActiveUniform",e,t,r,n,o,i,a)},dc:function(e,t,r,n,o){e=gr.programs[e];var i=$n.getActiveUniformBlockName(e,t);if(i)if(o&&r>0){var a=Mt(i,o,r);n&&(R[n>>2]=a)}else n&&(R[n>>2]=0)},ec:function(e,t,r,n){if(n)if(e=gr.programs[e],35393!=r){var o=$n.getActiveUniformBlockParameter(e,t,r);if(null!==o)if(35395==r)for(var i=0;i<o.length;i++)R[n+4*i>>2]=o[i];else R[n>>2]=o}else{var a=$n.getActiveUniformBlockName(e,t);R[n>>2]=a.length+1}else gr.recordError(1281)},hc:function(e,t,r,n,o){if(o)if(t>0&&0==r)gr.recordError(1281);else{e=gr.programs[e];for(var i=[],a=0;a<t;a++)i.push(R[r+4*a>>2]);var s=$n.getActiveUniforms(e,i,n);if(s){var u=s.length;for(a=0;a<u;a++)R[o+4*a>>2]=s[a]}}else gr.recordError(1281)},Id:function(e,t,r,n){var o=$n.getAttachedShaders(gr.programs[e]),i=o.length;i>t&&(i=t),R[r>>2]=i;for(var a=0;a<i;++a){var s=gr.shaders.indexOf(o[a]);R[n+4*a>>2]=s}},Hd:function(e,t){return $n.getAttribLocation(gr.programs[e],Fe(t))},Gd:function(e,t){Xr(e,t,4)},_b:function(e,t,r){r?Yr(r,$n.getBufferParameter(e,t)):gr.recordError(1281)},Dg:function(e,t,r){r?R[r>>2]=$n.getBufferParameter(e,t):gr.recordError(1281)},Eg:function(){var e=$n.getError()||gr.lastError;return gr.lastError=0,e},Fg:function(e,t){Xr(e,t,2)},wc:function(e,t){return $n.getFragDataLocation(gr.programs[e],Fe(t))},Te:function(e,t,r,n){var o=$n.getFramebufferAttachmentParameter(e,t,r);(o instanceof WebGLRenderbuffer||o instanceof WebGLTexture)&&(o=0|o.name),R[n>>2]=o},$b:function(e,t,r){Kr(e,t,r,1)},bc:function(e,t){Xr(e,t,1)},Kc:function(e,t,r){Kr(e,t,r,0)},eh:function(e,t){Xr(e,t,0)},Jb:function(e,t,r,n,o){if(n<0)gr.recordError(1281);else if(o){var i=$n.getInternalformatParameter(e,t,r);if(null!==i)for(var a=0;a<i.length&&a<n;++a)R[o+4*a>>2]=i[a]}else gr.recordError(1281)},Ob:function(e,t,r,n,o){gr.recordError(1282)},Gg:function(e,t,r,n){var o=$n.getProgramInfoLog(gr.programs[e]);null===o&&(o="(unknown error)");var i=t>0&&n?Mt(o,n,t):0;r&&(R[r>>2]=i)},Hg:function(e,t,r){if(r)if(e>=gr.counter)gr.recordError(1281);else if(e=gr.programs[e],35716==t){var n=$n.getProgramInfoLog(e);null===n&&(n="(unknown error)"),R[r>>2]=n.length+1}else if(35719==t){if(!e.maxUniformLength)for(var o=0;o<$n.getProgramParameter(e,35718);++o)e.maxUniformLength=Math.max(e.maxUniformLength,$n.getActiveUniform(e,o).name.length+1);R[r>>2]=e.maxUniformLength}else if(35722==t){if(!e.maxAttributeLength)for(o=0;o<$n.getProgramParameter(e,35721);++o)e.maxAttributeLength=Math.max(e.maxAttributeLength,$n.getActiveAttrib(e,o).name.length+1);R[r>>2]=e.maxAttributeLength}else if(35381==t){if(!e.maxUniformBlockNameLength)for(o=0;o<$n.getProgramParameter(e,35382);++o)e.maxUniformBlockNameLength=Math.max(e.maxUniformBlockNameLength,$n.getActiveUniformBlockName(e,o).length+1);R[r>>2]=e.maxUniformBlockNameLength}else R[r>>2]=$n.getProgramParameter(e,t);else gr.recordError(1281)},Yd:Zr,_d:en,Xd:tn,Uc:function(e,t,r){if(r){var n,o=gr.queries[e],i=$n.getQueryParameter(o,t);n="boolean"==typeof i?i?1:0:i,R[r>>2]=n}else gr.recordError(1281)},Zd:rn,Vc:function(e,t,r){r?R[r>>2]=$n.getQuery(e,t):gr.recordError(1281)},$d:function(e,t,r){r?R[r>>2]=$n.disjointTimerQueryExt.getQueryEXT(e,t):gr.recordError(1281)},Ue:function(e,t,r){r?R[r>>2]=$n.getRenderbufferParameter(e,t):gr.recordError(1281)},Vb:function(e,t,r){r?O[r>>2]=$n.getSamplerParameter(gr.samplers[e],t):gr.recordError(1281)},Wb:function(e,t,r){r?R[r>>2]=$n.getSamplerParameter(gr.samplers[e],t):gr.recordError(1281)},Ig:function(e,t,r,n){var o=$n.getShaderInfoLog(gr.shaders[e]);null===o&&(o="(unknown error)");var i=t>0&&n?Mt(o,n,t):0;r&&(R[r>>2]=i)},Ce:function(e,t,r,n){var o=$n.getShaderPrecisionFormat(e,t);R[r>>2]=o.rangeMin,R[r+4>>2]=o.rangeMax,R[n>>2]=o.precision},Fd:function(e,t,r,n){var o=$n.getShaderSource(gr.shaders[e]);if(o){var i=t>0&&n?Mt(o,n,t):0;r&&(R[r>>2]=i)}},Jg:function(e,t,r){if(r)if(35716==t){var n=$n.getShaderInfoLog(gr.shaders[e]);null===n&&(n="(unknown error)");var o=n?n.length+1:0;R[r>>2]=o}else if(35720==t){var i=$n.getShaderSource(gr.shaders[e]),a=i?i.length+1:0;R[r>>2]=a}else R[r>>2]=$n.getShaderParameter(gr.shaders[e],t);else gr.recordError(1281)},Ba:function(e){var t=gr.stringCache[e];if(!t){switch(e){case 7939:var r=$n.getSupportedExtensions()||[];r=r.concat(r.map((function(e){return"GL_"+e}))),t=rr(r.join(" "));break;case 7936:case 7937:case 37445:case 37446:var n=$n.getParameter(e);n||gr.recordError(1280),t=n&&rr(n);break;case 7938:var o=$n.getParameter(7938);o=gr.currentContext.version>=2?"OpenGL ES 3.0 ("+o+")":"OpenGL ES 2.0 ("+o+")",t=rr(o);break;case 35724:var i=$n.getParameter(35724),a=i.match(/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/);null!==a&&(3==a[1].length&&(a[1]=a[1]+"0"),i="OpenGL ES GLSL ES "+a[1]+" ("+i+")"),t=rr(i);break;default:gr.recordError(1280)}gr.stringCache[e]=t}return t},fh:function(e,t){if(gr.currentContext.version<2)return gr.recordError(1282),0;var r=gr.stringiCache[e];if(r)return t<0||t>=r.length?(gr.recordError(1281),0):r[t];if(7939===e){var n=$n.getSupportedExtensions()||[];return n=(n=n.concat(n.map((function(e){return"GL_"+e})))).map((function(e){return rr(e)})),r=gr.stringiCache[e]=n,t<0||t>=r.length?(gr.recordError(1281),0):r[t]}return gr.recordError(1280),0},ac:function(e,t,r,n,o){if(r<0)gr.recordError(1281);else if(o){var i=$n.getSyncParameter(gr.syncs[e],t);null!==i&&(R[o>>2]=i,n&&(R[n>>2]=1))}else gr.recordError(1281)},Ed:function(e,t,r){r?O[r>>2]=$n.getTexParameter(e,t):gr.recordError(1281)},Dd:function(e,t,r){r?R[r>>2]=$n.getTexParameter(e,t):gr.recordError(1281)},Ec:function(e,t,r,n,o,i,a){e=gr.programs[e];var s=$n.getTransformFeedbackVarying(e,t);if(s){if(a&&r>0){var u=Mt(s.name,a,r);n&&(R[n>>2]=u)}else n&&(R[n>>2]=0);o&&(R[o>>2]=s.size),i&&(R[i>>2]=s.type)}},fc:function(e,t){return $n.getUniformBlockIndex(gr.programs[e],Fe(t))},ic:function(e,t,r,n){if(n)if(t>0&&(0==r||0==n))gr.recordError(1281);else{e=gr.programs[e];for(var o=[],i=0;i<t;i++)o.push(Fe(R[r+4*i>>2]));var a=$n.getUniformIndices(e,o);if(a){var s=a.length;for(i=0;i<s;i++)R[n+4*i>>2]=a[i]}}else gr.recordError(1281)},Kg:function(e,t){if(t=Fe(t),e=gr.programs[e]){on(e);var r=e.uniformLocsById,n=0,o=t,i=nn(t);i>0&&(s=t.slice(i+1),n=parseInt(s)>>>0,o=t.slice(0,i));var a=e.uniformSizeAndIdsByName[o];if(a&&n<a[0]&&(r[n+=a[1]]=r[n]||$n.getUniformLocation(e,t)))return n}else gr.recordError(1281);var s;return-1},Cd:function(e,t,r){sn(e,t,r,2)},Bd:function(e,t,r){sn(e,t,r,0)},xc:function(e,t,r){sn(e,t,r,0)},Dc:cn,Cc:dn,yd:function(e,t,r){r?R[r>>2]=$n.getVertexAttribOffset(e,t):gr.recordError(1281)},Ad:function(e,t,r){un(e,t,r,2)},zd:function(e,t,r){un(e,t,r,5)},xd:function(e,t){$n.hint(e,t)},De:function(e,t,r){for(var n=Ar[t],o=0;o<t;o++)n[o]=R[r+4*o>>2];$n.invalidateFramebuffer(e,n)},Fe:function(e,t,r,n,o,i,a){for(var s=Ar[t],u=0;u<t;u++)s[u]=R[r+4*u>>2];$n.invalidateSubFramebuffer(e,s,n,o,i,a)},wd:function(e){var t=gr.buffers[e];return t?$n.isBuffer(t):0},vd:function(e){return $n.isEnabled(e)},ud:function(e){var t=gr.framebuffers[e];return t?$n.isFramebuffer(t):0},td:function(e){return(e=gr.programs[e])?$n.isProgram(e):0},Yc:function(e){var t=gr.queries[e];return t?$n.isQuery(t):0},ee:function(e){var t=gr.queries[e];return t?$n.disjointTimerQueryExt.isQueryEXT(t):0},sd:function(e){var t=gr.renderbuffers[e];return t?$n.isRenderbuffer(t):0},Zb:function(e){var t=gr.samplers[e];return t?$n.isSampler(t):0},rd:function(e){var t=gr.shaders[e];return t?$n.isShader(t):0},Ne:function(e){return $n.isSync(gr.syncs[e])},Lg:function(e){var t=gr.textures[e];return t?$n.isTexture(t):0},Rb:function(e){return $n.isTransformFeedback(gr.transformFeedbacks[e])},Lc:pn,Wd:hn,Mg:function(e){$n.lineWidth(e)},Ng:function(e){e=gr.programs[e],$n.linkProgram(e),e.uniformLocsById=0,e.uniformSizeAndIdsByName={}},hf:function(e,t,r,n,o,i){$n.mdibvbi.multiDrawArraysInstancedBaseInstanceWEBGL(e,R,t>>2,R,r>>2,R,n>>2,M,o>>2,i)},jf:function(e,t,r,n,o,i,a,s){$n.mdibvbi.multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL(e,R,t>>2,r,R,n>>2,R,o>>2,R,i>>2,M,a>>2,s)},Qb:function(){$n.pauseTransformFeedback()},Og:function(e,t){3317==e&&(gr.unpackAlignment=t),$n.pixelStorei(e,t)},qd:function(e,t){$n.polygonOffset(e,t)},Nb:function(e,t,r,n){gr.recordError(1280)},Lb:function(e,t,r){gr.recordError(1280)},ae:function(e,t){$n.disjointTimerQueryExt.queryCounterEXT(gr.queries[e],t)},lf:function(e){$n.readBuffer(e)},Pg:function(e,t,r,n,o,i,a){if(gr.currentContext.version>=2)if($n.currentPixelPackBufferBinding)$n.readPixels(e,t,r,n,o,i,a);else{var s=mn(i);$n.readPixels(e,t,r,n,o,i,s,a>>gn(s))}else{var u=yn(i,o,r,n,a);u?$n.readPixels(e,t,r,n,o,i,u):gr.recordError(1280)}},pd:function(){},Ve:function(e,t,r,n){$n.renderbufferStorage(e,t,r,n)},Re:function(e,t,r,n,o){$n.renderbufferStorageMultisample(e,t,r,n,o)},Pb:function(){$n.resumeTransformFeedback()},od:function(e,t){$n.sampleCoverage(e,!!t)},Je:function(e,t,r){$n.samplerParameterf(gr.samplers[e],t,r)},Yb:function(e,t,r){var n=O[r>>2];$n.samplerParameterf(gr.samplers[e],t,n)},Ke:function(e,t,r){$n.samplerParameteri(gr.samplers[e],t,r)},Le:function(e,t,r){var n=R[r>>2];$n.samplerParameteri(gr.samplers[e],t,n)},Qg:function(e,t,r,n){$n.scissor(e,t,r,n)},nd:function(e,t,r,n,o){gr.recordError(1280)},Rg:function(e,t,r,n){var o=gr.getSource(e,t,r,n);if(gr.currentContext.version>=2&&o.includes("#version 100")){var i="";(o=(o=o.replace(/#extension GL_OES_standard_derivatives : enable/g,"")).replace(/#extension GL_EXT_shader_texture_lod : enable/g,"")).includes("gl_FragColor")&&(i+="out mediump vec4 GL_FragColor;\n",o=o.replace(/gl_FragColor/g,"GL_FragColor")),o=(o=(o=(o=(o=(o=(o=(o=(o=(o=(o=(o=o.includes("attribute")?(o=o.replace(/attribute/g,"in")).replace(/varying/g,"out"):o.replace(/varying/g,"in")).replace(/textureCubeLodEXT/g,"textureCubeLod")).replace(/texture2DLodEXT/g,"texture2DLod")).replace(/texture2DProjLodEXT/g,"texture2DProjLod")).replace(/texture2DGradEXT/g,"texture2DGrad")).replace(/texture2DProjGradEXT/g,"texture2DProjGrad")).replace(/textureCubeGradEXT/g,"textureCubeGrad")).replace(/textureCube/g,"texture")).replace(/texture1D/g,"texture")).replace(/texture2D/g,"texture")).replace(/texture3D/g,"texture")).replace(/#version 100/g,"#version 300 es\n"+i)}$n.shaderSource(gr.shaders[e],o)},Sg:function(e,t,r){$n.stencilFunc(e,t,r)},Tg:function(e,t,r,n){$n.stencilFuncSeparate(e,t,r,n)},Ug:function(e){$n.stencilMask(e)},Vg:function(e,t){$n.stencilMaskSeparate(e,t)},Wg:function(e,t,r){$n.stencilOp(e,t,r)},Xg:function(e,t,r,n){$n.stencilOpSeparate(e,t,r,n)},Yg:function(e,t,r,n,o,i,a,s,u){if(gr.currentContext.version>=2&&(6402==a&&6402==r&&5125==s&&(r=33190),36193==s&&(s=5131,6408==a&&6408==r&&(r=34842)),34041==r&&(r=35056)),gr.currentContext.version>=2)if($n.currentPixelUnpackBufferBinding)$n.texImage2D(e,t,r,n,o,i,a,s,u);else if(u){var l=mn(s);$n.texImage2D(e,t,r,n,o,i,a,s,l,u>>gn(l))}else $n.texImage2D(e,t,r,n,o,i,a,s,null);else $n.texImage2D(e,t,r,n,o,i,a,s,u?yn(s,a,n,o,u):null)},dd:function(e,t,r,n,o,i,a,s,u,l){if($n.currentPixelUnpackBufferBinding)$n.texImage3D(e,t,r,n,o,i,a,s,u,l);else if(l){var c=mn(u);$n.texImage3D(e,t,r,n,o,i,a,s,u,c,l>>gn(c))}else $n.texImage3D(e,t,r,n,o,i,a,s,u,null)},Zg:function(e,t,r){$n.texParameterf(e,t,r)},_g:function(e,t,r){var n=O[r>>2];$n.texParameterf(e,t,n)},$g:function(e,t,r){$n.texParameteri(e,t,r)},ah:function(e,t,r){var n=R[r>>2];$n.texParameteri(e,t,n)},ef:function(e,t,r,n,o){$n.texStorage2D(e,t,r,n,o)},Kb:function(e,t,r,n,o,i){$n.texStorage3D(e,t,r,n,o,i)},bh:function(e,t,r,n,o,i,a,s,u){if(gr.currentContext.version>=2&&36193==s&&(s=5131),gr.currentContext.version>=2)if($n.currentPixelUnpackBufferBinding)$n.texSubImage2D(e,t,r,n,o,i,a,s,u);else if(u){var l=mn(s);$n.texSubImage2D(e,t,r,n,o,i,a,s,l,u>>gn(l))}else $n.texSubImage2D(e,t,r,n,o,i,a,s,null);else{var c=null;u&&(c=yn(s,a,o,i,u)),$n.texSubImage2D(e,t,r,n,o,i,a,s,c)}},cd:function(e,t,r,n,o,i,a,s,u,l,c){if($n.currentPixelUnpackBufferBinding)$n.texSubImage3D(e,t,r,n,o,i,a,s,u,l,c);else if(c){var d=mn(l);$n.texSubImage3D(e,t,r,n,o,i,a,s,u,l,d,c>>gn(d))}else $n.texSubImage3D(e,t,r,n,o,i,a,s,u,l,null)},Fc:function(e,t,r,n){e=gr.programs[e];for(var o=[],i=0;i<t;i++)o.push(Fe(R[r+4*i>>2]));$n.transformFeedbackVaryings(e,o,n)},ch:function(e,t){$n.uniform1f(an(e),t)},dh:function(e,t,r){if(gr.currentContext.version>=2)t&&$n.uniform1fv(an(e),O,r>>2,t);else{if(t<=288)for(var n=vn[t-1],o=0;o<t;++o)n[o]=O[r+4*o>>2];else n=O.subarray(r>>2,r+4*t>>2);$n.uniform1fv(an(e),n)}},Qf:function(e,t){$n.uniform1i(an(e),t)},Rf:function(e,t,r){if(gr.currentContext.version>=2)t&&$n.uniform1iv(an(e),R,r>>2,t);else{if(t<=288)for(var n=bn[t-1],o=0;o<t;++o)n[o]=R[r+4*o>>2];else n=R.subarray(r>>2,r+4*t>>2);$n.uniform1iv(an(e),n)}},vc:function(e,t){$n.uniform1ui(an(e),t)},qc:function(e,t,r){t&&$n.uniform1uiv(an(e),M,r>>2,t)},Sf:function(e,t,r){$n.uniform2f(an(e),t,r)},Tf:function(e,t,r){if(gr.currentContext.version>=2)t&&$n.uniform2fv(an(e),O,r>>2,2*t);else{if(t<=144)for(var n=vn[2*t-1],o=0;o<2*t;o+=2)n[o]=O[r+4*o>>2],n[o+1]=O[r+(4*o+4)>>2];else n=O.subarray(r>>2,r+8*t>>2);$n.uniform2fv(an(e),n)}},Pf:function(e,t,r){$n.uniform2i(an(e),t,r)},Of:function(e,t,r){if(gr.currentContext.version>=2)t&&$n.uniform2iv(an(e),R,r>>2,2*t);else{if(t<=144)for(var n=bn[2*t-1],o=0;o<2*t;o+=2)n[o]=R[r+4*o>>2],n[o+1]=R[r+(4*o+4)>>2];else n=R.subarray(r>>2,r+8*t>>2);$n.uniform2iv(an(e),n)}},uc:function(e,t,r){$n.uniform2ui(an(e),t,r)},pc:function(e,t,r){t&&$n.uniform2uiv(an(e),M,r>>2,2*t)},Nf:function(e,t,r,n){$n.uniform3f(an(e),t,r,n)},Mf:function(e,t,r){if(gr.currentContext.version>=2)t&&$n.uniform3fv(an(e),O,r>>2,3*t);else{if(t<=96)for(var n=vn[3*t-1],o=0;o<3*t;o+=3)n[o]=O[r+4*o>>2],n[o+1]=O[r+(4*o+4)>>2],n[o+2]=O[r+(4*o+8)>>2];else n=O.subarray(r>>2,r+12*t>>2);$n.uniform3fv(an(e),n)}},Lf:function(e,t,r,n){$n.uniform3i(an(e),t,r,n)},Kf:function(e,t,r){if(gr.currentContext.version>=2)t&&$n.uniform3iv(an(e),R,r>>2,3*t);else{if(t<=96)for(var n=bn[3*t-1],o=0;o<3*t;o+=3)n[o]=R[r+4*o>>2],n[o+1]=R[r+(4*o+4)>>2],n[o+2]=R[r+(4*o+8)>>2];else n=R.subarray(r>>2,r+12*t>>2);$n.uniform3iv(an(e),n)}},tc:function(e,t,r,n){$n.uniform3ui(an(e),t,r,n)},oc:function(e,t,r){t&&$n.uniform3uiv(an(e),M,r>>2,3*t)},Jf:function(e,t,r,n,o){$n.uniform4f(an(e),t,r,n,o)},If:function(e,t,r){if(gr.currentContext.version>=2)t&&$n.uniform4fv(an(e),O,r>>2,4*t);else{if(t<=72){var n=vn[4*t-1],o=O;r>>=2;for(var i=0;i<4*t;i+=4){var a=r+i;n[i]=o[a],n[i+1]=o[a+1],n[i+2]=o[a+2],n[i+3]=o[a+3]}}else n=O.subarray(r>>2,r+16*t>>2);$n.uniform4fv(an(e),n)}},wf:function(e,t,r,n,o){$n.uniform4i(an(e),t,r,n,o)},xf:function(e,t,r){if(gr.currentContext.version>=2)t&&$n.uniform4iv(an(e),R,r>>2,4*t);else{if(t<=72)for(var n=bn[4*t-1],o=0;o<4*t;o+=4)n[o]=R[r+4*o>>2],n[o+1]=R[r+(4*o+4)>>2],n[o+2]=R[r+(4*o+8)>>2],n[o+3]=R[r+(4*o+12)>>2];else n=R.subarray(r>>2,r+16*t>>2);$n.uniform4iv(an(e),n)}},sc:function(e,t,r,n,o){$n.uniform4ui(an(e),t,r,n,o)},nc:function(e,t,r){t&&$n.uniform4uiv(an(e),M,r>>2,4*t)},cc:function(e,t,r){e=gr.programs[e],$n.uniformBlockBinding(e,t,r)},yf:function(e,t,r,n){if(gr.currentContext.version>=2)t&&$n.uniformMatrix2fv(an(e),!!r,O,n>>2,4*t);else{if(t<=72)for(var o=vn[4*t-1],i=0;i<4*t;i+=4)o[i]=O[n+4*i>>2],o[i+1]=O[n+(4*i+4)>>2],o[i+2]=O[n+(4*i+8)>>2],o[i+3]=O[n+(4*i+12)>>2];else o=O.subarray(n>>2,n+16*t>>2);$n.uniformMatrix2fv(an(e),!!r,o)}},Tc:function(e,t,r,n){t&&$n.uniformMatrix2x3fv(an(e),!!r,O,n>>2,6*t)},Rc:function(e,t,r,n){t&&$n.uniformMatrix2x4fv(an(e),!!r,O,n>>2,8*t)},zf:function(e,t,r,n){if(gr.currentContext.version>=2)t&&$n.uniformMatrix3fv(an(e),!!r,O,n>>2,9*t);else{if(t<=32)for(var o=vn[9*t-1],i=0;i<9*t;i+=9)o[i]=O[n+4*i>>2],o[i+1]=O[n+(4*i+4)>>2],o[i+2]=O[n+(4*i+8)>>2],o[i+3]=O[n+(4*i+12)>>2],o[i+4]=O[n+(4*i+16)>>2],o[i+5]=O[n+(4*i+20)>>2],o[i+6]=O[n+(4*i+24)>>2],o[i+7]=O[n+(4*i+28)>>2],o[i+8]=O[n+(4*i+32)>>2];else o=O.subarray(n>>2,n+36*t>>2);$n.uniformMatrix3fv(an(e),!!r,o)}},Sc:function(e,t,r,n){t&&$n.uniformMatrix3x2fv(an(e),!!r,O,n>>2,6*t)},Pc:function(e,t,r,n){t&&$n.uniformMatrix3x4fv(an(e),!!r,O,n>>2,12*t)},Af:function(e,t,r,n){if(gr.currentContext.version>=2)t&&$n.uniformMatrix4fv(an(e),!!r,O,n>>2,16*t);else{if(t<=18){var o=vn[16*t-1],i=O;n>>=2;for(var a=0;a<16*t;a+=16){var s=n+a;o[a]=i[s],o[a+1]=i[s+1],o[a+2]=i[s+2],o[a+3]=i[s+3],o[a+4]=i[s+4],o[a+5]=i[s+5],o[a+6]=i[s+6],o[a+7]=i[s+7],o[a+8]=i[s+8],o[a+9]=i[s+9],o[a+10]=i[s+10],o[a+11]=i[s+11],o[a+12]=i[s+12],o[a+13]=i[s+13],o[a+14]=i[s+14],o[a+15]=i[s+15]}}else o=O.subarray(n>>2,n+64*t>>2);$n.uniformMatrix4fv(an(e),!!r,o)}},Qc:function(e,t,r,n){t&&$n.uniformMatrix4x2fv(an(e),!!r,O,n>>2,8*t)},Oc:function(e,t,r,n){t&&$n.uniformMatrix4x3fv(an(e),!!r,O,n>>2,12*t)},Bf:function(e){e=gr.programs[e],$n.useProgram(e),$n.currentProgram=e},md:function(e){$n.validateProgram(gr.programs[e])},Cf:function(e,t){$n.vertexAttrib1f(e,t)},ld:function(e,t){$n.vertexAttrib1f(e,O[t>>2])},kd:function(e,t,r){$n.vertexAttrib2f(e,t,r)},Df:function(e,t){$n.vertexAttrib2f(e,O[t>>2],O[t+4>>2])},jd:function(e,t,r,n){$n.vertexAttrib3f(e,t,r,n)},Ef:function(e,t){$n.vertexAttrib3f(e,O[t>>2],O[t+4>>2],O[t+8>>2])},id:function(e,t,r,n,o){$n.vertexAttrib4f(e,t,r,n,o)},Ff:function(e,t){$n.vertexAttrib4f(e,O[t>>2],O[t+4>>2],O[t+8>>2],O[t+12>>2])},ff:En,Sd:_n,Hb:Cn,hd:Sn,Ib:kn,Bc:function(e,t,r,n,o){$n.vertexAttribI4i(e,t,r,n,o)},zc:function(e,t){$n.vertexAttribI4i(e,R[t>>2],R[t+4>>2],R[t+8>>2],R[t+12>>2])},Ac:function(e,t,r,n,o){$n.vertexAttribI4ui(e,t,r,n,o)},yc:function(e,t){$n.vertexAttribI4ui(e,M[t>>2],M[t+4>>2],M[t+8>>2],M[t+12>>2])},gf:function(e,t,r,n,o){$n.vertexAttribIPointer(e,t,r,n,o)},Gf:function(e,t,r,n,o,i){$n.vertexAttribPointer(e,t,r,!!n,o,i)},Hf:function(e,t,r,n){$n.viewport(e,t,r,n)},Da:function(e,t,r){r=Number(r),$n.waitSync(gr.syncs[e],t,r)},Bb:(e,t,r)=>D.copyWithin(e,t,t+r),jb:e=>{var t=D.length,r=2147483648;if((e>>>=0)>r)return!1;for(var n,o=1;o<=4;o*=2){var i=t*(1+.2/o);i=Math.min(i,e+100663296);var a=Math.min(r,(n=Math.max(e,i))+(65536-n%65536)%65536);if(xn(a))return!0}return!1},Ua:function(e,t,r,n,o,i,a,u,l){const c=s.UTF8ToString(e,e+t),d=s.HEAPU8.subarray(o,o+i),f=s.emscripten_ubq_codec_audioDecoderNextHandle++,p={codec:c,sampleRate:r,numberOfChannels:n,description:d};try{const e=s.emscripten_ubq_codec_createAudioDecoder(a,u,l);AudioDecoder.isConfigSupported(p).then((t=>{e.configUnsupported=!t}),(()=>{e.configUnsupported=!0})),e.configure(p),s.emscripten_ubq_codec_audioDecoders.set(f,{audioDecoder:e,decoderConfig:p,leftBufferPtr:a,rightBufferPtr:u,bufferLength:l})}catch(e){return s.emscripten_ubq_codec_createNativeResult({error:e})}return s.emscripten_ubq_codec_createNativeResult({handle:f})},La:function(e,t,r,n,o,i){const a=s.UTF8ToString(e,e+t),u=s.emscripten_ubq_codec_audioEncoderNextHandle++,l={codec:a,sampleRate:r,numberOfChannels:n,bitrate:o};try{const e=new AudioEncoder({output:e=>{const t=s._malloc(e.byteLength),r=s.HEAPU8.subarray(t,t+e.byteLength);e.copyTo(r),s.emscripten_ubq_codec_onOutputEncodedAudioChunk(u,t,e.byteLength,i),s._free(t)},error:e=>console.error(e)});e.configure(l),s.emscripten_ubq_codec_audioEncoders.set(u,{audioEncoder:e,audioEncoderConfig:l,frameIndex:0})}catch(e){return e+=' Requested codec: "'+a+'"',e+="; sample rate: "+r,e+="; channels: "+n,e+="; bit rate: "+o,s.emscripten_ubq_codec_createNativeResult({error:e})}return s.emscripten_ubq_codec_createNativeResult({handle:u})},Za:function(e,t,r,n,o,i,a){const u=s.UTF8ToString(e,e+t),l=s.HEAPU8.subarray(o,o+i),c=s.emscripten_ubq_codec_videoDecoderNextHandle++,d={codec:u,codedWidth:r,codedHeight:n,description:l,optimizeForLatency:!0};try{const e=s.emscripten_ubq_codec_createVideoDecoder(c,a);VideoDecoder.isConfigSupported(d).then((t=>{e.configUnsupported=!t}),(()=>{e.configUnsupported=!0})),e.configure(d),s.emscripten_ubq_codec_videoDecoders.set(c,{videoDecoder:e,decoderConfig:d,codecServicePtr:a})}catch(e){return s.emscripten_ubq_codec_createNativeResult({error:e})}return s.emscripten_ubq_codec_createNativeResult({handle:c})},Pa:function(e,t,r,n,o,i){const a=s.UTF8ToString(e,e+t),u=s.emscripten_ubq_codec_videoEncoderNextHandle++,l=s.specialHTMLTargets["!canvas"];l.width=r,l.height=n;const c={codec:a,width:r,height:n,avc:{format:"annexb"},framerate:o};try{const e=new VideoEncoder({output:e=>{const t=s._malloc(e.byteLength),r=s.HEAPU8.subarray(t,t+e.byteLength);e.copyTo(r),s.emscripten_ubq_codec_onOutputEncodedVideoChunk(u,t,e.byteLength,i),s._free(t)},error:e=>console.error(e)});VideoEncoder.isConfigSupported(c).then((t=>{e.configUnsupported=!t}),(()=>{e.configUnsupported=!0})),e.configure(c),s.emscripten_ubq_codec_videoEncoders.set(u,{videoEncoder:e,encoderConfig:c,groupOfPictures:150,frameIndex:0})}catch(e){return e+=' Requested codec: "'+a+'"',e+="; resolution: "+r+"x"+n,s.emscripten_ubq_codec_createNativeResult({error:e})}return s.emscripten_ubq_codec_createNativeResult({handle:u})},Qa:function(e,t,r,n,o,i){const a=s.emscripten_ubq_codec_audioDecoders.get(e);if(a.audioDecoder.unexpectedError)return s.emscripten_ubq_codec_createNativeResult({code:2,error:a.audioDecoder.unexpectedError});"closed"===a.audioDecoder.state&&(a.audioDecoder=s.emscripten_ubq_codec_createAudioDecoder(a.leftBufferPtr,a.rightBufferPtr,a.bufferLength),a.audioDecoder.configure(a.decoderConfig));const u=a.audioDecoder,l=s.HEAPU8.subarray(o,o+i),c=new EncodedAudioChunk({type:t?"key":"delta",timestamp:r,duration:n,data:l});try{u.decode(c)}catch(e){return u.configUnsupported?s.emscripten_ubq_codec_createNativeResult({code:2,error:e}):s.emscripten_ubq_codec_createNativeResult({code:1,error:e})}return s.emscripten_ubq_codec_createNativeResult({code:0})},Ha:function(e,t,r,n,o,i){const a=s.emscripten_ubq_codec_videoDecoders.get(e);if(a.videoDecoder.unexpectedError)return s.emscripten_ubq_codec_createNativeResult({code:2,error:a.videoDecoder.unexpectedError});if("closed"===a.videoDecoder.state){const t=a.videoDecoder.textures;return a.videoDecoder=s.emscripten_ubq_codec_createVideoDecoder(e,a.codecServicePtr),a.videoDecoder.textures=t,a.videoDecoder.configure(a.decoderConfig),s.emscripten_ubq_codec_createNativeResult({code:1,error:"VideoDecoder was closed"})}const u=a.videoDecoder,l=s.HEAPU8.subarray(o,o+i),c=new EncodedVideoChunk({type:t?"key":"delta",timestamp:r,duration:n,data:l});try{u.decode(c)}catch(e){return u.configUnsupported?s.emscripten_ubq_codec_createNativeResult({code:2,error:e}):s.emscripten_ubq_codec_createNativeResult({code:1,error:e})}return s.emscripten_ubq_codec_createNativeResult({code:0})},Ta:function(e){if(s.emscripten_ubq_codec_audioDecoders.has(e)){const t=s.emscripten_ubq_codec_audioDecoders.get(e);"closed"!==t.audioDecoder.state&&t.audioDecoder.close(),s.emscripten_ubq_codec_audioDecoders.delete(e)}},Ka:function(e){const t=s.emscripten_ubq_codec_audioEncoders.get(e);"closed"!==t.audioEncoder.state&&t.audioEncoder.close(),s.emscripten_ubq_codec_audioEncoders.delete(e)},Xa:function(e){if(s.emscripten_ubq_codec_videoDecoders.has(e)){const t=s.emscripten_ubq_codec_videoDecoders.get(e);"closed"!==t.videoDecoder.state&&t.videoDecoder.close(),s.emscripten_ubq_codec_videoDecoders.delete(e)}},Oa:function(e){const t=s.emscripten_ubq_codec_videoEncoders.get(e);"closed"!==t.videoEncoder.state&&t.videoEncoder.close(),s.emscripten_ubq_codec_videoEncoders.delete(e)},Ja:function(e,t,r){const n=1e6,o=s.emscripten_ubq_codec_audioEncoders.get(e),i=o.audioEncoderConfig.sampleRate,a=o.audioEncoderConfig.numberOfChannels,u=r/a,l=Math.round(n*(o.frameIndex*u/i)),c=Math.round(n*(u/i)),d=s.HEAPF32.subarray(t/4,t/4+r),f=new AudioData({format:"f32",sampleRate:i,numberOfFrames:u,numberOfChannels:a,duration:c,timestamp:l,data:d});o.audioEncoder.encode(f),o.frameIndex++,f.close()},Na:function(e,t,r){const n=1e6,o=s.emscripten_ubq_codec_videoEncoders.get(e),i=Math.round(n*(o.frameIndex/o.encoderConfig.framerate)),a=o.frameIndex%o.groupOfPictures==0,u=Math.round(n/o.encoderConfig.framerate),l=s.specialHTMLTargets["!canvas"],c=new VideoFrame(l,{timestamp:i,duration:u});o.videoEncoder.encode(c,{keyFrame:a}),c.close(),o.frameIndex++},Ia:async function(e,t){const r=s.emscripten_ubq_codec_audioEncoders.get(e);await r.audioEncoder.flush(),s.emscripten_ubq_codec_onFinalizedAudioEncoding(e,t)},Ma:async function(e,t){const r=s.emscripten_ubq_codec_videoEncoders.get(e);await r.videoEncoder.flush(),s.emscripten_ubq_codec_onFinalizedVideoEncoding(e,t)},Sa:async function(e,t){const r=s.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder;r.flushing=!0;try{await r.flush()}catch{}r.flushing=!1,r.writtenFrames=t},X:async function(e,t,r){const n=s.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder;n.shouldDropFrames=r,n.flushing=!0;try{await n.flush()}catch{}n.flushing=!1,n.shouldDropFrames=!1,n.decodedFrames=t},ia:function(e){return s.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder.decodeQueueSize},ja:function(e){return s.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder.decodedFrames},_:function(e){return s.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder.writtenFrames},Ra:function(e){return s.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder.flushing},Wa:function(e){return s.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder.flushing},Y:function(){return"undefined"!=typeof VideoFrame&&"undefined"!=typeof VideoDecoder&&"undefined"!=typeof VideoEncoder&&"undefined"!=typeof AudioDecoder&&"undefined"!=typeof AudioEncoder},Va:function(e,t){s.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder.requestedFrame=t},Ya:function(e,t,r){const n=s.emscripten_ubq_codec_videoDecoders.get(e),o=s.HEAPU32.subarray(t/4,t/4+r);n.videoDecoder.textures=[];for(let e=0;e<r;e++)n.videoDecoder.textures[e]=gr.textures[o[e]]},oe:function(e){const t=s.emscripten_ubq_asyncFetchManager.getProcess(e);return!!(null==t?void 0:t.allocate())},ea:function(e,t,r,n){return s.emscripten_ubq_asyncFetchManager.createHeader(e,t,r,n)},se:function(e){s.emscripten_ubq_asyncFetchManager.deleteHeader(e)},te:function(e,t,r,n,o,i,a,u,l){return s.emscripten_ubq_asyncFetchManager.fetch(e,t,r,n,o,i,a,u,l).handle},le:function(e){return s.emscripten_ubq_asyncFetchManager.deleteProcess(e)},re:function(e){var t,r;return null!==(r=null===(t=s.emscripten_ubq_asyncFetchManager.getProcess(e))||void 0===t?void 0:t.receivedLength)&&void 0!==r?r:0},ne:function(e){const t=s.emscripten_ubq_asyncFetchManager.getProcess(e);return(null==t?void 0:t.isAllocated())?t.resultAddress:-1},me:function(e){const t=s.emscripten_ubq_asyncFetchManager.getProcess(e);return(null==t?void 0:t.isAllocated())?t.resultLength:-1},xa:function(e){var t,r;return null!==(r=null===(t=s.emscripten_ubq_asyncFetchManager.getProcess(e))||void 0===t?void 0:t.state)&&void 0!==r?r:-1},pe:function(e){var t,r;return null!==(r=null===(t=s.emscripten_ubq_asyncFetchManager.getProcess(e))||void 0===t?void 0:t.totalBytes)&&void 0!==r?r:0},ab:function(){return!!s.emscripten_ubq_settings_forceWebGL1},la:function(e,t){var r=t>>2,n=R[r+6],o={alpha:!!R[r+0],depth:!!R[r+1],stencil:!!R[r+2],antialias:!!R[r+3],premultipliedAlpha:!!R[r+4],preserveDrawingBuffer:!!R[r+5],powerPreference:Tn[n],failIfMajorPerformanceCaveat:!!R[r+7],majorVersion:R[r+8],minorVersion:R[r+9],enableExtensionsByDefault:R[r+10],explicitSwapControl:R[r+11],proxyContextToMainThread:R[r+12],renderViaOffscreenBackBuffer:R[r+13]},i=function(e){return function(e){var t;return e=(t=e)>2?Fe(t):t,Fn[e]||("undefined"!=typeof document?document.querySelector(e):void 0)}(e)}(e);return i?o.explicitSwapControl?0:gr.createContext(i,o):0},ka:function(e){gr.currentContext==e&&(gr.currentContext=0),gr.deleteContext(e)},bb:function(e,t){var r=gr.getContext(e),n=Fe(t);return n.startsWith("GL_")&&(n=n.substr(3)),"ANGLE_instanced_arrays"==n&&cr($n),"OES_vertex_array_object"==n&&dr($n),"WEBGL_draw_buffers"==n&&fr($n),"WEBGL_draw_instanced_base_vertex_base_instance"==n&&pr($n),"WEBGL_multi_draw_instanced_base_vertex_base_instance"==n&&hr($n),"WEBGL_multi_draw"==n&&mr($n),!!r.GLctx.getExtension(n)},$a:function(e){for(var t=e>>2,r=0;r<14;++r)R[t+r]=0;R[t+0]=R[t+1]=R[t+3]=R[t+4]=R[t+8]=R[t+10]=1},cb:function(e){return gr.makeContextCurrent(e)?0:-5},sb:(e,t)=>{var r=0;return Ln().forEach((function(n,o){var i=t+r;M[e+4*o>>2]=i,((e,t)=>{for(var r=0;r<e.length;++r)A[t++>>0]=e.charCodeAt(r);A[t>>0]=0})(n,i),r+=n.length+1})),0},tb:(e,t)=>{var r=Ln();M[e>>2]=r.length;var n=0;return r.forEach((function(e){n+=e.length+1})),M[t>>2]=n,0},we:ir,aa:function(e){try{var t=Ae.getStreamFromFD(e);return Te.close(t),0}catch(e){if(void 0===Te||"ErrnoError"!==e.name)throw e;return e.errno}},kb:function(e,t,r,n,o){t=Kt(t),r=Kt(r),n=Kt(n),o=Kt(o);try{if(isNaN(n))return 61;var i=Ae.getStreamFromFD(e),a=Rn(i,t,r,n);return M[o>>2]=a,0}catch(e){if(void 0===Te||"ErrnoError"!==e.name)throw e;return e.errno}},qa:function(e,t,r,n){try{var o=Ae.getStreamFromFD(e),i=Rn(o,t,r);return M[n>>2]=i,0}catch(e){if(void 0===Te||"ErrnoError"!==e.name)throw e;return e.errno}},rb:function(e,t,r,n){t=Kt(t),n=Kt(n);try{if(isNaN(t))return 61;var o=Ae.getStreamFromFD(e);return Te.llseek(o,t,r),I[n>>3]=BigInt(o.position),o.getdents&&0===t&&0===r&&(o.getdents=null),0}catch(e){if(void 0===Te||"ErrnoError"!==e.name)throw e;return e.errno}},pa:function(e,t,r,n){try{var o=((e,t,r,n)=>{for(var o=0,i=0;i<r;i++){var a=M[t>>2],s=M[t+4>>2];t+=8;var u=Te.write(e,A,a,s,n);if(u<0)return-1;o+=u,void 0!==n&&(n+=u)}return o})(Ae.getStreamFromFD(e),t,r);return M[n>>2]=o,0}catch(e){if(void 0===Te||"ErrnoError"!==e.name)throw e;return e.errno}},eb:(e,t)=>(me(D.subarray(e,e+t)),0),w:function(e,t,r){var n=ro();try{return wt(e)(t,r)}catch(e){if(no(n),e!==e+0)throw e;to(1,0)}},M:function(e,t){var r=ro();try{return wt(e)(t)}catch(e){if(no(r),e!==e+0)throw e;to(1,0)}},F:function(e,t,r){var n=ro();try{return wt(e)(t,r)}catch(e){if(no(n),e!==e+0)throw e;to(1,0)}},k:function(e,t,r,n){var o=ro();try{return wt(e)(t,r,n)}catch(e){if(no(o),e!==e+0)throw e;to(1,0)}},Ea:function(e){var t=ro();try{return wt(e)()}catch(e){if(no(t),e!==e+0)throw e;to(1,0)}},ga:function(e,t,r){var n=ro();try{return wt(e)(t,r)}catch(e){if(no(n),e!==e+0)throw e;to(1,0)}},p:function(e,t){var r=ro();try{return wt(e)(t)}catch(e){if(no(r),e!==e+0)throw e;to(1,0)}},V:function(e,t,r,n,o,i,a,s,u,l,c,d,f,p,h,m){var g=ro();try{return wt(e)(t,r,n,o,i,a,s,u,l,c,d,f,p,h,m)}catch(e){if(no(g),e!==e+0)throw e;to(1,0)}},o:function(e,t,r){var n=ro();try{return wt(e)(t,r)}catch(e){if(no(n),e!==e+0)throw e;to(1,0)}},q:function(e,t,r,n){var o=ro();try{return wt(e)(t,r,n)}catch(e){if(no(o),e!==e+0)throw e;to(1,0)}},S:function(e,t,r,n,o){var i=ro();try{return wt(e)(t,r,n,o)}catch(e){if(no(i),e!==e+0)throw e;to(1,0)}},Be:function(e,t,r,n,o,i){var a=ro();try{return wt(e)(t,r,n,o,i)}catch(e){if(no(a),e!==e+0)throw e;to(1,0)}},za:function(e,t,r,n,o,i,a){var s=ro();try{return wt(e)(t,r,n,o,i,a)}catch(e){if(no(s),e!==e+0)throw e;to(1,0)}},ya:function(e,t,r,n,o,i,a,s,u,l){var c=ro();try{return wt(e)(t,r,n,o,i,a,s,u,l)}catch(e){if(no(c),e!==e+0)throw e;to(1,0)}},Q:function(e){var t=ro();try{wt(e)()}catch(e){if(no(t),e!==e+0)throw e;to(1,0)}},r:function(e,t){var r=ro();try{wt(e)(t)}catch(e){if(no(r),e!==e+0)throw e;to(1,0)}},A:function(e,t,r,n){var o=ro();try{wt(e)(t,r,n)}catch(e){if(no(o),e!==e+0)throw e;to(1,0)}},E:function(e,t,r){var n=ro();try{wt(e)(t,r)}catch(e){if(no(n),e!==e+0)throw e;to(1,0)}},n:function(e,t,r,n){var o=ro();try{wt(e)(t,r,n)}catch(e){if(no(o),e!==e+0)throw e;to(1,0)}},C:function(e,t,r,n,o){var i=ro();try{wt(e)(t,r,n,o)}catch(e){if(no(i),e!==e+0)throw e;to(1,0)}},Ae:function(e,t,r,n,o,i){var a=ro();try{wt(e)(t,r,n,o,i)}catch(e){if(no(a),e!==e+0)throw e;to(1,0)}},ye:function(e,t,r,n,o,i,a){var s=ro();try{wt(e)(t,r,n,o,i,a)}catch(e){if(no(s),e!==e+0)throw e;to(1,0)}},gh:function(e,t,r,n,o,i,a,s){var u=ro();try{wt(e)(t,r,n,o,i,a,s)}catch(e){if(no(u),e!==e+0)throw e;to(1,0)}},ze:function(e,t,r,n,o,i,a,s,u,l){var c=ro();try{wt(e)(t,r,n,o,i,a,s,u,l)}catch(e){if(no(c),e!==e+0)throw e;to(1,0)}},ha:function(e,t){const r=Dt.toValue(t),n=s.ctx;n.bindTexture(n.TEXTURE_2D,gr.textures[e]),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,r)},fb:(e,t,r,n,o)=>((e,t,r,n)=>{var o=R[n+40>>2],i={tm_sec:R[n>>2],tm_min:R[n+4>>2],tm_hour:R[n+8>>2],tm_mday:R[n+12>>2],tm_mon:R[n+16>>2],tm_year:R[n+20>>2],tm_wday:R[n+24>>2],tm_yday:R[n+28>>2],tm_isdst:R[n+32>>2],tm_gmtoff:R[n+36>>2],tm_zone:o?Fe(o):""},a=Fe(r),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var u in s)a=a.replace(new RegExp(u,"g"),s[u]);var l=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],c=["January","February","March","April","May","June","July","August","September","October","November","December"];function d(e,t,r){for(var n="number"==typeof e?e.toString():e||"";n.length<t;)n=r[0]+n;return n}function f(e,t){return d(e,t,"0")}function p(e,t){function r(e){return e<0?-1:e>0?1:0}var n;return 0===(n=r(e.getFullYear()-t.getFullYear()))&&0===(n=r(e.getMonth()-t.getMonth()))&&(n=r(e.getDate()-t.getDate())),n}function h(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function m(e){var t=((e,t)=>{for(var r=new Date(e.getTime());t>0;){var n=Zt(r.getFullYear()),o=r.getMonth(),i=(n?Mn:On)[o];if(!(t>i-r.getDate()))return r.setDate(r.getDate()+t),r;t-=i-r.getDate()+1,r.setDate(1),o<11?r.setMonth(o+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1))}return r})(new Date(e.tm_year+1900,0,1),e.tm_yday),r=new Date(t.getFullYear(),0,4),n=new Date(t.getFullYear()+1,0,4),o=h(r),i=h(n);return p(o,t)<=0?p(i,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var g={"%a":e=>l[e.tm_wday].substring(0,3),"%A":e=>l[e.tm_wday],"%b":e=>c[e.tm_mon].substring(0,3),"%B":e=>c[e.tm_mon],"%C":e=>f((e.tm_year+1900)/100|0,2),"%d":e=>f(e.tm_mday,2),"%e":e=>d(e.tm_mday,2," "),"%g":e=>m(e).toString().substring(2),"%G":e=>m(e),"%H":e=>f(e.tm_hour,2),"%I":e=>{var t=e.tm_hour;return 0==t?t=12:t>12&&(t-=12),f(t,2)},"%j":e=>f(e.tm_mday+((e,t)=>{for(var r=0,n=0;n<=t;r+=e[n++]);return r})(Zt(e.tm_year+1900)?Mn:On,e.tm_mon-1),3),"%m":e=>f(e.tm_mon+1,2),"%M":e=>f(e.tm_min,2),"%n":()=>"\n","%p":e=>e.tm_hour>=0&&e.tm_hour<12?"AM":"PM","%S":e=>f(e.tm_sec,2),"%t":()=>"\t","%u":e=>e.tm_wday||7,"%U":e=>{var t=e.tm_yday+7-e.tm_wday;return f(Math.floor(t/7),2)},"%V":e=>{var t=Math.floor((e.tm_yday+7-(e.tm_wday+6)%7)/7);if((e.tm_wday+371-e.tm_yday-2)%7<=2&&t++,t){if(53==t){var r=(e.tm_wday+371-e.tm_yday)%7;4==r||3==r&&Zt(e.tm_year)||(t=1)}}else{t=52;var n=(e.tm_wday+7-e.tm_yday-1)%7;(4==n||5==n&&Zt(e.tm_year%400-1))&&t++}return f(t,2)},"%w":e=>e.tm_wday,"%W":e=>{var t=e.tm_yday+7-(e.tm_wday+6)%7;return f(Math.floor(t/7),2)},"%y":e=>(e.tm_year+1900).toString().substring(2),"%Y":e=>e.tm_year+1900,"%z":e=>{var t=e.tm_gmtoff,r=t>=0;return t=(t=Math.abs(t)/60)/60*100+t%60,(r?"+":"-")+String("0000"+t).slice(-4)},"%Z":e=>e.tm_zone,"%%":()=>"%"};for(var u in a=a.replace(/%%/g,"\0\0"),g)a.includes(u)&&(a=a.replace(new RegExp(u,"g"),g[u](i)));var y=_e(a=a.replace(/\0\0/g,"%"),!1);return y.length>t?0:(In(y,e),y.length-1)})(e,t,r,n)},zn=(function(){var e,t,r,n,i={a:Gn};function a(e,t){var r,n=e.exports;return x=(P=n).hh,H(),j=P.kh,r=P.ih,W.unshift(r),te(),n}if(ee(),s.instantiateWasm)try{return s.instantiateWasm(i,a)}catch(e){k("Module.instantiateWasm callback failed with error: "+e),o(e)}(e=C,t=X,r=i,n=function(e){a(e.instance)},e||"function"!=typeof WebAssembly.instantiateStreaming||ne(t)||b||"function"!=typeof fetch?ae(t,r,n):fetch(t,{credentials:"same-origin"}).then((e=>WebAssembly.instantiateStreaming(e,r).then(n,(function(e){return k("wasm streaming compile failed: "+e),k("falling back to ArrayBuffer instantiation"),ae(t,r,n)}))))).catch(o)}(),s._malloc=e=>(zn=s._malloc=P.jh)(e)),Yn=s._free=e=>(Yn=s._free=P.lh)(e),Xn=()=>(Xn=P.mh)(),Kn=(s._ma_malloc_emscripten=(e,t)=>(s._ma_malloc_emscripten=P.nh)(e,t),s._ma_free_emscripten=(e,t)=>(s._ma_free_emscripten=P.oh)(e,t),s._ma_device_process_pcm_frames_capture__webaudio=(e,t,r)=>(Kn=s._ma_device_process_pcm_frames_capture__webaudio=P.ph)(e,t,r)),Qn=s._ma_device_process_pcm_frames_playback__webaudio=(e,t,r)=>(Qn=s._ma_device_process_pcm_frames_playback__webaudio=P.qh)(e,t,r),Zn=e=>(Zn=P.rh)(e),Jn=e=>(Jn=P.sh)(e),eo=(s.__embind_initialize_bindings=()=>(s.__embind_initialize_bindings=P.th)(),(e,t)=>(eo=P.uh)(e,t)),to=(e,t)=>(to=P.vh)(e,t),ro=()=>(ro=P.wh)(),no=e=>(no=P.xh)(e),oo=e=>(oo=P.yh)(e),io=e=>(io=P.zh)(e),ao=e=>(ao=P.Ah)(e),so=(e,t,r)=>(so=P.Bh)(e,t,r),uo=e=>(uo=P.Ch)(e);function lo(){function e(){Wn||(Wn=!0,s.calledRun=!0,q||(s.noFSInit||Te.init.initialized||Te.init(),Te.ignorePermissions=!1,Ce.init(),le(W),t(s),s.onRuntimeInitialized&&s.onRuntimeInitialized(),function(){if(s.postRun)for("function"==typeof s.postRun&&(s.postRun=[s.postRun]);s.postRun.length;)e=s.postRun.shift(),z.unshift(e);var e;le(z)}()))}Q>0||(function(){if(s.preRun)for("function"==typeof s.preRun&&(s.preRun=[s.preRun]);s.preRun.length;)e=s.preRun.shift(),V.unshift(e);var e;le(V)}(),Q>0||(s.setStatus?(s.setStatus("Running..."),setTimeout((function(){setTimeout((function(){s.setStatus("")}),1),e()}),1)):e()))}if(s.___start_em_js=2360139,s.___stop_em_js=2360390,s.addRunDependency=ee,s.removeRunDependency=te,s.FS_createPath=Te.createPath,s.FS_createDataFile=Te.createDataFile,s.FS_createLazyFile=Te.createLazyFile,s.FS_createDevice=Te.createDevice,s.FS_unlink=Te.unlink,s.ccall=function(e,t,r,n,o){var i={string:e=>{var t=0;return null!=e&&0!==e&&(t=(e=>{var t=we(e)+1,r=oo(t);return Mt(e,r,t),r})(e)),t},array:e=>{var t=oo(e.length);return In(e,t),t}},a=function(e){return s["_"+e]}(e),u=[],l=0;if(n)for(var c=0;c<n.length;c++){var d=i[r[c]];d?(0===l&&(l=ro()),u[c]=d(n[c])):u[c]=n[c]}var f=a.apply(null,u);return function(e){return 0!==l&&no(l),function(e){return"string"===t?Fe(e):"boolean"===t?Boolean(e):e}(e)}(f)},s.getValue=function(e,t="i8"){switch(t.endsWith("*")&&(t="*"),t){case"i1":case"i8":return A[e>>0];case"i16":return B[e>>1];case"i32":return R[e>>2];case"i64":return I[e>>3];case"float":return O[e>>2];case"double":return $[e>>3];case"*":return M[e>>2];default:re(`invalid type for getValue: ${t}`)}},s.UTF8ToString=Fe,s.specialHTMLTargets=Fn,s.FS_createPreloadedFile=Te.createPreloadedFile,J=function e(){Wn||lo(),Wn||(J=e)},s.preInit)for("function"==typeof s.preInit&&(s.preInit=[s.preInit]);s.preInit.length>0;)s.preInit.pop()();return lo(),e.ready});e.exports=o},809:e=>{"use strict";e.exports=require("node-fetch")},300:e=>{"use strict";e.exports=require("buffer")},113:e=>{"use strict";e.exports=require("crypto")},147:e=>{"use strict";e.exports=require("fs")},17:e=>{"use strict";e.exports=require("path")},310:e=>{"use strict";e.exports=require("url")}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.p="";var n={};return(()=>{"use strict";r.d(n,{default:()=>Qe});const e=Symbol("PROXY");function t(t,r){Object.defineProperty(t[r],e,{value:{type:"getter"},writable:!1})}function o(t,r){Object.defineProperty(t[r],e,{value:{type:"setter"},writable:!1})}var i,a,s,u,l,c,d,f,p,h,m,g,y;Symbol("RESTORE"),function(e){let t;!function(e){e[e.sRGB=0]="sRGB",e[e.CMYK=1]="CMYK",e[e.SpotColor=2]="SpotColor"}(t=e.ColorSpace||(e.ColorSpace={})),e.toColor=function(e){switch(e.colorSpace){case t.sRGB:return{r:e.components.x,g:e.components.y,b:e.components.z,a:e.components.w};case t.SpotColor:return{name:e.spotColorName,tint:e.tint,externalReference:e.externalReference};case t.CMYK:return{c:e.components.x,m:e.components.y,y:e.components.z,k:e.components.w,tint:e.tint};default:throw new Error("Unknown color space!")}},e.fromColor=function(e){if(function(e){return"r"in e&&"a"in e&&void 0!==e.r&&void 0!==e.a}(e))return{colorSpace:t.sRGB,components:{x:e.r,y:e.g,z:e.b,w:e.a},spotColorName:"",tint:1,externalReference:""};if(function(e){return"c"in e&&"m"in e&&"y"in e&&"k"in e&&void 0!==e.c&&void 0!==e.m&&void 0!==e.y&&void 0!==e.k}(e))return{colorSpace:t.CMYK,components:{x:e.c,y:e.m,z:e.y,w:e.k},spotColorName:"",tint:e.tint,externalReference:""};if(function(e){return"name"in e&&void 0!==e.name}(e))return{colorSpace:t.SpotColor,components:{x:0,y:0,z:0,w:0},spotColorName:e.name,tint:e.tint,externalReference:e.externalReference};throw new Error("Unknown color space!")}}(i||(i={})),function(e){e[e.Pending=0]="Pending",e[e.Ready=1]="Ready",e[e.Error=2]="Error"}(a||(a={})),function(e){e.Added="DesignBlockAddedEvent",e.Updated="DesignBlockUpdatedEvent",e.Removed="DesignBlockRemovedEvent"}(s||(s={})),function(e){e[e.Left=0]="Left",e[e.Right=1]="Right",e[e.Middle=2]="Middle",e[e.Unknown=255]="Unknown"}(u||(u={})),function(e){e[e.Up=0]="Up",e[e.Down=1]="Down"}(l||(l={})),function(e){e[e.Key0=0]="Key0",e[e.Key1=1]="Key1",e[e.Key2=2]="Key2",e[e.Key3=3]="Key3",e[e.Key4=4]="Key4",e[e.Key5=5]="Key5",e[e.Key6=6]="Key6",e[e.Key7=7]="Key7",e[e.Key8=8]="Key8",e[e.Key9=9]="Key9",e[e.A=10]="A",e[e.B=11]="B",e[e.C=12]="C",e[e.D=13]="D",e[e.E=14]="E",e[e.F=15]="F",e[e.G=16]="G",e[e.H=17]="H",e[e.I=18]="I",e[e.J=19]="J",e[e.K=20]="K",e[e.L=21]="L",e[e.M=22]="M",e[e.N=23]="N",e[e.O=24]="O",e[e.P=25]="P",e[e.Q=26]="Q",e[e.R=27]="R",e[e.S=28]="S",e[e.T=29]="T",e[e.U=30]="U",e[e.V=31]="V",e[e.W=32]="W",e[e.X=33]="X",e[e.Y=34]="Y",e[e.Z=35]="Z",e[e.ArrowLeft=36]="ArrowLeft",e[e.ArrowRight=37]="ArrowRight",e[e.ArrowUp=38]="ArrowUp",e[e.ArrowDown=39]="ArrowDown",e[e.Backspace=40]="Backspace",e[e.Enter=41]="Enter",e[e.Space=42]="Space",e[e.Escape=43]="Escape",e[e.Delete=44]="Delete",e[e.Control=45]="Control",e[e.Option=46]="Option",e[e.Shift=47]="Shift",e[e.Unknown=255]="Unknown"}(c||(c={})),function(e){e[e.Thin=100]="Thin",e[e.ExtraLight=200]="ExtraLight",e[e.Light=300]="Light",e[e.Normal=400]="Normal",e[e.Medium=500]="Medium",e[e.SemiBold=600]="SemiBold",e[e.Bold=700]="Bold",e[e.ExtraBold=800]="ExtraBold",e[e.Heavy=900]="Heavy"}(d||(d={})),function(e){e[e.Normal=0]="Normal",e[e.Italic=1]="Italic"}(f||(f={})),function(e){e.Bold="bold",e.Italic="italic"}(p||(p={})),function(e){e[e.Undefined=0]="Undefined",e[e.DesignUnit=1]="DesignUnit",e[e.Percent=2]="Percent",e[e.Auto=3]="Auto"}(h||(h={})),function(e){e[e.Free=0]="Free",e[e.VerticalStack=1]="VerticalStack",e[e.HorizontalStack=2]="HorizontalStack",e[e.DepthStack=3]="DepthStack"}(m||(m={})),function(e){e[e.Began=0]="Began",e[e.Changed=1]="Changed",e[e.Ended=2]="Ended"}(g||(g={})),function(e){e[e.Creator=0]="Creator",e[e.Adopter=1]="Adopter",e[e.Viewer=2]="Viewer",e[e.Presenter=3]="Presenter"}(y||(y={}));var v=function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a};class b{constructor(e){Object.defineProperty(this,"ubq",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.ubq=e}useInternalAPI(e){const t=this.ubq.getInternalAPI();try{return e(t)}finally{t.delete()}}setValue(e,t,r,n){return this.useInternalAPI((o=>w(o.setValue(e,t,r,n))))}getValue(e,t,r){return this.useInternalAPI((n=>w(n.getValue(e,t,r))))}async execute(e,t){return new Promise(((r,n)=>{this.useInternalAPI((o=>o.ubqExecute(e,t,(e=>{try{const t=w(e);r(t)}catch(e){n(e)}})))).delete()}))}}function w(e){if(e.isValid()){const t=e.value();return e.delete(),t}{const t=e.error(),r=t.publicMessage();throw t.delete(),e.delete(),new Error(r)}}function E(e){return new Promise(((t,r)=>{e((e=>{try{const r=w(e);t(r)}catch(e){r(e)}}))}))}v([o],b.prototype,"setValue",null),v([t],b.prototype,"getValue",null);const _=(e,t=!0)=>{const r=[];for(let t=0;t<e.size();t+=1)r.push(e.get(t));return t&&e.delete(),r};var C,S,k,x,P,T=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};const F=new WeakMap,A={assets:[],total:0,currentPage:0,nextPage:void 0};class D{constructor(e){C.add(this),S.set(this,void 0),Object.defineProperty(this,"onAssetSourceAdded",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=T(this,S,"f").subscribeToAssetSourceAdded(e);return()=>{T(this,S,"f").isDeleted()||w(T(this,S,"f").unsubscribe(t))}}}),Object.defineProperty(this,"onAssetSourceRemoved",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=T(this,S,"f").subscribeToAssetSourceRemoved(e);return()=>{T(this,S,"f").isDeleted()||w(T(this,S,"f").unsubscribe(t))}}}),function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?o.call(e,r):o?o.value=r:t.set(e,r)}(this,S,e,"f")}addSource(e){var t,r,n,o,i,a;const s=null===(t=e.getSupportedMimeTypes)||void 0===t?void 0:t.bind(e),u=null===(r=e.getGroups)||void 0===r?void 0:r.bind(e),l=null===(n=e.applyAsset)||void 0===n?void 0:n.bind(e),c=null===(o=e.applyAssetToBlock)||void 0===o?void 0:o.bind(e),d=null===(i=e.addAsset)||void 0===i?void 0:i.bind(e),f=null===(a=e.removeAsset)||void 0===a?void 0:a.bind(e),p=e.credits,h=e.license;w(T(this,S,"f").addAssetSource(e.id,(async(t,r)=>{var n;try{const n=Object.assign(Object.assign({},t),{tags:_(t.tags),groups:_(t.groups),excludeGroups:_(t.excludeGroups)}),o=await e.findAssets(n);if(o){const t=Object.assign(Object.assign({},o),{assets:o.assets.map((t=>B(t,e.id)))});r.invoke(t)}else r.invoke(A)}catch(e){r.invoke(null!==(n=e.message)&&void 0!==n?n:"Unknown error in user-defined `findAssets`")}}),u?async e=>{var t;try{const t=await u();e.invoke(t)}catch(r){e.invoke(null!==(t=r.message)&&void 0!==t?t:"Unknown error in user-defined `getGroups`")}}:null,p?()=>{var e;return{name:p.name,url:null!==(e=p.url)&&void 0!==e?e:""}}:null,h?()=>{var e;return{name:h.name,url:null!==(e=h.url)&&void 0!==e?e:""}}:null,s?()=>{var e;return null!==(e=s())&&void 0!==e?e:[]}:null,l?async(e,t)=>{var r;try{const r=await l(T(this,C,"m",k).call(this,e));t.invoke(r)}catch(e){t.invoke(null!==(r=e.message)&&void 0!==r?r:"Unknown error in user-defined `applyAsset`")}}:null,c?async(e,t,r)=>{var n;try{await c(T(this,C,"m",k).call(this,e),t),r.invoke({})}catch(e){r.invoke(null!==(n=e.message)&&void 0!==n?n:"Unknown error in user-defined `applyAssetToBlock`")}}:null,d?async e=>{d(e)}:null,f?async e=>{f(e)}:null)),T(this,C,"m",x).call(this,e.id,e)}addLocalSource(e,t,r,n){w(T(this,S,"f").addLocalAssetSource(e,null!=t?t:[],r?async(e,t)=>{var n;try{const n=await r(T(this,C,"m",k).call(this,e));t.invoke(n)}catch(e){t.invoke(null!==(n=e.message)&&void 0!==n?n:"Unknown error in user-defined `applyAsset`")}}:null,n?async(e,t,r)=>{var o;try{await n(T(this,C,"m",k).call(this,e),t),r.invoke()}catch(e){r.invoke(null!==(o=e.message)&&void 0!==o?o:"Unknown error in user-defined `replaceAsset`")}}:null))}removeSource(e){w(T(this,S,"f").removeAssetSource(e)),T(this,C,"m",P).call(this,e)}findAllSources(){return _(T(this,S,"f").findAllAssetSources())}findAssets(e,t){return new Promise(((r,n)=>{var o,i,a,s,u,l,c;let d=null!==(o=null==t?void 0:t.tags)&&void 0!==o?o:[];Array.isArray(d)||(d=[d]);const f={perPage:null!==(i=null==t?void 0:t.perPage)&&void 0!==i?i:0,page:null!==(a=null==t?void 0:t.page)&&void 0!==a?a:0,query:null!==(s=null==t?void 0:t.query)&&void 0!==s?s:"",tags:d,groups:null!==(u=null==t?void 0:t.groups)&&void 0!==u?u:[],excludeGroups:null!==(l=null==t?void 0:t.excludeGroups)&&void 0!==l?l:[],locale:null!==(c=null==t?void 0:t.locale)&&void 0!==c?c:""};T(this,S,"f").findAssetSourceAssets(e,f,(e=>{try{const t=w(e),n=_(t.assets).map(T(this,C,"m",k));r({assets:n.map((e=>(e.payload&&"string"==typeof e.payload&&(e.payload=JSON.parse(e.payload)),e))),currentPage:t.currentPage,nextPage:-1===t.nextPage?void 0:t.nextPage,total:t.total})}catch(e){n(e)}}))}))}async getGroups(e){return E((t=>T(this,S,"f").getAssetSourceGroups(e,t))).then((e=>_(e)))}getSupportedMimeTypes(e){return _(w(T(this,S,"f").getAssetSourceSupportedMimeTypes(e)))}getCredits(e){const t=w(T(this,S,"f").getAssetSourceCredits(e));if(t.name||t.url)return t.url?t:{name:t.name,url:void 0}}getLicense(e){const t=w(T(this,S,"f").getAssetSourceLicense(e));if(t.name||t.url)return t.url?t:{name:t.name,url:void 0}}canManageAssets(e){var t,r;return!!(null===(r=null===(t=F.get(T(this,S,"f")))||void 0===t?void 0:t.get(e))||void 0===r?void 0:r.canManageAssets)}addAssetToSource(e,t){w(T(this,S,"f").addAssetToSource(e,t))}removeAssetFromSource(e,t){w(T(this,S,"f").removeAssetFromSource(e,t))}async apply(e,t){return new Promise(((r,n)=>{T(this,S,"f").applyAssetSourceAsset(e,B(t,e),(e=>{try{const t=w(e);T(this,S,"f").isValid(t)?r(t):r(void 0)}catch(e){n(e)}}))}))}async applyToBlock(e,t,r){return E((n=>T(this,S,"f").applyAssetSourceAssetToBlock(e,B(t,e),r,n)))}async defaultApplyAsset(e){return new Promise(((t,r)=>{T(this,S,"f").defaultApplyAsset(B(e,""),(e=>{try{const r=w(e);T(this,S,"f").isValid(r)?t(r):t(void 0)}catch(e){r(e)}}))}))}async defaultApplyAssetToBlock(e,t){return E((r=>T(this,S,"f").defaultApplyAssetToBlock(B(e,""),t,r)))}dispose(){F.delete(T(this,S,"f"))}}function B(e,t){return"context"in e&&e.context.sourceId===t?e:Object.assign(Object.assign({},e),{context:{sourceId:t}})}function L(e,t){const r=`[UBQ] ${e}`;switch(t){case"Warning":console.warn(r);break;case"Error":console.error(r);break;case"Info":console.info(r);break;default:console.log(r)}}S=new WeakMap,C=new WeakSet,k=function(e){var t,r,n,o,i,a,s,u;const l=Object.assign(Object.assign({},e),{groups:_(e.groups),meta:void 0,tags:_(e.tags)});return e.meta.size()>0&&(l.meta={},_(e.meta.keys()).forEach((t=>{l.meta[t]="width"===t||"height"===t?parseFloat(e.meta.get(t)):e.meta.get(t)}))),0===(null===(t=l.groups)||void 0===t?void 0:t.length)&&delete l.groups,l.locale||delete l.locale,l.label||delete l.label,0===(null===(r=l.tags)||void 0===r?void 0:r.length)&&delete l.tags,(null===(n=l.credits)||void 0===n?void 0:n.name)||(null===(o=l.credits)||void 0===o?void 0:o.url)?l.credits.url||delete l.credits.url:delete l.credits,(null===(i=l.license)||void 0===i?void 0:i.name)||(null===(a=l.license)||void 0===a?void 0:a.url)?l.license.url||delete l.license.url:delete l.license,(null===(s=l.utm)||void 0===s?void 0:s.source)||(null===(u=l.utm)||void 0===u?void 0:u.medium)?(l.utm.source||delete l.utm.source,l.utm.medium||delete l.utm.medium):delete l.utm,l},x=function(e,t){F.has(T(this,S,"f"))||F.set(T(this,S,"f"),new Map),t.canManageAssets&&console.warn(`\nDEPRECATION WARNING:\n\n'canManageAssets' flag was found for asset source with the id '${e}'.\n\nThis flag is deprecated and will be removed in the next version. If you have used it to control if an upload buttons is rendered in the asset library, use the 'canAdd' options on an asset library entry. See documentation here: https://img.ly/docs/cesdk/ui/guides/customize-asset-library/`),F.get(T(this,S,"f")).set(e,{canManageAssets:t.canManageAssets})},P=function(e){var t;null===(t=F.get(T(this,S,"f")))||void 0===t||t.delete(e)};const R={baseURL:"/extensions/",entries:["ly.img.cesdk.fonts"]};function M(e,t=("undefined"==typeof window?"":window.location.href)){return new URL(e,""===t?void 0:t).href}function O(e){return"/"!==e[e.length-1]?`${e}/`:e}const I=async function(e,t,r=fetch,n,o=new Set(n.findAllSources())){const i=e.map((async e=>{const i=function(e,t){const r=e.endsWith("/"),n=t.startsWith("/");return r&&n?`${e.substring(0,e.length-1)}${t}`:r||n?`${e}${t}`:`${e}/${t}`}(t,`/${e}/content.json`);return r(i).then((e=>{if(!e.ok)throw new Error(e.statusText);return e.json()})).then((r=>{if(void 0===r.assets)throw new Error(`Invalid content.json for assets: ${e}`);const i=r.assets;o.has(e)||n.addLocalSource(e),i.forEach((r=>{r.meta&&Object.entries(r.meta).forEach((([e,n])=>{const o=n.toString();if(o.includes("{{base_url}}")){const n=o.replace("{{base_url}}",t);r.meta&&(r.meta[e]=n)}})),n.addAssetToSource(e,r)}))}))}));await Promise.all(i)};class U extends TypeError{constructor(e,t){let r;const{message:n,...o}=e,{path:i}=e;super(0===i.length?n:"At path: "+i.join(".")+" -- "+n),this.value=void 0,this.key=void 0,this.type=void 0,this.refinement=void 0,this.path=void 0,this.branch=void 0,this.failures=void 0,Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>{var n;return null!=(n=r)?n:r=[e,...t()]}}}function $(e){return"object"==typeof e&&null!=e}function j(e){return"string"==typeof e?JSON.stringify(e):""+e}function q(e,t,r,n){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});const{path:o,branch:i}=t,{type:a}=r,{refinement:s,message:u="Expected a value of type `"+a+"`"+(s?" with refinement `"+s+"`":"")+", but received: `"+j(n)+"`"}=e;return{value:n,type:a,refinement:s,key:o[o.length-1],path:o,branch:i,...e,message:u}}function*N(e,t,r,n){var o;$(o=e)&&"function"==typeof o[Symbol.iterator]||(e=[e]);for(const o of e){const e=q(o,t,r,n);e&&(yield e)}}function*H(e,t,r={}){const{path:n=[],branch:o=[e],coerce:i=!1,mask:a=!1}=r,s={path:n,branch:o};if(i&&(e=t.coercer(e,s),a&&"type"!==t.type&&$(t.schema)&&$(e)&&!Array.isArray(e)))for(const r in e)void 0===t.schema[r]&&delete e[r];let u=!0;for(const r of t.validator(e,s))u=!1,yield[r,void 0];for(let[r,l,c]of t.entries(e,s)){const t=H(l,c,{path:void 0===r?n:[...n,r],branch:void 0===r?o:[...o,l],coerce:i,mask:a});for(const n of t)n[0]?(u=!1,yield[n[0],void 0]):i&&(l=n[1],void 0===r?e=l:e instanceof Map?e.set(r,l):e instanceof Set?e.add(l):$(e)&&(e[r]=l))}if(u)for(const r of t.refiner(e,s))u=!1,yield[r,void 0];u&&(yield[void 0,e])}class V{constructor(e){this.TYPE=void 0,this.type=void 0,this.schema=void 0,this.coercer=void 0,this.validator=void 0,this.refiner=void 0,this.entries=void 0;const{type:t,schema:r,validator:n,refiner:o,coercer:i=(e=>e),entries:a=function*(){}}=e;this.type=t,this.schema=r,this.entries=a,this.coercer=i,this.validator=n?(e,t)=>N(n(e,t),t,this,e):()=>[],this.refiner=o?(e,t)=>N(o(e,t),t,this,e):()=>[]}assert(e){return function(e,t){const r=W(e,t);if(r[0])throw r[0]}(e,this)}create(e){return function(e,t){const r=W(e,t,{coerce:!0});if(r[0])throw r[0];return r[1]}(e,this)}is(e){return function(e,t){return!W(e,t)[0]}(e,this)}mask(e){return function(e,t){const r=W(e,t,{coerce:!0,mask:!0});if(r[0])throw r[0];return r[1]}(e,this)}validate(e,t={}){return W(e,this,t)}}function W(e,t,r={}){const n=H(e,t,r),o=function(e){const{done:t,value:r}=e.next();return t?void 0:r}(n);return o[0]?[new U(o[0],(function*(){for(const e of n)e[0]&&(yield e[0])})),void 0]:[void 0,o[1]]}function G(e,t){return new V({type:e,schema:null,validator:t})}function z(e){return new V({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||"Expected an array value, but received: "+j(e)})}function Y(){return G("boolean",(e=>"boolean"==typeof e))}function X(){return G("integer",(e=>"number"==typeof e&&!isNaN(e)&&Number.isInteger(e)||"Expected an integer, but received: "+j(e)))}function K(){return G("number",(e=>"number"==typeof e&&!isNaN(e)||"Expected a number, but received: "+j(e)))}function Q(e){const t=e?Object.keys(e):[],r=G("never",(()=>!1));return new V({type:"object",schema:e||null,*entries(n){if(e&&$(n)){const o=new Set(Object.keys(n));for(const r of t)o.delete(r),yield[r,n[r],e[r]];for(const e of o)yield[e,n[e],r]}},validator:e=>$(e)||"Expected an object, but received: "+j(e),coercer:e=>$(e)?{...e}:e})}function Z(){return G("string",(e=>"string"==typeof e||"Expected a string, but received: "+j(e)))}function J(e,t,r={}){const{exclusive:n}=r;return re(e,"max",(r=>n?r<t:r<=t||"Expected a "+e.type+" less than "+(n?"":"or equal to ")+t+" but received `"+r+"`"))}function ee(e,t,r={}){const{exclusive:n}=r;return re(e,"min",(r=>n?r>t:r>=t||"Expected a "+e.type+" greater than "+(n?"":"or equal to ")+t+" but received `"+r+"`"))}function te(e){return re(e,"nonempty",(t=>function(e){return e instanceof Map||e instanceof Set?e.size:e.length}(t)>0||"Expected a nonempty "+e.type+" but received an empty one"))}function re(e,t,r){return new V({...e,*refiner(n,o){yield*e.refiner(n,o);const i=N(r(n,o),o,e,n);for(const e of i)yield{...e,refinement:t}}})}function ne(e,t,r){const[n]=W(t,r);if(n)throw n.message=`Error in argument '${e}': ${n.message}`,n}function oe(){const e=/image\/(png|jpeg|webp|x-tga)|video\/(mp4|quicktime)|application\/octet-stream|application\/pdf/;return G("MimeType",(t=>!("string"!=typeof t||!e.test(t))||{message:`expected one of "image/png", "image/jpeg", "image/webp", "image/x-tga", "video/mp4", "video/quicktime", "application/pdf" or "application/octet-stream", but got "${t}"`}))}function ie(){const e=["Free","VerticalStack","HorizontalStack","DepthStack"];return G("SceneLayout",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}var ae;!function(e){e.Png="image/png",e.Jpeg="image/jpeg",e.WebP="image/webp",e.Tga="image/x-tga",e.Mp4="video/mp4",e.QuickTime="video/quicktime",e.Binary="application/octet-stream",e.Pdf="application/pdf",e.Zip="application/zip"}(ae||(ae={}));const se=ae,ue="undefined"!=typeof Blob?Blob:(()=>{try{return r(300).Blob}catch(e){return function(){throw new Error("Could not find Blob constructor and failed to require('buffer').Blob")}}})();var le,ce=function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},de=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class fe{constructor(e){le.set(this,void 0),Object.defineProperty(this,"onZoomLevelChanged",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=de(this,le,"f").subscribeToZoomLevel(e);return()=>{de(this,le,"f").isDeleted()||w(de(this,le,"f").unsubscribe(t))}}}),Object.defineProperty(this,"onActiveChanged",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=de(this,le,"f").subscribeToActiveSceneChange(e);return()=>{de(this,le,"f").isDeleted()||w(de(this,le,"f").unsubscribe(t))}}}),function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?o.call(e,r):o?o.value=r:t.set(e,r)}(this,le,e,"f")}async loadFromString(e){return ne("sceneContent",e,Z()),E((t=>de(this,le,"f").loadSceneFromString(e,t)))}async loadFromURL(e){return ne("url",e,Z()),E((t=>de(this,le,"f").loadSceneFromURL(e,t)))}async saveToString(){const e=this.get();if(null==e)throw new Error("No scene available.");return E((t=>{de(this,le,"f").saveSceneToString(e,t)}))}async saveToArchive(){return new Promise(((e,t)=>{const r=this.get();null==r?t(new Error("No scene available.")):de(this,le,"f").saveSceneToArchive(r,(r=>{"error"in r?t(r.error):e(new ue([r],{type:se.Zip}))}))}))}create(e="Free"){return ne("sceneLayout",e,ie()),w(de(this,le,"f").createScene(e))}createVideo(){return w(de(this,le,"f").createVideoScene())}createFromImage(e,t=300,r=1,n="Free",o=0,i=!1){return ne("url",e,Z()),ne("dpi",t,ee(K(),0)),ne("pixelScaleFactor",r,ee(K(),0)),ne("sceneLayout",n,ie()),E((a=>de(this,le,"f").createSceneFromImage(e,t,r,n,o,i,a)))}createFromVideo(e){return ne("url",e,Z()),E((t=>de(this,le,"f").createSceneFromVideo(e,t)))}get(){const e=w(de(this,le,"f").findByType("scene")),t=_(e);return t.length>0?t[0]:null}async applyTemplateFromString(e){return ne("content",e,Z()),E((t=>de(this,le,"f").applyTemplateFromString(e,t)))}async applyTemplateFromURL(e){return ne("url",e,Z()),E((t=>de(this,le,"f").applyTemplateFromURL(e,t)))}getMode(){const e=this.get();return w(de(this,le,"f").getSceneMode(e))}setDesignUnit(e){ne("designUnit",e,function(){const e=["Pixel","Millimeter","Inch"];return G("DesignUnit",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}());const t=this.get();w(de(this,le,"f").setDesignUnit(t,e))}getDesignUnit(){const e=this.get();return w(de(this,le,"f").getDesignUnit(e))}getPages(){return _(w(de(this,le,"f").getPages()))}getCurrentPage(){const e=this.get();if(null==e)return null;const t=w(de(this,le,"f").findNearestToViewPortCenterByKind(e,"page")),r=_(t);return r.length>0?r[0]:null}findNearestToViewPortCenterByType(e){ne("type",e,Z());const t=this.get();if(null==t)return[];const r=w(de(this,le,"f").findNearestToViewPortCenterByType(t,e));return _(r)}findNearestToViewPortCenterByKind(e){ne("kind",e,Z());const t=this.get();if(null==t)return[];const r=w(de(this,le,"f").findNearestToViewPortCenterByKind(t,e));return _(r)}setZoomLevel(e=1){const t=this.get();ne("zoomLevel",e,ee(K(),0)),de(this,le,"f").setZoomLevel(t,e)}getZoomLevel(){const e=this.get();return w(de(this,le,"f").getZoomLevel(e))}async zoomToBlock(e,t=0,r=0,n=0,o=0){return ne("id",e,X()),E((i=>de(this,le,"f").zoomToBlock(e,t,r,n,o,i)))}enableZoomAutoFit(e,t,r=0,n=0,o=0,i=0){return ne("id",e,X()),ne("axis",t,function(){const e=["Horizontal","Vertical","Both"];return G("ZoomAutoFitAxis",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}()),"Horizontal"===t?(ne("paddingBefore",r,K()),ne("paddingAfter",n,K()),w(de(this,le,"f").enableZoomAutoFit(e,t,r,0,n,0))):"Vertical"===t?(ne("paddingBefore",r,K()),ne("paddingAfter",n,K()),w(de(this,le,"f").enableZoomAutoFit(e,t,0,r,0,n))):(ne("paddingLeft",r,K()),ne("paddingTop",n,K()),ne("paddingRight",o,K()),ne("paddingBottom",i,K()),w(de(this,le,"f").enableZoomAutoFit(e,t,r,n,o,i)))}disableZoomAutoFit(e){return ne("blockOrScene",e,X()),w(de(this,le,"f").disableZoomAutoFit(e))}isZoomAutoFitEnabled(e){return ne("blockOrScene",e,X()),w(de(this,le,"f").isZoomAutoFitEnabled(e))}unstable_enableCameraPositionClamping(e,t=0,r=0,n=0,o=0,i=0,a=0,s=0,u=0){return ne("ids",e,z(K())),ne("paddingLeft",t,K()),ne("paddingTop",r,K()),ne("paddingRight",n,K()),ne("paddingBottom",o,K()),ne("scaledPaddingLeft",t,K()),ne("scaledPaddingTop",r,K()),ne("scaledPaddingRight",n,K()),ne("scaledPaddingBottom",o,K()),w(de(this,le,"f").unstable_enableCameraPositionClamping(e,t,r,n,o,i,a,s,u))}unstable_disableCameraPositionClamping(e=this.get()){if(null==e)throw new Error("No scene available.");return w(de(this,le,"f").unstable_disableCameraPositionClamping(e))}unstable_isCameraPositionClampingEnabled(e=this.get()){if(null==e)throw new Error("No scene available.");return w(de(this,le,"f").unstable_isCameraPositionClampingEnabled(e))}unstable_enableCameraZoomClamping(e,t=-1,r=-1,n=0,o=0,i=0,a=0){return ne("ids",e,z(K())),ne("minZoomLimit",t,K()),ne("maxZoomLimit",r,K()),ne("paddingLeft",n,K()),ne("paddingTop",o,K()),ne("paddingRight",i,K()),ne("paddingBottom",a,K()),w(de(this,le,"f").unstable_enableCameraZoomClamping(e,t,r,n,o,i,a))}unstable_disableCameraZoomClamping(e=this.get()){if(null==e)throw new Error("No scene available.");return w(de(this,le,"f").unstable_disableCameraZoomClamping(e))}unstable_isCameraZoomClampingEnabled(e=this.get()){if(null==e)throw new Error("No scene available.");return w(de(this,le,"f").unstable_isCameraZoomClampingEnabled(e))}}le=new WeakMap,ce([o],fe.prototype,"loadFromString",null),ce([o],fe.prototype,"loadFromURL",null),ce([o],fe.prototype,"create",null),ce([o],fe.prototype,"createVideo",null),ce([o],fe.prototype,"createFromImage",null),ce([o],fe.prototype,"createFromVideo",null),ce([t],fe.prototype,"get",null),ce([o],fe.prototype,"applyTemplateFromString",null),ce([o],fe.prototype,"applyTemplateFromURL",null),ce([t],fe.prototype,"getMode",null),ce([o],fe.prototype,"setDesignUnit",null),ce([t],fe.prototype,"getDesignUnit",null),ce([t],fe.prototype,"getPages",null),ce([t],fe.prototype,"getCurrentPage",null),ce([t],fe.prototype,"findNearestToViewPortCenterByType",null),ce([t],fe.prototype,"findNearestToViewPortCenterByKind",null),ce([o],fe.prototype,"setZoomLevel",null),ce([t],fe.prototype,"getZoomLevel",null),ce([o],fe.prototype,"zoomToBlock",null),ce([o],fe.prototype,"enableZoomAutoFit",null),ce([o],fe.prototype,"disableZoomAutoFit",null),ce([t],fe.prototype,"isZoomAutoFitEnabled",null);var pe,he=function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},me=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class ge{constructor(e){pe.set(this,void 0),Object.defineProperty(this,"onSelectionChanged",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=me(this,pe,"f").subscribeToSelectionChange(e);return()=>{me(this,pe,"f").isDeleted()||w(me(this,pe,"f").unsubscribe(t))}}}),Object.defineProperty(this,"onClicked",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=me(this,pe,"f").subscribeToBlockClicked(e);return()=>{me(this,pe,"f").isDeleted()||w(me(this,pe,"f").unsubscribe(t))}}}),function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?o.call(e,r):o?o.value=r:t.set(e,r)}(this,pe,e,"f")}async export(e,t=se.Png,r={}){var n,o,i;ne("handle",e,K()),ne("mimeType",t,oe()),ne("options",r,Q());const a=null!=r.targetWidth&&null!=r.targetHeight,s=null!==(n=r.jpegQuality)&&void 0!==n?n:.9,u=null!==(o=r.webpQuality)&&void 0!==o?o:1,l=null!==(i=r.pngCompressionLevel)&&void 0!==i?i:5;return ne("jpegQuality",s,ee(J(K(),1),0,{exclusive:!0})),ne("webpQuality",u,ee(J(K(),1),0,{exclusive:!0})),ne("pngCompressionLevel",l,ee(J(X(),9),0)),null==r.targetWidth&&null==r.targetHeight||(ne("targetWidth",r.targetWidth,K()),ne("targetHeight",r.targetHeight,K())),new Promise(((n,o)=>{var i,c,d;me(this,pe,"f").exportToBuffer(e,t,(e=>{"error"in e?o(e.error):n(new ue([e],{type:t}))}),{pngCompressionLevel:l,jpegQuality:s,webpQuality:u,useTargetSize:a,targetWidth:null!==(i=r.targetWidth)&&void 0!==i?i:0,targetHeight:null!==(c=r.targetHeight)&&void 0!==c?c:0,exportPdfWithHighCompatibility:null===(d=r.exportPdfWithHighCompatibility)||void 0===d||d})}))}async exportWithColorMask(e,t=se.Png,r,n,o,i={}){var a,s,u;ne("handle",e,K()),ne("mimeType",t,oe()),ne("options",i,Q());const l=null!=i.targetWidth&&null!=i.targetHeight,c=null!==(a=i.jpegQuality)&&void 0!==a?a:.9,d=null!==(s=i.webpQuality)&&void 0!==s?s:1,f=null!==(u=i.pngCompressionLevel)&&void 0!==u?u:5;return ne("jpegQuality",c,ee(J(K(),1),0,{exclusive:!0})),ne("webpQuality",d,ee(J(K(),1),0,{exclusive:!0})),ne("pngCompressionLevel",f,ee(J(X(),9),0)),null==i.targetWidth&&null==i.targetHeight||(ne("targetWidth",i.targetWidth,K()),ne("targetHeight",i.targetHeight,K())),new Promise(((a,s)=>{var u,p,h;me(this,pe,"f").exportWithColorMaskToBuffer(e,t,r,n,o,((e,r)=>{if("error"in e)s(e.error);else if("error"in r)s(r.error);else{const n=new ue([e],{type:t}),o=new ue([r],{type:t});a([n,o])}}),{pngCompressionLevel:f,jpegQuality:c,webpQuality:d,useTargetSize:l,targetWidth:null!==(u=i.targetWidth)&&void 0!==u?u:0,targetHeight:null!==(p=i.targetHeight)&&void 0!==p?p:0,exportPdfWithHighCompatibility:null===(h=i.exportPdfWithHighCompatibility)||void 0===h||h})}))}async exportVideo(e,t=se.Mp4,r,n){throw new Error("Method not implemented. An implementation is available on the BlockAPI at engine.block or cesdk.engine.block")}async loadFromString(e){return ne("content",e,Z()),E((t=>me(this,pe,"f").loadBlocksFromString(e,t))).then((e=>_(e)))}async saveToString(e){return ne("blocks",e,z(K())),E((t=>me(this,pe,"f").saveBlocksToString(e,t)))}create(e){return ne("type",e,Z()),w(me(this,pe,"f").create(e))}createFill(e){return ne("type",e,Z()),w(me(this,pe,"f").createFill(e))}getType(e){return ne("id",e,X()),w(me(this,pe,"f").getType(e))}getKind(e){return ne("id",e,X()),w(me(this,pe,"f").getKind(e))}setKind(e,t){ne("id",e,X()),w(me(this,pe,"f").setKind(e,t))}select(e){return ne("id",e,X()),w(me(this,pe,"f").select(e))}setSelected(e,t){return ne("id",e,X()),ne("selected",t,Y()),w(me(this,pe,"f").setSelected(e,t))}isSelected(e){return ne("id",e,X()),w(me(this,pe,"f").isSelected(e))}findAllSelected(){return _(me(this,pe,"f").findAllSelected())}isGroupable(e){return ne("ids",e,z(K())),w(me(this,pe,"f").isGroupable(e))}group(e){return ne("ids",e,te(z(K()))),w(me(this,pe,"f").group(e))}ungroup(e){return ne("id",e,K()),w(me(this,pe,"f").ungroup(e))}enterGroup(e){return ne("id",e,K()),w(me(this,pe,"f").enterGroup(e))}exitGroup(e){return ne("id",e,K()),w(me(this,pe,"f").exitGroup(e))}setName(e,t){return ne("id",e,X()),ne("name",t,Z()),w(me(this,pe,"f").setName(e,t))}getName(e){return ne("id",e,X()),w(me(this,pe,"f").getName(e))}getUUID(e){return ne("id",e,X()),w(me(this,pe,"f").getUUID(e))}findByName(e){ne("name",e,Z());const t=me(this,pe,"f").findByName(e);return _(t)}findByType(e){ne("type",e,Z());const t=w(me(this,pe,"f").findByType(e));return _(t)}findByKind(e){ne("kind",e,Z());const t=w(me(this,pe,"f").findByKind(e));return _(t)}findAll(){return _(me(this,pe,"f").findAll())}findAllPlaceholders(){return _(me(this,pe,"f").findAllPlaceholders())}createShape(e){return ne("type",e,Z()),w(me(this,pe,"f").createShape(e))}hasShape(e){return ne("id",e,X()),w(me(this,pe,"f").hasShape(e))}getShape(e){return ne("id",e,X()),w(me(this,pe,"f").getShape(e))}setShape(e,t){return ne("id",e,X()),ne("shape",t,X()),w(me(this,pe,"f").setShape(e,t))}isVisible(e){return ne("id",e,X()),w(me(this,pe,"f").isVisible(e))}setVisible(e,t){return ne("id",e,X()),ne("visible",t,Y()),w(me(this,pe,"f").setVisible(e,t))}isClipped(e){return ne("id",e,X()),w(me(this,pe,"f").isClipped(e))}setClipped(e,t){return ne("id",e,X()),ne("clipped",t,Y()),w(me(this,pe,"f").setClipped(e,t))}getPositionX(e){return ne("id",e,X()),w(me(this,pe,"f").getPositionX(e))}getPositionXMode(e){return ne("id",e,X()),w(me(this,pe,"f").getPositionXMode(e))}getPositionY(e){return ne("id",e,X()),w(me(this,pe,"f").getPositionY(e))}getPositionYMode(e){return ne("id",e,X()),w(me(this,pe,"f").getPositionYMode(e))}setPositionX(e,t){return ne("id",e,X()),ne("value",t,K()),w(me(this,pe,"f").setPositionX(e,t))}setPositionXMode(e,t){return ne("id",e,X()),w(me(this,pe,"f").setPositionXMode(e,t))}setPositionY(e,t){return ne("id",e,X()),ne("value",t,K()),w(me(this,pe,"f").setPositionY(e,t))}setPositionYMode(e,t){return ne("id",e,X()),w(me(this,pe,"f").setPositionYMode(e,t))}setAlwaysOnTop(e,t){return ne("id",e,X()),ne("enabled",t,Y()),w(me(this,pe,"f").setAlwaysOnTop(e,t))}setAlwaysOnBottom(e,t){return ne("id",e,X()),ne("enabled",t,Y()),w(me(this,pe,"f").setAlwaysOnBottom(e,t))}isAlwaysOnTop(e){return ne("id",e,X()),w(me(this,pe,"f").isAlwaysOnTop(e))}isAlwaysOnBottom(e){return ne("id",e,X()),w(me(this,pe,"f").isAlwaysOnBottom(e))}bringToFront(e){return ne("id",e,K()),w(me(this,pe,"f").bringToFront(e))}sendToBack(e){return ne("id",e,K()),w(me(this,pe,"f").sendToBack(e))}bringForward(e){return ne("id",e,K()),w(me(this,pe,"f").bringForward(e))}sendBackward(e){return ne("id",e,K()),w(me(this,pe,"f").sendBackward(e))}getRotation(e){return ne("id",e,X()),w(me(this,pe,"f").getRotation(e))}setRotation(e,t){return ne("id",e,X()),ne("radians",t,K()),w(me(this,pe,"f").setRotation(e,t))}getFlipHorizontal(e){return ne("id",e,X()),w(me(this,pe,"f").getFlip(e)).horizontal}getFlipVertical(e){return ne("id",e,X()),w(me(this,pe,"f").getFlip(e)).vertical}setFlipHorizontal(e,t){return ne("id",e,X()),ne("flip",t,Y()),w(me(this,pe,"f").setFlipHorizontal(e,t))}setFlipVertical(e,t){return ne("id",e,X()),ne("flip",t,Y()),w(me(this,pe,"f").setFlipVertical(e,t))}hasContentFillMode(e){return ne("id",e,X()),w(me(this,pe,"f").hasContentFillMode(e))}getWidth(e){return ne("id",e,X()),w(me(this,pe,"f").getWidth(e))}getWidthMode(e){return ne("id",e,X()),w(me(this,pe,"f").getWidthMode(e))}getHeight(e){return ne("id",e,X()),w(me(this,pe,"f").getHeight(e))}getHeightMode(e){return ne("id",e,X()),w(me(this,pe,"f").getHeightMode(e))}setWidth(e,t){return ne("id",e,X()),ne("value",t,K()),w(me(this,pe,"f").setWidth(e,t))}setWidthMode(e,t){return ne("id",e,X()),w(me(this,pe,"f").setWidthMode(e,t))}setHeight(e,t){return ne("id",e,X()),ne("value",t,K()),w(me(this,pe,"f").setHeight(e,t))}setHeightMode(e,t){return ne("id",e,X()),w(me(this,pe,"f").setHeightMode(e,t))}getFrameX(e){return ne("id",e,X()),w(me(this,pe,"f").getLastFrameX(e))}getFrameY(e){return ne("id",e,X()),w(me(this,pe,"f").getLastFrameY(e))}getFrameWidth(e){return ne("id",e,X()),w(me(this,pe,"f").getLastFrameWidth(e))}getFrameHeight(e){return ne("id",e,X()),w(me(this,pe,"f").getLastFrameHeight(e))}setContentFillMode(e,t){return ne("id",e,X()),w(me(this,pe,"f").setContentFillMode(e,t))}getContentFillMode(e){return ne("id",e,X()),w(me(this,pe,"f").getContentFillMode(e))}duplicate(e){return ne("id",e,X()),w(me(this,pe,"f").duplicate(e))}destroy(e){return ne("id",e,X()),w(me(this,pe,"f").destroy(e))}isValid(e){return ne("id",e,X()),me(this,pe,"f").isValid(e)}getParent(e){return ne("id",e,X()),w(me(this,pe,"f").hasParent(e))?w(me(this,pe,"f").getParent(e)):null}getChildren(e){ne("id",e,X());const t=w(me(this,pe,"f").getChildren(e));return _(t)}insertChild(e,t,r){return ne("parent",e,K()),ne("child",t,K()),ne("index",r,ee(K(),0)),w(me(this,pe,"f").insertChild(e,t,r))}appendChild(e,t){return ne("parent",e,K()),ne("child",t,K()),w(me(this,pe,"f").appendChild(e,t))}referencesAnyVariables(e){return ne("id",e,X()),w(me(this,pe,"f").referencesAnyVariables(e))}getGlobalBoundingBoxX(e){return ne("id",e,X()),w(me(this,pe,"f").getGlobalBoundingBoxX(e))}getGlobalBoundingBoxY(e){return ne("id",e,X()),w(me(this,pe,"f").getGlobalBoundingBoxY(e))}getGlobalBoundingBoxWidth(e){return ne("id",e,X()),w(me(this,pe,"f").getGlobalBoundingBoxWidth(e))}getGlobalBoundingBoxHeight(e){return ne("id",e,X()),w(me(this,pe,"f").getGlobalBoundingBoxHeight(e))}getScreenSpaceBoundingBoxXYWH(e){return ne("ids",e,z(K())),w(me(this,pe,"f").getScreenSpaceBoundingBoxXYWH(e))}alignHorizontally(e,t){return ne("ids",e,te(z(K()))),w(me(this,pe,"f").alignHorizontally(e,t))}alignVertically(e,t){return ne("ids",e,te(z(K()))),w(me(this,pe,"f").alignVertically(e,t))}isAlignable(e){return ne("ids",e,z(K())),w(me(this,pe,"f").isAlignable(e))}distributeHorizontally(e){return ne("ids",e,te(z(K()))),w(me(this,pe,"f").distributeHorizontally(e))}distributeVertically(e){return ne("ids",e,te(z(K()))),w(me(this,pe,"f").distributeVertically(e))}isDistributable(e){return ne("ids",e,z(K())),w(me(this,pe,"f").isDistributable(e))}fillParent(e){return ne("id",e,X()),w(me(this,pe,"f").fillParent(e))}resizeContentAware(e,t,r){return ne("ids",e,z(K())),ne("width",t,K()),ne("height",r,K()),w(me(this,pe,"f").resizeContentAware(e,t,r))}scale(e,t,r=0,n=0){return ne("id",e,X()),w(me(this,pe,"f").scale(e,t,r,n))}findAllProperties(e){return ne("id",e,X()),_(w(me(this,pe,"f").findAllProperties(e)))}isPropertyReadable(e){return ne("property",e,Z()),me(this,pe,"f").isPropertyReadable(e)}isPropertyWritable(e){return ne("property",e,Z()),me(this,pe,"f").isPropertyWritable(e)}getPropertyType(e){return ne("property",e,Z()),w(me(this,pe,"f").getPropertyType(e))}getEnumValues(e){return ne("enumProperty",e,Z()),_(w(me(this,pe,"f").getEnumValues(e)))}setBool(e,t,r){return ne("id",e,X()),ne("property",t,Z()),ne("value",r,Y()),w(me(this,pe,"f").setBool(e,t,r))}getBool(e,t){return ne("id",e,X()),ne("property",t,Z()),w(me(this,pe,"f").getBool(e,t))}setInt(e,t,r){return ne("id",e,X()),ne("property",t,Z()),ne("value",r,X()),w(me(this,pe,"f").setInt(e,t,r))}getInt(e,t){return ne("id",e,X()),ne("property",t,Z()),w(me(this,pe,"f").getInt(e,t))}setFloat(e,t,r){return ne("id",e,X()),ne("property",t,Z()),ne("value",r,K()),w(me(this,pe,"f").setFloat(e,t,r))}getFloat(e,t){return ne("id",e,X()),ne("property",t,Z()),w(me(this,pe,"f").getFloat(e,t))}setDouble(e,t,r){return ne("id",e,X()),ne("property",t,Z()),ne("value",r,K()),w(me(this,pe,"f").setDouble(e,t,r))}getDouble(e,t){return ne("id",e,X()),ne("property",t,Z()),w(me(this,pe,"f").getDouble(e,t))}setString(e,t,r){return ne("id",e,X()),ne("property",t,Z()),ne("value",r,Z()),w(me(this,pe,"f").setString(e,t,r))}getString(e,t){return ne("id",e,X()),ne("property",t,Z()),w(me(this,pe,"f").getString(e,t))}setColor(e,t,r){return ne("id",e,X()),ne("property",t,Z()),w(me(this,pe,"f").setColor(e,t,i.fromColor(r)))}getColor(e,t){return ne("id",e,X()),ne("property",t,Z()),i.toColor(w(me(this,pe,"f").getColor(e,t)))}setColorRGBA(e,t,r,n,o,i=1){return ne("id",e,X()),ne("property",t,Z()),ne("r",r,K()),ne("g",n,K()),ne("b",o,K()),ne("a",i,K()),w(me(this,pe,"f").setColorRGBA(e,t,r,n,o,i))}getColorRGBA(e,t){return ne("id",e,X()),ne("property",t,Z()),w(me(this,pe,"f").getColorRGBA(e,t))}setColorSpot(e,t,r,n=1){return ne("id",e,X()),ne("property",t,Z()),ne("name",r,Z()),ne("tint",n,K()),w(me(this,pe,"f").setColorSpot(e,t,r,n))}getColorSpotName(e,t){return ne("id",e,X()),ne("property",t,Z()),w(me(this,pe,"f").getColorSpotName(e,t))}getColorSpotTint(e,t){return ne("id",e,X()),ne("property",t,Z()),w(me(this,pe,"f").getColorSpotTint(e,t))}setGradientColorStops(e,t,r){ne("id",e,X()),ne("property",t,Z());const n=r.map((e=>({color:i.fromColor(e.color),stop:e.stop})));return w(me(this,pe,"f").setGradientColorStops(e,t,n))}getGradientColorStops(e,t){ne("id",e,X()),ne("property",t,Z());const r=w(me(this,pe,"f").getGradientColorStops(e,t));return _(r).map((e=>({color:i.toColor(e.color),stop:e.stop})))}setEnum(e,t,r){return ne("id",e,X()),ne("property",t,Z()),ne("value",r,Z()),w(me(this,pe,"f").setEnum(e,t,r))}getEnum(e,t){return ne("id",e,X()),ne("property",t,Z()),w(me(this,pe,"f").getEnum(e,t))}hasCrop(e){return ne("id",e,X()),w(me(this,pe,"f").hasCrop(e))}setCropScaleX(e,t){return ne("id",e,X()),ne("scaleX",t,K()),w(me(this,pe,"f").setCropScaleX(e,t))}setCropScaleY(e,t){return ne("id",e,X()),ne("scaleY",t,K()),w(me(this,pe,"f").setCropScaleY(e,t))}setCropRotation(e,t){return ne("id",e,X()),ne("rotation",t,K()),w(me(this,pe,"f").setCropRotation(e,t))}setCropScaleRatio(e,t){return ne("id",e,X()),ne("scaleRatio",t,K()),w(me(this,pe,"f").setCropScaleRatio(e,t))}setCropTranslationX(e,t){return ne("id",e,X()),ne("translationX",t,K()),w(me(this,pe,"f").setCropTranslationX(e,t))}setCropTranslationY(e,t){return ne("id",e,X()),ne("translationY",t,K()),w(me(this,pe,"f").setCropTranslationY(e,t))}resetCrop(e){return ne("id",e,X()),w(me(this,pe,"f").resetCrop(e))}getCropScaleX(e){return ne("id",e,X()),w(me(this,pe,"f").getCropScaleX(e))}getCropScaleY(e){return ne("id",e,X()),w(me(this,pe,"f").getCropScaleY(e))}getCropRotation(e){return ne("id",e,X()),w(me(this,pe,"f").getCropRotation(e))}getCropScaleRatio(e){return ne("id",e,X()),w(me(this,pe,"f").getCropScaleRatio(e))}getCropTranslationX(e){return ne("id",e,X()),w(me(this,pe,"f").getCropTranslationX(e))}getCropTranslationY(e){return ne("id",e,X()),w(me(this,pe,"f").getCropTranslationY(e))}adjustCropToFillFrame(e,t){return ne("id",e,X()),ne("minScaleRatio",t,K()),w(me(this,pe,"f").adjustCropToFillFrame(e,t))}flipCropHorizontal(e){return ne("id",e,X()),w(me(this,pe,"f").flipCropHorizontal(e))}flipCropVertical(e){return ne("id",e,X()),w(me(this,pe,"f").flipCropVertical(e))}hasOpacity(e){return ne("id",e,X()),w(me(this,pe,"f").hasOpacity(e))}setOpacity(e,t){return ne("id",e,X()),ne("opacity",t,K()),w(me(this,pe,"f").setOpacity(e,t))}getOpacity(e){return ne("id",e,X()),w(me(this,pe,"f").getOpacity(e))}hasBlendMode(e){return ne("id",e,X()),w(me(this,pe,"f").hasBlendMode(e))}setBlendMode(e,t){return ne("id",e,X()),ne("blendMode",t,Z()),w(me(this,pe,"f").setBlendMode(e,t))}getBlendMode(e){return ne("id",e,X()),w(me(this,pe,"f").getBlendMode(e))}hasFillColor(e){return ne("id",e,X()),w(me(this,pe,"f").hasFillColor(e))}setFillColorRGBA(e,t,r,n,o=1){return ne("id",e,X()),ne("r",t,K()),ne("g",r,K()),ne("b",n,K()),ne("a",o,K()),w(me(this,pe,"f").setFillColorRGBA(e,t,r,n,o))}getFillColorRGBA(e){return ne("id",e,X()),w(me(this,pe,"f").getFillColorRGBA(e))}setFillColorEnabled(e,t){return ne("id",e,X()),ne("enabled",t,Y()),w(me(this,pe,"f").setFillColorEnabled(e,t))}isFillColorEnabled(e){return ne("id",e,X()),w(me(this,pe,"f").isFillColorEnabled(e))}createEffect(e){return ne("type",e,Z()),w(me(this,pe,"f").createEffect(e))}hasEffects(e){return ne("id",e,X()),w(me(this,pe,"f").hasEffects(e))}getEffects(e){ne("id",e,X());const t=w(me(this,pe,"f").getEffects(e));return _(t)}insertEffect(e,t,r){ne("id",e,X()),ne("effectId",t,X()),ne("index",r,ee(X(),0)),w(me(this,pe,"f").insertEffect(e,t,r))}appendEffect(e,t){ne("id",e,X()),ne("effectId",t,X()),w(me(this,pe,"f").appendEffect(e,t))}removeEffect(e,t){ne("id",e,X()),ne("index",t,ee(X(),0)),w(me(this,pe,"f").removeEffect(e,t))}hasEffectEnabled(e){return ne("effectId",e,X()),w(me(this,pe,"f").hasEffectEnabled(e))}setEffectEnabled(e,t){ne("effectId",e,X()),ne("enabled",t,Y()),w(me(this,pe,"f").setEffectEnabled(e,t))}isEffectEnabled(e){return ne("effectId",e,X()),w(me(this,pe,"f").isEffectEnabled(e))}createBlur(e){return ne("type",e,Z()),w(me(this,pe,"f").createBlur(e))}hasBlur(e){return ne("id",e,X()),w(me(this,pe,"f").hasBlur(e))}setBlur(e,t){ne("id",e,X()),ne("blurId",t,X()),w(me(this,pe,"f").setBlur(e,t))}getBlur(e){return ne("id",e,X()),w(me(this,pe,"f").getBlur(e))}setBlurEnabled(e,t){ne("id",e,X()),ne("enabled",t,Y()),w(me(this,pe,"f").setBlurEnabled(e,t))}isBlurEnabled(e){return ne("id",e,X()),w(me(this,pe,"f").isBlurEnabled(e))}hasBackgroundColor(e){return ne("id",e,X()),w(me(this,pe,"f").hasBackgroundColor(e))}setBackgroundColorRGBA(e,t,r,n,o=1){return ne("id",e,X()),ne("r",t,K()),ne("g",r,K()),ne("b",n,K()),ne("a",o,K()),w(me(this,pe,"f").setBackgroundColorRGBA(e,t,r,n,o))}getBackgroundColorRGBA(e){return ne("id",e,X()),w(me(this,pe,"f").getBackgroundColorRGBA(e))}setBackgroundColorEnabled(e,t){return ne("id",e,X()),ne("enabled",t,Y()),w(me(this,pe,"f").setBackgroundColorEnabled(e,t))}isBackgroundColorEnabled(e){return ne("id",e,X()),w(me(this,pe,"f").isBackgroundColorEnabled(e))}hasStroke(e){return ne("id",e,X()),w(me(this,pe,"f").hasStroke(e))}setStrokeEnabled(e,t){return ne("id",e,X()),ne("enabled",t,Y()),w(me(this,pe,"f").setStrokeEnabled(e,t))}isStrokeEnabled(e){return ne("id",e,X()),w(me(this,pe,"f").isStrokeEnabled(e))}setStrokeColorRGBA(e,t,r,n,o=1){return ne("id",e,X()),ne("r",t,K()),ne("g",r,K()),ne("b",n,K()),ne("a",o,K()),w(me(this,pe,"f").setStrokeColorRGBA(e,t,r,n,o))}setStrokeColor(e,t){return ne("id",e,X()),w(me(this,pe,"f").setStrokeColor(e,i.fromColor(t)))}getStrokeColorRGBA(e){return ne("id",e,X()),w(me(this,pe,"f").getStrokeColorRGBA(e))}getStrokeColor(e){return ne("id",e,X()),i.toColor(w(me(this,pe,"f").getStrokeColor(e)))}setStrokeWidth(e,t){return ne("id",e,X()),ne("width",t,K()),w(me(this,pe,"f").setStrokeWidth(e,t))}getStrokeWidth(e){return ne("id",e,X()),w(me(this,pe,"f").getStrokeWidth(e))}setStrokeStyle(e,t){return ne("id",e,X()),w(me(this,pe,"f").setStrokeStyle(e,t))}getStrokeStyle(e){return ne("id",e,X()),w(me(this,pe,"f").getStrokeStyle(e))}setStrokePosition(e,t){return ne("id",e,X()),w(me(this,pe,"f").setStrokePosition(e,t))}getStrokePosition(e){return ne("id",e,X()),w(me(this,pe,"f").getStrokePosition(e))}setStrokeCornerGeometry(e,t){return ne("id",e,X()),w(me(this,pe,"f").setStrokeCornerGeometry(e,t))}getStrokeCornerGeometry(e){return ne("id",e,X()),w(me(this,pe,"f").getStrokeCornerGeometry(e))}hasDropShadow(e){return ne("id",e,X()),w(me(this,pe,"f").hasDropShadow(e))}setDropShadowEnabled(e,t){return ne("id",e,X()),ne("enabled",t,Y()),w(me(this,pe,"f").setDropShadowEnabled(e,t))}isDropShadowEnabled(e){return ne("id",e,X()),w(me(this,pe,"f").isDropShadowEnabled(e))}setDropShadowColorRGBA(e,t,r,n,o=1){return ne("id",e,X()),ne("r",t,K()),ne("g",r,K()),ne("b",n,K()),ne("a",o,K()),w(me(this,pe,"f").setDropShadowColorRGBA(e,t,r,n,o))}setDropShadowColor(e,t){return ne("id",e,X()),w(me(this,pe,"f").setDropShadowColor(e,i.fromColor(t)))}getDropShadowColorRGBA(e){return ne("id",e,X()),w(me(this,pe,"f").getDropShadowColorRGBA(e))}getDropShadowColor(e){return ne("id",e,X()),i.toColor(w(me(this,pe,"f").getDropShadowColor(e)))}setDropShadowOffsetX(e,t){return ne("id",e,X()),ne("offsetX",t,K()),w(me(this,pe,"f").setDropShadowOffsetX(e,t))}getDropShadowOffsetX(e){return ne("id",e,X()),w(me(this,pe,"f").getDropShadowOffsetX(e))}setDropShadowOffsetY(e,t){return ne("id",e,X()),ne("offsetY",t,K()),w(me(this,pe,"f").setDropShadowOffsetY(e,t))}getDropShadowOffsetY(e){return ne("id",e,X()),w(me(this,pe,"f").getDropShadowOffsetY(e))}setDropShadowBlurRadiusX(e,t){return ne("id",e,X()),ne("blurRadiusX",t,K()),w(me(this,pe,"f").setDropShadowBlurRadiusX(e,t))}getDropShadowBlurRadiusX(e){return ne("id",e,X()),w(me(this,pe,"f").getDropShadowBlurRadiusX(e))}setDropShadowBlurRadiusY(e,t){return ne("id",e,X()),ne("blurRadiusY",t,K()),w(me(this,pe,"f").setDropShadowBlurRadiusY(e,t))}getDropShadowBlurRadiusY(e){return ne("id",e,X()),w(me(this,pe,"f").getDropShadowBlurRadiusY(e))}setDropShadowClip(e,t){return ne("id",e,X()),w(me(this,pe,"f").setDropShadowClip(e,t))}getDropShadowClip(e){return ne("id",e,X()),w(me(this,pe,"f").getDropShadowClip(e))}createCutoutFromBlocks(e,t=2,r=4){return ne("ids",e,z(X())),ne("vectorizeDistanceThreshold",t,K()),ne("maxSmoothingDistance",r,K()),w(me(this,pe,"f").createCutoutFromBlocks(e,t,r))}createCutoutFromPath(e){return ne("path",e,Z()),w(me(this,pe,"f").createCutoutFromPath(e))}createCutoutFromOperation(e,t){return ne("ids",e,z(X())),ne("op",t,function(){const e=["Difference","Intersection","Union","XOR"];return G("CutoutOperation",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}()),w(me(this,pe,"f").createCutoutFromOperation(e,t))}replaceText(e,t,r=-1,n=-1){ne("id",e,X()),ne("text",t,Z()),ne("from",r,X()),ne("to",n,X()),w(me(this,pe,"f").replaceText(e,t,r,n))}removeText(e,t=-1,r=-1){ne("id",e,X()),ne("from",t,X()),ne("to",r,X()),w(me(this,pe,"f").removeText(e,t,r))}setTextColor(e,t,r=-1,n=-1){ne("id",e,X()),ne("from",r,X()),ne("to",n,X()),w(me(this,pe,"f").setTextColor(e,i.fromColor(t),r,n))}getTextColors(e,t=-1,r=-1){ne("id",e,X()),ne("from",t,X()),ne("to",r,X());const n=me(this,pe,"f").getTextColors(e,t,r);return _(w(n)).map((e=>i.toColor(e)))}getTextFontWeights(e,t=-1,r=-1){return ne("id",e,X()),ne("from",t,X()),ne("to",r,X()),_(w(me(this,pe,"f").getTextFontWeights(e,t,r)))}getTextFontStyles(e,t=-1,r=-1){return ne("id",e,X()),ne("from",t,X()),ne("to",r,X()),_(w(me(this,pe,"f").getTextFontStyles(e,t,r)))}getTextCases(e,t=-1,r=-1){return ne("id",e,X()),ne("from",t,X()),ne("to",r,X()),_(w(me(this,pe,"f").getTextCases(e,t,r)))}setTextCase(e,t,r=-1,n=-1){ne("id",e,X()),ne("textCase",t,Z()),ne("from",r,X()),ne("to",n,X()),w(me(this,pe,"f").setTextCase(e,t,r,n))}getTextCursorRange(){return w(me(this,pe,"f").getTextCursorRange())}hasFill(e){return ne("id",e,X()),w(me(this,pe,"f").hasFill(e))}isFillEnabled(e){return ne("id",e,X()),w(me(this,pe,"f").isFillEnabled(e))}setFillEnabled(e,t){return ne("id",e,X()),w(me(this,pe,"f").setFillEnabled(e,t))}getFill(e){return ne("id",e,X()),w(me(this,pe,"f").getFill(e))}setFill(e,t){return ne("id",e,X()),ne("fill",t,X()),w(me(this,pe,"f").setFill(e,t))}setFillSolidColor(e,t,r,n,o=1){ne("id",e,X()),w(me(this,pe,"f").setFillSolidColor(e,t,r,n,o))}getFillSolidColor(e){return ne("id",e,X()),w(me(this,pe,"f").getFillSolidColor(e))}setPlaceholderEnabled(e,t){ne("id",e,X()),ne("enabled",t,Y()),w(me(this,pe,"f").setPlaceholderEnabled(e,t))}isPlaceholderEnabled(e){return ne("id",e,X()),w(me(this,pe,"f").isPlaceholderEnabled(e))}hasPlaceholderBehavior(e){return ne("id",e,X()),w(me(this,pe,"f").hasPlaceholderBehavior(e))}setPlaceholderBehaviorEnabled(e,t){ne("id",e,X()),w(me(this,pe,"f").setPlaceholderBehaviorEnabled(e,t))}isPlaceholderBehaviorEnabled(e){return ne("id",e,X()),w(me(this,pe,"f").isPlaceholderBehaviorEnabled(e))}hasPlaceholderControls(e){return ne("id",e,X()),w(me(this,pe,"f").hasPlaceholderControls(e))}setPlaceholderControlsOverlayEnabled(e,t){return ne("id",e,X()),ne("enabled",t,Y()),w(me(this,pe,"f").setPlaceholderControlsOverlayEnabled(e,t))}isPlaceholderControlsOverlayEnabled(e){return ne("id",e,X()),w(me(this,pe,"f").isPlaceholderControlsOverlayEnabled(e))}setPlaceholderControlsButtonEnabled(e,t){return ne("id",e,X()),ne("enabled",t,Y()),w(me(this,pe,"f").setPlaceholderControlsButtonEnabled(e,t))}isPlaceholderControlsButtonEnabled(e){return ne("id",e,X()),w(me(this,pe,"f").isPlaceholderControlsButtonEnabled(e))}setMetadata(e,t,r){ne("id",e,X()),ne("key",t,Z()),ne("value",r,Z()),w(me(this,pe,"f").setMetadata(e,t,r))}getMetadata(e,t){return ne("id",e,X()),ne("key",t,Z()),w(me(this,pe,"f").getMetadata(e,t))}hasMetadata(e,t){return ne("id",e,X()),ne("key",t,Z()),w(me(this,pe,"f").hasMetadata(e,t))}findAllMetadata(e){return ne("id",e,X()),_(w(me(this,pe,"f").findAllMetadata(e)))}removeMetadata(e,t){ne("id",e,X()),ne("key",t,Z()),w(me(this,pe,"f").removeMetadata(e,t))}setScopeEnabled(e,t,r){ne("id",e,X()),ne("key",t,Z()),ne("enabled",r,Y()),w(me(this,pe,"f").setScopeEnabled(e,t,r))}isScopeEnabled(e,t){return ne("id",e,X()),ne("key",t,Z()),w(me(this,pe,"f").isScopeEnabled(e,t))}isAllowedByScope(e,t){return ne("id",e,X()),ne("key",t,Z()),w(me(this,pe,"f").isAllowedByScope(e,t))}hasDuration(e){return ne("id",e,X()),w(me(this,pe,"f").hasDuration(e))}setDuration(e,t){return ne("id",e,X()),ne("duration",t,K()),w(me(this,pe,"f").setDuration(e,t))}getDuration(e){return ne("id",e,X()),w(me(this,pe,"f").getDuration(e))}hasTimeOffset(e){return ne("id",e,X()),w(me(this,pe,"f").hasTimeOffset(e))}setTimeOffset(e,t){return ne("id",e,X()),ne("offset",t,K()),w(me(this,pe,"f").setTimeOffset(e,t))}getTimeOffset(e){return ne("id",e,X()),w(me(this,pe,"f").getTimeOffset(e))}hasTrim(e){return ne("id",e,X()),w(me(this,pe,"f").hasTrim(e))}setTrimOffset(e,t){return ne("id",e,X()),ne("offset",t,K()),w(me(this,pe,"f").setTrimOffset(e,t))}getTrimOffset(e){return ne("id",e,X()),w(me(this,pe,"f").getTrimOffset(e))}setTrimLength(e,t){return ne("id",e,X()),ne("length",t,K()),w(me(this,pe,"f").setTrimLength(e,t))}getTrimLength(e){return ne("id",e,X()),w(me(this,pe,"f").getTrimLength(e))}getTotalSceneDuration(e){return ne("scene",e,X()),w(me(this,pe,"f").getTotalSceneDuration(e))}setPlaying(e,t){return ne("id",e,X()),ne("enabled",t,Y()),w(me(this,pe,"f").setPlaying(e,t))}isPlaying(e){return ne("id",e,X()),w(me(this,pe,"f").isPlaying(e))}hasPlaybackTime(e){return ne("id",e,X()),w(me(this,pe,"f").hasPlaybackTime(e))}setPlaybackTime(e,t){return ne("id",e,X()),ne("time",t,K()),w(me(this,pe,"f").setPlaybackTime(e,t))}getPlaybackTime(e){return ne("id",e,X()),w(me(this,pe,"f").getPlaybackTime(e))}setSoloPlaybackEnabled(e,t){return ne("id",e,X()),ne("enabled",t,Y()),w(me(this,pe,"f").setSoloPlaybackEnabled(e,t))}isSoloPlaybackEnabled(e){return ne("id",e,X()),w(me(this,pe,"f").isSoloPlaybackEnabled(e))}hasPlaybackControl(e){return ne("id",e,X()),w(me(this,pe,"f").hasPlaybackControl(e))}setLooping(e,t){ne("id",e,X()),ne("looping",t,Y()),w(me(this,pe,"f").setLooping(e,t))}isLooping(e){return ne("id",e,X()),w(me(this,pe,"f").isLooping(e))}setMuted(e,t){ne("id",e,X()),ne("muted",t,Y()),w(me(this,pe,"f").setMuted(e,t))}isMuted(e){return ne("id",e,X()),w(me(this,pe,"f").isMuted(e))}setVolume(e,t){ne("id",e,X()),ne("volume",t,K()),w(me(this,pe,"f").setVolume(e,t))}getVolume(e){return ne("id",e,X()),w(me(this,pe,"f").getVolume(e))}async forceLoadAVResource(e){return ne("id",e,X()),E((t=>me(this,pe,"f").forceLoadAVResource(e,t)))}getAVResourceTotalDuration(e){return ne("id",e,X()),w(me(this,pe,"f").getAVResourceTotalDuration(e))}getVideoWidth(e){return ne("id",e,X()),w(me(this,pe,"f").getVideoWidth(e))}getVideoHeight(e){return ne("id",e,X()),w(me(this,pe,"f").getVideoHeight(e))}generateVideoThumbnailSequence(e,t,r,n,o,i){return ne("id",e,X()),ne("thumbnailHeight",t,X()),ne("timeBegin",r,K()),ne("timeEnd",n,K()),ne("numberOfFrames",o,X()),me(this,pe,"f").generateVideoThumbnailSequence(e,t,r,n,o,(e=>{"error"in e?i(0,new Error(e.error)):i(e.frameIndex,new ImageData(new Uint8ClampedArray(e.imageData),e.width,e.height))})),()=>{w(me(this,pe,"f").cancelVideoThumbnailSequenceGeneration(e))}}async getVideoFillThumbnail(e,t){return ne("id",e,X()),ne("thumbnailHeight",t,X()),new Promise(((r,n)=>{me(this,pe,"f").getVideoFillThumbnail(e,t,(e=>{"error"in e?n(e.error):r(new ue([e],{type:"image/jpeg"}))}))}))}async getVideoFillThumbnailAtlas(e,t,r,n){return ne("id",e,X()),ne("numberOfColumns",t,X()),ne("numberOfRows",r,X()),ne("thumbnailHeight",n,X()),new Promise(((o,i)=>{me(this,pe,"f").getVideoFillThumbnailAtlas(e,t,r,n,(e=>{"error"in e?i(e.error):o(new ue([e],{type:"image/jpeg"}))}))}))}async getPageThumbnailAtlas(e,t,r,n){return ne("id",e,X()),ne("numberOfColumns",t,X()),ne("numberOfRows",r,X()),new Promise(((o,i)=>{me(this,pe,"f").getPageThumbnailAtlas(e,t,r,n,(e=>{"error"in e?i(e.error):o(new ue([e],{type:"image/jpeg"}))}))}))}setNativePixelBuffer(e,t){t instanceof HTMLVideoElement&&(t.width=t.videoWidth,t.height=t.videoHeight),w(me(this,pe,"f").setNativePixelBuffer(e,t))}}pe=new WeakMap,he([o],ge.prototype,"loadFromString",null),he([o],ge.prototype,"create",null),he([o],ge.prototype,"createFill",null),he([t],ge.prototype,"getType",null),he([o],ge.prototype,"select",null),he([o],ge.prototype,"setSelected",null),he([t],ge.prototype,"isSelected",null),he([t],ge.prototype,"findAllSelected",null),he([t],ge.prototype,"isGroupable",null),he([o],ge.prototype,"group",null),he([o],ge.prototype,"ungroup",null),he([o],ge.prototype,"enterGroup",null),he([o],ge.prototype,"exitGroup",null),he([o],ge.prototype,"setName",null),he([t],ge.prototype,"getName",null),he([t],ge.prototype,"getUUID",null),he([t],ge.prototype,"findByName",null),he([t],ge.prototype,"findByType",null),he([t],ge.prototype,"findAll",null),he([t],ge.prototype,"findAllPlaceholders",null),he([o],ge.prototype,"createShape",null),he([t],ge.prototype,"hasShape",null),he([t],ge.prototype,"getShape",null),he([o],ge.prototype,"setShape",null),he([t],ge.prototype,"isVisible",null),he([o],ge.prototype,"setVisible",null),he([t],ge.prototype,"isClipped",null),he([o],ge.prototype,"setClipped",null),he([t],ge.prototype,"getPositionX",null),he([t],ge.prototype,"getPositionXMode",null),he([t],ge.prototype,"getPositionY",null),he([t],ge.prototype,"getPositionYMode",null),he([o],ge.prototype,"setPositionX",null),he([o],ge.prototype,"setPositionXMode",null),he([o],ge.prototype,"setPositionY",null),he([o],ge.prototype,"setPositionYMode",null),he([o],ge.prototype,"setAlwaysOnTop",null),he([o],ge.prototype,"setAlwaysOnBottom",null),he([t],ge.prototype,"isAlwaysOnTop",null),he([t],ge.prototype,"isAlwaysOnBottom",null),he([o],ge.prototype,"bringToFront",null),he([o],ge.prototype,"sendToBack",null),he([o],ge.prototype,"bringForward",null),he([o],ge.prototype,"sendBackward",null),he([t],ge.prototype,"getRotation",null),he([o],ge.prototype,"setRotation",null),he([t],ge.prototype,"getFlipHorizontal",null),he([t],ge.prototype,"getFlipVertical",null),he([o],ge.prototype,"setFlipHorizontal",null),he([o],ge.prototype,"setFlipVertical",null),he([t],ge.prototype,"hasContentFillMode",null),he([t],ge.prototype,"getWidth",null),he([t],ge.prototype,"getWidthMode",null),he([t],ge.prototype,"getHeight",null),he([t],ge.prototype,"getHeightMode",null),he([o],ge.prototype,"setWidth",null),he([o],ge.prototype,"setWidthMode",null),he([o],ge.prototype,"setHeight",null),he([o],ge.prototype,"setHeightMode",null),he([t],ge.prototype,"getFrameX",null),he([t],ge.prototype,"getFrameY",null),he([t],ge.prototype,"getFrameWidth",null),he([t],ge.prototype,"getFrameHeight",null),he([o],ge.prototype,"setContentFillMode",null),he([t],ge.prototype,"getContentFillMode",null),he([o],ge.prototype,"duplicate",null),he([o],ge.prototype,"destroy",null),he([t],ge.prototype,"isValid",null),he([t],ge.prototype,"getParent",null),he([t],ge.prototype,"getChildren",null),he([o],ge.prototype,"insertChild",null),he([o],ge.prototype,"appendChild",null),he([t],ge.prototype,"referencesAnyVariables",null),he([t],ge.prototype,"getGlobalBoundingBoxX",null),he([t],ge.prototype,"getGlobalBoundingBoxY",null),he([t],ge.prototype,"getGlobalBoundingBoxWidth",null),he([t],ge.prototype,"getGlobalBoundingBoxHeight",null),he([t],ge.prototype,"getScreenSpaceBoundingBoxXYWH",null),he([o],ge.prototype,"alignHorizontally",null),he([o],ge.prototype,"alignVertically",null),he([t],ge.prototype,"isAlignable",null),he([o],ge.prototype,"distributeHorizontally",null),he([o],ge.prototype,"distributeVertically",null),he([o],ge.prototype,"isDistributable",null),he([o],ge.prototype,"fillParent",null),he([o],ge.prototype,"resizeContentAware",null),he([o],ge.prototype,"scale",null),he([t],ge.prototype,"findAllProperties",null),he([t],ge.prototype,"isPropertyReadable",null),he([t],ge.prototype,"isPropertyWritable",null),he([t],ge.prototype,"getPropertyType",null),he([t],ge.prototype,"getEnumValues",null),he([o],ge.prototype,"setBool",null),he([t],ge.prototype,"getBool",null),he([o],ge.prototype,"setInt",null),he([t],ge.prototype,"getInt",null),he([o],ge.prototype,"setFloat",null),he([t],ge.prototype,"getFloat",null),he([o],ge.prototype,"setDouble",null),he([t],ge.prototype,"getDouble",null),he([o],ge.prototype,"setString",null),he([t],ge.prototype,"getString",null),he([o],ge.prototype,"setColor",null),he([t],ge.prototype,"getColor",null),he([o],ge.prototype,"setColorRGBA",null),he([t],ge.prototype,"getColorRGBA",null),he([o],ge.prototype,"setColorSpot",null),he([t],ge.prototype,"getColorSpotName",null),he([t],ge.prototype,"getColorSpotTint",null),he([o],ge.prototype,"setGradientColorStops",null),he([t],ge.prototype,"getGradientColorStops",null),he([o],ge.prototype,"setEnum",null),he([t],ge.prototype,"getEnum",null),he([t],ge.prototype,"hasCrop",null),he([o],ge.prototype,"setCropScaleX",null),he([o],ge.prototype,"setCropScaleY",null),he([o],ge.prototype,"setCropRotation",null),he([o],ge.prototype,"setCropScaleRatio",null),he([o],ge.prototype,"setCropTranslationX",null),he([o],ge.prototype,"setCropTranslationY",null),he([o],ge.prototype,"resetCrop",null),he([t],ge.prototype,"getCropScaleX",null),he([t],ge.prototype,"getCropScaleY",null),he([t],ge.prototype,"getCropRotation",null),he([t],ge.prototype,"getCropScaleRatio",null),he([t],ge.prototype,"getCropTranslationX",null),he([t],ge.prototype,"getCropTranslationY",null),he([o],ge.prototype,"adjustCropToFillFrame",null),he([o],ge.prototype,"flipCropHorizontal",null),he([o],ge.prototype,"flipCropVertical",null),he([t],ge.prototype,"hasOpacity",null),he([o],ge.prototype,"setOpacity",null),he([t],ge.prototype,"getOpacity",null),he([t],ge.prototype,"hasBlendMode",null),he([o],ge.prototype,"setBlendMode",null),he([t],ge.prototype,"getBlendMode",null),he([t],ge.prototype,"hasFillColor",null),he([o],ge.prototype,"setFillColorRGBA",null),he([t],ge.prototype,"getFillColorRGBA",null),he([o],ge.prototype,"setFillColorEnabled",null),he([t],ge.prototype,"isFillColorEnabled",null),he([o],ge.prototype,"createEffect",null),he([t],ge.prototype,"hasEffects",null),he([t],ge.prototype,"getEffects",null),he([o],ge.prototype,"insertEffect",null),he([o],ge.prototype,"appendEffect",null),he([o],ge.prototype,"removeEffect",null),he([t],ge.prototype,"hasEffectEnabled",null),he([o],ge.prototype,"setEffectEnabled",null),he([t],ge.prototype,"isEffectEnabled",null),he([o],ge.prototype,"createBlur",null),he([t],ge.prototype,"hasBlur",null),he([o],ge.prototype,"setBlur",null),he([t],ge.prototype,"getBlur",null),he([o],ge.prototype,"setBlurEnabled",null),he([t],ge.prototype,"isBlurEnabled",null),he([t],ge.prototype,"hasBackgroundColor",null),he([o],ge.prototype,"setBackgroundColorRGBA",null),he([t],ge.prototype,"getBackgroundColorRGBA",null),he([o],ge.prototype,"setBackgroundColorEnabled",null),he([t],ge.prototype,"isBackgroundColorEnabled",null),he([t],ge.prototype,"hasStroke",null),he([o],ge.prototype,"setStrokeEnabled",null),he([t],ge.prototype,"isStrokeEnabled",null),he([o],ge.prototype,"setStrokeColorRGBA",null),he([o],ge.prototype,"setStrokeColor",null),he([t],ge.prototype,"getStrokeColorRGBA",null),he([t],ge.prototype,"getStrokeColor",null),he([o],ge.prototype,"setStrokeWidth",null),he([t],ge.prototype,"getStrokeWidth",null),he([o],ge.prototype,"setStrokeStyle",null),he([t],ge.prototype,"getStrokeStyle",null),he([o],ge.prototype,"setStrokePosition",null),he([t],ge.prototype,"getStrokePosition",null),he([o],ge.prototype,"setStrokeCornerGeometry",null),he([t],ge.prototype,"getStrokeCornerGeometry",null),he([t],ge.prototype,"hasDropShadow",null),he([o],ge.prototype,"setDropShadowEnabled",null),he([t],ge.prototype,"isDropShadowEnabled",null),he([o],ge.prototype,"setDropShadowColorRGBA",null),he([o],ge.prototype,"setDropShadowColor",null),he([t],ge.prototype,"getDropShadowColorRGBA",null),he([t],ge.prototype,"getDropShadowColor",null),he([o],ge.prototype,"setDropShadowOffsetX",null),he([t],ge.prototype,"getDropShadowOffsetX",null),he([o],ge.prototype,"setDropShadowOffsetY",null),he([t],ge.prototype,"getDropShadowOffsetY",null),he([o],ge.prototype,"setDropShadowBlurRadiusX",null),he([t],ge.prototype,"getDropShadowBlurRadiusX",null),he([o],ge.prototype,"setDropShadowBlurRadiusY",null),he([t],ge.prototype,"getDropShadowBlurRadiusY",null),he([o],ge.prototype,"setDropShadowClip",null),he([t],ge.prototype,"getDropShadowClip",null),he([o],ge.prototype,"createCutoutFromBlocks",null),he([o],ge.prototype,"createCutoutFromPath",null),he([o],ge.prototype,"createCutoutFromOperation",null),he([o],ge.prototype,"replaceText",null),he([o],ge.prototype,"removeText",null),he([o],ge.prototype,"setTextColor",null),he([t],ge.prototype,"getTextColors",null),he([t],ge.prototype,"getTextFontWeights",null),he([t],ge.prototype,"getTextFontStyles",null),he([t],ge.prototype,"getTextCases",null),he([o],ge.prototype,"setTextCase",null),he([t],ge.prototype,"getTextCursorRange",null),he([t],ge.prototype,"hasFill",null),he([t],ge.prototype,"isFillEnabled",null),he([o],ge.prototype,"setFillEnabled",null),he([t],ge.prototype,"getFill",null),he([o],ge.prototype,"setFill",null),he([o],ge.prototype,"setFillSolidColor",null),he([t],ge.prototype,"getFillSolidColor",null),he([o],ge.prototype,"setPlaceholderEnabled",null),he([t],ge.prototype,"isPlaceholderEnabled",null),he([t],ge.prototype,"hasPlaceholderBehavior",null),he([o],ge.prototype,"setPlaceholderBehaviorEnabled",null),he([t],ge.prototype,"isPlaceholderBehaviorEnabled",null),he([t],ge.prototype,"hasPlaceholderControls",null),he([o],ge.prototype,"setPlaceholderControlsOverlayEnabled",null),he([t],ge.prototype,"isPlaceholderControlsOverlayEnabled",null),he([o],ge.prototype,"setPlaceholderControlsButtonEnabled",null),he([t],ge.prototype,"isPlaceholderControlsButtonEnabled",null),he([o],ge.prototype,"setMetadata",null),he([t],ge.prototype,"getMetadata",null),he([t],ge.prototype,"hasMetadata",null),he([t],ge.prototype,"findAllMetadata",null),he([o],ge.prototype,"removeMetadata",null),he([o],ge.prototype,"setScopeEnabled",null),he([t],ge.prototype,"isScopeEnabled",null),he([t],ge.prototype,"isAllowedByScope",null),he([t],ge.prototype,"hasDuration",null),he([o],ge.prototype,"setDuration",null),he([t],ge.prototype,"getDuration",null),he([t],ge.prototype,"hasTimeOffset",null),he([o],ge.prototype,"setTimeOffset",null),he([t],ge.prototype,"getTimeOffset",null),he([t],ge.prototype,"hasTrim",null),he([o],ge.prototype,"setTrimOffset",null),he([t],ge.prototype,"getTrimOffset",null),he([o],ge.prototype,"setTrimLength",null),he([t],ge.prototype,"getTrimLength",null),he([t],ge.prototype,"getTotalSceneDuration",null),he([o],ge.prototype,"setPlaying",null),he([t],ge.prototype,"isPlaying",null),he([t],ge.prototype,"hasPlaybackTime",null),he([o],ge.prototype,"setPlaybackTime",null),he([t],ge.prototype,"getPlaybackTime",null),he([o],ge.prototype,"setSoloPlaybackEnabled",null),he([t],ge.prototype,"isSoloPlaybackEnabled",null),he([t],ge.prototype,"hasPlaybackControl",null),he([o],ge.prototype,"setLooping",null),he([t],ge.prototype,"isLooping",null),he([o],ge.prototype,"setMuted",null),he([t],ge.prototype,"isMuted",null),he([o],ge.prototype,"setVolume",null),he([t],ge.prototype,"getVolume",null),he([o],ge.prototype,"forceLoadAVResource",null),he([t],ge.prototype,"getAVResourceTotalDuration",null),he([t],ge.prototype,"getVideoWidth",null),he([t],ge.prototype,"getVideoHeight",null),he([t],ge.prototype,"getVideoFillThumbnail",null),he([t],ge.prototype,"getVideoFillThumbnailAtlas",null),he([t],ge.prototype,"getPageThumbnailAtlas",null);var ye,ve=function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},be=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class we{constructor(e){ye.set(this,void 0),Object.defineProperty(this,"onStateChanged",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=be(this,ye,"f").subscribeToEditorState(e);return()=>{be(this,ye,"f").isDeleted()||w(be(this,ye,"f").unsubscribe(t))}}}),Object.defineProperty(this,"onHistoryUpdated",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=be(this,ye,"f").subscribeToHistory(e);return()=>{be(this,ye,"f").isDeleted()||be(this,ye,"f").unsubscribe(t)}}}),Object.defineProperty(this,"onSettingsChanged",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=be(this,ye,"f").subscribeToSettings(e);return()=>{be(this,ye,"f").isDeleted()||w(be(this,ye,"f").unsubscribe(t))}}}),function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?o.call(e,r):o?o.value=r:t.set(e,r)}(this,ye,e,"f")}setEditMode(e){ne("keypath",e,Z()),be(this,ye,"f").setEditMode(e)}getEditMode(){return be(this,ye,"f").getEditMode()}getCursorType(){return be(this,ye,"f").getCursorType()}getCursorRotation(){return be(this,ye,"f").getCursorRotation()}getTextCursorPositionInScreenSpaceX(){return be(this,ye,"f").getTextCursorPositionInScreenSpaceX()}getTextCursorPositionInScreenSpaceY(){return be(this,ye,"f").getTextCursorPositionInScreenSpaceY()}createHistory(){return be(this,ye,"f").createHistory()}destroyHistory(e){w(be(this,ye,"f").destroyHistory(e))}setActiveHistory(e){w(be(this,ye,"f").setActiveHistory(e))}getActiveHistory(){return be(this,ye,"f").getActiveHistory()}addUndoStep(){w(be(this,ye,"f").addUndoStep())}undo(){w(be(this,ye,"f").undo())}redo(){w(be(this,ye,"f").redo())}canUndo(){return w(be(this,ye,"f").canUndo())}canRedo(){return w(be(this,ye,"f").canRedo())}setSettingBool(e,t){return ne("keypath",e,Z()),ne("value",t,Y()),w(be(this,ye,"f").setSettingBool(e,t))}getSettingBool(e){return ne("keypath",e,Z()),w(be(this,ye,"f").getSettingBool(e))}setSettingInt(e,t){return ne("keypath",e,Z()),ne("value",t,X()),w(be(this,ye,"f").setSettingInt(e,t))}getSettingInt(e){return ne("keypath",e,Z()),w(be(this,ye,"f").getSettingInt(e))}setSettingFloat(e,t){return ne("keypath",e,Z()),ne("value",t,K()),w(be(this,ye,"f").setSettingFloat(e,t))}getSettingFloat(e){return ne("keypath",e,Z()),w(be(this,ye,"f").getSettingFloat(e))}setSettingString(e,t){return ne("keypath",e,Z()),ne("value",t,Z()),w(be(this,ye,"f").setSettingString(e,t))}getSettingString(e){return ne("keypath",e,Z()),w(be(this,ye,"f").getSettingString(e))}setSettingColor(e,t){return ne("keypath",e,Z()),w(be(this,ye,"f").setSettingColor(e,i.fromColor(t)))}getSettingColor(e){return ne("keypath",e,Z()),i.toColor(w(be(this,ye,"f").getSettingColor(e)))}setSettingColorRGBA(e,t,r,n,o=1){return ne("keypath",e,Z()),ne("r",t,K()),ne("g",r,K()),ne("b",n,K()),ne("a",o,K()),w(be(this,ye,"f").setSettingColorRGBA(e,t,r,n,o))}getSettingColorRGBA(e){return ne("keypath",e,Z()),w(be(this,ye,"f").getSettingColorRGBA(e))}setSettingEnum(e,t){return ne("keypath",e,Z()),ne("value",t,Z()),w(be(this,ye,"f").setSettingEnum(e,t))}getSettingEnum(e){return ne("keypath",e,Z()),w(be(this,ye,"f").getSettingEnum(e))}getSettingEnumOptions(e){return ne("keypath",e,Z()),_(w(be(this,ye,"f").getSettingEnumOptions(e)))}findAllSettings(){return _(be(this,ye,"f").findAllSettings())}getSettingType(e){return ne("keypath",e,Z()),w(be(this,ye,"f").getSettingType(e))}getAvailableMemory(){return w(be(this,ye,"f").getAvailableMemory())}getUsedMemory(){return w(be(this,ye,"f").getUsedMemory())}setURIResolver(e){return w(be(this,ye,"f").setURIResolver(e))}defaultURIResolver(e){return be(this,ye,"f").defaultURIResolver(e)}getAbsoluteURI(e){return w(be(this,ye,"f").getAbsoluteURI(e))}setGlobalScope(e,t){ne("key",e,Z()),ne("value",t,Z()),w(be(this,ye,"f").setGlobalScope(e,t))}getGlobalScope(e){return ne("key",e,Z()),w(be(this,ye,"f").getGlobalScope(e))}findAllSpotColors(){return _(be(this,ye,"f").findAllSpotColors())}getSpotColorRGBA(e){return ne("name",e,Z()),be(this,ye,"f").getSpotColorRGB(e)}getSpotColorCMYK(e){return ne("name",e,Z()),be(this,ye,"f").getSpotColorCMYK(e)}setSpotColorRGB(e,t,r,n){return ne("name",e,Z()),ne("r",t,K()),ne("g",r,K()),ne("b",n,K()),be(this,ye,"f").setSpotColorRGB(e,t,r,n)}setSpotColorCMYK(e,t,r,n,o){return ne("name",e,Z()),ne("c",t,K()),ne("m",r,K()),ne("y",n,K()),ne("k",o,K()),be(this,ye,"f").setSpotColorCMYK(e,t,r,n,o)}removeSpotColor(e){return ne("name",e,Z()),w(be(this,ye,"f").removeSpotColor(e))}setSpotColorForCutoutType(e,t){return ne("type",e,Z()),ne("color",t,Z()),w(be(this,ye,"f").setSpotColorForCutoutType(e,t))}getSpotColorForCutoutType(e){return ne("type",e,Z()),w(be(this,ye,"f").getSpotColorForCutoutType(e))}convertColorToColorSpace(e,t){return ne("colorSpace",t,Z()),i.toColor(w(be(this,ye,"f").convertColorToColorSpace(i.fromColor(e),t)))}}ye=new WeakMap,ve([o],we.prototype,"setEditMode",null),ve([t],we.prototype,"getEditMode",null),ve([t],we.prototype,"getCursorType",null),ve([t],we.prototype,"getCursorRotation",null),ve([t],we.prototype,"getTextCursorPositionInScreenSpaceX",null),ve([t],we.prototype,"getTextCursorPositionInScreenSpaceY",null),ve([o],we.prototype,"createHistory",null),ve([o],we.prototype,"destroyHistory",null),ve([o],we.prototype,"setActiveHistory",null),ve([t],we.prototype,"getActiveHistory",null),ve([o],we.prototype,"addUndoStep",null),ve([o],we.prototype,"undo",null),ve([o],we.prototype,"redo",null),ve([t],we.prototype,"canUndo",null),ve([t],we.prototype,"canRedo",null),ve([o],we.prototype,"setSettingBool",null),ve([t],we.prototype,"getSettingBool",null),ve([o],we.prototype,"setSettingInt",null),ve([t],we.prototype,"getSettingInt",null),ve([o],we.prototype,"setSettingFloat",null),ve([t],we.prototype,"getSettingFloat",null),ve([o],we.prototype,"setSettingString",null),ve([t],we.prototype,"getSettingString",null),ve([o],we.prototype,"setSettingColor",null),ve([t],we.prototype,"getSettingColor",null),ve([o],we.prototype,"setSettingColorRGBA",null),ve([t],we.prototype,"getSettingColorRGBA",null),ve([o],we.prototype,"setSettingEnum",null),ve([t],we.prototype,"getSettingEnum",null),ve([t],we.prototype,"getAvailableMemory",null),ve([t],we.prototype,"getUsedMemory",null),ve([o],we.prototype,"setURIResolver",null),ve([t],we.prototype,"defaultURIResolver",null),ve([t],we.prototype,"getAbsoluteURI",null),ve([o],we.prototype,"setGlobalScope",null),ve([t],we.prototype,"getGlobalScope",null),ve([t],we.prototype,"findAllSpotColors",null),ve([t],we.prototype,"getSpotColorRGBA",null),ve([t],we.prototype,"getSpotColorCMYK",null),ve([o],we.prototype,"setSpotColorRGB",null),ve([o],we.prototype,"setSpotColorCMYK",null),ve([o],we.prototype,"removeSpotColor",null),ve([o],we.prototype,"setSpotColorForCutoutType",null),ve([o],we.prototype,"getSpotColorForCutoutType",null);var Ee,_e=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class Ce{constructor(e){Ee.set(this,void 0),Object.defineProperty(this,"subscribe",{enumerable:!0,configurable:!0,writable:!0,value:(e,t)=>{ne("blocks",e,z());const r=_e(this,Ee,"f").subscribe(e,(e=>{try{t(_(e,!0))}catch(e){console.error(e)}}));return()=>{_e(this,Ee,"f").isDeleted()||w(_e(this,Ee,"f").unsubscribe(r))}}}),function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?o.call(e,r):o?o.value=r:t.set(e,r)}(this,Ee,e,"f")}}Ee=new WeakMap;var Se,ke=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class xe{constructor(e){Se.set(this,void 0),function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?o.call(e,r):o?o.value=r:t.set(e,r)}(this,Se,e,"f")}findAll(){return _(ke(this,Se,"f").findAllVariables())}setString(e,t){return ne("key",e,Z()),ne("value",t,Z()),w(ke(this,Se,"f").setVariableString(e,t))}getString(e){return ne("key",e,Z()),w(ke(this,Se,"f").getVariableString(e))}remove(e){return ne("key",e,Z()),w(ke(this,Se,"f").removeVariable(e))}}Se=new WeakMap;const Pe=require("fs/promises");var Te=r.n(Pe),Fe=r(310);const Ae=function(){if("undefined"!=typeof fetch)return fetch;if("undefined"!=typeof window)throw new Error("Could not find `fetch` API");try{return r(809)}catch(e){throw new Error("Could not find a `fetch` implementation. Please make sure you're using Node.JS >= 18, or install the node-fetch@cjs package, or provide another polyfill.")}}();async function De(e){if(!e.match(/^file:/))return Ae(e);try{const t=await Te().readFile((0,Fe.fileURLToPath)(e),{encoding:"utf8"}),r=JSON.parse(t);return{ok:!0,json:async()=>r}}catch(e){return{ok:!1,statusText:e.message}}}const Be=Ae;var Le=r(502),Re=r.n(Le);const Me=r.p+"assets/core/cesdk-v1.18.0-rc.0-d92fadafda0b5129818d.data",Oe=r.p+"assets/core/cesdk-v1.18.0-rc.0-052becb2ba36be17d8b2.wasm",Ie=Re();function Ue(e,t){const r=t.split("/").pop(),n=new URL(r,e.core.baseURL);return"file:"===n.protocol?(0,Fe.fileURLToPath)(n):new URL(r,e.core.baseURL).toString()}var $e,je,qe,Ne,He,Ve,We,Ge,ze=function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},Ye=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class Xe{constructor(e,t){$e.add(this),Object.defineProperty(this,"asset",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"block",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"editor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"event",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"scene",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"variable",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),je.set(this,void 0),qe.set(this,void 0),Ne.set(this,void 0),ze(this,qe,e,"f"),ze(this,je,new b(e),"f"),this.asset=new D(e),this.block=new ge(e),this.editor=new we(e),this.event=new Ce(e),this.scene=new fe(e),this.variable=new xe(e),this.block.exportVideo=()=>{throw new Error("Exporting video is currently not supported on Node.JS")},Ye(this,$e,"m",He).call(this),"undefined"!=typeof window&&window.Cypress&&(this.config=t,this.helper=Ye(this,je,"f"))}update(){Ye(this,qe,"f").update()}dispose(){Ye(this,$e,"m",We).call(this),ze(this,je,null,"f"),this.block=null,this.scene=null,this.variable=null,Ye(this,qe,"f").delete(),ze(this,qe,null,"f")}static async init(e){console.log("[CreativeEngine] Revision 16eba11e05976b738ed24231fdb57ca8d76f19a5");const t=function(e){var t;return e&&"callbacks"in e&&(null===(t=e.callbacks)||void 0===t?void 0:t.log)&&!e.logger?Object.assign(Object.assign({},e),{logger:e.callbacks.log}):e}(e),r=function(e={},t="https://cdn.img.ly/packages/imgly/cesdk-engine/1.18.0-rc.0/assets"){var r,n,o,i,a,s,u,l,c,d;const f=Object.assign(Object.assign({},e),{license:e.license,featureFlags:null!==(r=e.featureFlags)&&void 0!==r?r:{},baseURL:null!==(n=e.baseURL)&&void 0!==n?n:t,core:null!==(o=e.core)&&void 0!==o?o:{baseURL:"core/"},extensions:null!==(i=e.extensions)&&void 0!==i?i:Object.assign({},R),logger:null!==(a=e.logger)&&void 0!==a?a:L,presets:null!==(s=e.presets)&&void 0!==s?s:{}});return null!==(u=(c=f.extensions).baseURL)&&void 0!==u||(c.baseURL=R.baseURL),null!==(l=(d=f.extensions).entries)&&void 0!==l||(d.entries=Object.assign({},R.entries)),f.baseURL=M(f.baseURL),f.baseURL=O(f.baseURL),f.core.baseURL=M(f.core.baseURL,f.baseURL),f.core.baseURL=O(f.core.baseURL),f.extensions.baseURL=O(f.extensions.baseURL),f.extensions.entries=f.extensions.entries.map((e=>O(e))),f}(t,`file://${__dirname}/assets/`);for(const t of function(e){var t;const r=[];return e?("callbacks"in e&&(null===(t=e.callbacks)||void 0===t?void 0:t.log)&&r.push("config.callbacks.log has been moved to config.logger"),e.scene&&r.push("config.scene options have been removed. You can set a scene's dpi and pixelScaleFactor via the BlockApi's setInt(sceneId, 'scene/dpi', dpi) and setInt(sceneId, 'scene/pixelScaleFactor', factor)."),e.page&&r.push("config.page options have been moved to the EditorAPI"),e.variables&&r.push("config.variables has been removed. Please use the VariableAPI instead"),r):r}(e))r.logger(t,"Warning");const n=new this(await async function(e){const t=e.logger,{getPreloadedPackage:r,instantiateWasm:n}=await async function(e){if(!e.core.baseURL.startsWith("http"))return{};const t=Ue(e,Me),r=Ue(e,Oe),n=Be(t).then((e=>{if(e.status>=400)throw new Error(`Failed to fetch DATA package: ${e.status} ${e.statusText}`);return e.arrayBuffer()})),o=await n;return{getPreloadedPackage:function(e,r){if(e===t){if(r!==o.byteLength)throw new Error(`Attempt to get preloaded data package of incorrect size. Expected: ${r} Actual: ${o.byteLength}`);return o}return null},instantiateWasm:function(e,t){const n=e,o=Be(r).then((e=>{if(e.status>=400)throw new Error(`Failed to fetch WASM package: ${e.status} ${e.statusText}`);return e}));return void 0!==WebAssembly.instantiateStreaming?o.then((e=>WebAssembly.instantiateStreaming(e,n))).then((({instance:e})=>t(e))):o.then((e=>e.arrayBuffer())).then((e=>WebAssembly.compile(e))).then((e=>WebAssembly.instantiate(e,n))).then(t),{}}}}(e),o={locateFile:t=>t.endsWith(".wasm")?Ue(e,Oe):t.endsWith(".data")?Ue(e,Me):Ue(e,t),instantiateWasm:n,getPreloadedPackage:r,print:e=>{e&&t(e,"Info")},printErr:e=>{e&&t(e,"Error")},onRuntimeInitialized:()=>{t("Engine has been initialized.","Info")},logReadFiles:!1,printWithColors:!0},i=await Ie(o);i.emscripten_ubq_asyncFetchManager.setFetch(Be);const a=w(i.createEngine("","auto"));return function(e,t){var r,n;const o=new b(e),i=new we(e),a=new D(e);i.setSettingString("license",t.license||""),i.setSettingEnum("role",null!==(r=t.role)&&void 0!==r?r:"Creator"),"Adopter"===t.role&&i.setSettingEnum("doubleClickSelectionMode","Direct"),i.setSettingString("basePath",t.baseURL),i.setSettingBool("showBuildVersion",!1),(null===(n=t.featureFlags)||void 0===n?void 0:n.preventScrolling)&&(i.setSettingBool("touch/singlePointPanning",!1),i.setSettingBool("touch/dragStartCanSelect",!1)),a.addLocalSource("ly.img.text"),Object.entries(t.presets.typefaces||{}).forEach((([e,t])=>{(t.fonts||[]).forEach((r=>{const n=`${e}_${r.weight}_${r.style}`;o.execute("ubq/assets/registerFont",[n,r.fontURL,t.family,r.weight,r.style])}))})),function(){var e;const r=!!(null===(e=t.featureFlags)||void 0===e?void 0:e.singlePageMode);i.setSettingBool("features/singlePageModeEnabled",r),i.setSettingBool("features/effectsEnabled",!0)}(),function(){var e;const r=null!==(e=t.extensions)&&void 0!==e?e:[];r.entries.forEach((e=>{o.execute("ubq/extension/register",`${r.baseURL+e}`)}))}(),function(){const t=new xe(e);"undefined"!=typeof window&&window.Cypress&&(t.setString("company_name","img.ly"),t.setString("first_name","Charly"),t.setString("last_name","Williams"),t.setString("address","742 Evergreen Terrace"),t.setString("city","Springfield"))}()}(a,e),a}(r),r);return function(e,t){var r,n,o,i,a,s,u,l;if(e)try{const c=t.editor;if(null!=(null===(n=null===(r=e.page)||void 0===r?void 0:r.title)||void 0===n?void 0:n.show)&&c.setSettingBool("page/title/show",e.page.title.show),null!=(null===(i=null===(o=e.page)||void 0===o?void 0:o.title)||void 0===i?void 0:i.fontFileUri)&&c.setSettingString("page/title/fontFileUri",null===(s=null===(a=e.page)||void 0===a?void 0:a.title)||void 0===s?void 0:s.fontFileUri),null!=(null===(u=e.page)||void 0===u?void 0:u.dimOutOfPageAreas)&&c.setSettingBool("page/dimOutOfPageAreas",null===(l=e.page)||void 0===l?void 0:l.dimOutOfPageAreas),e.variables)for(const r in e.variables)if(Object.prototype.hasOwnProperty.call(e.variables,r)){const n=e.variables[r];t.variable.setString(r,String(n.value))}}catch(e){console.error(e)}}(e,n),n}async addDefaultAssetSources({baseURL:e="https://cdn.img.ly/assets/v1",excludeAssetSourceIds:t=[]}={}){return async function(e,t,r,n){const o=["ly.img.sticker","ly.img.vectorpath","ly.img.filter.lut","ly.img.filter.duotone","ly.img.colors.defaultPalette"].filter((e=>!r.includes(e)));await I(o,t,n,e)}(this.asset,e,t,De)}async addDemoAssetSources({excludeAssetSourceIds:e=[],sceneMode:t="Design",withUploadAssetSources:r=!1}={}){return async function(e,t,r,n,o,i,a="https://cdn.img.ly/assets/demo/v1"){const s=new Set(e.findAllSources()),u="ly.img.image.upload";!o||r.includes(u)||s.has(u)||e.addLocalSource(u,["image/jpeg","image/png","image/webp","image/svg+xml","image/gif","image/bmp"]);const l="ly.img.video.upload";"Video"!==n||!o||r.includes(l)||s.has(l)||e.addLocalSource(l,["video/mp4","video/quicktime"]);const c="ly.img.audio.upload";"Video"!==n||!o||r.includes(c)||s.has(c)||e.addLocalSource(c,["audio/mpeg","audio/x-m4a","audio/m4a","audio/mp3"]);const d=["ly.img.image","ly.img.video","ly.img.audio"].filter((e=>!r.includes(e)));s.has("ly.img.template")||r.includes("ly.img.template")||(e.addLocalSource("ly.img.template",void 0,(async e=>{var r;const n=null===(r=e.meta)||void 0===r?void 0:r.uri;if(n)if(n.startsWith("UBQ1"))t.applyTemplateFromString(n);else{const e=new URL(n,window.location.href);t.applyTemplateFromURL(e.href)}})),d.push("ly.img.template")),await I(d,a,i,e)}(this.asset,this.scene,e,t,r,De)}}je=new WeakMap,qe=new WeakMap,Ne=new WeakMap,$e=new WeakSet,He=function(){Ye(this,$e,"m",Ve).call(this)},Ve=function(){if(Ye(this,Ne,"f"))return;const e=()=>{this.update(),ze(this,Ne,setTimeout(e,16),"f")};ze(this,Ne,setTimeout(e,16),"f")},We=function(){Ye(this,Ne,"f")&&(clearTimeout(Ye(this,Ne,"f")),ze(this,Ne,null,"f"))},function(e){e.Scene="//ly.img.ubq/scene",e.Stack="//ly.img.ubq/stack",e.Camera="//ly.img.ubq/camera",e.Page="//ly.img.ubq/page",e.Image="//ly.img.ubq/image",e.Graphic="//ly.img.ubq/graphic",e.Video="//ly.img.ubq/video",e.VideoFill="//ly.img.ubq/fill/video",e.ImageFill="//ly.img.ubq/fill/image",e.Audio="//ly.img.ubq/audio",e.Text="//ly.img.ubq/text",e.Sticker="//ly.img.ubq/sticker",e.VectorPath="//ly.img.ubq/vector_path",e.RectShape="//ly.img.ubq/shapes/rect",e.LineShape="//ly.img.ubq/shapes/line",e.StarShape="//ly.img.ubq/shapes/star",e.PolygonShape="//ly.img.ubq/shapes/polygon",e.EllipseShape="//ly.img.ubq/shapes/ellipse",e.Group="//ly.img.ubq/group",e.Cutout="//ly.img.ubq/cutout",e.ColorFill="//ly.img.ubq/fill/color",e.LinearGradientFill="//ly.img.ubq/fill/gradient/linear",e.RadialGradientFill="//ly.img.ubq/fill/gradient/radial",e.ConicalGradientFill="//ly.img.ubq/fill/gradient/conical"}(Ge||(Ge={}));const Ke=Ge,Qe=Xe,Ze=Xe;Object.defineProperty(Ze,"__esModule",{value:!0}),Object.defineProperty(Ze,"default",{value:Xe}),Object.defineProperty(Ze,"LogLevel",{value:{Info:"Info",Warning:"Warning",Error:"Error"}}),Object.defineProperty(Ze,"DesignBlockType",{value:Ke}),Object.defineProperty(Ze,"MimeType",{value:se})})(),n.default})()));
|
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(global,(()=>(()=>{var e={502:(e,t,r)=>{var n,o=(n=(n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||__filename,function(e={}){var t,o,i,a,s=e;if(void 0===globalThis.BigInt64Array){function u(e){return[0|Number(BigInt(e)&BigInt(4294967295)),0|Number(BigInt(e)>>32n)]}function l(e){return function t(r){var n;"number"==typeof r&&(r=new Uint32Array(2*r)),ArrayBuffer.isView(r)||(r.constructor&&"ArrayBuffer"===r.constructor.name?r=new Uint32Array(r):(n=r,r=new Uint32Array(2*r.length)));var o=new Proxy({slice:(e,n)=>(void 0===n&&(n=r.length),t(r.slice(2*e,2*n))),subarray:(e,n)=>t(r.subarray(2*e,2*n)),[Symbol.iterator]:function*(){for(var t=0;t<r.length/2;t++)yield e(r[2*t],r[2*t+1])},BYTES_PER_ELEMENT:2*r.BYTES_PER_ELEMENT,buffer:r.buffer,byteLength:r.byteLength,byteOffset:r.byteOffset,length:r.length/2,copyWithin:function(e,t,n){return r.copyWithin(2*e,2*t,2*n),o},set(e,t){if(void 0===t&&(t=0),2*(e.length+t)>r.length)throw new RangeError("offset is out of bounds");for(var n=0;n<e.length;n++){var o=u(e[n]);r.set(o,2*(t+n))}}},{get(t,n,o){if("string"!=typeof n||!/^\d+$/.test(n))return Reflect.get(t,n,o);var i=r[2*n],a=r[2*n+1];return e(i,a)},set(e,t,n,o){if("string"!=typeof t||!/^\d+$/.test(t))return Reflect.set(e,t,n,o);if("bigint"!=typeof n)throw new TypeError(`Cannot convert ${n} to a BigInt`);var i=u(n);return r.set(i,2*t),!0}});return n&&o.set(n),o}}globalThis.BigUint64Array=l((function(e,t){return BigInt(e)|BigInt(t)<<32n})),globalThis.BigInt64Array=l((function(e,t){return BigInt(e)|BigInt(t+2*(2147483648&t))<<32n}))}s.ready=new Promise(((e,r)=>{t=e,o=r})),s.expectedDataFileDownloads||(s.expectedDataFileDownloads=0),s.expectedDataFileDownloads++,s.ENVIRONMENT_IS_PTHREAD||s.$ww||function(e){"object"==typeof window?window.encodeURIComponent(window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/"):"undefined"==typeof process&&"undefined"!=typeof location&&encodeURIComponent(location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/");var t="cesdk.data";"function"!=typeof s.locateFilePackage||s.locateFile||(s.locateFile=s.locateFilePackage,k("warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)"));var n=s.locateFile?s.locateFile(t,""):t,o=e.remote_package_size,i=null,a=s.getPreloadedPackage?s.getPreloadedPackage(n,o):null;function u(){function t(e,t){if(!e)throw t+(new Error).stack}function r(e,t,r){this.start=e,this.end=t,this.audio=r}s.FS_createPath("/","ly.img.cesdk",!0,!0),s.FS_createPath("/ly.img.cesdk","fonts",!0,!0),s.FS_createPath("/ly.img.cesdk","icons",!0,!0),s.FS_createPath("/ly.img.cesdk","icu",!0,!0),s.FS_createPath("/ly.img.cesdk","presets",!0,!0),s.FS_createPath("/ly.img.cesdk","shaders",!0,!0),s.FS_createPath("/ly.img.cesdk/shaders","common",!0,!0),r.prototype={requests:{},open:function(e,t){this.name=t,this.requests[t]=this,s.addRunDependency(`fp ${this.name}`)},send:function(){},onload:function(){var e=this.byteArray.subarray(this.start,this.end);this.finish(e)},finish:function(e){s.FS_createDataFile(this.name,null,e,!0,!0,!0),s.removeRunDependency(`fp ${this.name}`),this.requests[this.name]=null}};for(var n=e.files,o=0;o<n.length;++o)new r(n[o].start,n[o].end,n[o].audio||0).open("GET",n[o].filename);function u(n){t(n,"Loading data file failed."),t(n.constructor.name===ArrayBuffer.name,"bad input to processPackageData");var o=new Uint8Array(n);r.prototype.byteArray=o;for(var i=e.files,a=0;a<i.length;++a)r.prototype.requests[i[a].filename].onload();s.removeRunDependency("datafile_cesdk.data")}s.addRunDependency("datafile_cesdk.data"),s.preloadResults||(s.preloadResults={}),s.preloadResults["cesdk.data"]={fromCache:!1},a?(u(a),a=null):i=u}a||function(e,t,n,o){if("object"!=typeof process||"object"!=typeof process.versions||"string"!=typeof process.versions.node){var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onprogress=function(r){var n=e,o=t;if(r.total&&(o=r.total),r.loaded){i.addedTotal?s.dataFileDownloads[n].loaded=r.loaded:(i.addedTotal=!0,s.dataFileDownloads||(s.dataFileDownloads={}),s.dataFileDownloads[n]={loaded:r.loaded,total:o});var a=0,u=0,l=0;for(var c in s.dataFileDownloads){var d=s.dataFileDownloads[c];a+=d.total,u+=d.loaded,l++}a=Math.ceil(a*s.expectedDataFileDownloads/l),s.setStatus&&s.setStatus(`Downloading data... (${u}/${a})`)}else s.dataFileDownloads||s.setStatus&&s.setStatus("Downloading data...")},i.onerror=function(t){throw new Error("NetworkError for: "+e)},i.onload=function(e){if(!(200==i.status||304==i.status||206==i.status||0==i.status&&i.response))throw new Error(i.statusText+" : "+i.responseURL);var t=i.response;n(t)},i.send(null)}else r(147).readFile(e,(function(e,t){var r;e?(r=e,console.error("package error:",r)):n(t.buffer)}))}(n,o,(function(e){i?(i(e),i=null):a=e})),s.calledRun?u():(s.preRun||(s.preRun=[]),s.preRun.push(u))}({files:[{filename:"/ly.img.cesdk/fonts/imgly_font_inter_semibold.otf",start:0,end:270760},{filename:"/ly.img.cesdk/icons/ErrorAudio.svg",start:270760,end:271672},{filename:"/ly.img.cesdk/icons/ErrorConnection.svg",start:271672,end:272620},{filename:"/ly.img.cesdk/icons/ErrorVideo.svg",start:272620,end:273473},{filename:"/ly.img.cesdk/icons/Move.svg",start:273473,end:274748},{filename:"/ly.img.cesdk/icons/RotateIndicator.svg",start:274748,end:275745},{filename:"/ly.img.cesdk/icu/icudt71l.dat",start:275745,end:710017},{filename:"/ly.img.cesdk/presets/.keep",start:710017,end:710017},{filename:"/ly.img.cesdk/shaders/adjustments.sksl",start:710017,end:713906},{filename:"/ly.img.cesdk/shaders/black_and_white_color_mixer.sksl",start:713906,end:720223},{filename:"/ly.img.cesdk/shaders/common/ubq_adjustments.sksl",start:720223,end:724814},{filename:"/ly.img.cesdk/shaders/common/ubq_color_conversions.sksl",start:724814,end:734799},{filename:"/ly.img.cesdk/shaders/common/ubq_constants.sksl",start:734799,end:735289},{filename:"/ly.img.cesdk/shaders/common/ubq_hue_constants.sksl",start:735289,end:738456},{filename:"/ly.img.cesdk/shaders/common/ubq_noise.sksl",start:738456,end:741094},{filename:"/ly.img.cesdk/shaders/cross_cut.sksl",start:741094,end:742041},{filename:"/ly.img.cesdk/shaders/dot_pattern.sksl",start:742041,end:742556},{filename:"/ly.img.cesdk/shaders/duotone_filter.sksl",start:742556,end:743520},{filename:"/ly.img.cesdk/shaders/extrude_blur.sksl",start:743520,end:745637},{filename:"/ly.img.cesdk/shaders/glow.sksl",start:745637,end:746604},{filename:"/ly.img.cesdk/shaders/half_tone.sksl",start:746604,end:747098},{filename:"/ly.img.cesdk/shaders/hsp_selective_adjustments.sksl",start:747098,end:760698},{filename:"/ly.img.cesdk/shaders/linocut.sksl",start:760698,end:761483},{filename:"/ly.img.cesdk/shaders/liquid.sksl",start:761483,end:761965},{filename:"/ly.img.cesdk/shaders/lut_filter.sksl",start:761965,end:764828},{filename:"/ly.img.cesdk/shaders/mask_color.sksl",start:764828,end:765333},{filename:"/ly.img.cesdk/shaders/mirror.sksl",start:765333,end:765787},{filename:"/ly.img.cesdk/shaders/outliner.sksl",start:765787,end:767424},{filename:"/ly.img.cesdk/shaders/pixelize.sksl",start:767424,end:767724},{filename:"/ly.img.cesdk/shaders/placeholder_overlay_lines.sksl",start:767724,end:768412},{filename:"/ly.img.cesdk/shaders/posterize.sksl",start:768412,end:768624},{filename:"/ly.img.cesdk/shaders/radial_pixel.sksl",start:768624,end:769187},{filename:"/ly.img.cesdk/shaders/sharpie.sksl",start:769187,end:771492},{filename:"/ly.img.cesdk/shaders/shifter.sksl",start:771492,end:772176},{filename:"/ly.img.cesdk/shaders/tiltshift.sksl",start:772176,end:772758},{filename:"/ly.img.cesdk/shaders/tv_glitch.sksl",start:772758,end:773476},{filename:"/ly.img.cesdk/shaders/vignette.sksl",start:773476,end:773848}],remote_package_size:773848}),"object"==typeof window&&"object"==typeof window.performance?s.performance=performance:"object"==typeof global&&"object"==typeof global.perf_hooks&&"object"==typeof global.perf_hooks.performance?s.performance=global.perf_hooks.performance:s.performance={mark:function(){},measure:function(){}},function(e){e[e.PENDING=0]="PENDING",e[e.FINISHED=1]="FINISHED",e[e.ALLOCATED=2]="ALLOCATED",e[e.ERROR=3]="ERROR"}(i||(i={})),function(e){e[e.GET=0]="GET",e[e.POST=1]="POST"}(a||(a={}));class c{constructor(e,t){this.state=i.PENDING,this.totalBytes=0,this.receivedLength=0,this.handle=e,this.uri=t}async readChunks(e){let t=0;const r=[],n=e=>{r.push(e),t+=e.length,this.receivedLength=t};if(null==e);else if("getReader"in e){const t=e.getReader();for(;;){const{done:e,value:r}=await t.read();if(e)break;n(r)}}else await new Promise(((t,r)=>{e.on("data",n),e.on("end",(()=>t())),e.on("error",(e=>r(e)))}));const o=new Uint8Array(t);let i=0;for(const e of r)o.set(e,i),i+=e.length;return this.finish(o)}isPending(){return this.state===i.PENDING}isError(){return this.state===i.ERROR}isFinished(){return this.state===i.FINISHED}isAllocated(){return this.state===i.ALLOCATED}allocate(){if(this.isAllocated())return this;if(this.isFinished()){const e=this.result.length,t=s._malloc(e);s.HEAPU8.set(this.result,t);const r=Object.assign(Object.assign({},this),{state:i.ALLOCATED,resultAddress:t,resultLength:e});return Object.assign(this,r),r}return null}finish(e){const t=Object.assign(Object.assign({},this),{state:i.FINISHED,result:e,totalBytes:e.length});return Object.assign(this,t)}fail(e){const t=Object.assign(Object.assign({},this),{state:i.ERROR,error:e});return Object.assign(this,t)}}s.emscripten_ubq_asyncFetchManager=new class{constructor(){this._nextHandle=0,this._nextHeaderHandle=0,this._processes=new Map,this._headers=new Map,this._fetchImpl=null}_fetch(e,t){return this._fetchImpl?this._fetchImpl(e,t):fetch(e,t)}setFetch(e){this._fetchImpl=e}getProcess(e){return this._processes.get(e)}deleteProcess(e){return this._processes.delete(e)}fetch(e,t,r,n,o,i,a,u,l){const d=s.UTF8ToString(t,r),f=this._nextHandle++,p=new c(f,d);return this._processes.set(f,p),d.match(/^file:/)?this._fetchFile(p).catch((e=>(p.fail(e),Promise.reject(e)))):this._fetchRemote(p,e,n,o,i,a,u,l).catch((e=>(p.fail(e),Promise.reject(e)))),p}async _fetchFile(e){if("undefined"!=typeof window)throw new Error("File URLs supported only in Node.JS");const t=r(147),{fileURLToPath:n}=r(310),o=t.createReadStream(n(e.uri));return e.readChunks(o)}async _fetchRemote(e,t,r,n,o,i,u,l){const c=s.UTF8ToString(u,l),d=this.getHeaders(r,n),f=t===a.POST?new Uint8Array(s.HEAPU8.buffer,o,i):void 0,p=await this._fetch(e.uri,{method:a[t],headers:d,body:f,mode:"cors",credentials:c});if(p.status>=200&&p.status<=209){let t=0;return p.headers.has("Content-Length")&&(t=+p.headers.get("Content-Length")),e.totalBytes=t,e.readChunks(p.body)}return e.fail(p.statusText)}getHeaders(e,t){const r={};for(let n=0;n<t;n++){const t=s.getValue(e+4*n,"i32"),o=this._headers.get(t);r[o.key]=o.value}return r}createHeader(e,t,r,n){const o=s.UTF8ToString(e,t),i=s.UTF8ToString(r,n),a=this._nextHeaderHandle++;return this._headers.set(a,{key:o,value:i}),a}deleteHeader(e){return this._headers.delete(e)}},s.emscripten_ubq_codec_videoDecoders=new Map,s.emscripten_ubq_codec_audioDecoders=new Map,s.emscripten_ubq_codec_videoEncoders=new Map,s.emscripten_ubq_codec_audioEncoders=new Map,s.emscripten_ubq_codec_videoDecoderNextHandle=1,s.emscripten_ubq_codec_audioDecoderNextHandle=1,s.emscripten_ubq_codec_videoEncoderNextHandle=1,s.emscripten_ubq_codec_audioEncoderNextHandle=1,s.emscripten_ubq_codec_createNativeResult=function(e){const t=s._malloc(8),r=s.HEAPU32.subarray(t/4,t/4+2);if(r[0]=e.handle?e.handle:e.code?e.code:0,e.error){const t=(new TextEncoder).encode(e.error),n=s._malloc(t.length+1),o=s.HEAPU8.subarray(n,n+t.length+1);for(let e=0;e<t.length;e++)o[e]=t[e];o[t.length]=0,r[1]=n}else r[1]=0;return t},s.emscripten_ubq_codec_createVideoDecoder=function(e,t){const r=new VideoDecoder({output:n=>{const o=r.textures;let i=!1;if((r.shouldDropFrames||r.decodedFrames<r.requestedFrame||r.decodeQueueSize>=o.length)&&(i=!0),!i){var a=s.ctx;const e=r.decodedFrames%o.length;a.bindTexture(a.TEXTURE_2D,o[e]),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,a.RGBA,a.UNSIGNED_BYTE,n)}n.close(),r.decodedFrames++,s.emscripten_ubq_codec_onOutputDecodedVideoFrame(e,r.decodedFrames,i,t)},error:e=>{r.unexpectedError=e,console.error(e)}});return r.decodedFrames=0,r.requestedFrame=0,r.shouldDropFrames=!1,r},s.emscripten_ubq_codec_createAudioDecoder=function(e,t,r){const n=new AudioDecoder({output:o=>{if(n.flushing)return void o.close();const i=s.HEAPF32.subarray(e/4,e/4+r),a=s.HEAPF32.subarray(t/4,t/4+r),u=1===o.numberOfChannels?0:1;if("f32-planar"===o.format){let e=n.writtenFrames%r;if(e+o.numberOfFrames<=r)o.copyTo(i.subarray(e),{planeIndex:0,frameCount:o.numberOfFrames}),o.copyTo(a.subarray(e),{planeIndex:u,frameCount:o.numberOfFrames});else{const t=r-e;o.copyTo(i.subarray(e),{planeIndex:0,frameCount:t}),o.copyTo(a.subarray(e),{planeIndex:u,frameCount:t}),o.copyTo(i,{planeIndex:0,frameOffset:t}),o.copyTo(a,{planeIndex:u,frameOffset:t})}n.writtenFrames+=o.numberOfFrames}else if("s16-planar"===o.format)if(1===o.numberOfChannels){const e=new Int16Array(o.numberOfFrames);o.copyTo(e,{planeIndex:0});for(let t=0;t<o.numberOfFrames;t++){const o=e[t]/32768;let s=n.writtenFrames%r;i[s]=o,a[s]=o,n.writtenFrames++}}else{const e=new Int16Array(o.numberOfFrames),t=new Int16Array(o.numberOfFrames);o.copyTo(e,{planeIndex:0}),o.copyTo(t,{planeIndex:1});for(let s=0;s<o.numberOfFrames;s++){let o=n.writtenFrames%r;i[o]=e[s]/32768,a[o]=t[s]/32768,n.writtenFrames++}}else if("s16"===o.format){const e=new Int16Array(o.numberOfFrames*o.numberOfChannels);if(o.copyTo(e,{planeIndex:0}),1===o.numberOfChannels)for(let t=0;t<o.numberOfFrames;t++){const o=e[t]/32768;let s=n.writtenFrames%r;i[s]=o,a[s]=o,n.writtenFrames++}else for(let t=0;t<o.numberOfFrames;t++){let s=n.writtenFrames%r;i[s]=e[t*o.numberOfChannels+0]/32768,a[s]=e[t*o.numberOfChannels+1]/32768,n.writtenFrames++}}else console.error("Unsupported audio format:",o.format);o.close()},error:e=>{n.unexpectedError=e,console.error(e)}});return n.writtenFrames=0,n},s.emscripten_ubq_settings_forceWebGL1=!1;var d,f,p,h=Object.assign({},s),m="./this.program",g=(e,t)=>{throw t},y="object"==typeof window,v="function"==typeof importScripts,b="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,w="";if(b){var E=r(147),_=r(17);w=v?_.dirname(w)+"/":__dirname+"/",d=(e,t)=>(e=oe(e)?new URL(e):_.normalize(e),E.readFileSync(e,t?void 0:"utf8")),p=e=>{var t=d(e,!0);return t.buffer||(t=new Uint8Array(t)),t},f=(e,t,r,n=!0)=>{e=oe(e)?new URL(e):_.normalize(e),E.readFile(e,n?void 0:"utf8",((e,o)=>{e?r(e):t(n?o.buffer:o)}))},!s.thisProgram&&process.argv.length>1&&(m=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),g=(e,t)=>{throw process.exitCode=e,t},s.inspect=()=>"[Emscripten Module object]"}else(y||v)&&(v?w=self.location.href:"undefined"!=typeof document&&document.currentScript&&(w=document.currentScript.src),n&&(w=n),w=0!==w.indexOf("blob:")?w.substr(0,w.replace(/[?#].*/,"").lastIndexOf("/")+1):"",d=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},v&&(p=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),f=(e,t,r)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?t(n.response):r()},n.onerror=r,n.send(null)});var C,S=s.print||console.log.bind(console),k=s.printErr||console.error.bind(console);Object.assign(s,h),h=null,s.arguments&&s.arguments,s.thisProgram&&(m=s.thisProgram),s.quit&&(g=s.quit),s.wasmBinary&&(C=s.wasmBinary);var x,P,T=s.noExitRuntime||!0;"object"!=typeof WebAssembly&&re("no native wasm support detected");var F,A,D,B,L,R,M,O,I,U,$,j,q=!1;function N(e,t){e||re(t)}function H(){var e=x.buffer;s.HEAP8=A=new Int8Array(e),s.HEAP16=B=new Int16Array(e),s.HEAP32=R=new Int32Array(e),s.HEAPU8=D=new Uint8Array(e),s.HEAPU16=L=new Uint16Array(e),s.HEAPU32=M=new Uint32Array(e),s.HEAPF32=O=new Float32Array(e),s.HEAPF64=$=new Float64Array(e),s.HEAP64=I=new BigInt64Array(e),s.HEAPU64=U=new BigUint64Array(e)}var V=[],W=[],G=[],z=[];function Y(){return T||!1}var X,K,Q=0,Z=null,J=null;function ee(e){Q++,s.monitorRunDependencies&&s.monitorRunDependencies(Q)}function te(e){if(Q--,s.monitorRunDependencies&&s.monitorRunDependencies(Q),0==Q&&(null!==Z&&(clearInterval(Z),Z=null),J)){var t=J;J=null,t()}}function re(e){s.onAbort&&s.onAbort(e),k(e="Aborted("+e+")"),q=!0,F=1,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw o(t),t}function ne(e){return e.startsWith("data:application/octet-stream;base64,")}function oe(e){return e.startsWith("file://")}function ie(e){if(e==X&&C)return new Uint8Array(C);if(p)return p(e);throw"both async and sync fetching of the wasm failed"}function ae(e,t,r){return function(e){return C||!y&&!v||"function"!=typeof fetch?Promise.resolve().then((()=>ie(e))):fetch(e,{credentials:"same-origin"}).then((t=>{if(!t.ok)throw"failed to load wasm binary file at '"+e+"'";return t.arrayBuffer()})).catch((()=>ie(e)))}(e).then((e=>WebAssembly.instantiate(e,t))).then((e=>e)).then(r,(e=>{k("failed to asynchronously prepare wasm: "+e),re(e)}))}ne(X="cesdk.wasm")||(K=X,X=s.locateFile?s.locateFile(K,w):w+K);var se={2354824:(e,t,r,n,o)=>"undefined"==typeof window||void 0===(window.AudioContext||window.webkitAudioContext)?0:(void 0===window.miniaudio&&(window.miniaudio={referenceCount:0},window.miniaudio.device_type={},window.miniaudio.device_type.playback=e,window.miniaudio.device_type.capture=t,window.miniaudio.device_type.duplex=r,window.miniaudio.device_state={},window.miniaudio.device_state.stopped=n,window.miniaudio.device_state.started=o,miniaudio.devices=[],miniaudio.track_device=function(e){for(var t=0;t<miniaudio.devices.length;++t)if(null==miniaudio.devices[t])return miniaudio.devices[t]=e,t;return miniaudio.devices.push(e),miniaudio.devices.length-1},miniaudio.untrack_device_by_index=function(e){for(miniaudio.devices[e]=null;miniaudio.devices.length>0&&null==miniaudio.devices[miniaudio.devices.length-1];)miniaudio.devices.pop()},miniaudio.untrack_device=function(e){for(var t=0;t<miniaudio.devices.length;++t)if(miniaudio.devices[t]==e)return miniaudio.untrack_device_by_index(t)},miniaudio.get_device_by_index=function(e){return miniaudio.devices[e]},miniaudio.unlock_event_types=["touchstart","touchend","click"],miniaudio.unlock=function(){for(var e=0;e<miniaudio.devices.length;++e){var t=miniaudio.devices[e];null!=t&&null!=t.webaudio&&2===t.state&&t.webaudio.resume()}miniaudio.unlock_event_types.map((function(e){document.removeEventListener(e,miniaudio.unlock,!0)}))},miniaudio.unlock_event_types.map((function(e){document.addEventListener(e,miniaudio.unlock,!0)}))),window.miniaudio.referenceCount+=1,1),2356814:()=>{void 0!==window.miniaudio&&(window.miniaudio.referenceCount-=1,0===window.miniaudio.referenceCount&&delete window.miniaudio)},2356978:()=>void 0!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia,2357082:()=>{try{var e=new(window.AudioContext||window.webkitAudioContext),t=e.sampleRate;return e.close(),t}catch(e){return 0}},2357253:(e,t,r,n,o,i)=>{var a=e,u=t,l=r,c=n,d=o,f=i;if(void 0===window.miniaudio)return-1;var p={},h={};a==window.miniaudio.device_type.playback&&(h.sampleRate=l),p.webaudio=new(window.AudioContext||window.webkitAudioContext)(h),p.webaudio.suspend(),p.state=window.miniaudio.device_state.stopped;var m=0,g=u;return a!=window.miniaudio.device_type.playback&&(m=u),p.scriptNode=p.webaudio.createScriptProcessor(c,m,g),p.scriptNode.onaudioprocess=function(e){if(null!=p.intermediaryBufferView&&0!=p.intermediaryBufferView.length||(p.intermediaryBufferView=new Float32Array(s.HEAPF32.buffer,d,c*u)),a==miniaudio.device_type.capture||a==miniaudio.device_type.duplex){for(var t=0;t<u;t+=1)for(var r=e.inputBuffer.getChannelData(t),n=p.intermediaryBufferView,o=0;o<c;o+=1)n[o*u+t]=r[o];Kn(f,c,d)}if(a==miniaudio.device_type.playback||a==miniaudio.device_type.duplex)for(Qn(f,c,d),t=0;t<e.outputBuffer.numberOfChannels;++t){var i=e.outputBuffer.getChannelData(t);for(n=p.intermediaryBufferView,o=0;o<c;o+=1)i[o]=n[o*u+t]}else for(t=0;t<e.outputBuffer.numberOfChannels;++t)e.outputBuffer.getChannelData(t).fill(0)},a!=miniaudio.device_type.capture&&a!=miniaudio.device_type.duplex||navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(e){p.streamNode=p.webaudio.createMediaStreamSource(e),p.streamNode.connect(p.scriptNode),p.scriptNode.connect(p.webaudio.destination)})).catch((function(e){console.log("Failed to get user media: "+e)})),a==miniaudio.device_type.playback&&p.scriptNode.connect(p.webaudio.destination),miniaudio.track_device(p)},2360036:e=>miniaudio.get_device_by_index(e).webaudio.sampleRate,2360102:e=>{var t=miniaudio.get_device_by_index(e);void 0!==t.scriptNode&&(t.scriptNode.onaudioprocess=function(e){},t.scriptNode.disconnect(),t.scriptNode=void 0),void 0!==t.streamNode&&(t.streamNode.disconnect(),t.streamNode=void 0),t.webaudio.close(),t.webaudio=void 0},2360467:e=>{miniaudio.untrack_device_by_index(e)},2360510:e=>{var t=miniaudio.get_device_by_index(e);t.webaudio.resume(),t.state=miniaudio.device_state.started},2360635:e=>{var t=miniaudio.get_device_by_index(e);t.webaudio.suspend(),t.state=miniaudio.device_state.stopped},2360761:()=>!!globalThis.ubq_browserTabHidden,2360807:()=>A.length};function ue(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var le=e=>{for(;e.length>0;)e.shift()(s)},ce=[],de=0;function fe(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){M[this.ptr+4>>2]=e},this.get_type=function(){return M[this.ptr+4>>2]},this.set_destructor=function(e){M[this.ptr+8>>2]=e},this.get_destructor=function(){return M[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,A[this.ptr+12>>0]=e},this.get_caught=function(){return 0!=A[this.ptr+12>>0]},this.set_rethrown=function(e){e=e?1:0,A[this.ptr+13>>0]=e},this.get_rethrown=function(){return 0!=A[this.ptr+13>>0]},this.init=function(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t)},this.set_adjusted_ptr=function(e){M[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return M[this.ptr+16>>2]},this.get_exception_ptr=function(){if(uo(this.get_type()))return M[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}var pe=e=>{var t=de;if(!t)return Zn(0),0;var r=new fe(t);r.set_adjusted_ptr(t);var n=r.get_type();if(!n)return Zn(0),t;for(var o in e){var i=e[o];if(0===i||i===n)break;var a=r.ptr+16;if(so(i,n,a))return Zn(i),t}return Zn(n),t},he={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,t)=>{for(var r=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:e=>{var t=he.isAbs(e),r="/"===e.substr(-1);return(e=he.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=he.splitPath(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:e=>{if("/"===e)return"/";var t=(e=(e=he.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments);return he.normalize(e.join("/"))},join2:(e,t)=>he.normalize(e+"/"+t)},me=e=>(me=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>crypto.getRandomValues(e);if(b)try{var e=r(113);if(e.randomFillSync)return t=>e.randomFillSync(t);var t=e.randomBytes;return e=>(e.set(t(e.byteLength)),e)}catch(e){}re("initRandomDevice")})())(e),ge={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:Te.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,t=he.isAbs(n)}return(t?"/":"")+(e=he.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||"."},relative:(e,t)=>{function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=ge.resolve(e).substr(1),t=ge.resolve(t).substr(1);for(var n=r(e.split("/")),o=r(t.split("/")),i=Math.min(n.length,o.length),a=i,s=0;s<i;s++)if(n[s]!==o[s]){a=s;break}var u=[];for(s=a;s<n.length;s++)u.push("..");return(u=u.concat(o.slice(a))).join("/")}},ye="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,ve=(e,t,r)=>{for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.buffer&&ye)return ye.decode(e.subarray(t,o));for(var i="";t<o;){var a=e[t++];if(128&a){var s=63&e[t++];if(192!=(224&a)){var u=63&e[t++];if((a=224==(240&a)?(15&a)<<12|s<<6|u:(7&a)<<18|s<<12|u<<6|63&e[t++])<65536)i+=String.fromCharCode(a);else{var l=a-65536;i+=String.fromCharCode(55296|l>>10,56320|1023&l)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i},be=[],we=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n<=127?t++:n<=2047?t+=2:n>=55296&&n<=57343?(t+=4,++r):t+=3}return t},Ee=(e,t,r,n)=>{if(!(n>0))return 0;for(var o=r,i=r+n-1,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),s<=127){if(r>=i)break;t[r++]=s}else if(s<=2047){if(r+1>=i)break;t[r++]=192|s>>6,t[r++]=128|63&s}else if(s<=65535){if(r+2>=i)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|63&s}else{if(r+3>=i)break;t[r++]=240|s>>18,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}}return t[r]=0,r-o};function _e(e,t,r){var n=r>0?r:we(e)+1,o=new Array(n),i=Ee(e,o,0,o.length);return t&&(o.length=i),o}var Ce={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){Ce.ttys[e]={input:[],output:[],ops:t},Te.registerDevice(e,Ce.stream_ops)},stream_ops:{open:function(e){var t=Ce.ttys[e.node.rdev];if(!t)throw new Te.ErrnoError(43);e.tty=t,e.seekable=!1},close:function(e){e.tty.ops.fsync(e.tty)},fsync:function(e){e.tty.ops.fsync(e.tty)},read:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.get_char)throw new Te.ErrnoError(60);for(var i=0,a=0;a<n;a++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new Te.ErrnoError(29)}if(void 0===s&&0===i)throw new Te.ErrnoError(6);if(null==s)break;i++,t[r+a]=s}return i&&(e.node.timestamp=Date.now()),i},write:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.put_char)throw new Te.ErrnoError(60);try{for(var i=0;i<n;i++)e.tty.ops.put_char(e.tty,t[r+i])}catch(e){throw new Te.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(e){return(()=>{if(!be.length){var e=null;if(b){var t=Buffer.alloc(256),r=0,n=process.stdin.fd;try{r=E.readSync(n,t,0,256,-1)}catch(e){if(!e.toString().includes("EOF"))throw e;r=0}e=r>0?t.slice(0,r).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\n");if(!e)return null;be=_e(e,!0)}return be.shift()})()},put_char:function(e,t){null===t||10===t?(S(ve(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync:function(e){e.output&&e.output.length>0&&(S(ve(e.output,0)),e.output=[])},ioctl_tcgets:function(e){return{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:function(e,t,r){return 0},ioctl_tiocgwinsz:function(e){return[24,80]}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(k(ve(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync:function(e){e.output&&e.output.length>0&&(k(ve(e.output,0)),e.output=[])}}},Se=e=>{e=((e,t)=>65536*Math.ceil(e/65536))(e);var t=eo(65536,e);return t?((e,t)=>(D.fill(0,e,e+t),e))(t,e):0},ke={ops_table:null,mount:e=>ke.createNode(null,"/",16895,0),createNode(e,t,r,n){if(Te.isBlkdev(r)||Te.isFIFO(r))throw new Te.ErrnoError(63);ke.ops_table||(ke.ops_table={dir:{node:{getattr:ke.node_ops.getattr,setattr:ke.node_ops.setattr,lookup:ke.node_ops.lookup,mknod:ke.node_ops.mknod,rename:ke.node_ops.rename,unlink:ke.node_ops.unlink,rmdir:ke.node_ops.rmdir,readdir:ke.node_ops.readdir,symlink:ke.node_ops.symlink},stream:{llseek:ke.stream_ops.llseek}},file:{node:{getattr:ke.node_ops.getattr,setattr:ke.node_ops.setattr},stream:{llseek:ke.stream_ops.llseek,read:ke.stream_ops.read,write:ke.stream_ops.write,allocate:ke.stream_ops.allocate,mmap:ke.stream_ops.mmap,msync:ke.stream_ops.msync}},link:{node:{getattr:ke.node_ops.getattr,setattr:ke.node_ops.setattr,readlink:ke.node_ops.readlink},stream:{}},chrdev:{node:{getattr:ke.node_ops.getattr,setattr:ke.node_ops.setattr},stream:Te.chrdev_stream_ops}});var o=Te.createNode(e,t,r,n);return Te.isDir(o.mode)?(o.node_ops=ke.ops_table.dir.node,o.stream_ops=ke.ops_table.dir.stream,o.contents={}):Te.isFile(o.mode)?(o.node_ops=ke.ops_table.file.node,o.stream_ops=ke.ops_table.file.stream,o.usedBytes=0,o.contents=null):Te.isLink(o.mode)?(o.node_ops=ke.ops_table.link.node,o.stream_ops=ke.ops_table.link.stream):Te.isChrdev(o.mode)&&(o.node_ops=ke.ops_table.chrdev.node,o.stream_ops=ke.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[t]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:e=>e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0),expandFileStorage(e,t){var r=e.contents?e.contents.length:0;if(!(r>=t)){t=Math.max(t,r*(r<1048576?2:1.125)>>>0),0!=r&&(t=Math.max(t,256));var n=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,t){if(e.usedBytes!=t)if(0==t)e.contents=null,e.usedBytes=0;else{var r=e.contents;e.contents=new Uint8Array(t),r&&e.contents.set(r.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr(e){var t={};return t.dev=Te.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,Te.isDir(e.mode)?t.size=4096:Te.isFile(e.mode)?t.size=e.usedBytes:Te.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&ke.resizeFileStorage(e,t.size)},lookup(e,t){throw Te.genericErrors[44]},mknod:(e,t,r,n)=>ke.createNode(e,t,r,n),rename(e,t,r){if(Te.isDir(e.mode)){var n;try{n=Te.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new Te.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=r,t.contents[r]=e,t.timestamp=e.parent.timestamp,e.parent=t},unlink(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir(e,t){var r=Te.lookupNode(e,t);for(var n in r.contents)throw new Te.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir(e){var t=[".",".."];for(var r in e.contents)e.contents.hasOwnProperty(r)&&t.push(r);return t},symlink(e,t,r){var n=ke.createNode(e,t,41471,0);return n.link=r,n},readlink(e){if(!Te.isLink(e.mode))throw new Te.ErrnoError(28);return e.link}},stream_ops:{read(e,t,r,n,o){var i=e.node.contents;if(o>=e.node.usedBytes)return 0;var a=Math.min(e.node.usedBytes-o,n);if(a>8&&i.subarray)t.set(i.subarray(o,o+a),r);else for(var s=0;s<a;s++)t[r+s]=i[o+s];return a},write(e,t,r,n,o,i){if(t.buffer===A.buffer&&(i=!1),!n)return 0;var a=e.node;if(a.timestamp=Date.now(),t.subarray&&(!a.contents||a.contents.subarray)){if(i)return a.contents=t.subarray(r,r+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===o)return a.contents=t.slice(r,r+n),a.usedBytes=n,n;if(o+n<=a.usedBytes)return a.contents.set(t.subarray(r,r+n),o),n}if(ke.expandFileStorage(a,o+n),a.contents.subarray&&t.subarray)a.contents.set(t.subarray(r,r+n),o);else for(var s=0;s<n;s++)a.contents[o+s]=t[r+s];return a.usedBytes=Math.max(a.usedBytes,o+n),n},llseek(e,t,r){var n=t;if(1===r?n+=e.position:2===r&&Te.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new Te.ErrnoError(28);return n},allocate(e,t,r){ke.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap(e,t,r,n,o){if(!Te.isFile(e.node.mode))throw new Te.ErrnoError(43);var i,a,s=e.node.contents;if(2&o||s.buffer!==A.buffer){if((r>0||r+t<s.length)&&(s=s.subarray?s.subarray(r,r+t):Array.prototype.slice.call(s,r,r+t)),a=!0,!(i=Se(t)))throw new Te.ErrnoError(48);A.set(s,i)}else a=!1,i=s.byteOffset;return{ptr:i,allocated:a}},msync:(e,t,r,n,o)=>(ke.stream_ops.write(e,t,0,n,r,!1),0)}},xe=s.preloadPlugins||[];function Pe(e,t){var r=0;return e&&(r|=365),t&&(r|=146),r}var Te={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(e,t={})=>{if(!(e=ge.resolve(e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new Te.ErrnoError(32);for(var r=e.split("/").filter((e=>!!e)),n=Te.root,o="/",i=0;i<r.length;i++){var a=i===r.length-1;if(a&&t.parent)break;if(n=Te.lookupNode(n,r[i]),o=he.join2(o,r[i]),Te.isMountpoint(n)&&(!a||a&&t.follow_mount)&&(n=n.mounted.root),!a||t.follow)for(var s=0;Te.isLink(n.mode);){var u=Te.readlink(o);if(o=ge.resolve(he.dirname(o),u),n=Te.lookupPath(o,{recurse_count:t.recurse_count+1}).node,s++>40)throw new Te.ErrnoError(32)}}return{path:o,node:n}},getPath:e=>{for(var t;;){if(Te.isRoot(e)){var r=e.mount.mountpoint;return t?"/"!==r[r.length-1]?`${r}/${t}`:r+t:r}t=t?`${e.name}/${t}`:e.name,e=e.parent}},hashName:(e,t)=>{for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>0)%Te.nameTable.length},hashAddNode:e=>{var t=Te.hashName(e.parent.id,e.name);e.name_next=Te.nameTable[t],Te.nameTable[t]=e},hashRemoveNode:e=>{var t=Te.hashName(e.parent.id,e.name);if(Te.nameTable[t]===e)Te.nameTable[t]=e.name_next;else for(var r=Te.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode:(e,t)=>{var r=Te.mayLookup(e);if(r)throw new Te.ErrnoError(r,e);for(var n=Te.hashName(e.id,t),o=Te.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===t)return o}return Te.lookup(e,t)},createNode:(e,t,r,n)=>{var o=new Te.FSNode(e,t,r,n);return Te.hashAddNode(o),o},destroyNode:e=>{Te.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==(49152&e),flagsToPermissionString:e=>{var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:(e,t)=>Te.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2,mayLookup:e=>Te.nodePermissions(e,"x")||(e.node_ops.lookup?0:2),mayCreate:(e,t)=>{try{return Te.lookupNode(e,t),20}catch(e){}return Te.nodePermissions(e,"wx")},mayDelete:(e,t,r)=>{var n;try{n=Te.lookupNode(e,t)}catch(e){return e.errno}var o=Te.nodePermissions(e,"wx");if(o)return o;if(r){if(!Te.isDir(n.mode))return 54;if(Te.isRoot(n)||Te.getPath(n)===Te.cwd())return 10}else if(Te.isDir(n.mode))return 31;return 0},mayOpen:(e,t)=>e?Te.isLink(e.mode)?32:Te.isDir(e.mode)&&("r"!==Te.flagsToPermissionString(t)||512&t)?31:Te.nodePermissions(e,Te.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd:()=>{for(var e=0;e<=Te.MAX_OPEN_FDS;e++)if(!Te.streams[e])return e;throw new Te.ErrnoError(33)},getStreamChecked:e=>{var t=Te.getStream(e);if(!t)throw new Te.ErrnoError(8);return t},getStream:e=>Te.streams[e],createStream:(e,t=-1)=>(Te.FSStream||(Te.FSStream=function(){this.shared={}},Te.FSStream.prototype={},Object.defineProperties(Te.FSStream.prototype,{object:{get(){return this.node},set(e){this.node=e}},isRead:{get(){return 1!=(2097155&this.flags)}},isWrite:{get(){return 0!=(2097155&this.flags)}},isAppend:{get(){return 1024&this.flags}},flags:{get(){return this.shared.flags},set(e){this.shared.flags=e}},position:{get(){return this.shared.position},set(e){this.shared.position=e}}})),e=Object.assign(new Te.FSStream,e),-1==t&&(t=Te.nextfd()),e.fd=t,Te.streams[t]=e,e),closeStream:e=>{Te.streams[e]=null},chrdev_stream_ops:{open:e=>{var t=Te.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:()=>{throw new Te.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice:(e,t)=>{Te.devices[e]={stream_ops:t}},getDevice:e=>Te.devices[e],getMounts:e=>{for(var t=[],r=[e];r.length;){var n=r.pop();t.push(n),r.push.apply(r,n.mounts)}return t},syncfs:(e,t)=>{"function"==typeof e&&(t=e,e=!1),Te.syncFSRequests++,Te.syncFSRequests>1&&k(`warning: ${Te.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var r=Te.getMounts(Te.root.mount),n=0;function o(e){return Te.syncFSRequests--,t(e)}function i(e){if(e)return i.errored?void 0:(i.errored=!0,o(e));++n>=r.length&&o(null)}r.forEach((t=>{if(!t.type.syncfs)return i(null);t.type.syncfs(t,e,i)}))},mount:(e,t,r)=>{var n,o="/"===r,i=!r;if(o&&Te.root)throw new Te.ErrnoError(10);if(!o&&!i){var a=Te.lookupPath(r,{follow_mount:!1});if(r=a.path,n=a.node,Te.isMountpoint(n))throw new Te.ErrnoError(10);if(!Te.isDir(n.mode))throw new Te.ErrnoError(54)}var s={type:e,opts:t,mountpoint:r,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,o?Te.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:e=>{var t=Te.lookupPath(e,{follow_mount:!1});if(!Te.isMountpoint(t.node))throw new Te.ErrnoError(28);var r=t.node,n=r.mounted,o=Te.getMounts(n);Object.keys(Te.nameTable).forEach((e=>{for(var t=Te.nameTable[e];t;){var r=t.name_next;o.includes(t.mount)&&Te.destroyNode(t),t=r}})),r.mounted=null;var i=r.mount.mounts.indexOf(n);r.mount.mounts.splice(i,1)},lookup:(e,t)=>e.node_ops.lookup(e,t),mknod:(e,t,r)=>{var n=Te.lookupPath(e,{parent:!0}).node,o=he.basename(e);if(!o||"."===o||".."===o)throw new Te.ErrnoError(28);var i=Te.mayCreate(n,o);if(i)throw new Te.ErrnoError(i);if(!n.node_ops.mknod)throw new Te.ErrnoError(63);return n.node_ops.mknod(n,o,t,r)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,Te.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,Te.mknod(e,t,0)),mkdirTree:(e,t)=>{for(var r=e.split("/"),n="",o=0;o<r.length;++o)if(r[o]){n+="/"+r[o];try{Te.mkdir(n,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,r)=>(void 0===r&&(r=t,t=438),t|=8192,Te.mknod(e,t,r)),symlink:(e,t)=>{if(!ge.resolve(e))throw new Te.ErrnoError(44);var r=Te.lookupPath(t,{parent:!0}).node;if(!r)throw new Te.ErrnoError(44);var n=he.basename(t),o=Te.mayCreate(r,n);if(o)throw new Te.ErrnoError(o);if(!r.node_ops.symlink)throw new Te.ErrnoError(63);return r.node_ops.symlink(r,n,e)},rename:(e,t)=>{var r,n,o=he.dirname(e),i=he.dirname(t),a=he.basename(e),s=he.basename(t);if(r=Te.lookupPath(e,{parent:!0}).node,n=Te.lookupPath(t,{parent:!0}).node,!r||!n)throw new Te.ErrnoError(44);if(r.mount!==n.mount)throw new Te.ErrnoError(75);var u,l=Te.lookupNode(r,a),c=ge.relative(e,i);if("."!==c.charAt(0))throw new Te.ErrnoError(28);if("."!==(c=ge.relative(t,o)).charAt(0))throw new Te.ErrnoError(55);try{u=Te.lookupNode(n,s)}catch(e){}if(l!==u){var d=Te.isDir(l.mode),f=Te.mayDelete(r,a,d);if(f)throw new Te.ErrnoError(f);if(f=u?Te.mayDelete(n,s,d):Te.mayCreate(n,s))throw new Te.ErrnoError(f);if(!r.node_ops.rename)throw new Te.ErrnoError(63);if(Te.isMountpoint(l)||u&&Te.isMountpoint(u))throw new Te.ErrnoError(10);if(n!==r&&(f=Te.nodePermissions(r,"w")))throw new Te.ErrnoError(f);Te.hashRemoveNode(l);try{r.node_ops.rename(l,n,s)}catch(e){throw e}finally{Te.hashAddNode(l)}}},rmdir:e=>{var t=Te.lookupPath(e,{parent:!0}).node,r=he.basename(e),n=Te.lookupNode(t,r),o=Te.mayDelete(t,r,!0);if(o)throw new Te.ErrnoError(o);if(!t.node_ops.rmdir)throw new Te.ErrnoError(63);if(Te.isMountpoint(n))throw new Te.ErrnoError(10);t.node_ops.rmdir(t,r),Te.destroyNode(n)},readdir:e=>{var t=Te.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new Te.ErrnoError(54);return t.node_ops.readdir(t)},unlink:e=>{var t=Te.lookupPath(e,{parent:!0}).node;if(!t)throw new Te.ErrnoError(44);var r=he.basename(e),n=Te.lookupNode(t,r),o=Te.mayDelete(t,r,!1);if(o)throw new Te.ErrnoError(o);if(!t.node_ops.unlink)throw new Te.ErrnoError(63);if(Te.isMountpoint(n))throw new Te.ErrnoError(10);t.node_ops.unlink(t,r),Te.destroyNode(n)},readlink:e=>{var t=Te.lookupPath(e).node;if(!t)throw new Te.ErrnoError(44);if(!t.node_ops.readlink)throw new Te.ErrnoError(28);return ge.resolve(Te.getPath(t.parent),t.node_ops.readlink(t))},stat:(e,t)=>{var r=Te.lookupPath(e,{follow:!t}).node;if(!r)throw new Te.ErrnoError(44);if(!r.node_ops.getattr)throw new Te.ErrnoError(63);return r.node_ops.getattr(r)},lstat:e=>Te.stat(e,!0),chmod:(e,t,r)=>{var n;if(!(n="string"==typeof e?Te.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new Te.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod:(e,t)=>{Te.chmod(e,t,!0)},fchmod:(e,t)=>{var r=Te.getStreamChecked(e);Te.chmod(r.node,t)},chown:(e,t,r,n)=>{var o;if(!(o="string"==typeof e?Te.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new Te.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(e,t,r)=>{Te.chown(e,t,r,!0)},fchown:(e,t,r)=>{var n=Te.getStreamChecked(e);Te.chown(n.node,t,r)},truncate:(e,t)=>{if(t<0)throw new Te.ErrnoError(28);var r;if(!(r="string"==typeof e?Te.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new Te.ErrnoError(63);if(Te.isDir(r.mode))throw new Te.ErrnoError(31);if(!Te.isFile(r.mode))throw new Te.ErrnoError(28);var n=Te.nodePermissions(r,"w");if(n)throw new Te.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate:(e,t)=>{var r=Te.getStreamChecked(e);if(0==(2097155&r.flags))throw new Te.ErrnoError(28);Te.truncate(r.node,t)},utime:(e,t,r)=>{var n=Te.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open:(e,t,r)=>{if(""===e)throw new Te.ErrnoError(44);var n;if(r=void 0===r?438:r,r=64&(t="string"==typeof t?function(e){var t={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===t)throw new Error(`Unknown file open mode: ${e}`);return t}(t):t)?4095&r|32768:0,"object"==typeof e)n=e;else{e=he.normalize(e);try{n=Te.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var o=!1;if(64&t)if(n){if(128&t)throw new Te.ErrnoError(20)}else n=Te.mknod(e,r,0),o=!0;if(!n)throw new Te.ErrnoError(44);if(Te.isChrdev(n.mode)&&(t&=-513),65536&t&&!Te.isDir(n.mode))throw new Te.ErrnoError(54);if(!o){var i=Te.mayOpen(n,t);if(i)throw new Te.ErrnoError(i)}512&t&&!o&&Te.truncate(n,0),t&=-131713;var a=Te.createStream({node:n,path:Te.getPath(n),flags:t,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return a.stream_ops.open&&a.stream_ops.open(a),!s.logReadFiles||1&t||(Te.readFiles||(Te.readFiles={}),e in Te.readFiles||(Te.readFiles[e]=1)),a},close:e=>{if(Te.isClosed(e))throw new Te.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{Te.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek:(e,t,r)=>{if(Te.isClosed(e))throw new Te.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new Te.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new Te.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read:(e,t,r,n,o)=>{if(n<0||o<0)throw new Te.ErrnoError(28);if(Te.isClosed(e))throw new Te.ErrnoError(8);if(1==(2097155&e.flags))throw new Te.ErrnoError(8);if(Te.isDir(e.node.mode))throw new Te.ErrnoError(31);if(!e.stream_ops.read)throw new Te.ErrnoError(28);var i=void 0!==o;if(i){if(!e.seekable)throw new Te.ErrnoError(70)}else o=e.position;var a=e.stream_ops.read(e,t,r,n,o);return i||(e.position+=a),a},write:(e,t,r,n,o,i)=>{if(n<0||o<0)throw new Te.ErrnoError(28);if(Te.isClosed(e))throw new Te.ErrnoError(8);if(0==(2097155&e.flags))throw new Te.ErrnoError(8);if(Te.isDir(e.node.mode))throw new Te.ErrnoError(31);if(!e.stream_ops.write)throw new Te.ErrnoError(28);e.seekable&&1024&e.flags&&Te.llseek(e,0,2);var a=void 0!==o;if(a){if(!e.seekable)throw new Te.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,t,r,n,o,i);return a||(e.position+=s),s},allocate:(e,t,r)=>{if(Te.isClosed(e))throw new Te.ErrnoError(8);if(t<0||r<=0)throw new Te.ErrnoError(28);if(0==(2097155&e.flags))throw new Te.ErrnoError(8);if(!Te.isFile(e.node.mode)&&!Te.isDir(e.node.mode))throw new Te.ErrnoError(43);if(!e.stream_ops.allocate)throw new Te.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap:(e,t,r,n,o)=>{if(0!=(2&n)&&0==(2&o)&&2!=(2097155&e.flags))throw new Te.ErrnoError(2);if(1==(2097155&e.flags))throw new Te.ErrnoError(2);if(!e.stream_ops.mmap)throw new Te.ErrnoError(43);return e.stream_ops.mmap(e,t,r,n,o)},msync:(e,t,r,n,o)=>e.stream_ops.msync?e.stream_ops.msync(e,t,r,n,o):0,munmap:e=>0,ioctl:(e,t,r)=>{if(!e.stream_ops.ioctl)throw new Te.ErrnoError(59);return e.stream_ops.ioctl(e,t,r)},readFile:(e,t={})=>{if(t.flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error(`Invalid encoding type "${t.encoding}"`);var r,n=Te.open(e,t.flags),o=Te.stat(e).size,i=new Uint8Array(o);return Te.read(n,i,0,o,0),"utf8"===t.encoding?r=ve(i,0):"binary"===t.encoding&&(r=i),Te.close(n),r},writeFile:(e,t,r={})=>{r.flags=r.flags||577;var n=Te.open(e,r.flags,r.mode);if("string"==typeof t){var o=new Uint8Array(we(t)+1),i=Ee(t,o,0,o.length);Te.write(n,o,0,i,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");Te.write(n,t,0,t.byteLength,void 0,r.canOwn)}Te.close(n)},cwd:()=>Te.currentPath,chdir:e=>{var t=Te.lookupPath(e,{follow:!0});if(null===t.node)throw new Te.ErrnoError(44);if(!Te.isDir(t.node.mode))throw new Te.ErrnoError(54);var r=Te.nodePermissions(t.node,"x");if(r)throw new Te.ErrnoError(r);Te.currentPath=t.path},createDefaultDirectories:()=>{Te.mkdir("/tmp"),Te.mkdir("/home"),Te.mkdir("/home/web_user")},createDefaultDevices:()=>{Te.mkdir("/dev"),Te.registerDevice(Te.makedev(1,3),{read:()=>0,write:(e,t,r,n,o)=>n}),Te.mkdev("/dev/null",Te.makedev(1,3)),Ce.register(Te.makedev(5,0),Ce.default_tty_ops),Ce.register(Te.makedev(6,0),Ce.default_tty1_ops),Te.mkdev("/dev/tty",Te.makedev(5,0)),Te.mkdev("/dev/tty1",Te.makedev(6,0));var e=new Uint8Array(1024),t=0,r=()=>(0===t&&(t=me(e).byteLength),e[--t]);Te.createDevice("/dev","random",r),Te.createDevice("/dev","urandom",r),Te.mkdir("/dev/shm"),Te.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{Te.mkdir("/proc");var e=Te.mkdir("/proc/self");Te.mkdir("/proc/self/fd"),Te.mount({mount:()=>{var t=Te.createNode(e,"fd",16895,73);return t.node_ops={lookup:(e,t)=>{var r=+t,n=Te.getStreamChecked(r),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},t}},{},"/proc/self/fd")},createStandardStreams:()=>{s.stdin?Te.createDevice("/dev","stdin",s.stdin):Te.symlink("/dev/tty","/dev/stdin"),s.stdout?Te.createDevice("/dev","stdout",null,s.stdout):Te.symlink("/dev/tty","/dev/stdout"),s.stderr?Te.createDevice("/dev","stderr",null,s.stderr):Te.symlink("/dev/tty1","/dev/stderr"),Te.open("/dev/stdin",0),Te.open("/dev/stdout",1),Te.open("/dev/stderr",1)},ensureErrnoError:()=>{Te.ErrnoError||(Te.ErrnoError=function(e,t){this.name="ErrnoError",this.node=t,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},Te.ErrnoError.prototype=new Error,Te.ErrnoError.prototype.constructor=Te.ErrnoError,[44].forEach((e=>{Te.genericErrors[e]=new Te.ErrnoError(e),Te.genericErrors[e].stack="<generic error, no stack>"})))},staticInit:()=>{Te.ensureErrnoError(),Te.nameTable=new Array(4096),Te.mount(ke,{},"/"),Te.createDefaultDirectories(),Te.createDefaultDevices(),Te.createSpecialDirectories(),Te.filesystems={MEMFS:ke}},init:(e,t,r)=>{Te.init.initialized=!0,Te.ensureErrnoError(),s.stdin=e||s.stdin,s.stdout=t||s.stdout,s.stderr=r||s.stderr,Te.createStandardStreams()},quit:()=>{Te.init.initialized=!1;for(var e=0;e<Te.streams.length;e++){var t=Te.streams[e];t&&Te.close(t)}},findObject:(e,t)=>{var r=Te.analyzePath(e,t);return r.exists?r.object:null},analyzePath:(e,t)=>{try{e=(n=Te.lookupPath(e,{follow:!t})).path}catch(e){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=Te.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=he.basename(e),n=Te.lookupPath(e,{follow:!t}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot="/"===n.path}catch(e){r.error=e.errno}return r},createPath:(e,t,r,n)=>{e="string"==typeof e?e:Te.getPath(e);for(var o=t.split("/").reverse();o.length;){var i=o.pop();if(i){var a=he.join2(e,i);try{Te.mkdir(a)}catch(e){}e=a}}return a},createFile:(e,t,r,n,o)=>{var i=he.join2("string"==typeof e?e:Te.getPath(e),t),a=Pe(n,o);return Te.create(i,a)},createDataFile:(e,t,r,n,o,i)=>{var a=t;e&&(e="string"==typeof e?e:Te.getPath(e),a=t?he.join2(e,t):e);var s=Pe(n,o),u=Te.create(a,s);if(r){if("string"==typeof r){for(var l=new Array(r.length),c=0,d=r.length;c<d;++c)l[c]=r.charCodeAt(c);r=l}Te.chmod(u,146|s);var f=Te.open(u,577);Te.write(f,r,0,r.length,0,i),Te.close(f),Te.chmod(u,s)}return u},createDevice:(e,t,r,n)=>{var o=he.join2("string"==typeof e?e:Te.getPath(e),t),i=Pe(!!r,!!n);Te.createDevice.major||(Te.createDevice.major=64);var a=Te.makedev(Te.createDevice.major++,0);return Te.registerDevice(a,{open:e=>{e.seekable=!1},close:e=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(e,t,n,o,i)=>{for(var a=0,s=0;s<o;s++){var u;try{u=r()}catch(e){throw new Te.ErrnoError(29)}if(void 0===u&&0===a)throw new Te.ErrnoError(6);if(null==u)break;a++,t[n+s]=u}return a&&(e.node.timestamp=Date.now()),a},write:(e,t,r,o,i)=>{for(var a=0;a<o;a++)try{n(t[r+a])}catch(e){throw new Te.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),a}}),Te.mkdev(o,i,a)},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.");if(!d)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=_e(d(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new Te.ErrnoError(29)}},createLazyFile:(e,t,r,n,o)=>{function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,r=e/this.chunkSize|0;return this.getter(r)[t]}},i.prototype.setDataGetter=function(e){this.getter=e},i.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",r,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+r+". Status: "+e.status);var t,n=Number(e.getResponseHeader("Content-length")),o=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,i=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,a=1048576;o||(a=n);var s=this;s.setDataGetter((e=>{var t=e*a,o=(e+1)*a-1;if(o=Math.min(o,n-1),void 0===s.chunks[e]&&(s.chunks[e]=((e,t)=>{if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",r,!1),n!==a&&o.setRequestHeader("Range","bytes="+e+"-"+t),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+r+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):_e(o.responseText||"",!0)})(t,o)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!i&&n||(a=n=1,n=this.getter(0).length,a=n,S("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!v)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a=new i;Object.defineProperties(a,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:a}}else s={isDevice:!1,url:r};var u=Te.createFile(e,t,s,n,o);s.contents?u.contents=s.contents:s.url&&(u.contents=null,u.url=s.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var l={};function c(e,t,r,n,o){var i=e.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,n);if(i.slice)for(var s=0;s<a;s++)t[r+s]=i[o+s];else for(s=0;s<a;s++)t[r+s]=i.get(o+s);return a}return Object.keys(u.stream_ops).forEach((e=>{var t=u.stream_ops[e];l[e]=function(){return Te.forceLoadFile(u),t.apply(null,arguments)}})),l.read=(e,t,r,n,o)=>(Te.forceLoadFile(u),c(e,t,r,n,o)),l.mmap=(e,t,r,n,o)=>{Te.forceLoadFile(u);var i=Se(t);if(!i)throw new Te.ErrnoError(48);return c(e,A,i,t,r),{ptr:i,allocated:!0}},u.stream_ops=l,u}},Fe=(e,t)=>e?ve(D,e,t):"",Ae={DEFAULT_POLLMASK:5,calculateAt:function(e,t,r){if(he.isAbs(t))return t;var n;if(n=-100===e?Te.cwd():Ae.getStreamFromFD(e).path,0==t.length){if(!r)throw new Te.ErrnoError(44);return n}return he.join2(n,t)},doStat:function(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&he.normalize(t)!==he.normalize(Te.getPath(e.node)))return-54;throw e}R[r>>2]=n.dev,R[r+4>>2]=n.mode,M[r+8>>2]=n.nlink,R[r+12>>2]=n.uid,R[r+16>>2]=n.gid,R[r+20>>2]=n.rdev,I[r+24>>3]=BigInt(n.size),R[r+32>>2]=4096,R[r+36>>2]=n.blocks;var o=n.atime.getTime(),i=n.mtime.getTime(),a=n.ctime.getTime();return I[r+40>>3]=BigInt(Math.floor(o/1e3)),M[r+48>>2]=o%1e3*1e3,I[r+56>>3]=BigInt(Math.floor(i/1e3)),M[r+64>>2]=i%1e3*1e3,I[r+72>>3]=BigInt(Math.floor(a/1e3)),M[r+80>>2]=a%1e3*1e3,I[r+88>>3]=BigInt(n.ino),0},doMsync:function(e,t,r,n,o){if(!Te.isFile(t.node.mode))throw new Te.ErrnoError(43);if(2&n)return 0;var i=D.slice(e,e+r);Te.msync(t,i,o,r,n)},varargs:void 0,get:()=>(Ae.varargs+=4,R[Ae.varargs-4>>2]),getStr:e=>Fe(e),getStreamFromFD:function(e){return Te.getStreamChecked(e)}},De={};function Be(e){for(;e.length;){var t=e.pop();e.pop()(t)}}function Le(e){return this.fromWireType(R[e>>2])}var Re={},Me={},Oe={},Ie=void 0;function Ue(e){throw new Ie(e)}function $e(e,t,r){function n(t){var n=r(t);n.length!==e.length&&Ue("Mismatched type converter count");for(var o=0;o<e.length;++o)Ge(e[o],n[o])}e.forEach((function(e){Oe[e]=t}));var o=new Array(t.length),i=[],a=0;t.forEach(((e,t)=>{Me.hasOwnProperty(e)?o[t]=Me[e]:(i.push(e),Re.hasOwnProperty(e)||(Re[e]=[]),Re[e].push((()=>{o[t]=Me[e],++a===i.length&&n(o)})))})),0===i.length&&n(o)}var je={};function qe(e){if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e}var Ne=void 0;function He(e){for(var t="",r=e;D[r];)t+=Ne[D[r++]];return t}var Ve=void 0;function We(e){throw new Ve(e)}function Ge(e,t,r={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(e,t,r={}){var n=t.name;if(e||We(`type "${n}" must have a positive integer typeid pointer`),Me.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;We(`Cannot register type '${n}' twice`)}if(Me[e]=t,delete Oe[e],Re.hasOwnProperty(e)){var o=Re[e];delete Re[e],o.forEach((e=>e()))}}(e,t,r)}function ze(e,t,r){switch(t){case 0:return r?function(e){return A[e]}:function(e){return D[e]};case 1:return r?function(e){return B[e>>1]}:function(e){return L[e>>1]};case 2:return r?function(e){return R[e>>2]}:function(e){return M[e>>2]};case 3:return r?function(e){return I[e>>3]}:function(e){return U[e>>3]};default:throw new TypeError("Unknown integer type: "+e)}}function Ye(e){switch(e){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError(`Unknown type size: ${e}`)}}function Xe(e){We(e.$$.ptrType.registeredClass.name+" instance already deleted")}var Ke=!1;function Qe(e){}function Ze(e){e.count.value-=1,0===e.count.value&&function(e){e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)}(e)}function Je(e,t,r){if(t===r)return e;if(void 0===r.baseClass)return null;var n=Je(e,t,r.baseClass);return null===n?null:r.downcast(n)}var et={};var tt=[];function rt(){for(;tt.length;){var e=tt.pop();e.$$.deleteScheduled=!1,e.delete()}}var nt=void 0;var ot={};function it(e,t){return t.ptrType&&t.ptr||Ue("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&Ue("Both smartPtrType and smartPtr must be specified"),t.count={value:1},at(Object.create(e,{$$:{value:t}}))}var at=function(e){return"undefined"==typeof FinalizationRegistry?(at=e=>e,e):(Ke=new FinalizationRegistry((e=>{Ze(e.$$)})),at=e=>{var t=e.$$;if(t.smartPtr){var r={$$:t};Ke.register(e,r,e)}return e},Qe=e=>Ke.unregister(e),at(e))};function st(){}function ut(e){if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=48&&t<=57?`_${e}`:e}function lt(e,t){return{[e=ut(e)]:function(){return t.apply(this,arguments)}}[e]}function ct(e,t,r){if(void 0===e[t].overloadTable){var n=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||We(`Function '${r}' called with an invalid number of arguments (${arguments.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[arguments.length].apply(this,arguments)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}}function dt(e,t,r){s.hasOwnProperty(e)?((void 0===r||void 0!==s[e].overloadTable&&void 0!==s[e].overloadTable[r])&&We(`Cannot register public name '${e}' twice`),ct(s,e,e),s.hasOwnProperty(r)&&We(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),s[e].overloadTable[r]=t):(s[e]=t,void 0!==r&&(s[e].numArguments=r))}function ft(e,t,r,n,o,i,a,s){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=o,this.getActualType=i,this.upcast=a,this.downcast=s,this.pureVirtualFunctions=[]}function pt(e,t,r){for(;t!==r;)t.upcast||We(`Expected null or instance of ${r.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e}function ht(e,t){if(null===t)return this.isReference&&We(`null is not a valid ${this.name}`),0;t.$$||We(`Cannot pass "${qe(t)}" as a ${this.name}`),t.$$.ptr||We(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=t.$$.ptrType.registeredClass;return pt(t.$$.ptr,r,this.registeredClass)}function mt(e,t){var r;if(null===t)return this.isReference&&We(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,r),r):0;t.$$||We(`Cannot pass "${qe(t)}" as a ${this.name}`),t.$$.ptr||We(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&We(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);var n=t.$$.ptrType.registeredClass;if(r=pt(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&We("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:We(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:r=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)r=t.$$.smartPtr;else{var o=t.clone();r=this.rawShare(r,Dt.toHandle((function(){o.delete()}))),null!==e&&e.push(this.rawDestructor,r)}break;default:We("Unsupporting sharing policy")}return r}function gt(e,t){if(null===t)return this.isReference&&We(`null is not a valid ${this.name}`),0;t.$$||We(`Cannot pass "${qe(t)}" as a ${this.name}`),t.$$.ptr||We(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&We(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass;return pt(t.$$.ptr,r,this.registeredClass)}function yt(e,t,r,n,o,i,a,s,u,l,c){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=o,this.pointeeType=i,this.sharingPolicy=a,this.rawGetPointee=s,this.rawConstructor=u,this.rawShare=l,this.rawDestructor=c,o||void 0!==t.baseClass?this.toWireType=mt:n?(this.toWireType=ht,this.destructorFunction=null):(this.toWireType=gt,this.destructorFunction=null)}function vt(e,t,r){s.hasOwnProperty(e)||Ue("Replacing nonexistant public symbol"),void 0!==s[e].overloadTable&&void 0!==r?s[e].overloadTable[r]=t:(s[e]=t,s[e].argCount=r)}var bt=[],wt=e=>{var t=bt[e];return t||(e>=bt.length&&(bt.length=e+1),bt[e]=t=j.get(e)),t};function Et(e,t){e=He(e);var r=wt(t);return"function"!=typeof r&&We(`unknown function pointer with signature ${e}: ${t}`),r}var _t=void 0;function Ct(e){var t=Jn(e),r=He(t);return Yn(t),r}function St(e,t){var r=[],n={};throw t.forEach((function e(t){n[t]||Me[t]||(Oe[t]?Oe[t].forEach(e):(r.push(t),n[t]=!0))})),new _t(`${e}: `+r.map(Ct).join([", "]))}function kt(e,t){for(var r=[],n=0;n<e;n++)r.push(M[t+4*n>>2]);return r}function xt(e,t){if(!(e instanceof Function))throw new TypeError(`new_ called with constructor type ${typeof e} which is not a function`);var r=lt(e.name||"unknownFunctionName",(function(){}));r.prototype=e.prototype;var n=new r,o=e.apply(n,t);return o instanceof Object?o:n}function Pt(e,t,r,n,o,i){var a=t.length;a<2&&We("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var s=null!==t[1]&&null!==r,u=!1,l=1;l<t.length;++l)if(null!==t[l]&&void 0===t[l].destructorFunction){u=!0;break}var c="void"!==t[0].name,d="",f="";for(l=0;l<a-2;++l)d+=(0!==l?", ":"")+"arg"+l,f+=(0!==l?", ":"")+"arg"+l+"Wired";var p=`\n return function ${ut(e)}(${d}) {\n if (arguments.length !== ${a-2}) {\n throwBindingError('function ${e} called with ${arguments.length} arguments, expected ${a-2} args!');\n }`;u&&(p+="var destructors = [];\n");var h=u?"destructors":"null",m=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],g=[We,n,o,Be,t[0],t[1]];for(s&&(p+="var thisWired = classParam.toWireType("+h+", this);\n"),l=0;l<a-2;++l)p+="var arg"+l+"Wired = argType"+l+".toWireType("+h+", arg"+l+"); // "+t[l+2].name+"\n",m.push("argType"+l),g.push(t[l+2]);if(s&&(f="thisWired"+(f.length>0?", ":"")+f),p+=(c||i?"var rv = ":"")+"invoker(fn"+(f.length>0?", ":"")+f+");\n",u)p+="runDestructors(destructors);\n";else for(l=s?1:2;l<t.length;++l){var y=1===l?"thisWired":"arg"+(l-2)+"Wired";null!==t[l].destructorFunction&&(p+=y+"_dtor("+y+"); // "+t[l].name+"\n",m.push(y+"_dtor"),g.push(t[l].destructorFunction))}return c&&(p+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),p+="}\n",m.push(p),xt(Function,m).apply(null,g)}function Tt(){this.allocated=[void 0],this.freelist=[]}var Ft=new Tt;function At(e){e>=Ft.reserved&&0==--Ft.get(e).refcount&&Ft.free(e)}var Dt={toValue:e=>(e||We("Cannot use deleted val. handle = "+e),Ft.get(e).value),toHandle:e=>{switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return Ft.allocate({refcount:1,value:e})}}};function Bt(e,t,r){switch(t){case 0:return function(e){var t=r?A:D;return this.fromWireType(t[e])};case 1:return function(e){var t=r?B:L;return this.fromWireType(t[e>>1])};case 2:return function(e){var t=r?R:M;return this.fromWireType(t[e>>2])};default:throw new TypeError("Unknown integer type: "+e)}}function Lt(e,t){var r=Me[e];return void 0===r&&We(t+" has unknown type "+Ct(e)),r}function Rt(e,t){switch(t){case 2:return function(e){return this.fromWireType(O[e>>2])};case 3:return function(e){return this.fromWireType($[e>>3])};default:throw new TypeError("Unknown float type: "+e)}}var Mt=(e,t,r)=>Ee(e,D,t,r),Ot="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,It=(e,t)=>{for(var r=e,n=r>>1,o=n+t/2;!(n>=o)&&L[n];)++n;if((r=n<<1)-e>32&&Ot)return Ot.decode(D.subarray(e,r));for(var i="",a=0;!(a>=t/2);++a){var s=B[e+2*a>>1];if(0==s)break;i+=String.fromCharCode(s)}return i},Ut=(e,t,r)=>{if(void 0===r&&(r=2147483647),r<2)return 0;for(var n=t,o=(r-=2)<2*e.length?r/2:e.length,i=0;i<o;++i){var a=e.charCodeAt(i);B[t>>1]=a,t+=2}return B[t>>1]=0,t-n},$t=e=>2*e.length,jt=(e,t)=>{for(var r=0,n="";!(r>=t/4);){var o=R[e+4*r>>2];if(0==o)break;if(++r,o>=65536){var i=o-65536;n+=String.fromCharCode(55296|i>>10,56320|1023&i)}else n+=String.fromCharCode(o)}return n},qt=(e,t,r)=>{if(void 0===r&&(r=2147483647),r<4)return 0;for(var n=t,o=n+r-4,i=0;i<e.length;++i){var a=e.charCodeAt(i);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++i)),R[t>>2]=a,(t+=4)+4>o)break}return R[t>>2]=0,t-n},Nt=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&++r,t+=4}return t};function Ht(e,t){for(var r=new Array(e),n=0;n<e;++n)r[n]=Lt(M[t+4*n>>2],"parameter "+n);return r}var Vt={};function Wt(e){var t=Vt[e];return void 0===t?He(e):t}var Gt=[];function zt(){return"object"==typeof globalThis?globalThis:Function("return this")()}var Yt=[],Xt={};function Kt(e){return e<-9007199254740992||e>9007199254740992?NaN:Number(e)}var Qt,Zt=e=>e%4==0&&(e%100!=0||e%400==0),Jt=[0,31,60,91,121,152,182,213,244,274,305,335],er=[0,31,59,90,120,151,181,212,243,273,304,334],tr=e=>(Zt(e.getFullYear())?Jt:er)[e.getMonth()]+e.getDate()-1,rr=e=>{var t=we(e)+1,r=zn(t);return r&&Mt(e,r,t),r};function nr(e,t){if(ur.mainLoop.timingMode=e,ur.mainLoop.timingValue=t,!ur.mainLoop.func)return 1;if(ur.mainLoop.running||(ur.mainLoop.running=!0),0==e)ur.mainLoop.scheduler=function(){var e=0|Math.max(0,ur.mainLoop.tickStartTime+t-Qt());setTimeout(ur.mainLoop.runner,e)},ur.mainLoop.method="timeout";else if(1==e)ur.mainLoop.scheduler=function(){ur.requestAnimationFrame(ur.mainLoop.runner)},ur.mainLoop.method="rAF";else if(2==e){if("undefined"==typeof setImmediate){var r=[],n="setimmediate";addEventListener("message",(e=>{e.data!==n&&e.data.target!==n||(e.stopPropagation(),r.shift()())}),!0),setImmediate=function(e){r.push(e),v?(void 0===s.setImmediates&&(s.setImmediates=[]),s.setImmediates.push(e),postMessage({target:n})):postMessage(n,"*")}}ur.mainLoop.scheduler=function(){setImmediate(ur.mainLoop.runner)},ur.mainLoop.method="immediate"}return 0}Qt=()=>performance.now();var or=e=>{if(e instanceof ue||"unwind"==e)return F;g(1,e)},ir=(e,t)=>{var r;F=e,F=r=e,Y()||(s.onExit&&s.onExit(r),q=!0),g(r,new ue(r))},ar=e=>{if(!q)try{e(),(()=>{if(!Y())try{ir(F)}catch(e){or(e)}})()}catch(e){or(e)}},sr=(e,t)=>setTimeout((()=>{ar(e)}),t),ur={mainLoop:{running:!1,scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function(){ur.mainLoop.scheduler=null,ur.mainLoop.currentlyRunningMainloop++},resume:function(){ur.mainLoop.currentlyRunningMainloop++;var e=ur.mainLoop.timingMode,t=ur.mainLoop.timingValue,r=ur.mainLoop.func;ur.mainLoop.func=null,function(e,t,r,n,o){N(!ur.mainLoop.func,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),ur.mainLoop.func=e,ur.mainLoop.arg=n;var i=ur.mainLoop.currentlyRunningMainloop;function a(){return!(i<ur.mainLoop.currentlyRunningMainloop)}ur.mainLoop.running=!1,ur.mainLoop.runner=function(){if(!q)if(ur.mainLoop.queue.length>0){var t=Date.now(),r=ur.mainLoop.queue.shift();if(r.func(r.arg),ur.mainLoop.remainingBlockers){var n=ur.mainLoop.remainingBlockers,o=n%1==0?n-1:Math.floor(n);r.counted?ur.mainLoop.remainingBlockers=o:(o+=.5,ur.mainLoop.remainingBlockers=(8*n+o)/9)}if(S('main loop blocker "'+r.name+'" took '+(Date.now()-t)+" ms"),ur.mainLoop.updateStatus(),!a())return;setTimeout(ur.mainLoop.runner,0)}else a()&&(ur.mainLoop.currentFrameNumber=ur.mainLoop.currentFrameNumber+1|0,1==ur.mainLoop.timingMode&&ur.mainLoop.timingValue>1&&ur.mainLoop.currentFrameNumber%ur.mainLoop.timingValue!=0?ur.mainLoop.scheduler():(0==ur.mainLoop.timingMode&&(ur.mainLoop.tickStartTime=Qt()),ur.mainLoop.runIter(e),a()&&("object"==typeof SDL&&SDL.audio&&SDL.audio.queueNewAudioData&&SDL.audio.queueNewAudioData(),ur.mainLoop.scheduler())))}}(r,0,0,ur.mainLoop.arg),nr(e,t),ur.mainLoop.scheduler()},updateStatus:function(){if(s.setStatus){var e=s.statusMessage||"Please wait...",t=ur.mainLoop.remainingBlockers,r=ur.mainLoop.expectedBlockers;t?t<r?s.setStatus(e+" ("+(r-t)+"/"+r+")"):s.setStatus(e):s.setStatus("")}},runIter:function(e){if(!q){if(s.preMainLoop&&!1===s.preMainLoop())return;ar(e),s.postMainLoop&&s.postMainLoop()}}},isFullscreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init:function(){if(!ur.initted){ur.initted=!0;var e={canHandle:function(e){return!s.noImageDecoding&&/\.(jpg|jpeg|png|bmp)$/i.test(e)},handle:function(e,t,r,n){var o=new Blob([e],{type:ur.getMimetype(t)});o.size!==e.length&&(o=new Blob([new Uint8Array(e).buffer],{type:ur.getMimetype(t)}));var i=URL.createObjectURL(o),a=new Image;a.onload=()=>{N(a.complete,"Image "+t+" could not be decoded");var n=document.createElement("canvas");n.width=a.width,n.height=a.height,n.getContext("2d").drawImage(a,0,0),jn[t]=n,URL.revokeObjectURL(i),r&&r(e)},a.onerror=e=>{S("Image "+i+" could not be decoded"),n&&n()},a.src=i}};xe.push(e);var t={canHandle:function(e){return!s.noAudioDecoding&&e.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},handle:function(e,t,r,n){var o=!1;function i(n){o||(o=!0,qn[t]=n,r&&r(e))}var a=new Blob([e],{type:ur.getMimetype(t)}),s=URL.createObjectURL(a),u=new Audio;u.addEventListener("canplaythrough",(()=>i(u)),!1),u.onerror=function(r){o||(k("warning: browser could not fully decode audio "+t+", trying slower base64 approach"),u.src="data:audio/x-"+t.substr(-3)+";base64,"+function(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r="",n=0,o=0,i=0;i<e.length;i++)for(n=n<<8|e[i],o+=8;o>=6;){var a=n>>o-6&63;o-=6,r+=t[a]}return 2==o?(r+=t[(3&n)<<4],r+="=="):4==o&&(r+=t[(15&n)<<2],r+="="),r}(e),i(u))},u.src=s,sr((()=>{i(u)}),1e4)}};xe.push(t);var r=s.canvas;r&&(r.requestPointerLock=r.requestPointerLock||r.mozRequestPointerLock||r.webkitRequestPointerLock||r.msRequestPointerLock||(()=>{}),r.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||(()=>{}),r.exitPointerLock=r.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",n,!1),document.addEventListener("mozpointerlockchange",n,!1),document.addEventListener("webkitpointerlockchange",n,!1),document.addEventListener("mspointerlockchange",n,!1),s.elementPointerLock&&r.addEventListener("click",(e=>{!ur.pointerLock&&s.canvas.requestPointerLock&&(s.canvas.requestPointerLock(),e.preventDefault())}),!1))}function n(){ur.pointerLock=document.pointerLockElement===s.canvas||document.mozPointerLockElement===s.canvas||document.webkitPointerLockElement===s.canvas||document.msPointerLockElement===s.canvas}},createContext:function(e,t,r,n){if(t&&s.ctx&&e==s.canvas)return s.ctx;var o,i;if(t){var a={antialias:!1,alpha:!1,majorVersion:"undefined"!=typeof WebGL2RenderingContext?2:1};if(n)for(var u in n)a[u]=n[u];void 0!==gr&&(i=gr.createContext(e,a))&&(o=gr.getContext(i).GLctx)}else o=e.getContext("2d");return o?(r&&(t||N(void 0===$n,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),s.ctx=o,t&&gr.makeContextCurrent(i),s.useWebGL=t,ur.moduleContextCreatedCallbacks.forEach((e=>e())),ur.init()),o):null},destroyContext:function(e,t,r){},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen:function(e,t){ur.lockPointer=e,ur.resizeCanvas=t,void 0===ur.lockPointer&&(ur.lockPointer=!0),void 0===ur.resizeCanvas&&(ur.resizeCanvas=!1);var r=s.canvas;function n(){ur.isFullscreen=!1;var e=r.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e?(r.exitFullscreen=ur.exitFullscreen,ur.lockPointer&&r.requestPointerLock(),ur.isFullscreen=!0,ur.resizeCanvas?ur.setFullscreenCanvasSize():ur.updateCanvasDimensions(r)):(e.parentNode.insertBefore(r,e),e.parentNode.removeChild(e),ur.resizeCanvas?ur.setWindowedCanvasSize():ur.updateCanvasDimensions(r)),s.onFullScreen&&s.onFullScreen(ur.isFullscreen),s.onFullscreen&&s.onFullscreen(ur.isFullscreen)}ur.fullscreenHandlersInstalled||(ur.fullscreenHandlersInstalled=!0,document.addEventListener("fullscreenchange",n,!1),document.addEventListener("mozfullscreenchange",n,!1),document.addEventListener("webkitfullscreenchange",n,!1),document.addEventListener("MSFullscreenChange",n,!1));var o=document.createElement("div");r.parentNode.insertBefore(o,r),o.appendChild(r),o.requestFullscreen=o.requestFullscreen||o.mozRequestFullScreen||o.msRequestFullscreen||(o.webkitRequestFullscreen?()=>o.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):null)||(o.webkitRequestFullScreen?()=>o.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT):null),o.requestFullscreen()},exitFullscreen:function(){return!!ur.isFullscreen&&((document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||(()=>{})).apply(document,[]),!0)},nextRAF:0,fakeRequestAnimationFrame:function(e){var t=Date.now();if(0===ur.nextRAF)ur.nextRAF=t+1e3/60;else for(;t+2>=ur.nextRAF;)ur.nextRAF+=1e3/60;var r=Math.max(ur.nextRAF-t,0);setTimeout(e,r)},requestAnimationFrame:function(e){"function"!=typeof requestAnimationFrame?(0,ur.fakeRequestAnimationFrame)(e):requestAnimationFrame(e)},safeSetTimeout:function(e,t){return sr(e,t)},safeRequestAnimationFrame:function(e){return ur.requestAnimationFrame((()=>{ar(e)}))},getMimetype:function(e){return{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:function(e){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(e)},getMovementX:function(e){return e.movementX||e.mozMovementX||e.webkitMovementX||0},getMovementY:function(e){return e.movementY||e.mozMovementY||e.webkitMovementY||0},getMouseWheelDelta:function(e){var t=0;switch(e.type){case"DOMMouseScroll":t=e.detail/3;break;case"mousewheel":t=e.wheelDelta/120;break;case"wheel":switch(t=e.deltaY,e.deltaMode){case 0:t/=100;break;case 1:t/=3;break;case 2:t*=80;break;default:throw"unrecognized mouse wheel delta mode: "+e.deltaMode}break;default:throw"unrecognized mouse wheel event: "+e.type}return t},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent:function(e){if(ur.pointerLock)"mousemove"!=e.type&&"mozMovementX"in e?ur.mouseMovementX=ur.mouseMovementY=0:(ur.mouseMovementX=ur.getMovementX(e),ur.mouseMovementY=ur.getMovementY(e)),"undefined"!=typeof SDL?(ur.mouseX=SDL.mouseX+ur.mouseMovementX,ur.mouseY=SDL.mouseY+ur.mouseMovementY):(ur.mouseX+=ur.mouseMovementX,ur.mouseY+=ur.mouseMovementY);else{var t=s.canvas.getBoundingClientRect(),r=s.canvas.width,n=s.canvas.height,o=void 0!==window.scrollX?window.scrollX:window.pageXOffset,i=void 0!==window.scrollY?window.scrollY:window.pageYOffset;if("touchstart"===e.type||"touchend"===e.type||"touchmove"===e.type){var a=e.touch;if(void 0===a)return;var u=a.pageX-(o+t.left),l=a.pageY-(i+t.top),c={x:u*=r/t.width,y:l*=n/t.height};if("touchstart"===e.type)ur.lastTouches[a.identifier]=c,ur.touches[a.identifier]=c;else if("touchend"===e.type||"touchmove"===e.type){var d=ur.touches[a.identifier];d||(d=c),ur.lastTouches[a.identifier]=d,ur.touches[a.identifier]=c}return}var f=e.pageX-(o+t.left),p=e.pageY-(i+t.top);f*=r/t.width,p*=n/t.height,ur.mouseMovementX=f-ur.mouseX,ur.mouseMovementY=p-ur.mouseY,ur.mouseX=f,ur.mouseY=p}},resizeListeners:[],updateResizeListeners:function(){var e=s.canvas;ur.resizeListeners.forEach((t=>t(e.width,e.height)))},setCanvasSize:function(e,t,r){var n=s.canvas;ur.updateCanvasDimensions(n,e,t),r||ur.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize:function(){if("undefined"!=typeof SDL){var e=M[SDL.screen>>2];e|=8388608,R[SDL.screen>>2]=e}ur.updateCanvasDimensions(s.canvas),ur.updateResizeListeners()},setWindowedCanvasSize:function(){if("undefined"!=typeof SDL){var e=M[SDL.screen>>2];e&=-8388609,R[SDL.screen>>2]=e}ur.updateCanvasDimensions(s.canvas),ur.updateResizeListeners()},updateCanvasDimensions:function(e,t,r){t&&r?(e.widthNative=t,e.heightNative=r):(t=e.widthNative,r=e.heightNative);var n=t,o=r;if(s.forcedAspectRatio&&s.forcedAspectRatio>0&&(n/o<s.forcedAspectRatio?n=Math.round(o*s.forcedAspectRatio):o=Math.round(n/s.forcedAspectRatio)),(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e.parentNode&&"undefined"!=typeof screen){var i=Math.min(screen.width/n,screen.height/o);n=Math.round(n*i),o=Math.round(o*i)}ur.resizeCanvas?(e.width!=n&&(e.width=n),e.height!=o&&(e.height=o),void 0!==e.style&&(e.style.removeProperty("width"),e.style.removeProperty("height"))):(e.width!=t&&(e.width=t),e.height!=r&&(e.height=r),void 0!==e.style&&(n!=t||o!=r?(e.style.setProperty("width",n+"px","important"),e.style.setProperty("height",o+"px","important")):(e.style.removeProperty("width"),e.style.removeProperty("height"))))}},lr={errorCode:12288,defaultDisplayInitialized:!1,currentContext:0,currentReadSurface:0,currentDrawSurface:0,contextAttributes:{alpha:!1,depth:!1,stencil:!1,antialias:!1},stringCache:{},setErrorCode:function(e){lr.errorCode=e},chooseConfig:function(e,t,r,n,o){if(62e3!=e)return lr.setErrorCode(12296),0;if(t)for(;;){var i=R[t>>2];if(12321==i){var a=R[t+4>>2];lr.contextAttributes.alpha=a>0}else if(12325==i){var s=R[t+4>>2];lr.contextAttributes.depth=s>0}else if(12326==i){var u=R[t+4>>2];lr.contextAttributes.stencil=u>0}else if(12337==i){var l=R[t+4>>2];lr.contextAttributes.antialias=l>0}else if(12338==i)l=R[t+4>>2],lr.contextAttributes.antialias=1==l;else if(12544==i){var c=R[t+4>>2];lr.contextAttributes.lowLatency=12547!=c}else if(12344==i)break;t+=8}return r&&n||o?(o&&(R[o>>2]=1),r&&n>0&&(R[r>>2]=62002),lr.setErrorCode(12288),1):(lr.setErrorCode(12300),0)}};function cr(e){var t=e.getExtension("ANGLE_instanced_arrays");if(t)return e.vertexAttribDivisor=function(e,r){t.vertexAttribDivisorANGLE(e,r)},e.drawArraysInstanced=function(e,r,n,o){t.drawArraysInstancedANGLE(e,r,n,o)},e.drawElementsInstanced=function(e,r,n,o,i){t.drawElementsInstancedANGLE(e,r,n,o,i)},1}function dr(e){var t=e.getExtension("OES_vertex_array_object");if(t)return e.createVertexArray=function(){return t.createVertexArrayOES()},e.deleteVertexArray=function(e){t.deleteVertexArrayOES(e)},e.bindVertexArray=function(e){t.bindVertexArrayOES(e)},e.isVertexArray=function(e){return t.isVertexArrayOES(e)},1}function fr(e){var t=e.getExtension("WEBGL_draw_buffers");if(t)return e.drawBuffers=function(e,r){t.drawBuffersWEBGL(e,r)},1}function pr(e){return!!(e.dibvbi=e.getExtension("WEBGL_draw_instanced_base_vertex_base_instance"))}function hr(e){return!!(e.mdibvbi=e.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance"))}function mr(e){return!!(e.multiDrawWebgl=e.getExtension("WEBGL_multi_draw"))}var gr={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:[],offscreenCanvases:{},queries:[],samplers:[],transformFeedbacks:[],syncs:[],stringCache:{},stringiCache:{},unpackAlignment:4,recordError:function(e){gr.lastError||(gr.lastError=e)},getNewId:function(e){for(var t=gr.counter++,r=e.length;r<t;r++)e[r]=null;return t},getSource:function(e,t,r,n){for(var o="",i=0;i<t;++i){var a=n?R[n+4*i>>2]:-1;o+=Fe(R[r+4*i>>2],a<0?void 0:a)}return o},createContext:function(e,t){e.getContextSafariWebGL2Fixed||(e.getContextSafariWebGL2Fixed=e.getContext,e.getContext=function(t,r){var n=e.getContextSafariWebGL2Fixed(t,r);return"webgl"==t==n instanceof WebGLRenderingContext?n:null});var r=t.majorVersion>1?e.getContext("webgl2",t):e.getContext("webgl",t);return r?gr.registerContext(r,t):0},registerContext:function(e,t){var r=gr.getNewId(gr.contexts),n={handle:r,attributes:t,version:t.majorVersion,GLctx:e};return e.canvas&&(e.canvas.GLctxObject=n),gr.contexts[r]=n,(void 0===t.enableExtensionsByDefault||t.enableExtensionsByDefault)&&gr.initExtensions(n),r},makeContextCurrent:function(e){return gr.currentContext=gr.contexts[e],s.ctx=$n=gr.currentContext&&gr.currentContext.GLctx,!(e&&!$n)},getContext:function(e){return gr.contexts[e]},deleteContext:function(e){gr.currentContext===gr.contexts[e]&&(gr.currentContext=null),"object"==typeof Pn&&Pn.removeAllHandlersOnTarget(gr.contexts[e].GLctx.canvas),gr.contexts[e]&&gr.contexts[e].GLctx.canvas&&(gr.contexts[e].GLctx.canvas.GLctxObject=void 0),gr.contexts[e]=null},initExtensions:function(e){if(e||(e=gr.currentContext),!e.initExtensionsDone){e.initExtensionsDone=!0;var t=e.GLctx;cr(t),dr(t),fr(t),pr(t),hr(t),e.version>=2&&(t.disjointTimerQueryExt=t.getExtension("EXT_disjoint_timer_query_webgl2")),(e.version<2||!t.disjointTimerQueryExt)&&(t.disjointTimerQueryExt=t.getExtension("EXT_disjoint_timer_query")),mr(t),(t.getSupportedExtensions()||[]).forEach((function(e){e.includes("lose_context")||e.includes("debug")||t.getExtension(e)}))}}},yr=[];function vr(e){$n.bindVertexArray(gr.vaos[e])}var br=vr,wr=vr;function Er(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2];$n.deleteVertexArray(gr.vaos[n]),gr.vaos[n]=null}}var _r=Er,Cr=Er;function Sr(e,t,r,n){$n.drawArraysInstanced(e,t,r,n)}var kr=Sr,xr=Sr,Pr=Sr,Tr=Sr,Fr=Sr,Ar=[];function Dr(e,t){for(var r=Ar[e],n=0;n<e;n++)r[n]=R[t+4*n>>2];$n.drawBuffers(r)}var Br=Dr,Lr=Dr,Rr=Dr;function Mr(e,t,r,n){$n.drawElements(e,t,r,n)}var Or=Mr;function Ir(e,t,r,n,o){$n.drawElementsInstanced(e,t,r,n,o)}var Ur=Ir,$r=Ir,jr=Ir,qr=Ir,Nr=Ir;function Hr(e,t,r,n){for(var o=0;o<e;o++){var i=$n[r](),a=i&&gr.getNewId(n);i?(i.name=a,n[a]=i):gr.recordError(1282),R[t+4*o>>2]=a}}function Vr(e,t){Hr(e,t,"createVertexArray",gr.vaos)}var Wr=Vr,Gr=Vr;function zr(e,t,r,n,o,i,a,s){t=gr.programs[t];var u=$n[e](t,r);if(u){var l=s&&Mt(u.name,s,n);o&&(R[o>>2]=l),i&&(R[i>>2]=u.size),a&&(R[a>>2]=u.type)}}function Yr(e,t){M[e>>2]=t,M[e+4>>2]=(t-M[e>>2])/4294967296}function Xr(e,t,r){if(t){var n=void 0;switch(e){case 36346:n=1;break;case 36344:return void(0!=r&&1!=r&&gr.recordError(1280));case 34814:case 36345:n=0;break;case 34466:var o=$n.getParameter(34467);n=o?o.length:0;break;case 33309:if(gr.currentContext.version<2)return void gr.recordError(1282);n=2*($n.getSupportedExtensions()||[]).length;break;case 33307:case 33308:if(gr.currentContext.version<2)return void gr.recordError(1280);n=33307==e?3:0}if(void 0===n){var i=$n.getParameter(e);switch(typeof i){case"number":n=i;break;case"boolean":n=i?1:0;break;case"string":return void gr.recordError(1280);case"object":if(null===i)switch(e){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 36662:case 36663:case 35053:case 35055:case 36010:case 35097:case 35869:case 32874:case 36389:case 35983:case 35368:case 34068:n=0;break;default:return void gr.recordError(1280)}else{if(i instanceof Float32Array||i instanceof Uint32Array||i instanceof Int32Array||i instanceof Array){for(var a=0;a<i.length;++a)switch(r){case 0:R[t+4*a>>2]=i[a];break;case 2:O[t+4*a>>2]=i[a];break;case 4:A[t+a>>0]=i[a]?1:0}return}try{n=0|i.name}catch(t){return gr.recordError(1280),void k("GL_INVALID_ENUM in glGet"+r+"v: Unknown object returned from WebGL getParameter("+e+")! (error: "+t+")")}}break;default:return gr.recordError(1280),void k("GL_INVALID_ENUM in glGet"+r+"v: Native code calling glGet"+r+"v("+e+") and it returns "+i+" of type "+typeof i+"!")}}switch(r){case 1:Yr(t,n);break;case 0:R[t>>2]=n;break;case 2:O[t>>2]=n;break;case 4:A[t>>0]=n?1:0}}else gr.recordError(1281)}function Kr(e,t,r,n){if(r){var o,i=$n.getIndexedParameter(e,t);switch(typeof i){case"boolean":o=i?1:0;break;case"number":o=i;break;case"object":if(null===i)switch(e){case 35983:case 35368:o=0;break;default:return void gr.recordError(1280)}else{if(!(i instanceof WebGLBuffer))return void gr.recordError(1280);o=0|i.name}break;default:return void gr.recordError(1280)}switch(n){case 1:Yr(r,o);break;case 0:R[r>>2]=o;break;case 2:O[r>>2]=o;break;case 4:A[r>>0]=o?1:0;break;default:throw"internal emscriptenWebGLGetIndexed() error, bad type: "+n}}else gr.recordError(1281)}function Qr(e,t,r){if(r){var n,o=gr.queries[e];Yr(r,"boolean"==typeof(n=gr.currentContext.version<2?$n.disjointTimerQueryExt.getQueryObjectEXT(o,t):$n.getQueryParameter(o,t))?n?1:0:n)}else gr.recordError(1281)}var Zr=Qr;function Jr(e,t,r){if(r){var n,o=gr.queries[e],i=$n.disjointTimerQueryExt.getQueryObjectEXT(o,t);n="boolean"==typeof i?i?1:0:i,R[r>>2]=n}else gr.recordError(1281)}var en=Jr,tn=Qr,rn=Jr;function nn(e){return"]"==e.slice(-1)&&e.lastIndexOf("[")}function on(e){var t,r,n=e.uniformLocsById,o=e.uniformSizeAndIdsByName;if(!n)for(e.uniformLocsById=n={},e.uniformArrayNamesById={},t=0;t<$n.getProgramParameter(e,35718);++t){var i=$n.getActiveUniform(e,t),a=i.name,s=i.size,u=nn(a),l=u>0?a.slice(0,u):a,c=e.uniformIdCounter;for(e.uniformIdCounter+=s,o[l]=[s,c],r=0;r<s;++r)n[c]=r,e.uniformArrayNamesById[c++]=l}}function an(e){var t=$n.currentProgram;if(t){var r=t.uniformLocsById[e];return"number"==typeof r&&(t.uniformLocsById[e]=r=$n.getUniformLocation(t,t.uniformArrayNamesById[e]+(r>0?"["+r+"]":""))),r}gr.recordError(1282)}function sn(e,t,r,n){if(r){on(e=gr.programs[e]);var o=$n.getUniform(e,an(t));if("number"==typeof o||"boolean"==typeof o)switch(n){case 0:R[r>>2]=o;break;case 2:O[r>>2]=o}else for(var i=0;i<o.length;i++)switch(n){case 0:R[r+4*i>>2]=o[i];break;case 2:O[r+4*i>>2]=o[i]}}else gr.recordError(1281)}function un(e,t,r,n){if(r){var o=$n.getVertexAttrib(e,t);if(34975==t)R[r>>2]=o&&o.name;else if("number"==typeof o||"boolean"==typeof o)switch(n){case 0:R[r>>2]=o;break;case 2:O[r>>2]=o;break;case 5:R[r>>2]=Math.fround(o)}else for(var i=0;i<o.length;i++)switch(n){case 0:R[r+4*i>>2]=o[i];break;case 2:O[r+4*i>>2]=o[i];break;case 5:R[r+4*i>>2]=Math.fround(o[i])}}else gr.recordError(1281)}function ln(e,t,r){un(e,t,r,0)}var cn=ln,dn=ln;function fn(e){var t=gr.vaos[e];return t?$n.isVertexArray(t):0}var pn=fn,hn=fn;function mn(e){return 0==(e-=5120)?A:1==e?D:2==e?B:4==e?R:6==e?O:5==e||28922==e||28520==e||30779==e||30782==e?M:L}function gn(e){return 31-Math.clz32(e.BYTES_PER_ELEMENT)}function yn(e,t,r,n,o,i){var a=mn(e),s=gn(a),u=1<<s,l=function(e){return{5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4}[e-6402]||1}(t)*u,c=function(e,t,r,n){var o;return t*(e*r+(o=n)-1&-o)}(r,n,l,gr.unpackAlignment);return a.subarray(o>>s,o+c>>s)}var vn=[],bn=[];function wn(e,t){$n.vertexAttribDivisor(e,t)}var En=wn,_n=wn,Cn=wn,Sn=wn,kn=wn,xn=e=>{var t=e-x.buffer.byteLength+65535>>>16;try{return x.grow(t),H(),1}catch(e){}},Pn={inEventHandler:0,removeAllEventListeners:function(){for(var e=Pn.eventHandlers.length-1;e>=0;--e)Pn._removeHandler(e);Pn.eventHandlers=[],Pn.deferredCalls=[]},registerRemoveEventListeners:function(){Pn.removeEventListenersRegistered||(G.push(Pn.removeAllEventListeners),Pn.removeEventListenersRegistered=!0)},deferredCalls:[],deferCall:function(e,t,r){function n(e,t){if(e.length!=t.length)return!1;for(var r in e)if(e[r]!=t[r])return!1;return!0}for(var o in Pn.deferredCalls){var i=Pn.deferredCalls[o];if(i.targetFunction==e&&n(i.argsList,r))return}Pn.deferredCalls.push({targetFunction:e,precedence:t,argsList:r}),Pn.deferredCalls.sort((function(e,t){return e.precedence<t.precedence}))},removeDeferredCalls:function(e){for(var t=0;t<Pn.deferredCalls.length;++t)Pn.deferredCalls[t].targetFunction==e&&(Pn.deferredCalls.splice(t,1),--t)},canPerformEventHandlerRequests:function(){return navigator.userActivation?navigator.userActivation.isActive:Pn.inEventHandler&&Pn.currentEventHandler.allowsDeferredCalls},runDeferredCalls:function(){if(Pn.canPerformEventHandlerRequests())for(var e=0;e<Pn.deferredCalls.length;++e){var t=Pn.deferredCalls[e];Pn.deferredCalls.splice(e,1),--e,t.targetFunction.apply(null,t.argsList)}},eventHandlers:[],removeAllHandlersOnTarget:function(e,t){for(var r=0;r<Pn.eventHandlers.length;++r)Pn.eventHandlers[r].target!=e||t&&t!=Pn.eventHandlers[r].eventTypeString||Pn._removeHandler(r--)},_removeHandler:function(e){var t=Pn.eventHandlers[e];t.target.removeEventListener(t.eventTypeString,t.eventListenerFunc,t.useCapture),Pn.eventHandlers.splice(e,1)},registerOrRemoveHandler:function(e){if(!e.target)return-4;var t=function(t){++Pn.inEventHandler,Pn.currentEventHandler=e,Pn.runDeferredCalls(),e.handlerFunc(t),Pn.runDeferredCalls(),--Pn.inEventHandler};if(e.callbackfunc)e.eventListenerFunc=t,e.target.addEventListener(e.eventTypeString,t,e.useCapture),Pn.eventHandlers.push(e),Pn.registerRemoveEventListeners();else for(var r=0;r<Pn.eventHandlers.length;++r)Pn.eventHandlers[r].target==e.target&&Pn.eventHandlers[r].eventTypeString==e.eventTypeString&&Pn._removeHandler(r--);return 0},getNodeNameForTarget:function(e){return e?e==window?"#window":e==screen?"#screen":e&&e.nodeName?e.nodeName:"":""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}},Tn=["default","low-power","high-performance"],Fn=[0,"undefined"!=typeof document?document:0,"undefined"!=typeof window?window:0];var An,Dn,Bn={},Ln=()=>{if(!Ln.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",_:m||"./this.program"};for(var t in Bn)void 0===Bn[t]?delete e[t]:e[t]=Bn[t];var r=[];for(var t in e)r.push(`${t}=${e[t]}`);Ln.strings=r}return Ln.strings},Rn=(e,t,r,n)=>{for(var o=0,i=0;i<r;i++){var a=M[t>>2],s=M[t+4>>2];t+=8;var u=Te.read(e,A,a,s,n);if(u<0)return-1;if(o+=u,u<s)break;void 0!==n&&(n+=u)}return o},Mn=[31,29,31,30,31,30,31,31,30,31,30,31],On=[31,28,31,30,31,30,31,31,30,31,30,31],In=(e,t)=>{A.set(e,t)},Un=function(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=Te.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n};Object.defineProperties(Un.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return Te.isDir(this.mode)}},isDevice:{get:function(){return Te.isChrdev(this.mode)}}}),Te.FSNode=Un,Te.createPreloadedFile=function(e,t,r,n,o,i,a,s,u,l){var c=t?ge.resolve(he.join2(e,t)):e;function d(r){function d(r){l&&l(),s||Te.createDataFile(e,t,r,n,o,u),i&&i(),te()}(function(e,t,r,n){void 0!==ur&&ur.init();var o=!1;return xe.forEach((function(i){o||i.canHandle(t)&&(i.handle(e,t,r,n),o=!0)})),o})(r,c,d,(()=>{a&&a(),te()}))||d(r)}ee(),"string"==typeof r?((e,t,r,n)=>{var o=`al ${e}`;f(e,(t=>{N(t,`Loading data file "${e}" failed (no arrayBuffer).`),d(new Uint8Array(t)),o&&te()}),(t=>{if(!r)throw`Loading data file "${e}" failed.`;r()})),o&&ee()})(r,0,a):d(r)},Te.staticInit(),s.FS_createPath=Te.createPath,s.FS_createDataFile=Te.createDataFile,s.FS_createPreloadedFile=Te.createPreloadedFile,s.FS_unlink=Te.unlink,s.FS_createLazyFile=Te.createLazyFile,s.FS_createDevice=Te.createDevice,Ie=s.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},function(){for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);Ne=e}(),Ve=s.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},st.prototype.isAliasOf=function(e){if(!(this instanceof st))return!1;if(!(e instanceof st))return!1;for(var t=this.$$.ptrType.registeredClass,r=this.$$.ptr,n=e.$$.ptrType.registeredClass,o=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return t===n&&r===o},st.prototype.clone=function(){if(this.$$.ptr||Xe(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,t=at(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 t.$$.count.value+=1,t.$$.deleteScheduled=!1,t},st.prototype.delete=function(){this.$$.ptr||Xe(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&We("Object already scheduled for deletion"),Qe(this),Ze(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},st.prototype.isDeleted=function(){return!this.$$.ptr},st.prototype.deleteLater=function(){return this.$$.ptr||Xe(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&We("Object already scheduled for deletion"),tt.push(this),1===tt.length&&nt&&nt(rt),this.$$.deleteScheduled=!0,this},s.getInheritedInstanceCount=function(){return Object.keys(ot).length},s.getLiveInheritedInstances=function(){var e=[];for(var t in ot)ot.hasOwnProperty(t)&&e.push(ot[t]);return e},s.flushPendingDeletes=rt,s.setDelayFunction=function(e){nt=e,tt.length&&nt&&nt(rt)},yt.prototype.getPointee=function(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},yt.prototype.destructor=function(e){this.rawDestructor&&this.rawDestructor(e)},yt.prototype.argPackAdvance=8,yt.prototype.readValueFromPointer=Le,yt.prototype.deleteObject=function(e){null!==e&&e.delete()},yt.prototype.fromWireType=function(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=function(e,t){return t=function(e,t){for(void 0===t&&We("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t}(e,t),ot[t]}(this.registeredClass,t);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var n=r.clone();return this.destructor(e),n}function o(){return this.isSmartPointer?it(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):it(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var i,a=this.registeredClass.getActualType(t),s=et[a];if(!s)return o.call(this);i=this.isConst?s.constPointerType:s.pointerType;var u=Je(t,this.registeredClass,i.registeredClass);return null===u?o.call(this):this.isSmartPointer?it(i.registeredClass.instancePrototype,{ptrType:i,ptr:u,smartPtrType:this,smartPtr:e}):it(i.registeredClass.instancePrototype,{ptrType:i,ptr:u})},_t=s.UnboundTypeError=(An=Error,(Dn=lt("UnboundTypeError",(function(e){this.name="UnboundTypeError",this.message=e;var t=new Error(e).stack;void 0!==t&&(this.stack=this.toString()+"\n"+t.replace(/^Error(:[^\n]*)?\n/,""))}))).prototype=Object.create(An.prototype),Dn.prototype.constructor=Dn,Dn.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},Dn),Object.assign(Tt.prototype,{get(e){return this.allocated[e]},has(e){return void 0!==this.allocated[e]},allocate(e){var t=this.freelist.pop()||this.allocated.length;return this.allocated[t]=e,t},free(e){this.allocated[e]=void 0,this.freelist.push(e)}}),Ft.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),Ft.reserved=Ft.allocated.length,s.count_emval_handles=function(){for(var e=0,t=Ft.reserved;t<Ft.allocated.length;++t)void 0!==Ft.allocated[t]&&++e;return e},s.requestFullscreen=function(e,t){ur.requestFullscreen(e,t)},s.requestAnimationFrame=function(e){ur.requestAnimationFrame(e)},s.setCanvasSize=function(e,t,r){ur.setCanvasSize(e,t,r)},s.pauseMainLoop=function(){ur.mainLoop.pause()},s.resumeMainLoop=function(){ur.mainLoop.resume()},s.getUserMedia=function(){ur.getUserMedia()},s.createContext=function(e,t,r,n){return ur.createContext(e,t,r,n)};for(var $n,jn={},qn={},Nn=0;Nn<32;++Nn)Ar.push(new Array(Nn));var Hn=new Float32Array(288);for(Nn=0;Nn<288;++Nn)vn[Nn]=Hn.subarray(0,Nn+1);var Vn=new Int32Array(288);for(Nn=0;Nn<288;++Nn)bn[Nn]=Vn.subarray(0,Nn+1);var Wn,Gn={Ga:function(e){var t=new fe(e);return t.get_caught()||t.set_caught(!0),t.set_rethrown(!1),ce.push(t),ao(t.excPtr),t.get_exception_ptr()},Fa:function(){to(0,0);var e=ce.pop();io(e.excPtr),de=0},m:()=>pe([]),Z:e=>pe([e]),h:function(e,t,r){throw new fe(e).init(t,r),de=e},K:function(e){throw de||(de=e),de},ba:function(e,t,r){Ae.varargs=r;try{var n=Ae.getStreamFromFD(e);switch(t){case 0:return(o=Ae.get())<0?-28:Te.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=Ae.get();return n.flags|=o,0;case 5:return o=Ae.get(),B[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return 28,R[Xn()>>2]=28,-1}}catch(e){if(void 0===Te||"ErrnoError"!==e.name)throw e;return-e.errno}},yb:function(e,t){try{var r=Ae.getStreamFromFD(e);return Ae.doStat(Te.stat,r.path,t)}catch(e){if(void 0===Te||"ErrnoError"!==e.name)throw e;return-e.errno}},Cb:function(e,t,r){Ae.varargs=r;try{var n=Ae.getStreamFromFD(e);switch(t){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return n.tty?0:-59;case 21505:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var o=n.tty.ops.ioctl_tcgets(n),i=Ae.get();R[i>>2]=o.c_iflag||0,R[i+4>>2]=o.c_oflag||0,R[i+8>>2]=o.c_cflag||0,R[i+12>>2]=o.c_lflag||0;for(var a=0;a<32;a++)A[i+a+17>>0]=o.c_cc[a]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){i=Ae.get();var s=R[i>>2],u=R[i+4>>2],l=R[i+8>>2],c=R[i+12>>2],d=[];for(a=0;a<32;a++)d.push(A[i+a+17>>0]);return n.tty.ops.ioctl_tcsets(n.tty,t,{c_iflag:s,c_oflag:u,c_cflag:l,c_lflag:c,c_cc:d})}return 0;case 21519:return n.tty?(i=Ae.get(),R[i>>2]=0,0):-59;case 21520:return n.tty?-28:-59;case 21531:return i=Ae.get(),Te.ioctl(n,t,i);case 21523:if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var f=n.tty.ops.ioctl_tiocgwinsz(n.tty);i=Ae.get(),B[i>>1]=f[0],B[i+2>>1]=f[1]}return 0;default:return-28}}catch(e){if(void 0===Te||"ErrnoError"!==e.name)throw e;return-e.errno}},ub:function(e,t){try{return e=Ae.getStr(e),Ae.doStat(Te.lstat,e,t)}catch(e){if(void 0===Te||"ErrnoError"!==e.name)throw e;return-e.errno}},vb:function(e,t,r,n){try{t=Ae.getStr(t);var o=256&n,i=4096&n;return n&=-6401,t=Ae.calculateAt(e,t,i),Ae.doStat(o?Te.lstat:Te.stat,t,r)}catch(e){if(void 0===Te||"ErrnoError"!==e.name)throw e;return-e.errno}},oa:function(e,t,r,n){Ae.varargs=n;try{t=Ae.getStr(t),t=Ae.calculateAt(e,t);var o=n?Ae.get():0;return Te.open(t,r,o).fd}catch(e){if(void 0===Te||"ErrnoError"!==e.name)throw e;return-e.errno}},wb:function(e,t){try{return e=Ae.getStr(e),Ae.doStat(Te.stat,e,t)}catch(e){if(void 0===Te||"ErrnoError"!==e.name)throw e;return-e.errno}},sa:function(e){var t=De[e];delete De[e];var r=t.elements,n=r.length,o=r.map((function(e){return e.getterReturnType})).concat(r.map((function(e){return e.setterArgumentType}))),i=t.rawConstructor,a=t.rawDestructor;$e([e],o,(function(e){return r.forEach(((t,r)=>{var o=e[r],i=t.getter,a=t.getterContext,s=e[r+n],u=t.setter,l=t.setterContext;t.read=e=>o.fromWireType(i(a,e)),t.write=(e,t)=>{var r=[];u(l,e,s.toWireType(r,t)),Be(r)}})),[{name:t.name,fromWireType:function(e){for(var t=new Array(n),o=0;o<n;++o)t[o]=r[o].read(e);return a(e),t},toWireType:function(e,o){if(n!==o.length)throw new TypeError(`Incorrect number of tuple elements for ${t.name}: expected=${n}, actual=${o.length}`);for(var s=i(),u=0;u<n;++u)r[u].write(s,o[u]);return null!==e&&e.push(a,s),s},argPackAdvance:8,readValueFromPointer:Le,destructorFunction:a}]}))},x:function(e){var t=je[e];delete je[e];var r=t.rawConstructor,n=t.rawDestructor,o=t.fields;$e([e],o.map((e=>e.getterReturnType)).concat(o.map((e=>e.setterArgumentType))),(e=>{var i={};return o.forEach(((t,r)=>{var n=t.fieldName,a=e[r],s=t.getter,u=t.getterContext,l=e[r+o.length],c=t.setter,d=t.setterContext;i[n]={read:e=>a.fromWireType(s(u,e)),write:(e,t)=>{var r=[];c(d,e,l.toWireType(r,t)),Be(r)}}})),[{name:t.name,fromWireType:function(e){var t={};for(var r in i)t[r]=i[r].read(e);return n(e),t},toWireType:function(e,t){for(var o in i)if(!(o in t))throw new TypeError(`Missing field: "${o}"`);var a=r();for(o in i)i[o].write(a,t[o]);return null!==e&&e.push(n,a),a},argPackAdvance:8,readValueFromPointer:Le,destructorFunction:n}]}))},wa:function(e,t,r,n,o){t=He(t);var i=Ye(r),a=-1!=t.indexOf("u");a&&(o=(1n<<64n)-1n),Ge(e,{name:t,fromWireType:function(e){return e},toWireType:function(e,r){if("bigint"!=typeof r&&"number"!=typeof r)throw new TypeError(`Cannot convert "${qe(r)}" to ${this.name}`);if(r<n||r>o)throw new TypeError(`Passing a number "${qe(r)}" from JS side to C/C++ side to an argument of type "${t}", which is outside the valid range [${n}, ${o}]!`);return r},argPackAdvance:8,readValueFromPointer:ze(t,i,!a),destructorFunction:null})},ie:function(e,t,r,n,o){var i=Ye(r);Ge(e,{name:t=He(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?n:o},argPackAdvance:8,readValueFromPointer:function(e){var n;if(1===r)n=A;else if(2===r)n=B;else{if(4!==r)throw new TypeError("Unknown boolean type size: "+t);n=R}return this.fromWireType(n[e>>i])},destructorFunction:null})},t:function(e,t,r,n,o,i,a,s,u,l,c,d,f){c=He(c),i=Et(o,i),s&&(s=Et(a,s)),l&&(l=Et(u,l)),f=Et(d,f);var p=ut(c);dt(p,(function(){St(`Cannot construct ${c} due to unbound types`,[n])})),$e([e,t,r],n?[n]:[],(function(t){var r,o;t=t[0],o=n?(r=t.registeredClass).instancePrototype:st.prototype;var a=lt(p,(function(){if(Object.getPrototypeOf(this)!==u)throw new Ve("Use 'new' to construct "+c);if(void 0===d.constructor_body)throw new Ve(c+" has no accessible constructor");var e=d.constructor_body[arguments.length];if(void 0===e)throw new Ve(`Tried to invoke ctor of ${c} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(d.constructor_body).toString()}) parameters instead!`);return e.apply(this,arguments)})),u=Object.create(o,{constructor:{value:a}});a.prototype=u;var d=new ft(c,a,u,f,r,i,s,l);d.baseClass&&(void 0===d.baseClass.__derivedClasses&&(d.baseClass.__derivedClasses=[]),d.baseClass.__derivedClasses.push(d));var h=new yt(c,d,!0,!1,!1),m=new yt(c+"*",d,!1,!1,!1),g=new yt(c+" const*",d,!1,!0,!1);return et[e]={pointerType:m,constPointerType:g},vt(p,a),[h,m,g]}))},v:function(e,t,r,n,o,i){var a=kt(t,r);o=Et(n,o),$e([],[e],(function(e){var r=`constructor ${(e=e[0]).name}`;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[t-1])throw new Ve(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${e.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.registeredClass.constructor_body[t-1]=()=>{St(`Cannot construct ${e.name} due to unbound types`,a)},$e([],a,(function(n){return n.splice(1,0,null),e.registeredClass.constructor_body[t-1]=Pt(r,n,null,o,i),[]})),[]}))},c:function(e,t,r,n,o,i,a,s,u){var l=kt(r,n);t=He(t),i=Et(o,i),$e([],[e],(function(e){var n=`${(e=e[0]).name}.${t}`;function o(){St(`Cannot call ${n} due to unbound types`,l)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(t);var c=e.registeredClass.instancePrototype,d=c[t];return void 0===d||void 0===d.overloadTable&&d.className!==e.name&&d.argCount===r-2?(o.argCount=r-2,o.className=e.name,c[t]=o):(ct(c,t,n),c[t].overloadTable[r-2]=o),$e([],l,(function(o){var s=Pt(n,o,e,i,a,u);return void 0===c[t].overloadTable?(s.argCount=r-2,c[t]=s):c[t].overloadTable[r-2]=s,[]})),[]}))},he:function(e,t){Ge(e,{name:t=He(t),fromWireType:function(e){var t=Dt.toValue(e);return At(e),t},toWireType:function(e,t){return Dt.toHandle(t)},argPackAdvance:8,readValueFromPointer:Le,destructorFunction:null})},T:function(e,t,r,n){var o=Ye(r);function i(){}t=He(t),i.values={},Ge(e,{name:t,constructor:i,fromWireType:function(e){return this.constructor.values[e]},toWireType:function(e,t){return t.value},argPackAdvance:8,readValueFromPointer:Bt(t,o,n),destructorFunction:null}),dt(t,i)},z:function(e,t,r){var n=Lt(e,"enum");t=He(t);var o=n.constructor,i=Object.create(n.constructor.prototype,{value:{value:r},constructor:{value:lt(`${n.name}_${t}`,(function(){}))}});o.values[r]=i,o[t]=i},va:function(e,t,r){var n=Ye(r);Ge(e,{name:t=He(t),fromWireType:function(e){return e},toWireType:function(e,t){return t},argPackAdvance:8,readValueFromPointer:Rt(t,n),destructorFunction:null})},J:function(e,t,r,n,o,i,a){var s=kt(t,r);e=He(e),o=Et(n,o),dt(e,(function(){St(`Cannot call ${e} due to unbound types`,s)}),t-1),$e([],s,(function(r){var n=[r[0],null].concat(r.slice(1));return vt(e,Pt(e,n,null,o,i,a),t-1),[]}))},P:function(e,t,r,n,o){t=He(t),-1===o&&(o=4294967295);var i=Ye(r),a=e=>e;if(0===n){var s=32-8*r;a=e=>e<<s>>>s}var u=t.includes("unsigned");Ge(e,{name:t,fromWireType:a,toWireType:u?function(e,t){return this.name,t>>>0}:function(e,t){return this.name,t},argPackAdvance:8,readValueFromPointer:ze(t,i,0!==n),destructorFunction:null})},B:function(e,t,r){var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][t];function o(e){var t=M,r=t[e>>=2],o=t[e+1];return new n(t.buffer,o,r)}Ge(e,{name:r=He(r),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},Ee:function(e,t,r,n,o,i,a,s,u,l,c,d){r=He(r),i=Et(o,i),s=Et(a,s),l=Et(u,l),d=Et(c,d),$e([e],[t],(function(e){return e=e[0],[new yt(r,e.registeredClass,!1,!1,!0,e,n,i,s,l,d)]}))},ua:function(e,t){var r="std::string"===(t=He(t));Ge(e,{name:t,fromWireType:function(e){var t,n=M[e>>2],o=e+4;if(r)for(var i=o,a=0;a<=n;++a){var s=o+a;if(a==n||0==D[s]){var u=Fe(i,s-i);void 0===t?t=u:(t+=String.fromCharCode(0),t+=u),i=s+1}}else{var l=new Array(n);for(a=0;a<n;++a)l[a]=String.fromCharCode(D[o+a]);t=l.join("")}return Yn(e),t},toWireType:function(e,t){var n;t instanceof ArrayBuffer&&(t=new Uint8Array(t));var o="string"==typeof t;o||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array||We("Cannot pass non-string to std::string"),n=r&&o?we(t):t.length;var i=zn(4+n+1),a=i+4;if(M[i>>2]=n,r&&o)Mt(t,a,n+1);else if(o)for(var s=0;s<n;++s){var u=t.charCodeAt(s);u>255&&(Yn(a),We("String has UTF-16 code units that do not fit in 8 bits")),D[a+s]=u}else for(s=0;s<n;++s)D[a+s]=t[s];return null!==e&&e.push(Yn,i),i},argPackAdvance:8,readValueFromPointer:Le,destructorFunction:function(e){Yn(e)}})},da:function(e,t,r){var n,o,i,a,s;r=He(r),2===t?(n=It,o=Ut,a=$t,i=()=>L,s=1):4===t&&(n=jt,o=qt,a=Nt,i=()=>M,s=2),Ge(e,{name:r,fromWireType:function(e){for(var r,o=M[e>>2],a=i(),u=e+4,l=0;l<=o;++l){var c=e+4+l*t;if(l==o||0==a[c>>s]){var d=n(u,c-u);void 0===r?r=d:(r+=String.fromCharCode(0),r+=d),u=c+t}}return Yn(e),r},toWireType:function(e,n){"string"!=typeof n&&We(`Cannot pass non-string to C++ string type ${r}`);var i=a(n),u=zn(4+i+t);return M[u>>2]=i>>s,o(n,u+4,i+t),null!==e&&e.push(Yn,u),u},argPackAdvance:8,readValueFromPointer:Le,destructorFunction:function(e){Yn(e)}})},ta:function(e,t,r,n,o,i){De[e]={name:He(t),rawConstructor:Et(r,n),rawDestructor:Et(o,i),elements:[]}},O:function(e,t,r,n,o,i,a,s,u){De[e].elements.push({getterReturnType:t,getter:Et(r,n),getterContext:o,setterArgumentType:i,setter:Et(a,s),setterContext:u})},y:function(e,t,r,n,o,i){je[e]={name:He(t),rawConstructor:Et(r,n),rawDestructor:Et(o,i),fields:[]}},i:function(e,t,r,n,o,i,a,s,u,l){je[e].fields.push({fieldName:He(t),getterReturnType:r,getter:Et(n,o),getterContext:i,setterArgumentType:a,setter:Et(s,u),setterContext:l})},je:function(e,t){Ge(e,{isVoid:!0,name:t=He(t),argPackAdvance:0,fromWireType:function(){},toWireType:function(e,t){}})},Ab:()=>!0,gb:()=>{throw 1/0},l:function(e,t,r){e=Dt.toValue(e),t=Lt(t,"emval::as");var n=[],o=Dt.toHandle(n);return M[r>>2]=o,t.toWireType(n,e)},s:function(e,t,r,n){e=Dt.toValue(e);for(var o=Ht(t,r),i=new Array(t),a=0;a<t;++a){var s=o[a];i[a]=s.readValueFromPointer(n),n+=s.argPackAdvance}var u=e.apply(void 0,i);return Dt.toHandle(u)},U:function(e,t,r,n,o){return(e=Gt[e])(t=Dt.toValue(t),r=Wt(r),function(e){var t=[];return M[e>>2]=Dt.toHandle(t),t}(n),o)},W:function(e,t,r,n){(e=Gt[e])(t=Dt.toValue(t),r=Wt(r),null,n)},b:At,be:function(e,t){return(e=Dt.toValue(e))==Dt.toValue(t)},D:function(e){return 0===e?Dt.toHandle(zt()):(e=Wt(e),Dt.toHandle(zt()[e]))},I:function(e,t){var r=Ht(e,t),n=r[0],o=n.name+"_$"+r.slice(1).map((function(e){return e.name})).join("_")+"$",i=Yt[o];if(void 0!==i)return i;for(var a=["retType"],s=[n],u="",l=0;l<e-1;++l)u+=(0!==l?", ":"")+"arg"+l,a.push("argType"+l),s.push(r[1+l]);var c,d,f="return function "+ut("methodCaller_"+o)+"(handle, name, destructors, args) {\n",p=0;for(l=0;l<e-1;++l)f+=" var arg"+l+" = argType"+l+".readValueFromPointer(args"+(p?"+"+p:"")+");\n",p+=r[l+1].argPackAdvance;for(f+=" var rv = handle[name]("+u+");\n",l=0;l<e-1;++l)r[l+1].deleteObject&&(f+=" argType"+l+".deleteObject(arg"+l+");\n");return n.isVoid||(f+=" return retType.toWireType(destructors, rv);\n"),f+="};\n",a.push(f),c=xt(Function,a).apply(null,s),d=Gt.length,Gt.push(c),i=d,Yt[o]=i,i},g:function(e,t){return e=Dt.toValue(e),t=Dt.toValue(t),Dt.toHandle(e[t])},d:function(e){e>4&&(Ft.get(e).refcount+=1)},Aa:function(e,t){return(e=Dt.toValue(e))instanceof Dt.toValue(t)},ca:function(e){return"number"==typeof(e=Dt.toValue(e))},L:function(e){return"string"==typeof(e=Dt.toValue(e))},xe:function(e,t,r,n){e=Dt.toValue(e);var o=Xt[t];return o||(o=function(e){for(var t="",r=0;r<e;++r)t+=(0!==r?", ":"")+"arg"+r;var n="return function emval_allocator_"+e+"(constructor, argTypes, args) {\n var HEAPU32 = getMemory();\n";for(r=0;r<e;++r)n+="var argType"+r+" = requireRegisteredType(HEAPU32[((argTypes)>>2)], 'parameter "+r+"');\nvar arg"+r+" = argType"+r+".readValueFromPointer(args);\nargs += argType"+r+"['argPackAdvance'];\nargTypes += 4;\n";return n+="var obj = new constructor("+t+");\nreturn valueToHandle(obj);\n}\n",new Function("requireRegisteredType","Module","valueToHandle","getMemory",n)(Lt,s,Dt.toHandle,(()=>M))}(t),Xt[t]=o),o(e,r,n)},N:function(){return Dt.toHandle([])},f:function(e){return Dt.toHandle(Wt(e))},H:function(){return Dt.toHandle({})},j:function(e){Be(Dt.toValue(e)),At(e)},u:function(e,t,r){e=Dt.toValue(e),t=Dt.toValue(t),r=Dt.toValue(r),e[t]=r},e:function(e,t){var r=(e=Lt(e,"_emval_take_value")).readValueFromPointer(t);return Dt.toHandle(r)},qe:function(e){throw Dt.toValue(e)},Mc:function(e){return e=Dt.toValue(e),Dt.toHandle(typeof e)},ob:function(e,t){e=Kt(e),t=Kt(t);var r=new Date(1e3*e);R[t>>2]=r.getUTCSeconds(),R[t+4>>2]=r.getUTCMinutes(),R[t+8>>2]=r.getUTCHours(),R[t+12>>2]=r.getUTCDate(),R[t+16>>2]=r.getUTCMonth(),R[t+20>>2]=r.getUTCFullYear()-1900,R[t+24>>2]=r.getUTCDay();var n=Date.UTC(r.getUTCFullYear(),0,1,0,0,0,0),o=(r.getTime()-n)/864e5|0;R[t+28>>2]=o},pb:function(e,t){e=Kt(e),t=Kt(t);var r=new Date(1e3*e);R[t>>2]=r.getSeconds(),R[t+4>>2]=r.getMinutes(),R[t+8>>2]=r.getHours(),R[t+12>>2]=r.getDate(),R[t+16>>2]=r.getMonth(),R[t+20>>2]=r.getFullYear()-1900,R[t+24>>2]=r.getDay();var n=0|tr(r);R[t+28>>2]=n,R[t+36>>2]=-60*r.getTimezoneOffset();var o=new Date(r.getFullYear(),0,1),i=new Date(r.getFullYear(),6,1).getTimezoneOffset(),a=o.getTimezoneOffset(),s=0|(i!=a&&r.getTimezoneOffset()==Math.min(a,i));R[t+32>>2]=s},qb:function(e){e=Kt(e);var t=(()=>{var t=new Date(R[e+20>>2]+1900,R[e+16>>2],R[e+12>>2],R[e+8>>2],R[e+4>>2],R[e>>2],0),r=R[e+32>>2],n=t.getTimezoneOffset(),o=new Date(t.getFullYear(),0,1),i=new Date(t.getFullYear(),6,1).getTimezoneOffset(),a=o.getTimezoneOffset(),s=Math.min(a,i);if(r<0)R[e+32>>2]=Number(i!=a&&s==n);else if(r>0!=(s==n)){var u=Math.max(a,i),l=r>0?s:u;t.setTime(t.getTime()+6e4*(l-n))}R[e+24>>2]=t.getDay();var c=0|tr(t);return R[e+28>>2]=c,R[e>>2]=t.getSeconds(),R[e+4>>2]=t.getMinutes(),R[e+8>>2]=t.getHours(),R[e+12>>2]=t.getDate(),R[e+16>>2]=t.getMonth(),R[e+20>>2]=t.getYear(),t.getTime()/1e3})();return BigInt(t)},lb:function(e,t,r,n,o,i,a){e=Kt(e),o=Kt(o),i=Kt(i),a=Kt(a);try{if(isNaN(o))return 61;var s=Ae.getStreamFromFD(n),u=Te.mmap(s,e,o,t,r),l=u.ptr;return R[i>>2]=u.allocated,M[a>>2]=l,0}catch(e){if(void 0===Te||"ErrnoError"!==e.name)throw e;return-e.errno}},nb:function(e,t,r,n,o,i){e=Kt(e),t=Kt(t),i=Kt(i);try{if(isNaN(i))return 61;var a=Ae.getStreamFromFD(o);2&r&&Ae.doMsync(e,a,t,n,i),Te.munmap(a)}catch(e){if(void 0===Te||"ErrnoError"!==e.name)throw e;return-e.errno}},hb:(e,t,r)=>{var n=(new Date).getFullYear(),o=new Date(n,0,1),i=new Date(n,6,1),a=o.getTimezoneOffset(),s=i.getTimezoneOffset(),u=Math.max(a,s);function l(e){var t=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return t?t[1]:"GMT"}M[e>>2]=60*u,R[t>>2]=Number(a!=s);var c=l(o),d=l(i),f=rr(c),p=rr(d);s<a?(M[r>>2]=f,M[r+4>>2]=p):(M[r>>2]=p,M[r+4>>2]=f)},a:()=>{re("")},ma:function(e,t,r,n,o){return lr.chooseConfig(e,t,r,n,o)},na:function(e,t,r,n){if(62e3!=e)return lr.setErrorCode(12296),0;for(var o=1;;){var i=R[n>>2];if(12440!=i){if(12344==i)break;return lr.setErrorCode(12292),0}o=R[n+4>>2],n+=8}return o<2||o>3?(lr.setErrorCode(12293),0):(lr.contextAttributes.majorVersion=o-1,lr.contextAttributes.minorVersion=0,lr.context=gr.createContext(s.canvas,lr.contextAttributes),0!=lr.context?(lr.setErrorCode(12288),gr.makeContextCurrent(lr.context),s.useWebGL=!0,ur.moduleContextCreatedCallbacks.forEach((function(e){e()})),gr.makeContextCurrent(null),62004):(lr.setErrorCode(12297),0))},_a:function(e,t,r,n){return 62e3!=e?(lr.setErrorCode(12296),0):62002!=t?(lr.setErrorCode(12293),0):(lr.setErrorCode(12288),62006)},gc:function(e,t){return 62e3!=e?(lr.setErrorCode(12296),0):62004!=t?(lr.setErrorCode(12294),0):(gr.deleteContext(lr.context),lr.setErrorCode(12288),lr.currentContext==t&&(lr.currentContext=0),1)},Xb:function(e,t){return 62e3!=e?(lr.setErrorCode(12296),0):62006!=t?(lr.setErrorCode(12301),1):(lr.currentReadSurface==t&&(lr.currentReadSurface=0),lr.currentDrawSurface==t&&(lr.currentDrawSurface=0),lr.setErrorCode(12288),1)},R:function(e,t,r,n){if(62e3!=e)return lr.setErrorCode(12296),0;if(62002!=t)return lr.setErrorCode(12293),0;if(!n)return lr.setErrorCode(12300),0;switch(lr.setErrorCode(12288),r){case 12320:return R[n>>2]=lr.contextAttributes.alpha?32:24,1;case 12321:return R[n>>2]=lr.contextAttributes.alpha?8:0,1;case 12322:case 12323:case 12324:return R[n>>2]=8,1;case 12325:return R[n>>2]=lr.contextAttributes.depth?24:0,1;case 12326:return R[n>>2]=lr.contextAttributes.stencil?8:0,1;case 12327:case 12335:case 12340:return R[n>>2]=12344,1;case 12328:return R[n>>2]=62002,1;case 12329:case 12333:case 12334:case 12345:case 12346:case 12347:case 12349:case 12350:case 12354:return R[n>>2]=0,1;case 12330:case 12332:return R[n>>2]=4096,1;case 12331:return R[n>>2]=16777216,1;case 12337:return R[n>>2]=lr.contextAttributes.antialias?4:0,1;case 12338:return R[n>>2]=lr.contextAttributes.antialias?1:0,1;case 12339:case 12352:return R[n>>2]=4,1;case 12341:case 12342:case 12343:return R[n>>2]=-1,1;case 12348:return R[n>>2]=1,1;case 12351:return R[n>>2]=12430,1;default:return lr.setErrorCode(12292),0}},mb:function(e){return lr.setErrorCode(12288),62e3},ra:function(){return lr.errorCode},db:function(e,t,r){return 62e3!=e?(lr.setErrorCode(12296),0):(t&&(R[t>>2]=1),r&&(R[r>>2]=4),lr.defaultDisplayInitialized=!0,lr.setErrorCode(12288),1)},xb:function(e,t,r,n){return 62e3!=e?(lr.setErrorCode(12296),0):0!=n&&62004!=n?(lr.setErrorCode(12294),0):0!=r&&62006!=r||0!=t&&62006!=t?(lr.setErrorCode(12301),0):(gr.makeContextCurrent(n?lr.context:null),lr.currentContext=n,lr.currentDrawSurface=t,lr.currentReadSurface=r,lr.setErrorCode(12288),1)},rc:function(e,t){if(lr.defaultDisplayInitialized)if(s.ctx){if(!s.ctx.isContextLost())return lr.setErrorCode(12288),1;lr.setErrorCode(12302)}else lr.setErrorCode(12290);else lr.setErrorCode(12289);return 0},Mb:function(e){return 62e3!=e?(lr.setErrorCode(12296),0):(lr.currentContext=0,lr.currentReadSurface=0,lr.currentDrawSurface=0,lr.defaultDisplayInitialized=!1,lr.setErrorCode(12288),1)},G:(e,t,r)=>((e,t,r)=>{var n=((e,t)=>{var r;for(yr.length=0,t>>=2;r=D[e++];)t+=105!=r&t,yr.push(105==r?R[t]:(106==r?I:$)[t++>>1]),++t;return yr})(t,r);return se[e].apply(null,n)})(e,t,r),ue:e=>{console.error(Fe(e))},ve:e=>{console.log(Fe(e))},fa:e=>{console.warn(Fe(e))},$:function(){return Date.now()},ke:function(){},ib:()=>2147483648,zb:Qt,Uf:function(e){$n.activeTexture(e)},Vf:function(e,t){$n.attachShader(gr.programs[e],gr.shaders[t])},Xc:function(e,t){$n.beginQuery(e,gr.queries[t])},de:function(e,t){$n.disjointTimerQueryExt.beginQueryEXT(e,gr.queries[t])},Jc:function(e){$n.beginTransformFeedback(e)},Wf:function(e,t,r){$n.bindAttribLocation(gr.programs[e],t,Fe(r))},Xf:function(e,t){35051==e?$n.currentPixelPackBufferBinding=t:35052==e&&($n.currentPixelUnpackBufferBinding=t),$n.bindBuffer(e,gr.buffers[t])},Gc:function(e,t,r){$n.bindBufferBase(e,t,gr.buffers[r])},Hc:function(e,t,r,n,o){$n.bindBufferRange(e,t,gr.buffers[r],n,o)},We:function(e,t){$n.bindFramebuffer(e,gr.framebuffers[t])},Xe:function(e,t){$n.bindRenderbuffer(e,gr.renderbuffers[t])},Ge:function(e,t){$n.bindSampler(e,gr.samplers[t])},Yf:function(e,t){$n.bindTexture(e,gr.textures[t])},Ub:function(e,t){$n.bindTransformFeedback(e,gr.transformFeedbacks[t])},qf:br,tf:wr,Zf:function(e,t,r,n){$n.blendColor(e,t,r,n)},_f:function(e){$n.blendEquation(e)},Rd:function(e,t){$n.blendEquationSeparate(e,t)},$f:function(e,t){$n.blendFunc(e,t)},Qd:function(e,t,r,n){$n.blendFuncSeparate(e,t,r,n)},Qe:function(e,t,r,n,o,i,a,s,u,l){$n.blitFramebuffer(e,t,r,n,o,i,a,s,u,l)},ag:function(e,t,r,n){gr.currentContext.version>=2?r&&t?$n.bufferData(e,D,n,r,t):$n.bufferData(e,t,n):$n.bufferData(e,r?D.subarray(r,r+t):t,n)},bg:function(e,t,r,n){gr.currentContext.version>=2?r&&$n.bufferSubData(e,t,D,n,r):$n.bufferSubData(e,t,D.subarray(n,n+r))},Ye:function(e){return $n.checkFramebufferStatus(e)},cg:function(e){$n.clear(e)},jc:function(e,t,r,n){$n.clearBufferfi(e,t,r,n)},kc:function(e,t,r){$n.clearBufferfv(e,t,O,r>>2)},mc:function(e,t,r){$n.clearBufferiv(e,t,R,r>>2)},lc:function(e,t,r){$n.clearBufferuiv(e,t,M,r>>2)},dg:function(e,t,r,n){$n.clearColor(e,t,r,n)},Pd:function(e){$n.clearDepth(e)},eg:function(e){$n.clearStencil(e)},Ca:function(e,t,r){return r=Number(r),$n.clientWaitSync(gr.syncs[e],t,r)},fg:function(e,t,r,n){$n.colorMask(!!e,!!t,!!r,!!n)},gg:function(e){$n.compileShader(gr.shaders[e])},hg:function(e,t,r,n,o,i,a,s){gr.currentContext.version>=2?$n.currentPixelUnpackBufferBinding||!a?$n.compressedTexImage2D(e,t,r,n,o,i,a,s):$n.compressedTexImage2D(e,t,r,n,o,i,D,s,a):$n.compressedTexImage2D(e,t,r,n,o,i,s?D.subarray(s,s+a):null)},ad:function(e,t,r,n,o,i,a,s,u){$n.currentPixelUnpackBufferBinding?$n.compressedTexImage3D(e,t,r,n,o,i,a,s,u):$n.compressedTexImage3D(e,t,r,n,o,i,a,D,u,s)},ig:function(e,t,r,n,o,i,a,s,u){gr.currentContext.version>=2?$n.currentPixelUnpackBufferBinding||!s?$n.compressedTexSubImage2D(e,t,r,n,o,i,a,s,u):$n.compressedTexSubImage2D(e,t,r,n,o,i,a,D,u,s):$n.compressedTexSubImage2D(e,t,r,n,o,i,a,u?D.subarray(u,u+s):null)},$c:function(e,t,r,n,o,i,a,s,u,l,c){$n.currentPixelUnpackBufferBinding?$n.compressedTexSubImage3D(e,t,r,n,o,i,a,s,u,l,c):$n.compressedTexSubImage3D(e,t,r,n,o,i,a,s,u,D,c,l)},Oe:function(e,t,r,n,o){$n.copyBufferSubData(e,t,r,n,o)},Od:function(e,t,r,n,o,i,a,s){$n.copyTexImage2D(e,t,r,n,o,i,a,s)},jg:function(e,t,r,n,o,i,a,s){$n.copyTexSubImage2D(e,t,r,n,o,i,a,s)},bd:function(e,t,r,n,o,i,a,s,u){$n.copyTexSubImage3D(e,t,r,n,o,i,a,s,u)},kg:function(){var e=gr.getNewId(gr.programs),t=$n.createProgram();return t.name=e,t.maxUniformLength=t.maxAttributeLength=t.maxUniformBlockNameLength=0,t.uniformIdCounter=1,gr.programs[e]=t,e},lg:function(e){var t=gr.getNewId(gr.shaders);return gr.shaders[t]=$n.createShader(e),t},mg:function(e){$n.cullFace(e)},ng:function(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2],o=gr.buffers[n];o&&($n.deleteBuffer(o),o.name=0,gr.buffers[n]=null,n==$n.currentPixelPackBufferBinding&&($n.currentPixelPackBufferBinding=0),n==$n.currentPixelUnpackBufferBinding&&($n.currentPixelUnpackBufferBinding=0))}},Ze:function(e,t){for(var r=0;r<e;++r){var n=R[t+4*r>>2],o=gr.framebuffers[n];o&&($n.deleteFramebuffer(o),o.name=0,gr.framebuffers[n]=null)}},og:function(e){if(e){var t=gr.programs[e];t?($n.deleteProgram(t),t.name=0,gr.programs[e]=null):gr.recordError(1281)}},Zc:function(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2],o=gr.queries[n];o&&($n.deleteQuery(o),gr.queries[n]=null)}},fe:function(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2],o=gr.queries[n];o&&($n.disjointTimerQueryExt.deleteQueryEXT(o),gr.queries[n]=null)}},_e:function(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2],o=gr.renderbuffers[n];o&&($n.deleteRenderbuffer(o),o.name=0,gr.renderbuffers[n]=null)}},He:function(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2],o=gr.samplers[n];o&&($n.deleteSampler(o),o.name=0,gr.samplers[n]=null)}},pg:function(e){if(e){var t=gr.shaders[e];t?($n.deleteShader(t),gr.shaders[e]=null):gr.recordError(1281)}},Pe:function(e){if(e){var t=gr.syncs[e];t?($n.deleteSync(t),t.name=0,gr.syncs[e]=null):gr.recordError(1281)}},qg:function(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2],o=gr.textures[n];o&&($n.deleteTexture(o),o.name=0,gr.textures[n]=null)}},Tb:function(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2],o=gr.transformFeedbacks[n];o&&($n.deleteTransformFeedback(o),o.name=0,gr.transformFeedbacks[n]=null)}},rf:_r,uf:Cr,Nd:function(e){$n.depthFunc(e)},rg:function(e){$n.depthMask(!!e)},Md:function(e,t){$n.depthRange(e,t)},Ld:function(e,t){$n.detachShader(gr.programs[e],gr.shaders[t])},sg:function(e){$n.disable(e)},tg:function(e){$n.disableVertexAttribArray(e)},ug:function(e,t,r){$n.drawArrays(e,t,r)},of:kr,Ud:xr,Fb:Pr,mf:function(e,t,r,n,o){$n.dibvbi.drawArraysInstancedBaseInstanceWEBGL(e,t,r,n,o)},gd:Tr,Gb:Fr,kf:Br,ed:Lr,Vd:Rr,vg:Or,pf:Ur,Td:$r,Db:jr,nf:function(e,t,r,n,o,i,a){$n.dibvbi.drawElementsInstancedBaseVertexBaseInstanceWEBGL(e,t,r,n,o,i,a)},Eb:qr,fd:Nr,df:function(e,t,r,n,o,i){Mr(e,n,o,i)},wg:function(e){$n.enable(e)},xg:function(e){$n.enableVertexAttribArray(e)},Wc:function(e){$n.endQuery(e)},ce:function(e){$n.disjointTimerQueryExt.endQueryEXT(e)},Ic:function(){$n.endTransformFeedback()},Me:function(e,t){var r=$n.fenceSync(e,t);if(r){var n=gr.getNewId(gr.syncs);return r.name=n,gr.syncs[n]=r,n}return 0},yg:function(){$n.finish()},zg:function(){$n.flush()},$e:function(e,t,r,n){$n.framebufferRenderbuffer(e,t,r,gr.renderbuffers[n])},af:function(e,t,r,n,o){$n.framebufferTexture2D(e,t,r,gr.textures[n],o)},Nc:function(e,t,r,n,o){$n.framebufferTextureLayer(e,t,gr.textures[r],n,o)},Ag:function(e){$n.frontFace(e)},Bg:function(e,t){Hr(e,t,"createBuffer",gr.buffers)},bf:function(e,t){Hr(e,t,"createFramebuffer",gr.framebuffers)},_c:function(e,t){Hr(e,t,"createQuery",gr.queries)},ge:function(e,t){for(var r=0;r<e;r++){var n=$n.disjointTimerQueryExt.createQueryEXT();if(!n){for(gr.recordError(1282);r<e;)R[t+4*r++>>2]=0;return}var o=gr.getNewId(gr.queries);n.name=o,gr.queries[o]=n,R[t+4*r>>2]=o}},cf:function(e,t){Hr(e,t,"createRenderbuffer",gr.renderbuffers)},Ie:function(e,t){Hr(e,t,"createSampler",gr.samplers)},Cg:function(e,t){Hr(e,t,"createTexture",gr.textures)},Sb:function(e,t){Hr(e,t,"createTransformFeedback",gr.transformFeedbacks)},sf:Wr,vf:Gr,Se:function(e){$n.generateMipmap(e)},Kd:function(e,t,r,n,o,i,a){zr("getActiveAttrib",e,t,r,n,o,i,a)},Jd:function(e,t,r,n,o,i,a){zr("getActiveUniform",e,t,r,n,o,i,a)},dc:function(e,t,r,n,o){e=gr.programs[e];var i=$n.getActiveUniformBlockName(e,t);if(i)if(o&&r>0){var a=Mt(i,o,r);n&&(R[n>>2]=a)}else n&&(R[n>>2]=0)},ec:function(e,t,r,n){if(n)if(e=gr.programs[e],35393!=r){var o=$n.getActiveUniformBlockParameter(e,t,r);if(null!==o)if(35395==r)for(var i=0;i<o.length;i++)R[n+4*i>>2]=o[i];else R[n>>2]=o}else{var a=$n.getActiveUniformBlockName(e,t);R[n>>2]=a.length+1}else gr.recordError(1281)},hc:function(e,t,r,n,o){if(o)if(t>0&&0==r)gr.recordError(1281);else{e=gr.programs[e];for(var i=[],a=0;a<t;a++)i.push(R[r+4*a>>2]);var s=$n.getActiveUniforms(e,i,n);if(s){var u=s.length;for(a=0;a<u;a++)R[o+4*a>>2]=s[a]}}else gr.recordError(1281)},Id:function(e,t,r,n){var o=$n.getAttachedShaders(gr.programs[e]),i=o.length;i>t&&(i=t),R[r>>2]=i;for(var a=0;a<i;++a){var s=gr.shaders.indexOf(o[a]);R[n+4*a>>2]=s}},Hd:function(e,t){return $n.getAttribLocation(gr.programs[e],Fe(t))},Gd:function(e,t){Xr(e,t,4)},_b:function(e,t,r){r?Yr(r,$n.getBufferParameter(e,t)):gr.recordError(1281)},Dg:function(e,t,r){r?R[r>>2]=$n.getBufferParameter(e,t):gr.recordError(1281)},Eg:function(){var e=$n.getError()||gr.lastError;return gr.lastError=0,e},Fg:function(e,t){Xr(e,t,2)},wc:function(e,t){return $n.getFragDataLocation(gr.programs[e],Fe(t))},Te:function(e,t,r,n){var o=$n.getFramebufferAttachmentParameter(e,t,r);(o instanceof WebGLRenderbuffer||o instanceof WebGLTexture)&&(o=0|o.name),R[n>>2]=o},$b:function(e,t,r){Kr(e,t,r,1)},bc:function(e,t){Xr(e,t,1)},Kc:function(e,t,r){Kr(e,t,r,0)},eh:function(e,t){Xr(e,t,0)},Jb:function(e,t,r,n,o){if(n<0)gr.recordError(1281);else if(o){var i=$n.getInternalformatParameter(e,t,r);if(null!==i)for(var a=0;a<i.length&&a<n;++a)R[o+4*a>>2]=i[a]}else gr.recordError(1281)},Ob:function(e,t,r,n,o){gr.recordError(1282)},Gg:function(e,t,r,n){var o=$n.getProgramInfoLog(gr.programs[e]);null===o&&(o="(unknown error)");var i=t>0&&n?Mt(o,n,t):0;r&&(R[r>>2]=i)},Hg:function(e,t,r){if(r)if(e>=gr.counter)gr.recordError(1281);else if(e=gr.programs[e],35716==t){var n=$n.getProgramInfoLog(e);null===n&&(n="(unknown error)"),R[r>>2]=n.length+1}else if(35719==t){if(!e.maxUniformLength)for(var o=0;o<$n.getProgramParameter(e,35718);++o)e.maxUniformLength=Math.max(e.maxUniformLength,$n.getActiveUniform(e,o).name.length+1);R[r>>2]=e.maxUniformLength}else if(35722==t){if(!e.maxAttributeLength)for(o=0;o<$n.getProgramParameter(e,35721);++o)e.maxAttributeLength=Math.max(e.maxAttributeLength,$n.getActiveAttrib(e,o).name.length+1);R[r>>2]=e.maxAttributeLength}else if(35381==t){if(!e.maxUniformBlockNameLength)for(o=0;o<$n.getProgramParameter(e,35382);++o)e.maxUniformBlockNameLength=Math.max(e.maxUniformBlockNameLength,$n.getActiveUniformBlockName(e,o).length+1);R[r>>2]=e.maxUniformBlockNameLength}else R[r>>2]=$n.getProgramParameter(e,t);else gr.recordError(1281)},Yd:Zr,_d:en,Xd:tn,Uc:function(e,t,r){if(r){var n,o=gr.queries[e],i=$n.getQueryParameter(o,t);n="boolean"==typeof i?i?1:0:i,R[r>>2]=n}else gr.recordError(1281)},Zd:rn,Vc:function(e,t,r){r?R[r>>2]=$n.getQuery(e,t):gr.recordError(1281)},$d:function(e,t,r){r?R[r>>2]=$n.disjointTimerQueryExt.getQueryEXT(e,t):gr.recordError(1281)},Ue:function(e,t,r){r?R[r>>2]=$n.getRenderbufferParameter(e,t):gr.recordError(1281)},Vb:function(e,t,r){r?O[r>>2]=$n.getSamplerParameter(gr.samplers[e],t):gr.recordError(1281)},Wb:function(e,t,r){r?R[r>>2]=$n.getSamplerParameter(gr.samplers[e],t):gr.recordError(1281)},Ig:function(e,t,r,n){var o=$n.getShaderInfoLog(gr.shaders[e]);null===o&&(o="(unknown error)");var i=t>0&&n?Mt(o,n,t):0;r&&(R[r>>2]=i)},Ce:function(e,t,r,n){var o=$n.getShaderPrecisionFormat(e,t);R[r>>2]=o.rangeMin,R[r+4>>2]=o.rangeMax,R[n>>2]=o.precision},Fd:function(e,t,r,n){var o=$n.getShaderSource(gr.shaders[e]);if(o){var i=t>0&&n?Mt(o,n,t):0;r&&(R[r>>2]=i)}},Jg:function(e,t,r){if(r)if(35716==t){var n=$n.getShaderInfoLog(gr.shaders[e]);null===n&&(n="(unknown error)");var o=n?n.length+1:0;R[r>>2]=o}else if(35720==t){var i=$n.getShaderSource(gr.shaders[e]),a=i?i.length+1:0;R[r>>2]=a}else R[r>>2]=$n.getShaderParameter(gr.shaders[e],t);else gr.recordError(1281)},Ba:function(e){var t=gr.stringCache[e];if(!t){switch(e){case 7939:var r=$n.getSupportedExtensions()||[];r=r.concat(r.map((function(e){return"GL_"+e}))),t=rr(r.join(" "));break;case 7936:case 7937:case 37445:case 37446:var n=$n.getParameter(e);n||gr.recordError(1280),t=n&&rr(n);break;case 7938:var o=$n.getParameter(7938);o=gr.currentContext.version>=2?"OpenGL ES 3.0 ("+o+")":"OpenGL ES 2.0 ("+o+")",t=rr(o);break;case 35724:var i=$n.getParameter(35724),a=i.match(/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/);null!==a&&(3==a[1].length&&(a[1]=a[1]+"0"),i="OpenGL ES GLSL ES "+a[1]+" ("+i+")"),t=rr(i);break;default:gr.recordError(1280)}gr.stringCache[e]=t}return t},fh:function(e,t){if(gr.currentContext.version<2)return gr.recordError(1282),0;var r=gr.stringiCache[e];if(r)return t<0||t>=r.length?(gr.recordError(1281),0):r[t];if(7939===e){var n=$n.getSupportedExtensions()||[];return n=(n=n.concat(n.map((function(e){return"GL_"+e})))).map((function(e){return rr(e)})),r=gr.stringiCache[e]=n,t<0||t>=r.length?(gr.recordError(1281),0):r[t]}return gr.recordError(1280),0},ac:function(e,t,r,n,o){if(r<0)gr.recordError(1281);else if(o){var i=$n.getSyncParameter(gr.syncs[e],t);null!==i&&(R[o>>2]=i,n&&(R[n>>2]=1))}else gr.recordError(1281)},Ed:function(e,t,r){r?O[r>>2]=$n.getTexParameter(e,t):gr.recordError(1281)},Dd:function(e,t,r){r?R[r>>2]=$n.getTexParameter(e,t):gr.recordError(1281)},Ec:function(e,t,r,n,o,i,a){e=gr.programs[e];var s=$n.getTransformFeedbackVarying(e,t);if(s){if(a&&r>0){var u=Mt(s.name,a,r);n&&(R[n>>2]=u)}else n&&(R[n>>2]=0);o&&(R[o>>2]=s.size),i&&(R[i>>2]=s.type)}},fc:function(e,t){return $n.getUniformBlockIndex(gr.programs[e],Fe(t))},ic:function(e,t,r,n){if(n)if(t>0&&(0==r||0==n))gr.recordError(1281);else{e=gr.programs[e];for(var o=[],i=0;i<t;i++)o.push(Fe(R[r+4*i>>2]));var a=$n.getUniformIndices(e,o);if(a){var s=a.length;for(i=0;i<s;i++)R[n+4*i>>2]=a[i]}}else gr.recordError(1281)},Kg:function(e,t){if(t=Fe(t),e=gr.programs[e]){on(e);var r=e.uniformLocsById,n=0,o=t,i=nn(t);i>0&&(s=t.slice(i+1),n=parseInt(s)>>>0,o=t.slice(0,i));var a=e.uniformSizeAndIdsByName[o];if(a&&n<a[0]&&(r[n+=a[1]]=r[n]||$n.getUniformLocation(e,t)))return n}else gr.recordError(1281);var s;return-1},Cd:function(e,t,r){sn(e,t,r,2)},Bd:function(e,t,r){sn(e,t,r,0)},xc:function(e,t,r){sn(e,t,r,0)},Dc:cn,Cc:dn,yd:function(e,t,r){r?R[r>>2]=$n.getVertexAttribOffset(e,t):gr.recordError(1281)},Ad:function(e,t,r){un(e,t,r,2)},zd:function(e,t,r){un(e,t,r,5)},xd:function(e,t){$n.hint(e,t)},De:function(e,t,r){for(var n=Ar[t],o=0;o<t;o++)n[o]=R[r+4*o>>2];$n.invalidateFramebuffer(e,n)},Fe:function(e,t,r,n,o,i,a){for(var s=Ar[t],u=0;u<t;u++)s[u]=R[r+4*u>>2];$n.invalidateSubFramebuffer(e,s,n,o,i,a)},wd:function(e){var t=gr.buffers[e];return t?$n.isBuffer(t):0},vd:function(e){return $n.isEnabled(e)},ud:function(e){var t=gr.framebuffers[e];return t?$n.isFramebuffer(t):0},td:function(e){return(e=gr.programs[e])?$n.isProgram(e):0},Yc:function(e){var t=gr.queries[e];return t?$n.isQuery(t):0},ee:function(e){var t=gr.queries[e];return t?$n.disjointTimerQueryExt.isQueryEXT(t):0},sd:function(e){var t=gr.renderbuffers[e];return t?$n.isRenderbuffer(t):0},Zb:function(e){var t=gr.samplers[e];return t?$n.isSampler(t):0},rd:function(e){var t=gr.shaders[e];return t?$n.isShader(t):0},Ne:function(e){return $n.isSync(gr.syncs[e])},Lg:function(e){var t=gr.textures[e];return t?$n.isTexture(t):0},Rb:function(e){return $n.isTransformFeedback(gr.transformFeedbacks[e])},Lc:pn,Wd:hn,Mg:function(e){$n.lineWidth(e)},Ng:function(e){e=gr.programs[e],$n.linkProgram(e),e.uniformLocsById=0,e.uniformSizeAndIdsByName={}},hf:function(e,t,r,n,o,i){$n.mdibvbi.multiDrawArraysInstancedBaseInstanceWEBGL(e,R,t>>2,R,r>>2,R,n>>2,M,o>>2,i)},jf:function(e,t,r,n,o,i,a,s){$n.mdibvbi.multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL(e,R,t>>2,r,R,n>>2,R,o>>2,R,i>>2,M,a>>2,s)},Qb:function(){$n.pauseTransformFeedback()},Og:function(e,t){3317==e&&(gr.unpackAlignment=t),$n.pixelStorei(e,t)},qd:function(e,t){$n.polygonOffset(e,t)},Nb:function(e,t,r,n){gr.recordError(1280)},Lb:function(e,t,r){gr.recordError(1280)},ae:function(e,t){$n.disjointTimerQueryExt.queryCounterEXT(gr.queries[e],t)},lf:function(e){$n.readBuffer(e)},Pg:function(e,t,r,n,o,i,a){if(gr.currentContext.version>=2)if($n.currentPixelPackBufferBinding)$n.readPixels(e,t,r,n,o,i,a);else{var s=mn(i);$n.readPixels(e,t,r,n,o,i,s,a>>gn(s))}else{var u=yn(i,o,r,n,a);u?$n.readPixels(e,t,r,n,o,i,u):gr.recordError(1280)}},pd:function(){},Ve:function(e,t,r,n){$n.renderbufferStorage(e,t,r,n)},Re:function(e,t,r,n,o){$n.renderbufferStorageMultisample(e,t,r,n,o)},Pb:function(){$n.resumeTransformFeedback()},od:function(e,t){$n.sampleCoverage(e,!!t)},Je:function(e,t,r){$n.samplerParameterf(gr.samplers[e],t,r)},Yb:function(e,t,r){var n=O[r>>2];$n.samplerParameterf(gr.samplers[e],t,n)},Ke:function(e,t,r){$n.samplerParameteri(gr.samplers[e],t,r)},Le:function(e,t,r){var n=R[r>>2];$n.samplerParameteri(gr.samplers[e],t,n)},Qg:function(e,t,r,n){$n.scissor(e,t,r,n)},nd:function(e,t,r,n,o){gr.recordError(1280)},Rg:function(e,t,r,n){var o=gr.getSource(e,t,r,n);if(gr.currentContext.version>=2&&o.includes("#version 100")){var i="";(o=(o=o.replace(/#extension GL_OES_standard_derivatives : enable/g,"")).replace(/#extension GL_EXT_shader_texture_lod : enable/g,"")).includes("gl_FragColor")&&(i+="out mediump vec4 GL_FragColor;\n",o=o.replace(/gl_FragColor/g,"GL_FragColor")),o=(o=(o=(o=(o=(o=(o=(o=(o=(o=(o=(o=o.includes("attribute")?(o=o.replace(/attribute/g,"in")).replace(/varying/g,"out"):o.replace(/varying/g,"in")).replace(/textureCubeLodEXT/g,"textureCubeLod")).replace(/texture2DLodEXT/g,"texture2DLod")).replace(/texture2DProjLodEXT/g,"texture2DProjLod")).replace(/texture2DGradEXT/g,"texture2DGrad")).replace(/texture2DProjGradEXT/g,"texture2DProjGrad")).replace(/textureCubeGradEXT/g,"textureCubeGrad")).replace(/textureCube/g,"texture")).replace(/texture1D/g,"texture")).replace(/texture2D/g,"texture")).replace(/texture3D/g,"texture")).replace(/#version 100/g,"#version 300 es\n"+i)}$n.shaderSource(gr.shaders[e],o)},Sg:function(e,t,r){$n.stencilFunc(e,t,r)},Tg:function(e,t,r,n){$n.stencilFuncSeparate(e,t,r,n)},Ug:function(e){$n.stencilMask(e)},Vg:function(e,t){$n.stencilMaskSeparate(e,t)},Wg:function(e,t,r){$n.stencilOp(e,t,r)},Xg:function(e,t,r,n){$n.stencilOpSeparate(e,t,r,n)},Yg:function(e,t,r,n,o,i,a,s,u){if(gr.currentContext.version>=2&&(6402==a&&6402==r&&5125==s&&(r=33190),36193==s&&(s=5131,6408==a&&6408==r&&(r=34842)),34041==r&&(r=35056)),gr.currentContext.version>=2)if($n.currentPixelUnpackBufferBinding)$n.texImage2D(e,t,r,n,o,i,a,s,u);else if(u){var l=mn(s);$n.texImage2D(e,t,r,n,o,i,a,s,l,u>>gn(l))}else $n.texImage2D(e,t,r,n,o,i,a,s,null);else $n.texImage2D(e,t,r,n,o,i,a,s,u?yn(s,a,n,o,u):null)},dd:function(e,t,r,n,o,i,a,s,u,l){if($n.currentPixelUnpackBufferBinding)$n.texImage3D(e,t,r,n,o,i,a,s,u,l);else if(l){var c=mn(u);$n.texImage3D(e,t,r,n,o,i,a,s,u,c,l>>gn(c))}else $n.texImage3D(e,t,r,n,o,i,a,s,u,null)},Zg:function(e,t,r){$n.texParameterf(e,t,r)},_g:function(e,t,r){var n=O[r>>2];$n.texParameterf(e,t,n)},$g:function(e,t,r){$n.texParameteri(e,t,r)},ah:function(e,t,r){var n=R[r>>2];$n.texParameteri(e,t,n)},ef:function(e,t,r,n,o){$n.texStorage2D(e,t,r,n,o)},Kb:function(e,t,r,n,o,i){$n.texStorage3D(e,t,r,n,o,i)},bh:function(e,t,r,n,o,i,a,s,u){if(gr.currentContext.version>=2&&36193==s&&(s=5131),gr.currentContext.version>=2)if($n.currentPixelUnpackBufferBinding)$n.texSubImage2D(e,t,r,n,o,i,a,s,u);else if(u){var l=mn(s);$n.texSubImage2D(e,t,r,n,o,i,a,s,l,u>>gn(l))}else $n.texSubImage2D(e,t,r,n,o,i,a,s,null);else{var c=null;u&&(c=yn(s,a,o,i,u)),$n.texSubImage2D(e,t,r,n,o,i,a,s,c)}},cd:function(e,t,r,n,o,i,a,s,u,l,c){if($n.currentPixelUnpackBufferBinding)$n.texSubImage3D(e,t,r,n,o,i,a,s,u,l,c);else if(c){var d=mn(l);$n.texSubImage3D(e,t,r,n,o,i,a,s,u,l,d,c>>gn(d))}else $n.texSubImage3D(e,t,r,n,o,i,a,s,u,l,null)},Fc:function(e,t,r,n){e=gr.programs[e];for(var o=[],i=0;i<t;i++)o.push(Fe(R[r+4*i>>2]));$n.transformFeedbackVaryings(e,o,n)},ch:function(e,t){$n.uniform1f(an(e),t)},dh:function(e,t,r){if(gr.currentContext.version>=2)t&&$n.uniform1fv(an(e),O,r>>2,t);else{if(t<=288)for(var n=vn[t-1],o=0;o<t;++o)n[o]=O[r+4*o>>2];else n=O.subarray(r>>2,r+4*t>>2);$n.uniform1fv(an(e),n)}},Qf:function(e,t){$n.uniform1i(an(e),t)},Rf:function(e,t,r){if(gr.currentContext.version>=2)t&&$n.uniform1iv(an(e),R,r>>2,t);else{if(t<=288)for(var n=bn[t-1],o=0;o<t;++o)n[o]=R[r+4*o>>2];else n=R.subarray(r>>2,r+4*t>>2);$n.uniform1iv(an(e),n)}},vc:function(e,t){$n.uniform1ui(an(e),t)},qc:function(e,t,r){t&&$n.uniform1uiv(an(e),M,r>>2,t)},Sf:function(e,t,r){$n.uniform2f(an(e),t,r)},Tf:function(e,t,r){if(gr.currentContext.version>=2)t&&$n.uniform2fv(an(e),O,r>>2,2*t);else{if(t<=144)for(var n=vn[2*t-1],o=0;o<2*t;o+=2)n[o]=O[r+4*o>>2],n[o+1]=O[r+(4*o+4)>>2];else n=O.subarray(r>>2,r+8*t>>2);$n.uniform2fv(an(e),n)}},Pf:function(e,t,r){$n.uniform2i(an(e),t,r)},Of:function(e,t,r){if(gr.currentContext.version>=2)t&&$n.uniform2iv(an(e),R,r>>2,2*t);else{if(t<=144)for(var n=bn[2*t-1],o=0;o<2*t;o+=2)n[o]=R[r+4*o>>2],n[o+1]=R[r+(4*o+4)>>2];else n=R.subarray(r>>2,r+8*t>>2);$n.uniform2iv(an(e),n)}},uc:function(e,t,r){$n.uniform2ui(an(e),t,r)},pc:function(e,t,r){t&&$n.uniform2uiv(an(e),M,r>>2,2*t)},Nf:function(e,t,r,n){$n.uniform3f(an(e),t,r,n)},Mf:function(e,t,r){if(gr.currentContext.version>=2)t&&$n.uniform3fv(an(e),O,r>>2,3*t);else{if(t<=96)for(var n=vn[3*t-1],o=0;o<3*t;o+=3)n[o]=O[r+4*o>>2],n[o+1]=O[r+(4*o+4)>>2],n[o+2]=O[r+(4*o+8)>>2];else n=O.subarray(r>>2,r+12*t>>2);$n.uniform3fv(an(e),n)}},Lf:function(e,t,r,n){$n.uniform3i(an(e),t,r,n)},Kf:function(e,t,r){if(gr.currentContext.version>=2)t&&$n.uniform3iv(an(e),R,r>>2,3*t);else{if(t<=96)for(var n=bn[3*t-1],o=0;o<3*t;o+=3)n[o]=R[r+4*o>>2],n[o+1]=R[r+(4*o+4)>>2],n[o+2]=R[r+(4*o+8)>>2];else n=R.subarray(r>>2,r+12*t>>2);$n.uniform3iv(an(e),n)}},tc:function(e,t,r,n){$n.uniform3ui(an(e),t,r,n)},oc:function(e,t,r){t&&$n.uniform3uiv(an(e),M,r>>2,3*t)},Jf:function(e,t,r,n,o){$n.uniform4f(an(e),t,r,n,o)},If:function(e,t,r){if(gr.currentContext.version>=2)t&&$n.uniform4fv(an(e),O,r>>2,4*t);else{if(t<=72){var n=vn[4*t-1],o=O;r>>=2;for(var i=0;i<4*t;i+=4){var a=r+i;n[i]=o[a],n[i+1]=o[a+1],n[i+2]=o[a+2],n[i+3]=o[a+3]}}else n=O.subarray(r>>2,r+16*t>>2);$n.uniform4fv(an(e),n)}},wf:function(e,t,r,n,o){$n.uniform4i(an(e),t,r,n,o)},xf:function(e,t,r){if(gr.currentContext.version>=2)t&&$n.uniform4iv(an(e),R,r>>2,4*t);else{if(t<=72)for(var n=bn[4*t-1],o=0;o<4*t;o+=4)n[o]=R[r+4*o>>2],n[o+1]=R[r+(4*o+4)>>2],n[o+2]=R[r+(4*o+8)>>2],n[o+3]=R[r+(4*o+12)>>2];else n=R.subarray(r>>2,r+16*t>>2);$n.uniform4iv(an(e),n)}},sc:function(e,t,r,n,o){$n.uniform4ui(an(e),t,r,n,o)},nc:function(e,t,r){t&&$n.uniform4uiv(an(e),M,r>>2,4*t)},cc:function(e,t,r){e=gr.programs[e],$n.uniformBlockBinding(e,t,r)},yf:function(e,t,r,n){if(gr.currentContext.version>=2)t&&$n.uniformMatrix2fv(an(e),!!r,O,n>>2,4*t);else{if(t<=72)for(var o=vn[4*t-1],i=0;i<4*t;i+=4)o[i]=O[n+4*i>>2],o[i+1]=O[n+(4*i+4)>>2],o[i+2]=O[n+(4*i+8)>>2],o[i+3]=O[n+(4*i+12)>>2];else o=O.subarray(n>>2,n+16*t>>2);$n.uniformMatrix2fv(an(e),!!r,o)}},Tc:function(e,t,r,n){t&&$n.uniformMatrix2x3fv(an(e),!!r,O,n>>2,6*t)},Rc:function(e,t,r,n){t&&$n.uniformMatrix2x4fv(an(e),!!r,O,n>>2,8*t)},zf:function(e,t,r,n){if(gr.currentContext.version>=2)t&&$n.uniformMatrix3fv(an(e),!!r,O,n>>2,9*t);else{if(t<=32)for(var o=vn[9*t-1],i=0;i<9*t;i+=9)o[i]=O[n+4*i>>2],o[i+1]=O[n+(4*i+4)>>2],o[i+2]=O[n+(4*i+8)>>2],o[i+3]=O[n+(4*i+12)>>2],o[i+4]=O[n+(4*i+16)>>2],o[i+5]=O[n+(4*i+20)>>2],o[i+6]=O[n+(4*i+24)>>2],o[i+7]=O[n+(4*i+28)>>2],o[i+8]=O[n+(4*i+32)>>2];else o=O.subarray(n>>2,n+36*t>>2);$n.uniformMatrix3fv(an(e),!!r,o)}},Sc:function(e,t,r,n){t&&$n.uniformMatrix3x2fv(an(e),!!r,O,n>>2,6*t)},Pc:function(e,t,r,n){t&&$n.uniformMatrix3x4fv(an(e),!!r,O,n>>2,12*t)},Af:function(e,t,r,n){if(gr.currentContext.version>=2)t&&$n.uniformMatrix4fv(an(e),!!r,O,n>>2,16*t);else{if(t<=18){var o=vn[16*t-1],i=O;n>>=2;for(var a=0;a<16*t;a+=16){var s=n+a;o[a]=i[s],o[a+1]=i[s+1],o[a+2]=i[s+2],o[a+3]=i[s+3],o[a+4]=i[s+4],o[a+5]=i[s+5],o[a+6]=i[s+6],o[a+7]=i[s+7],o[a+8]=i[s+8],o[a+9]=i[s+9],o[a+10]=i[s+10],o[a+11]=i[s+11],o[a+12]=i[s+12],o[a+13]=i[s+13],o[a+14]=i[s+14],o[a+15]=i[s+15]}}else o=O.subarray(n>>2,n+64*t>>2);$n.uniformMatrix4fv(an(e),!!r,o)}},Qc:function(e,t,r,n){t&&$n.uniformMatrix4x2fv(an(e),!!r,O,n>>2,8*t)},Oc:function(e,t,r,n){t&&$n.uniformMatrix4x3fv(an(e),!!r,O,n>>2,12*t)},Bf:function(e){e=gr.programs[e],$n.useProgram(e),$n.currentProgram=e},md:function(e){$n.validateProgram(gr.programs[e])},Cf:function(e,t){$n.vertexAttrib1f(e,t)},ld:function(e,t){$n.vertexAttrib1f(e,O[t>>2])},kd:function(e,t,r){$n.vertexAttrib2f(e,t,r)},Df:function(e,t){$n.vertexAttrib2f(e,O[t>>2],O[t+4>>2])},jd:function(e,t,r,n){$n.vertexAttrib3f(e,t,r,n)},Ef:function(e,t){$n.vertexAttrib3f(e,O[t>>2],O[t+4>>2],O[t+8>>2])},id:function(e,t,r,n,o){$n.vertexAttrib4f(e,t,r,n,o)},Ff:function(e,t){$n.vertexAttrib4f(e,O[t>>2],O[t+4>>2],O[t+8>>2],O[t+12>>2])},ff:En,Sd:_n,Hb:Cn,hd:Sn,Ib:kn,Bc:function(e,t,r,n,o){$n.vertexAttribI4i(e,t,r,n,o)},zc:function(e,t){$n.vertexAttribI4i(e,R[t>>2],R[t+4>>2],R[t+8>>2],R[t+12>>2])},Ac:function(e,t,r,n,o){$n.vertexAttribI4ui(e,t,r,n,o)},yc:function(e,t){$n.vertexAttribI4ui(e,M[t>>2],M[t+4>>2],M[t+8>>2],M[t+12>>2])},gf:function(e,t,r,n,o){$n.vertexAttribIPointer(e,t,r,n,o)},Gf:function(e,t,r,n,o,i){$n.vertexAttribPointer(e,t,r,!!n,o,i)},Hf:function(e,t,r,n){$n.viewport(e,t,r,n)},Da:function(e,t,r){r=Number(r),$n.waitSync(gr.syncs[e],t,r)},Bb:(e,t,r)=>D.copyWithin(e,t,t+r),jb:e=>{var t=D.length,r=2147483648;if((e>>>=0)>r)return!1;for(var n,o=1;o<=4;o*=2){var i=t*(1+.2/o);i=Math.min(i,e+100663296);var a=Math.min(r,(n=Math.max(e,i))+(65536-n%65536)%65536);if(xn(a))return!0}return!1},Ua:function(e,t,r,n,o,i,a,u,l){const c=s.UTF8ToString(e,e+t),d=s.HEAPU8.subarray(o,o+i),f=s.emscripten_ubq_codec_audioDecoderNextHandle++,p={codec:c,sampleRate:r,numberOfChannels:n,description:d};try{const e=s.emscripten_ubq_codec_createAudioDecoder(a,u,l);AudioDecoder.isConfigSupported(p).then((t=>{e.configUnsupported=!t}),(()=>{e.configUnsupported=!0})),e.configure(p),s.emscripten_ubq_codec_audioDecoders.set(f,{audioDecoder:e,decoderConfig:p,leftBufferPtr:a,rightBufferPtr:u,bufferLength:l})}catch(e){return s.emscripten_ubq_codec_createNativeResult({error:e})}return s.emscripten_ubq_codec_createNativeResult({handle:f})},La:function(e,t,r,n,o,i){const a=s.UTF8ToString(e,e+t),u=s.emscripten_ubq_codec_audioEncoderNextHandle++,l={codec:a,sampleRate:r,numberOfChannels:n,bitrate:o};try{const e=new AudioEncoder({output:e=>{const t=s._malloc(e.byteLength),r=s.HEAPU8.subarray(t,t+e.byteLength);e.copyTo(r),s.emscripten_ubq_codec_onOutputEncodedAudioChunk(u,t,e.byteLength,i),s._free(t)},error:e=>console.error(e)});e.configure(l),s.emscripten_ubq_codec_audioEncoders.set(u,{audioEncoder:e,audioEncoderConfig:l,frameIndex:0})}catch(e){return e+=' Requested codec: "'+a+'"',e+="; sample rate: "+r,e+="; channels: "+n,e+="; bit rate: "+o,s.emscripten_ubq_codec_createNativeResult({error:e})}return s.emscripten_ubq_codec_createNativeResult({handle:u})},Za:function(e,t,r,n,o,i,a){const u=s.UTF8ToString(e,e+t),l=s.HEAPU8.subarray(o,o+i),c=s.emscripten_ubq_codec_videoDecoderNextHandle++,d={codec:u,codedWidth:r,codedHeight:n,description:l,optimizeForLatency:!0};try{const e=s.emscripten_ubq_codec_createVideoDecoder(c,a);VideoDecoder.isConfigSupported(d).then((t=>{e.configUnsupported=!t}),(()=>{e.configUnsupported=!0})),e.configure(d),s.emscripten_ubq_codec_videoDecoders.set(c,{videoDecoder:e,decoderConfig:d,codecServicePtr:a})}catch(e){return s.emscripten_ubq_codec_createNativeResult({error:e})}return s.emscripten_ubq_codec_createNativeResult({handle:c})},Pa:function(e,t,r,n,o,i){const a=s.UTF8ToString(e,e+t),u=s.emscripten_ubq_codec_videoEncoderNextHandle++,l=s.specialHTMLTargets["!canvas"];l.width=r,l.height=n;const c={codec:a,width:r,height:n,avc:{format:"annexb"},framerate:o};try{const e=new VideoEncoder({output:e=>{const t=s._malloc(e.byteLength),r=s.HEAPU8.subarray(t,t+e.byteLength);e.copyTo(r),s.emscripten_ubq_codec_onOutputEncodedVideoChunk(u,t,e.byteLength,i),s._free(t)},error:e=>console.error(e)});VideoEncoder.isConfigSupported(c).then((t=>{e.configUnsupported=!t}),(()=>{e.configUnsupported=!0})),e.configure(c),s.emscripten_ubq_codec_videoEncoders.set(u,{videoEncoder:e,encoderConfig:c,groupOfPictures:150,frameIndex:0})}catch(e){return e+=' Requested codec: "'+a+'"',e+="; resolution: "+r+"x"+n,s.emscripten_ubq_codec_createNativeResult({error:e})}return s.emscripten_ubq_codec_createNativeResult({handle:u})},Qa:function(e,t,r,n,o,i){const a=s.emscripten_ubq_codec_audioDecoders.get(e);if(a.audioDecoder.unexpectedError)return s.emscripten_ubq_codec_createNativeResult({code:2,error:a.audioDecoder.unexpectedError});"closed"===a.audioDecoder.state&&(a.audioDecoder=s.emscripten_ubq_codec_createAudioDecoder(a.leftBufferPtr,a.rightBufferPtr,a.bufferLength),a.audioDecoder.configure(a.decoderConfig));const u=a.audioDecoder,l=s.HEAPU8.subarray(o,o+i),c=new EncodedAudioChunk({type:t?"key":"delta",timestamp:r,duration:n,data:l});try{u.decode(c)}catch(e){return u.configUnsupported?s.emscripten_ubq_codec_createNativeResult({code:2,error:e}):s.emscripten_ubq_codec_createNativeResult({code:1,error:e})}return s.emscripten_ubq_codec_createNativeResult({code:0})},Ha:function(e,t,r,n,o,i){const a=s.emscripten_ubq_codec_videoDecoders.get(e);if(a.videoDecoder.unexpectedError)return s.emscripten_ubq_codec_createNativeResult({code:2,error:a.videoDecoder.unexpectedError});if("closed"===a.videoDecoder.state){const t=a.videoDecoder.textures;return a.videoDecoder=s.emscripten_ubq_codec_createVideoDecoder(e,a.codecServicePtr),a.videoDecoder.textures=t,a.videoDecoder.configure(a.decoderConfig),s.emscripten_ubq_codec_createNativeResult({code:1,error:"VideoDecoder was closed"})}const u=a.videoDecoder,l=s.HEAPU8.subarray(o,o+i),c=new EncodedVideoChunk({type:t?"key":"delta",timestamp:r,duration:n,data:l});try{u.decode(c)}catch(e){return u.configUnsupported?s.emscripten_ubq_codec_createNativeResult({code:2,error:e}):s.emscripten_ubq_codec_createNativeResult({code:1,error:e})}return s.emscripten_ubq_codec_createNativeResult({code:0})},Ta:function(e){if(s.emscripten_ubq_codec_audioDecoders.has(e)){const t=s.emscripten_ubq_codec_audioDecoders.get(e);"closed"!==t.audioDecoder.state&&t.audioDecoder.close(),s.emscripten_ubq_codec_audioDecoders.delete(e)}},Ka:function(e){const t=s.emscripten_ubq_codec_audioEncoders.get(e);"closed"!==t.audioEncoder.state&&t.audioEncoder.close(),s.emscripten_ubq_codec_audioEncoders.delete(e)},Xa:function(e){if(s.emscripten_ubq_codec_videoDecoders.has(e)){const t=s.emscripten_ubq_codec_videoDecoders.get(e);"closed"!==t.videoDecoder.state&&t.videoDecoder.close(),s.emscripten_ubq_codec_videoDecoders.delete(e)}},Oa:function(e){const t=s.emscripten_ubq_codec_videoEncoders.get(e);"closed"!==t.videoEncoder.state&&t.videoEncoder.close(),s.emscripten_ubq_codec_videoEncoders.delete(e)},Ja:function(e,t,r){const n=1e6,o=s.emscripten_ubq_codec_audioEncoders.get(e),i=o.audioEncoderConfig.sampleRate,a=o.audioEncoderConfig.numberOfChannels,u=r/a,l=Math.round(n*(o.frameIndex*u/i)),c=Math.round(n*(u/i)),d=s.HEAPF32.subarray(t/4,t/4+r),f=new AudioData({format:"f32",sampleRate:i,numberOfFrames:u,numberOfChannels:a,duration:c,timestamp:l,data:d});o.audioEncoder.encode(f),o.frameIndex++,f.close()},Na:function(e,t,r){const n=1e6,o=s.emscripten_ubq_codec_videoEncoders.get(e),i=Math.round(n*(o.frameIndex/o.encoderConfig.framerate)),a=o.frameIndex%o.groupOfPictures==0,u=Math.round(n/o.encoderConfig.framerate),l=s.specialHTMLTargets["!canvas"],c=new VideoFrame(l,{timestamp:i,duration:u});o.videoEncoder.encode(c,{keyFrame:a}),c.close(),o.frameIndex++},Ia:async function(e,t){const r=s.emscripten_ubq_codec_audioEncoders.get(e);await r.audioEncoder.flush(),s.emscripten_ubq_codec_onFinalizedAudioEncoding(e,t)},Ma:async function(e,t){const r=s.emscripten_ubq_codec_videoEncoders.get(e);await r.videoEncoder.flush(),s.emscripten_ubq_codec_onFinalizedVideoEncoding(e,t)},Sa:async function(e,t){const r=s.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder;r.flushing=!0;try{await r.flush()}catch{}r.flushing=!1,r.writtenFrames=t},X:async function(e,t,r){const n=s.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder;n.shouldDropFrames=r,n.flushing=!0;try{await n.flush()}catch{}n.flushing=!1,n.shouldDropFrames=!1,n.decodedFrames=t},ia:function(e){return s.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder.decodeQueueSize},ja:function(e){return s.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder.decodedFrames},_:function(e){return s.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder.writtenFrames},Ra:function(e){return s.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder.flushing},Wa:function(e){return s.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder.flushing},Y:function(){return"undefined"!=typeof VideoFrame&&"undefined"!=typeof VideoDecoder&&"undefined"!=typeof VideoEncoder&&"undefined"!=typeof AudioDecoder&&"undefined"!=typeof AudioEncoder},Va:function(e,t){s.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder.requestedFrame=t},Ya:function(e,t,r){const n=s.emscripten_ubq_codec_videoDecoders.get(e),o=s.HEAPU32.subarray(t/4,t/4+r);n.videoDecoder.textures=[];for(let e=0;e<r;e++)n.videoDecoder.textures[e]=gr.textures[o[e]]},oe:function(e){const t=s.emscripten_ubq_asyncFetchManager.getProcess(e);return!!(null==t?void 0:t.allocate())},ea:function(e,t,r,n){return s.emscripten_ubq_asyncFetchManager.createHeader(e,t,r,n)},se:function(e){s.emscripten_ubq_asyncFetchManager.deleteHeader(e)},te:function(e,t,r,n,o,i,a,u,l){return s.emscripten_ubq_asyncFetchManager.fetch(e,t,r,n,o,i,a,u,l).handle},le:function(e){return s.emscripten_ubq_asyncFetchManager.deleteProcess(e)},re:function(e){var t,r;return null!==(r=null===(t=s.emscripten_ubq_asyncFetchManager.getProcess(e))||void 0===t?void 0:t.receivedLength)&&void 0!==r?r:0},ne:function(e){const t=s.emscripten_ubq_asyncFetchManager.getProcess(e);return(null==t?void 0:t.isAllocated())?t.resultAddress:-1},me:function(e){const t=s.emscripten_ubq_asyncFetchManager.getProcess(e);return(null==t?void 0:t.isAllocated())?t.resultLength:-1},xa:function(e){var t,r;return null!==(r=null===(t=s.emscripten_ubq_asyncFetchManager.getProcess(e))||void 0===t?void 0:t.state)&&void 0!==r?r:-1},pe:function(e){var t,r;return null!==(r=null===(t=s.emscripten_ubq_asyncFetchManager.getProcess(e))||void 0===t?void 0:t.totalBytes)&&void 0!==r?r:0},ab:function(){return!!s.emscripten_ubq_settings_forceWebGL1},la:function(e,t){var r=t>>2,n=R[r+6],o={alpha:!!R[r+0],depth:!!R[r+1],stencil:!!R[r+2],antialias:!!R[r+3],premultipliedAlpha:!!R[r+4],preserveDrawingBuffer:!!R[r+5],powerPreference:Tn[n],failIfMajorPerformanceCaveat:!!R[r+7],majorVersion:R[r+8],minorVersion:R[r+9],enableExtensionsByDefault:R[r+10],explicitSwapControl:R[r+11],proxyContextToMainThread:R[r+12],renderViaOffscreenBackBuffer:R[r+13]},i=function(e){return function(e){var t;return e=(t=e)>2?Fe(t):t,Fn[e]||("undefined"!=typeof document?document.querySelector(e):void 0)}(e)}(e);return i?o.explicitSwapControl?0:gr.createContext(i,o):0},ka:function(e){gr.currentContext==e&&(gr.currentContext=0),gr.deleteContext(e)},bb:function(e,t){var r=gr.getContext(e),n=Fe(t);return n.startsWith("GL_")&&(n=n.substr(3)),"ANGLE_instanced_arrays"==n&&cr($n),"OES_vertex_array_object"==n&&dr($n),"WEBGL_draw_buffers"==n&&fr($n),"WEBGL_draw_instanced_base_vertex_base_instance"==n&&pr($n),"WEBGL_multi_draw_instanced_base_vertex_base_instance"==n&&hr($n),"WEBGL_multi_draw"==n&&mr($n),!!r.GLctx.getExtension(n)},$a:function(e){for(var t=e>>2,r=0;r<14;++r)R[t+r]=0;R[t+0]=R[t+1]=R[t+3]=R[t+4]=R[t+8]=R[t+10]=1},cb:function(e){return gr.makeContextCurrent(e)?0:-5},sb:(e,t)=>{var r=0;return Ln().forEach((function(n,o){var i=t+r;M[e+4*o>>2]=i,((e,t)=>{for(var r=0;r<e.length;++r)A[t++>>0]=e.charCodeAt(r);A[t>>0]=0})(n,i),r+=n.length+1})),0},tb:(e,t)=>{var r=Ln();M[e>>2]=r.length;var n=0;return r.forEach((function(e){n+=e.length+1})),M[t>>2]=n,0},we:ir,aa:function(e){try{var t=Ae.getStreamFromFD(e);return Te.close(t),0}catch(e){if(void 0===Te||"ErrnoError"!==e.name)throw e;return e.errno}},kb:function(e,t,r,n,o){t=Kt(t),r=Kt(r),n=Kt(n),o=Kt(o);try{if(isNaN(n))return 61;var i=Ae.getStreamFromFD(e),a=Rn(i,t,r,n);return M[o>>2]=a,0}catch(e){if(void 0===Te||"ErrnoError"!==e.name)throw e;return e.errno}},qa:function(e,t,r,n){try{var o=Ae.getStreamFromFD(e),i=Rn(o,t,r);return M[n>>2]=i,0}catch(e){if(void 0===Te||"ErrnoError"!==e.name)throw e;return e.errno}},rb:function(e,t,r,n){t=Kt(t),n=Kt(n);try{if(isNaN(t))return 61;var o=Ae.getStreamFromFD(e);return Te.llseek(o,t,r),I[n>>3]=BigInt(o.position),o.getdents&&0===t&&0===r&&(o.getdents=null),0}catch(e){if(void 0===Te||"ErrnoError"!==e.name)throw e;return e.errno}},pa:function(e,t,r,n){try{var o=((e,t,r,n)=>{for(var o=0,i=0;i<r;i++){var a=M[t>>2],s=M[t+4>>2];t+=8;var u=Te.write(e,A,a,s,n);if(u<0)return-1;o+=u,void 0!==n&&(n+=u)}return o})(Ae.getStreamFromFD(e),t,r);return M[n>>2]=o,0}catch(e){if(void 0===Te||"ErrnoError"!==e.name)throw e;return e.errno}},eb:(e,t)=>(me(D.subarray(e,e+t)),0),w:function(e,t,r){var n=ro();try{return wt(e)(t,r)}catch(e){if(no(n),e!==e+0)throw e;to(1,0)}},M:function(e,t){var r=ro();try{return wt(e)(t)}catch(e){if(no(r),e!==e+0)throw e;to(1,0)}},F:function(e,t,r){var n=ro();try{return wt(e)(t,r)}catch(e){if(no(n),e!==e+0)throw e;to(1,0)}},k:function(e,t,r,n){var o=ro();try{return wt(e)(t,r,n)}catch(e){if(no(o),e!==e+0)throw e;to(1,0)}},Ea:function(e){var t=ro();try{return wt(e)()}catch(e){if(no(t),e!==e+0)throw e;to(1,0)}},ga:function(e,t,r){var n=ro();try{return wt(e)(t,r)}catch(e){if(no(n),e!==e+0)throw e;to(1,0)}},p:function(e,t){var r=ro();try{return wt(e)(t)}catch(e){if(no(r),e!==e+0)throw e;to(1,0)}},V:function(e,t,r,n,o,i,a,s,u,l,c,d,f,p,h,m){var g=ro();try{return wt(e)(t,r,n,o,i,a,s,u,l,c,d,f,p,h,m)}catch(e){if(no(g),e!==e+0)throw e;to(1,0)}},o:function(e,t,r){var n=ro();try{return wt(e)(t,r)}catch(e){if(no(n),e!==e+0)throw e;to(1,0)}},q:function(e,t,r,n){var o=ro();try{return wt(e)(t,r,n)}catch(e){if(no(o),e!==e+0)throw e;to(1,0)}},S:function(e,t,r,n,o){var i=ro();try{return wt(e)(t,r,n,o)}catch(e){if(no(i),e!==e+0)throw e;to(1,0)}},Be:function(e,t,r,n,o,i){var a=ro();try{return wt(e)(t,r,n,o,i)}catch(e){if(no(a),e!==e+0)throw e;to(1,0)}},za:function(e,t,r,n,o,i,a){var s=ro();try{return wt(e)(t,r,n,o,i,a)}catch(e){if(no(s),e!==e+0)throw e;to(1,0)}},ya:function(e,t,r,n,o,i,a,s,u,l){var c=ro();try{return wt(e)(t,r,n,o,i,a,s,u,l)}catch(e){if(no(c),e!==e+0)throw e;to(1,0)}},Q:function(e){var t=ro();try{wt(e)()}catch(e){if(no(t),e!==e+0)throw e;to(1,0)}},r:function(e,t){var r=ro();try{wt(e)(t)}catch(e){if(no(r),e!==e+0)throw e;to(1,0)}},A:function(e,t,r,n){var o=ro();try{wt(e)(t,r,n)}catch(e){if(no(o),e!==e+0)throw e;to(1,0)}},E:function(e,t,r){var n=ro();try{wt(e)(t,r)}catch(e){if(no(n),e!==e+0)throw e;to(1,0)}},n:function(e,t,r,n){var o=ro();try{wt(e)(t,r,n)}catch(e){if(no(o),e!==e+0)throw e;to(1,0)}},C:function(e,t,r,n,o){var i=ro();try{wt(e)(t,r,n,o)}catch(e){if(no(i),e!==e+0)throw e;to(1,0)}},Ae:function(e,t,r,n,o,i){var a=ro();try{wt(e)(t,r,n,o,i)}catch(e){if(no(a),e!==e+0)throw e;to(1,0)}},ye:function(e,t,r,n,o,i,a){var s=ro();try{wt(e)(t,r,n,o,i,a)}catch(e){if(no(s),e!==e+0)throw e;to(1,0)}},gh:function(e,t,r,n,o,i,a,s){var u=ro();try{wt(e)(t,r,n,o,i,a,s)}catch(e){if(no(u),e!==e+0)throw e;to(1,0)}},ze:function(e,t,r,n,o,i,a,s,u,l){var c=ro();try{wt(e)(t,r,n,o,i,a,s,u,l)}catch(e){if(no(c),e!==e+0)throw e;to(1,0)}},ha:function(e,t){const r=Dt.toValue(t),n=s.ctx;n.bindTexture(n.TEXTURE_2D,gr.textures[e]),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,r)},fb:(e,t,r,n,o)=>((e,t,r,n)=>{var o=R[n+40>>2],i={tm_sec:R[n>>2],tm_min:R[n+4>>2],tm_hour:R[n+8>>2],tm_mday:R[n+12>>2],tm_mon:R[n+16>>2],tm_year:R[n+20>>2],tm_wday:R[n+24>>2],tm_yday:R[n+28>>2],tm_isdst:R[n+32>>2],tm_gmtoff:R[n+36>>2],tm_zone:o?Fe(o):""},a=Fe(r),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var u in s)a=a.replace(new RegExp(u,"g"),s[u]);var l=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],c=["January","February","March","April","May","June","July","August","September","October","November","December"];function d(e,t,r){for(var n="number"==typeof e?e.toString():e||"";n.length<t;)n=r[0]+n;return n}function f(e,t){return d(e,t,"0")}function p(e,t){function r(e){return e<0?-1:e>0?1:0}var n;return 0===(n=r(e.getFullYear()-t.getFullYear()))&&0===(n=r(e.getMonth()-t.getMonth()))&&(n=r(e.getDate()-t.getDate())),n}function h(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function m(e){var t=((e,t)=>{for(var r=new Date(e.getTime());t>0;){var n=Zt(r.getFullYear()),o=r.getMonth(),i=(n?Mn:On)[o];if(!(t>i-r.getDate()))return r.setDate(r.getDate()+t),r;t-=i-r.getDate()+1,r.setDate(1),o<11?r.setMonth(o+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1))}return r})(new Date(e.tm_year+1900,0,1),e.tm_yday),r=new Date(t.getFullYear(),0,4),n=new Date(t.getFullYear()+1,0,4),o=h(r),i=h(n);return p(o,t)<=0?p(i,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var g={"%a":e=>l[e.tm_wday].substring(0,3),"%A":e=>l[e.tm_wday],"%b":e=>c[e.tm_mon].substring(0,3),"%B":e=>c[e.tm_mon],"%C":e=>f((e.tm_year+1900)/100|0,2),"%d":e=>f(e.tm_mday,2),"%e":e=>d(e.tm_mday,2," "),"%g":e=>m(e).toString().substring(2),"%G":e=>m(e),"%H":e=>f(e.tm_hour,2),"%I":e=>{var t=e.tm_hour;return 0==t?t=12:t>12&&(t-=12),f(t,2)},"%j":e=>f(e.tm_mday+((e,t)=>{for(var r=0,n=0;n<=t;r+=e[n++]);return r})(Zt(e.tm_year+1900)?Mn:On,e.tm_mon-1),3),"%m":e=>f(e.tm_mon+1,2),"%M":e=>f(e.tm_min,2),"%n":()=>"\n","%p":e=>e.tm_hour>=0&&e.tm_hour<12?"AM":"PM","%S":e=>f(e.tm_sec,2),"%t":()=>"\t","%u":e=>e.tm_wday||7,"%U":e=>{var t=e.tm_yday+7-e.tm_wday;return f(Math.floor(t/7),2)},"%V":e=>{var t=Math.floor((e.tm_yday+7-(e.tm_wday+6)%7)/7);if((e.tm_wday+371-e.tm_yday-2)%7<=2&&t++,t){if(53==t){var r=(e.tm_wday+371-e.tm_yday)%7;4==r||3==r&&Zt(e.tm_year)||(t=1)}}else{t=52;var n=(e.tm_wday+7-e.tm_yday-1)%7;(4==n||5==n&&Zt(e.tm_year%400-1))&&t++}return f(t,2)},"%w":e=>e.tm_wday,"%W":e=>{var t=e.tm_yday+7-(e.tm_wday+6)%7;return f(Math.floor(t/7),2)},"%y":e=>(e.tm_year+1900).toString().substring(2),"%Y":e=>e.tm_year+1900,"%z":e=>{var t=e.tm_gmtoff,r=t>=0;return t=(t=Math.abs(t)/60)/60*100+t%60,(r?"+":"-")+String("0000"+t).slice(-4)},"%Z":e=>e.tm_zone,"%%":()=>"%"};for(var u in a=a.replace(/%%/g,"\0\0"),g)a.includes(u)&&(a=a.replace(new RegExp(u,"g"),g[u](i)));var y=_e(a=a.replace(/\0\0/g,"%"),!1);return y.length>t?0:(In(y,e),y.length-1)})(e,t,r,n)},zn=(function(){var e,t,r,n,i={a:Gn};function a(e,t){var r,n=e.exports;return x=(P=n).hh,H(),j=P.kh,r=P.ih,W.unshift(r),te(),n}if(ee(),s.instantiateWasm)try{return s.instantiateWasm(i,a)}catch(e){k("Module.instantiateWasm callback failed with error: "+e),o(e)}(e=C,t=X,r=i,n=function(e){a(e.instance)},e||"function"!=typeof WebAssembly.instantiateStreaming||ne(t)||b||"function"!=typeof fetch?ae(t,r,n):fetch(t,{credentials:"same-origin"}).then((e=>WebAssembly.instantiateStreaming(e,r).then(n,(function(e){return k("wasm streaming compile failed: "+e),k("falling back to ArrayBuffer instantiation"),ae(t,r,n)}))))).catch(o)}(),s._malloc=e=>(zn=s._malloc=P.jh)(e)),Yn=s._free=e=>(Yn=s._free=P.lh)(e),Xn=()=>(Xn=P.mh)(),Kn=(s._ma_malloc_emscripten=(e,t)=>(s._ma_malloc_emscripten=P.nh)(e,t),s._ma_free_emscripten=(e,t)=>(s._ma_free_emscripten=P.oh)(e,t),s._ma_device_process_pcm_frames_capture__webaudio=(e,t,r)=>(Kn=s._ma_device_process_pcm_frames_capture__webaudio=P.ph)(e,t,r)),Qn=s._ma_device_process_pcm_frames_playback__webaudio=(e,t,r)=>(Qn=s._ma_device_process_pcm_frames_playback__webaudio=P.qh)(e,t,r),Zn=e=>(Zn=P.rh)(e),Jn=e=>(Jn=P.sh)(e),eo=(s.__embind_initialize_bindings=()=>(s.__embind_initialize_bindings=P.th)(),(e,t)=>(eo=P.uh)(e,t)),to=(e,t)=>(to=P.vh)(e,t),ro=()=>(ro=P.wh)(),no=e=>(no=P.xh)(e),oo=e=>(oo=P.yh)(e),io=e=>(io=P.zh)(e),ao=e=>(ao=P.Ah)(e),so=(e,t,r)=>(so=P.Bh)(e,t,r),uo=e=>(uo=P.Ch)(e);function lo(){function e(){Wn||(Wn=!0,s.calledRun=!0,q||(s.noFSInit||Te.init.initialized||Te.init(),Te.ignorePermissions=!1,Ce.init(),le(W),t(s),s.onRuntimeInitialized&&s.onRuntimeInitialized(),function(){if(s.postRun)for("function"==typeof s.postRun&&(s.postRun=[s.postRun]);s.postRun.length;)e=s.postRun.shift(),z.unshift(e);var e;le(z)}()))}Q>0||(function(){if(s.preRun)for("function"==typeof s.preRun&&(s.preRun=[s.preRun]);s.preRun.length;)e=s.preRun.shift(),V.unshift(e);var e;le(V)}(),Q>0||(s.setStatus?(s.setStatus("Running..."),setTimeout((function(){setTimeout((function(){s.setStatus("")}),1),e()}),1)):e()))}if(s.___start_em_js=2360827,s.___stop_em_js=2361078,s.addRunDependency=ee,s.removeRunDependency=te,s.FS_createPath=Te.createPath,s.FS_createDataFile=Te.createDataFile,s.FS_createLazyFile=Te.createLazyFile,s.FS_createDevice=Te.createDevice,s.FS_unlink=Te.unlink,s.ccall=function(e,t,r,n,o){var i={string:e=>{var t=0;return null!=e&&0!==e&&(t=(e=>{var t=we(e)+1,r=oo(t);return Mt(e,r,t),r})(e)),t},array:e=>{var t=oo(e.length);return In(e,t),t}},a=function(e){return s["_"+e]}(e),u=[],l=0;if(n)for(var c=0;c<n.length;c++){var d=i[r[c]];d?(0===l&&(l=ro()),u[c]=d(n[c])):u[c]=n[c]}var f=a.apply(null,u);return function(e){return 0!==l&&no(l),function(e){return"string"===t?Fe(e):"boolean"===t?Boolean(e):e}(e)}(f)},s.getValue=function(e,t="i8"){switch(t.endsWith("*")&&(t="*"),t){case"i1":case"i8":return A[e>>0];case"i16":return B[e>>1];case"i32":return R[e>>2];case"i64":return I[e>>3];case"float":return O[e>>2];case"double":return $[e>>3];case"*":return M[e>>2];default:re(`invalid type for getValue: ${t}`)}},s.UTF8ToString=Fe,s.specialHTMLTargets=Fn,s.FS_createPreloadedFile=Te.createPreloadedFile,J=function e(){Wn||lo(),Wn||(J=e)},s.preInit)for("function"==typeof s.preInit&&(s.preInit=[s.preInit]);s.preInit.length>0;)s.preInit.pop()();return lo(),e.ready});e.exports=o},809:e=>{"use strict";e.exports=require("node-fetch")},300:e=>{"use strict";e.exports=require("buffer")},113:e=>{"use strict";e.exports=require("crypto")},147:e=>{"use strict";e.exports=require("fs")},17:e=>{"use strict";e.exports=require("path")},310:e=>{"use strict";e.exports=require("url")}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.p="";var n={};return(()=>{"use strict";r.d(n,{default:()=>Qe});const e=Symbol("PROXY");function t(t,r){Object.defineProperty(t[r],e,{value:{type:"getter"},writable:!1})}function o(t,r){Object.defineProperty(t[r],e,{value:{type:"setter"},writable:!1})}var i,a,s,u,l,c,d,f,p,h,m,g,y;Symbol("RESTORE"),function(e){let t;!function(e){e[e.sRGB=0]="sRGB",e[e.CMYK=1]="CMYK",e[e.SpotColor=2]="SpotColor"}(t=e.ColorSpace||(e.ColorSpace={})),e.toColor=function(e){switch(e.colorSpace){case t.sRGB:return{r:e.components.x,g:e.components.y,b:e.components.z,a:e.components.w};case t.SpotColor:return{name:e.spotColorName,tint:e.tint,externalReference:e.externalReference};case t.CMYK:return{c:e.components.x,m:e.components.y,y:e.components.z,k:e.components.w,tint:e.tint};default:throw new Error("Unknown color space!")}},e.fromColor=function(e){if(function(e){return"r"in e&&"a"in e&&void 0!==e.r&&void 0!==e.a}(e))return{colorSpace:t.sRGB,components:{x:e.r,y:e.g,z:e.b,w:e.a},spotColorName:"",tint:1,externalReference:""};if(function(e){return"c"in e&&"m"in e&&"y"in e&&"k"in e&&void 0!==e.c&&void 0!==e.m&&void 0!==e.y&&void 0!==e.k}(e))return{colorSpace:t.CMYK,components:{x:e.c,y:e.m,z:e.y,w:e.k},spotColorName:"",tint:e.tint,externalReference:""};if(function(e){return"name"in e&&void 0!==e.name}(e))return{colorSpace:t.SpotColor,components:{x:0,y:0,z:0,w:0},spotColorName:e.name,tint:e.tint,externalReference:e.externalReference};throw new Error("Unknown color space!")}}(i||(i={})),function(e){e[e.Pending=0]="Pending",e[e.Ready=1]="Ready",e[e.Error=2]="Error"}(a||(a={})),function(e){e.Added="DesignBlockAddedEvent",e.Updated="DesignBlockUpdatedEvent",e.Removed="DesignBlockRemovedEvent"}(s||(s={})),function(e){e[e.Left=0]="Left",e[e.Right=1]="Right",e[e.Middle=2]="Middle",e[e.Unknown=255]="Unknown"}(u||(u={})),function(e){e[e.Up=0]="Up",e[e.Down=1]="Down"}(l||(l={})),function(e){e[e.Key0=0]="Key0",e[e.Key1=1]="Key1",e[e.Key2=2]="Key2",e[e.Key3=3]="Key3",e[e.Key4=4]="Key4",e[e.Key5=5]="Key5",e[e.Key6=6]="Key6",e[e.Key7=7]="Key7",e[e.Key8=8]="Key8",e[e.Key9=9]="Key9",e[e.A=10]="A",e[e.B=11]="B",e[e.C=12]="C",e[e.D=13]="D",e[e.E=14]="E",e[e.F=15]="F",e[e.G=16]="G",e[e.H=17]="H",e[e.I=18]="I",e[e.J=19]="J",e[e.K=20]="K",e[e.L=21]="L",e[e.M=22]="M",e[e.N=23]="N",e[e.O=24]="O",e[e.P=25]="P",e[e.Q=26]="Q",e[e.R=27]="R",e[e.S=28]="S",e[e.T=29]="T",e[e.U=30]="U",e[e.V=31]="V",e[e.W=32]="W",e[e.X=33]="X",e[e.Y=34]="Y",e[e.Z=35]="Z",e[e.ArrowLeft=36]="ArrowLeft",e[e.ArrowRight=37]="ArrowRight",e[e.ArrowUp=38]="ArrowUp",e[e.ArrowDown=39]="ArrowDown",e[e.Backspace=40]="Backspace",e[e.Enter=41]="Enter",e[e.Space=42]="Space",e[e.Escape=43]="Escape",e[e.Delete=44]="Delete",e[e.Control=45]="Control",e[e.Option=46]="Option",e[e.Shift=47]="Shift",e[e.Unknown=255]="Unknown"}(c||(c={})),function(e){e[e.Thin=100]="Thin",e[e.ExtraLight=200]="ExtraLight",e[e.Light=300]="Light",e[e.Normal=400]="Normal",e[e.Medium=500]="Medium",e[e.SemiBold=600]="SemiBold",e[e.Bold=700]="Bold",e[e.ExtraBold=800]="ExtraBold",e[e.Heavy=900]="Heavy"}(d||(d={})),function(e){e[e.Normal=0]="Normal",e[e.Italic=1]="Italic"}(f||(f={})),function(e){e.Bold="bold",e.Italic="italic"}(p||(p={})),function(e){e[e.Undefined=0]="Undefined",e[e.DesignUnit=1]="DesignUnit",e[e.Percent=2]="Percent",e[e.Auto=3]="Auto"}(h||(h={})),function(e){e[e.Free=0]="Free",e[e.VerticalStack=1]="VerticalStack",e[e.HorizontalStack=2]="HorizontalStack",e[e.DepthStack=3]="DepthStack"}(m||(m={})),function(e){e[e.Began=0]="Began",e[e.Changed=1]="Changed",e[e.Ended=2]="Ended"}(g||(g={})),function(e){e[e.Creator=0]="Creator",e[e.Adopter=1]="Adopter",e[e.Viewer=2]="Viewer",e[e.Presenter=3]="Presenter"}(y||(y={}));var v=function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a};class b{constructor(e){Object.defineProperty(this,"ubq",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.ubq=e}useInternalAPI(e){const t=this.ubq.getInternalAPI();try{return e(t)}finally{t.delete()}}setValue(e,t,r,n){return this.useInternalAPI((o=>w(o.setValue(e,t,r,n))))}getValue(e,t,r){return this.useInternalAPI((n=>w(n.getValue(e,t,r))))}async execute(e,t){return new Promise(((r,n)=>{this.useInternalAPI((o=>o.ubqExecute(e,t,(e=>{try{const t=w(e);r(t)}catch(e){n(e)}})))).delete()}))}}function w(e){if(e.isValid()){const t=e.value();return e.delete(),t}{const t=e.error(),r=t.publicMessage();throw t.delete(),e.delete(),new Error(r)}}function E(e){return new Promise(((t,r)=>{e((e=>{try{const r=w(e);t(r)}catch(e){r(e)}}))}))}v([o],b.prototype,"setValue",null),v([t],b.prototype,"getValue",null);const _=(e,t=!0)=>{const r=[];for(let t=0;t<e.size();t+=1)r.push(e.get(t));return t&&e.delete(),r};var C,S,k,x,P,T=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};const F=new WeakMap,A={assets:[],total:0,currentPage:0,nextPage:void 0};class D{constructor(e){C.add(this),S.set(this,void 0),Object.defineProperty(this,"onAssetSourceAdded",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=T(this,S,"f").subscribeToAssetSourceAdded(e);return()=>{T(this,S,"f").isDeleted()||w(T(this,S,"f").unsubscribe(t))}}}),Object.defineProperty(this,"onAssetSourceRemoved",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=T(this,S,"f").subscribeToAssetSourceRemoved(e);return()=>{T(this,S,"f").isDeleted()||w(T(this,S,"f").unsubscribe(t))}}}),function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?o.call(e,r):o?o.value=r:t.set(e,r)}(this,S,e,"f")}addSource(e){var t,r,n,o,i,a;const s=null===(t=e.getSupportedMimeTypes)||void 0===t?void 0:t.bind(e),u=null===(r=e.getGroups)||void 0===r?void 0:r.bind(e),l=null===(n=e.applyAsset)||void 0===n?void 0:n.bind(e),c=null===(o=e.applyAssetToBlock)||void 0===o?void 0:o.bind(e),d=null===(i=e.addAsset)||void 0===i?void 0:i.bind(e),f=null===(a=e.removeAsset)||void 0===a?void 0:a.bind(e),p=e.credits,h=e.license;w(T(this,S,"f").addAssetSource(e.id,(async(t,r)=>{var n;try{const n=Object.assign(Object.assign({},t),{tags:_(t.tags),groups:_(t.groups),excludeGroups:_(t.excludeGroups)}),o=await e.findAssets(n);if(o){const t=Object.assign(Object.assign({},o),{assets:o.assets.map((t=>B(t,e.id)))});r.invoke(t)}else r.invoke(A)}catch(e){r.invoke(null!==(n=e.message)&&void 0!==n?n:"Unknown error in user-defined `findAssets`")}}),u?async e=>{var t;try{const t=await u();e.invoke(t)}catch(r){e.invoke(null!==(t=r.message)&&void 0!==t?t:"Unknown error in user-defined `getGroups`")}}:null,p?()=>{var e;return{name:p.name,url:null!==(e=p.url)&&void 0!==e?e:""}}:null,h?()=>{var e;return{name:h.name,url:null!==(e=h.url)&&void 0!==e?e:""}}:null,s?()=>{var e;return null!==(e=s())&&void 0!==e?e:[]}:null,l?async(e,t)=>{var r;try{const r=await l(T(this,C,"m",k).call(this,e));t.invoke(r)}catch(e){t.invoke(null!==(r=e.message)&&void 0!==r?r:"Unknown error in user-defined `applyAsset`")}}:null,c?async(e,t,r)=>{var n;try{await c(T(this,C,"m",k).call(this,e),t),r.invoke({})}catch(e){r.invoke(null!==(n=e.message)&&void 0!==n?n:"Unknown error in user-defined `applyAssetToBlock`")}}:null,d?async e=>{d(e)}:null,f?async e=>{f(e)}:null)),T(this,C,"m",x).call(this,e.id,e)}addLocalSource(e,t,r,n){w(T(this,S,"f").addLocalAssetSource(e,null!=t?t:[],r?async(e,t)=>{var n;try{const n=await r(T(this,C,"m",k).call(this,e));t.invoke(n)}catch(e){t.invoke(null!==(n=e.message)&&void 0!==n?n:"Unknown error in user-defined `applyAsset`")}}:null,n?async(e,t,r)=>{var o;try{await n(T(this,C,"m",k).call(this,e),t),r.invoke()}catch(e){r.invoke(null!==(o=e.message)&&void 0!==o?o:"Unknown error in user-defined `replaceAsset`")}}:null))}removeSource(e){w(T(this,S,"f").removeAssetSource(e)),T(this,C,"m",P).call(this,e)}findAllSources(){return _(T(this,S,"f").findAllAssetSources())}findAssets(e,t){return new Promise(((r,n)=>{var o,i,a,s,u,l,c;let d=null!==(o=null==t?void 0:t.tags)&&void 0!==o?o:[];Array.isArray(d)||(d=[d]);const f={perPage:null!==(i=null==t?void 0:t.perPage)&&void 0!==i?i:0,page:null!==(a=null==t?void 0:t.page)&&void 0!==a?a:0,query:null!==(s=null==t?void 0:t.query)&&void 0!==s?s:"",tags:d,groups:null!==(u=null==t?void 0:t.groups)&&void 0!==u?u:[],excludeGroups:null!==(l=null==t?void 0:t.excludeGroups)&&void 0!==l?l:[],locale:null!==(c=null==t?void 0:t.locale)&&void 0!==c?c:""};T(this,S,"f").findAssetSourceAssets(e,f,(e=>{try{const t=w(e),n=_(t.assets).map(T(this,C,"m",k));r({assets:n.map((e=>(e.payload&&"string"==typeof e.payload&&(e.payload=JSON.parse(e.payload)),e))),currentPage:t.currentPage,nextPage:-1===t.nextPage?void 0:t.nextPage,total:t.total})}catch(e){n(e)}}))}))}async getGroups(e){return E((t=>T(this,S,"f").getAssetSourceGroups(e,t))).then((e=>_(e)))}getSupportedMimeTypes(e){return _(w(T(this,S,"f").getAssetSourceSupportedMimeTypes(e)))}getCredits(e){const t=w(T(this,S,"f").getAssetSourceCredits(e));if(t.name||t.url)return t.url?t:{name:t.name,url:void 0}}getLicense(e){const t=w(T(this,S,"f").getAssetSourceLicense(e));if(t.name||t.url)return t.url?t:{name:t.name,url:void 0}}canManageAssets(e){var t,r;return!!(null===(r=null===(t=F.get(T(this,S,"f")))||void 0===t?void 0:t.get(e))||void 0===r?void 0:r.canManageAssets)}addAssetToSource(e,t){w(T(this,S,"f").addAssetToSource(e,t))}removeAssetFromSource(e,t){w(T(this,S,"f").removeAssetFromSource(e,t))}async apply(e,t){return new Promise(((r,n)=>{T(this,S,"f").applyAssetSourceAsset(e,B(t,e),(e=>{try{const t=w(e);T(this,S,"f").isValid(t)?r(t):r(void 0)}catch(e){n(e)}}))}))}async applyToBlock(e,t,r){return E((n=>T(this,S,"f").applyAssetSourceAssetToBlock(e,B(t,e),r,n)))}async defaultApplyAsset(e){return new Promise(((t,r)=>{T(this,S,"f").defaultApplyAsset(B(e,""),(e=>{try{const r=w(e);T(this,S,"f").isValid(r)?t(r):t(void 0)}catch(e){r(e)}}))}))}async defaultApplyAssetToBlock(e,t){return E((r=>T(this,S,"f").defaultApplyAssetToBlock(B(e,""),t,r)))}dispose(){F.delete(T(this,S,"f"))}}function B(e,t){return"context"in e&&e.context.sourceId===t?e:Object.assign(Object.assign({},e),{context:{sourceId:t}})}function L(e,t){const r=`[UBQ] ${e}`;switch(t){case"Warning":console.warn(r);break;case"Error":console.error(r);break;case"Info":console.info(r);break;default:console.log(r)}}S=new WeakMap,C=new WeakSet,k=function(e){var t,r,n,o,i,a,s,u;const l=Object.assign(Object.assign({},e),{groups:_(e.groups),meta:void 0,tags:_(e.tags)});return e.meta.size()>0&&(l.meta={},_(e.meta.keys()).forEach((t=>{l.meta[t]="width"===t||"height"===t?parseFloat(e.meta.get(t)):e.meta.get(t)}))),0===(null===(t=l.groups)||void 0===t?void 0:t.length)&&delete l.groups,l.locale||delete l.locale,l.label||delete l.label,0===(null===(r=l.tags)||void 0===r?void 0:r.length)&&delete l.tags,(null===(n=l.credits)||void 0===n?void 0:n.name)||(null===(o=l.credits)||void 0===o?void 0:o.url)?l.credits.url||delete l.credits.url:delete l.credits,(null===(i=l.license)||void 0===i?void 0:i.name)||(null===(a=l.license)||void 0===a?void 0:a.url)?l.license.url||delete l.license.url:delete l.license,(null===(s=l.utm)||void 0===s?void 0:s.source)||(null===(u=l.utm)||void 0===u?void 0:u.medium)?(l.utm.source||delete l.utm.source,l.utm.medium||delete l.utm.medium):delete l.utm,l},x=function(e,t){F.has(T(this,S,"f"))||F.set(T(this,S,"f"),new Map),t.canManageAssets&&console.warn(`\nDEPRECATION WARNING:\n\n'canManageAssets' flag was found for asset source with the id '${e}'.\n\nThis flag is deprecated and will be removed in the next version. If you have used it to control if an upload buttons is rendered in the asset library, use the 'canAdd' options on an asset library entry. See documentation here: https://img.ly/docs/cesdk/ui/guides/customize-asset-library/`),F.get(T(this,S,"f")).set(e,{canManageAssets:t.canManageAssets})},P=function(e){var t;null===(t=F.get(T(this,S,"f")))||void 0===t||t.delete(e)};const R={baseURL:"/extensions/",entries:["ly.img.cesdk.fonts"]};function M(e,t=("undefined"==typeof window?"":window.location.href)){return new URL(e,""===t?void 0:t).href}function O(e){return"/"!==e[e.length-1]?`${e}/`:e}const I=async function(e,t,r=fetch,n,o=new Set(n.findAllSources())){const i=e.map((async e=>{const i=function(e,t){const r=e.endsWith("/"),n=t.startsWith("/");return r&&n?`${e.substring(0,e.length-1)}${t}`:r||n?`${e}${t}`:`${e}/${t}`}(t,`/${e}/content.json`);return r(i).then((e=>{if(!e.ok)throw new Error(e.statusText);return e.json()})).then((r=>{if(void 0===r.assets)throw new Error(`Invalid content.json for assets: ${e}`);const i=r.assets;o.has(e)||n.addLocalSource(e),i.forEach((r=>{r.meta&&Object.entries(r.meta).forEach((([e,n])=>{const o=n.toString();if(o.includes("{{base_url}}")){const n=o.replace("{{base_url}}",t);r.meta&&(r.meta[e]=n)}})),n.addAssetToSource(e,r)}))}))}));await Promise.all(i)};class U extends TypeError{constructor(e,t){let r;const{message:n,...o}=e,{path:i}=e;super(0===i.length?n:"At path: "+i.join(".")+" -- "+n),this.value=void 0,this.key=void 0,this.type=void 0,this.refinement=void 0,this.path=void 0,this.branch=void 0,this.failures=void 0,Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>{var n;return null!=(n=r)?n:r=[e,...t()]}}}function $(e){return"object"==typeof e&&null!=e}function j(e){return"string"==typeof e?JSON.stringify(e):""+e}function q(e,t,r,n){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});const{path:o,branch:i}=t,{type:a}=r,{refinement:s,message:u="Expected a value of type `"+a+"`"+(s?" with refinement `"+s+"`":"")+", but received: `"+j(n)+"`"}=e;return{value:n,type:a,refinement:s,key:o[o.length-1],path:o,branch:i,...e,message:u}}function*N(e,t,r,n){var o;$(o=e)&&"function"==typeof o[Symbol.iterator]||(e=[e]);for(const o of e){const e=q(o,t,r,n);e&&(yield e)}}function*H(e,t,r={}){const{path:n=[],branch:o=[e],coerce:i=!1,mask:a=!1}=r,s={path:n,branch:o};if(i&&(e=t.coercer(e,s),a&&"type"!==t.type&&$(t.schema)&&$(e)&&!Array.isArray(e)))for(const r in e)void 0===t.schema[r]&&delete e[r];let u=!0;for(const r of t.validator(e,s))u=!1,yield[r,void 0];for(let[r,l,c]of t.entries(e,s)){const t=H(l,c,{path:void 0===r?n:[...n,r],branch:void 0===r?o:[...o,l],coerce:i,mask:a});for(const n of t)n[0]?(u=!1,yield[n[0],void 0]):i&&(l=n[1],void 0===r?e=l:e instanceof Map?e.set(r,l):e instanceof Set?e.add(l):$(e)&&(e[r]=l))}if(u)for(const r of t.refiner(e,s))u=!1,yield[r,void 0];u&&(yield[void 0,e])}class V{constructor(e){this.TYPE=void 0,this.type=void 0,this.schema=void 0,this.coercer=void 0,this.validator=void 0,this.refiner=void 0,this.entries=void 0;const{type:t,schema:r,validator:n,refiner:o,coercer:i=(e=>e),entries:a=function*(){}}=e;this.type=t,this.schema=r,this.entries=a,this.coercer=i,this.validator=n?(e,t)=>N(n(e,t),t,this,e):()=>[],this.refiner=o?(e,t)=>N(o(e,t),t,this,e):()=>[]}assert(e){return function(e,t){const r=W(e,t);if(r[0])throw r[0]}(e,this)}create(e){return function(e,t){const r=W(e,t,{coerce:!0});if(r[0])throw r[0];return r[1]}(e,this)}is(e){return function(e,t){return!W(e,t)[0]}(e,this)}mask(e){return function(e,t){const r=W(e,t,{coerce:!0,mask:!0});if(r[0])throw r[0];return r[1]}(e,this)}validate(e,t={}){return W(e,this,t)}}function W(e,t,r={}){const n=H(e,t,r),o=function(e){const{done:t,value:r}=e.next();return t?void 0:r}(n);return o[0]?[new U(o[0],(function*(){for(const e of n)e[0]&&(yield e[0])})),void 0]:[void 0,o[1]]}function G(e,t){return new V({type:e,schema:null,validator:t})}function z(e){return new V({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||"Expected an array value, but received: "+j(e)})}function Y(){return G("boolean",(e=>"boolean"==typeof e))}function X(){return G("integer",(e=>"number"==typeof e&&!isNaN(e)&&Number.isInteger(e)||"Expected an integer, but received: "+j(e)))}function K(){return G("number",(e=>"number"==typeof e&&!isNaN(e)||"Expected a number, but received: "+j(e)))}function Q(e){const t=e?Object.keys(e):[],r=G("never",(()=>!1));return new V({type:"object",schema:e||null,*entries(n){if(e&&$(n)){const o=new Set(Object.keys(n));for(const r of t)o.delete(r),yield[r,n[r],e[r]];for(const e of o)yield[e,n[e],r]}},validator:e=>$(e)||"Expected an object, but received: "+j(e),coercer:e=>$(e)?{...e}:e})}function Z(){return G("string",(e=>"string"==typeof e||"Expected a string, but received: "+j(e)))}function J(e,t,r={}){const{exclusive:n}=r;return re(e,"max",(r=>n?r<t:r<=t||"Expected a "+e.type+" less than "+(n?"":"or equal to ")+t+" but received `"+r+"`"))}function ee(e,t,r={}){const{exclusive:n}=r;return re(e,"min",(r=>n?r>t:r>=t||"Expected a "+e.type+" greater than "+(n?"":"or equal to ")+t+" but received `"+r+"`"))}function te(e){return re(e,"nonempty",(t=>function(e){return e instanceof Map||e instanceof Set?e.size:e.length}(t)>0||"Expected a nonempty "+e.type+" but received an empty one"))}function re(e,t,r){return new V({...e,*refiner(n,o){yield*e.refiner(n,o);const i=N(r(n,o),o,e,n);for(const e of i)yield{...e,refinement:t}}})}function ne(e,t,r){const[n]=W(t,r);if(n)throw n.message=`Error in argument '${e}': ${n.message}`,n}function oe(){const e=/image\/(png|jpeg|webp|x-tga)|video\/(mp4|quicktime)|application\/octet-stream|application\/pdf/;return G("MimeType",(t=>!("string"!=typeof t||!e.test(t))||{message:`expected one of "image/png", "image/jpeg", "image/webp", "image/x-tga", "video/mp4", "video/quicktime", "application/pdf" or "application/octet-stream", but got "${t}"`}))}function ie(){const e=["Free","VerticalStack","HorizontalStack","DepthStack"];return G("SceneLayout",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}var ae;!function(e){e.Png="image/png",e.Jpeg="image/jpeg",e.WebP="image/webp",e.Tga="image/x-tga",e.Mp4="video/mp4",e.QuickTime="video/quicktime",e.Binary="application/octet-stream",e.Pdf="application/pdf",e.Zip="application/zip"}(ae||(ae={}));const se=ae,ue="undefined"!=typeof Blob?Blob:(()=>{try{return r(300).Blob}catch(e){return function(){throw new Error("Could not find Blob constructor and failed to require('buffer').Blob")}}})();var le,ce=function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},de=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class fe{constructor(e){le.set(this,void 0),Object.defineProperty(this,"onZoomLevelChanged",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=de(this,le,"f").subscribeToZoomLevel(e);return()=>{de(this,le,"f").isDeleted()||w(de(this,le,"f").unsubscribe(t))}}}),Object.defineProperty(this,"onActiveChanged",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=de(this,le,"f").subscribeToActiveSceneChange(e);return()=>{de(this,le,"f").isDeleted()||w(de(this,le,"f").unsubscribe(t))}}}),function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?o.call(e,r):o?o.value=r:t.set(e,r)}(this,le,e,"f")}async loadFromString(e){return ne("sceneContent",e,Z()),E((t=>de(this,le,"f").loadSceneFromString(e,t)))}async loadFromURL(e){return ne("url",e,Z()),E((t=>de(this,le,"f").loadSceneFromURL(e,t)))}async saveToString(){const e=this.get();if(null==e)throw new Error("No scene available.");return E((t=>{de(this,le,"f").saveSceneToString(e,t)}))}async saveToArchive(){return new Promise(((e,t)=>{const r=this.get();null==r?t(new Error("No scene available.")):de(this,le,"f").saveSceneToArchive(r,(r=>{"error"in r?t(r.error):e(new ue([r],{type:se.Zip}))}))}))}create(e="Free"){return ne("sceneLayout",e,ie()),w(de(this,le,"f").createScene(e))}createVideo(){return w(de(this,le,"f").createVideoScene())}createFromImage(e,t=300,r=1,n="Free",o=0,i=!1){return ne("url",e,Z()),ne("dpi",t,ee(K(),0)),ne("pixelScaleFactor",r,ee(K(),0)),ne("sceneLayout",n,ie()),E((a=>de(this,le,"f").createSceneFromImage(e,t,r,n,o,i,a)))}createFromVideo(e){return ne("url",e,Z()),E((t=>de(this,le,"f").createSceneFromVideo(e,t)))}get(){const e=w(de(this,le,"f").findByType("scene")),t=_(e);return t.length>0?t[0]:null}async applyTemplateFromString(e){return ne("content",e,Z()),E((t=>de(this,le,"f").applyTemplateFromString(e,t)))}async applyTemplateFromURL(e){return ne("url",e,Z()),E((t=>de(this,le,"f").applyTemplateFromURL(e,t)))}getMode(){const e=this.get();return w(de(this,le,"f").getSceneMode(e))}setDesignUnit(e){ne("designUnit",e,function(){const e=["Pixel","Millimeter","Inch"];return G("DesignUnit",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}());const t=this.get();w(de(this,le,"f").setDesignUnit(t,e))}getDesignUnit(){const e=this.get();return w(de(this,le,"f").getDesignUnit(e))}getPages(){return _(w(de(this,le,"f").getPages()))}getCurrentPage(){const e=this.get();if(null==e)return null;const t=w(de(this,le,"f").findNearestToViewPortCenterByKind(e,"page")),r=_(t);return r.length>0?r[0]:null}findNearestToViewPortCenterByType(e){ne("type",e,Z());const t=this.get();if(null==t)return[];const r=w(de(this,le,"f").findNearestToViewPortCenterByType(t,e));return _(r)}findNearestToViewPortCenterByKind(e){ne("kind",e,Z());const t=this.get();if(null==t)return[];const r=w(de(this,le,"f").findNearestToViewPortCenterByKind(t,e));return _(r)}setZoomLevel(e=1){const t=this.get();ne("zoomLevel",e,ee(K(),0)),de(this,le,"f").setZoomLevel(t,e)}getZoomLevel(){const e=this.get();return w(de(this,le,"f").getZoomLevel(e))}async zoomToBlock(e,t=0,r=0,n=0,o=0){return ne("id",e,X()),E((i=>de(this,le,"f").zoomToBlock(e,t,r,n,o,i)))}enableZoomAutoFit(e,t,r=0,n=0,o=0,i=0){return ne("id",e,X()),ne("axis",t,function(){const e=["Horizontal","Vertical","Both"];return G("ZoomAutoFitAxis",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}()),"Horizontal"===t?(ne("paddingBefore",r,K()),ne("paddingAfter",n,K()),w(de(this,le,"f").enableZoomAutoFit(e,t,r,0,n,0))):"Vertical"===t?(ne("paddingBefore",r,K()),ne("paddingAfter",n,K()),w(de(this,le,"f").enableZoomAutoFit(e,t,0,r,0,n))):(ne("paddingLeft",r,K()),ne("paddingTop",n,K()),ne("paddingRight",o,K()),ne("paddingBottom",i,K()),w(de(this,le,"f").enableZoomAutoFit(e,t,r,n,o,i)))}disableZoomAutoFit(e){return ne("blockOrScene",e,X()),w(de(this,le,"f").disableZoomAutoFit(e))}isZoomAutoFitEnabled(e){return ne("blockOrScene",e,X()),w(de(this,le,"f").isZoomAutoFitEnabled(e))}unstable_enableCameraPositionClamping(e,t=0,r=0,n=0,o=0,i=0,a=0,s=0,u=0){return ne("ids",e,z(K())),ne("paddingLeft",t,K()),ne("paddingTop",r,K()),ne("paddingRight",n,K()),ne("paddingBottom",o,K()),ne("scaledPaddingLeft",t,K()),ne("scaledPaddingTop",r,K()),ne("scaledPaddingRight",n,K()),ne("scaledPaddingBottom",o,K()),w(de(this,le,"f").unstable_enableCameraPositionClamping(e,t,r,n,o,i,a,s,u))}unstable_disableCameraPositionClamping(e=this.get()){if(null==e)throw new Error("No scene available.");return w(de(this,le,"f").unstable_disableCameraPositionClamping(e))}unstable_isCameraPositionClampingEnabled(e=this.get()){if(null==e)throw new Error("No scene available.");return w(de(this,le,"f").unstable_isCameraPositionClampingEnabled(e))}unstable_enableCameraZoomClamping(e,t=-1,r=-1,n=0,o=0,i=0,a=0){return ne("ids",e,z(K())),ne("minZoomLimit",t,K()),ne("maxZoomLimit",r,K()),ne("paddingLeft",n,K()),ne("paddingTop",o,K()),ne("paddingRight",i,K()),ne("paddingBottom",a,K()),w(de(this,le,"f").unstable_enableCameraZoomClamping(e,t,r,n,o,i,a))}unstable_disableCameraZoomClamping(e=this.get()){if(null==e)throw new Error("No scene available.");return w(de(this,le,"f").unstable_disableCameraZoomClamping(e))}unstable_isCameraZoomClampingEnabled(e=this.get()){if(null==e)throw new Error("No scene available.");return w(de(this,le,"f").unstable_isCameraZoomClampingEnabled(e))}}le=new WeakMap,ce([o],fe.prototype,"loadFromString",null),ce([o],fe.prototype,"loadFromURL",null),ce([o],fe.prototype,"create",null),ce([o],fe.prototype,"createVideo",null),ce([o],fe.prototype,"createFromImage",null),ce([o],fe.prototype,"createFromVideo",null),ce([t],fe.prototype,"get",null),ce([o],fe.prototype,"applyTemplateFromString",null),ce([o],fe.prototype,"applyTemplateFromURL",null),ce([t],fe.prototype,"getMode",null),ce([o],fe.prototype,"setDesignUnit",null),ce([t],fe.prototype,"getDesignUnit",null),ce([t],fe.prototype,"getPages",null),ce([t],fe.prototype,"getCurrentPage",null),ce([t],fe.prototype,"findNearestToViewPortCenterByType",null),ce([t],fe.prototype,"findNearestToViewPortCenterByKind",null),ce([o],fe.prototype,"setZoomLevel",null),ce([t],fe.prototype,"getZoomLevel",null),ce([o],fe.prototype,"zoomToBlock",null),ce([o],fe.prototype,"enableZoomAutoFit",null),ce([o],fe.prototype,"disableZoomAutoFit",null),ce([t],fe.prototype,"isZoomAutoFitEnabled",null);var pe,he=function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},me=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class ge{constructor(e){pe.set(this,void 0),Object.defineProperty(this,"onSelectionChanged",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=me(this,pe,"f").subscribeToSelectionChange(e);return()=>{me(this,pe,"f").isDeleted()||w(me(this,pe,"f").unsubscribe(t))}}}),Object.defineProperty(this,"onClicked",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=me(this,pe,"f").subscribeToBlockClicked(e);return()=>{me(this,pe,"f").isDeleted()||w(me(this,pe,"f").unsubscribe(t))}}}),function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?o.call(e,r):o?o.value=r:t.set(e,r)}(this,pe,e,"f")}async export(e,t=se.Png,r={}){var n,o,i;ne("handle",e,K()),ne("mimeType",t,oe()),ne("options",r,Q());const a=null!=r.targetWidth&&null!=r.targetHeight,s=null!==(n=r.jpegQuality)&&void 0!==n?n:.9,u=null!==(o=r.webpQuality)&&void 0!==o?o:1,l=null!==(i=r.pngCompressionLevel)&&void 0!==i?i:5;return ne("jpegQuality",s,ee(J(K(),1),0,{exclusive:!0})),ne("webpQuality",u,ee(J(K(),1),0,{exclusive:!0})),ne("pngCompressionLevel",l,ee(J(X(),9),0)),null==r.targetWidth&&null==r.targetHeight||(ne("targetWidth",r.targetWidth,K()),ne("targetHeight",r.targetHeight,K())),new Promise(((n,o)=>{var i,c,d;me(this,pe,"f").exportToBuffer(e,t,(e=>{"error"in e?o(e.error):n(new ue([e],{type:t}))}),{pngCompressionLevel:l,jpegQuality:s,webpQuality:u,useTargetSize:a,targetWidth:null!==(i=r.targetWidth)&&void 0!==i?i:0,targetHeight:null!==(c=r.targetHeight)&&void 0!==c?c:0,exportPdfWithHighCompatibility:null===(d=r.exportPdfWithHighCompatibility)||void 0===d||d})}))}async exportWithColorMask(e,t=se.Png,r,n,o,i={}){var a,s,u;ne("handle",e,K()),ne("mimeType",t,oe()),ne("options",i,Q());const l=null!=i.targetWidth&&null!=i.targetHeight,c=null!==(a=i.jpegQuality)&&void 0!==a?a:.9,d=null!==(s=i.webpQuality)&&void 0!==s?s:1,f=null!==(u=i.pngCompressionLevel)&&void 0!==u?u:5;return ne("jpegQuality",c,ee(J(K(),1),0,{exclusive:!0})),ne("webpQuality",d,ee(J(K(),1),0,{exclusive:!0})),ne("pngCompressionLevel",f,ee(J(X(),9),0)),null==i.targetWidth&&null==i.targetHeight||(ne("targetWidth",i.targetWidth,K()),ne("targetHeight",i.targetHeight,K())),new Promise(((a,s)=>{var u,p,h;me(this,pe,"f").exportWithColorMaskToBuffer(e,t,r,n,o,((e,r)=>{if("error"in e)s(e.error);else if("error"in r)s(r.error);else{const n=new ue([e],{type:t}),o=new ue([r],{type:t});a([n,o])}}),{pngCompressionLevel:f,jpegQuality:c,webpQuality:d,useTargetSize:l,targetWidth:null!==(u=i.targetWidth)&&void 0!==u?u:0,targetHeight:null!==(p=i.targetHeight)&&void 0!==p?p:0,exportPdfWithHighCompatibility:null===(h=i.exportPdfWithHighCompatibility)||void 0===h||h})}))}async exportVideo(e,t=se.Mp4,r,n){throw new Error("Method not implemented. An implementation is available on the BlockAPI at engine.block or cesdk.engine.block")}async loadFromString(e){return ne("content",e,Z()),E((t=>me(this,pe,"f").loadBlocksFromString(e,t))).then((e=>_(e)))}async saveToString(e){return ne("blocks",e,z(K())),E((t=>me(this,pe,"f").saveBlocksToString(e,t)))}create(e){return ne("type",e,Z()),w(me(this,pe,"f").create(e))}createFill(e){return ne("type",e,Z()),w(me(this,pe,"f").createFill(e))}getType(e){return ne("id",e,X()),w(me(this,pe,"f").getType(e))}getKind(e){return ne("id",e,X()),w(me(this,pe,"f").getKind(e))}setKind(e,t){ne("id",e,X()),w(me(this,pe,"f").setKind(e,t))}select(e){return ne("id",e,X()),w(me(this,pe,"f").select(e))}setSelected(e,t){return ne("id",e,X()),ne("selected",t,Y()),w(me(this,pe,"f").setSelected(e,t))}isSelected(e){return ne("id",e,X()),w(me(this,pe,"f").isSelected(e))}findAllSelected(){return _(me(this,pe,"f").findAllSelected())}isGroupable(e){return ne("ids",e,z(K())),w(me(this,pe,"f").isGroupable(e))}group(e){return ne("ids",e,te(z(K()))),w(me(this,pe,"f").group(e))}ungroup(e){return ne("id",e,K()),w(me(this,pe,"f").ungroup(e))}enterGroup(e){return ne("id",e,K()),w(me(this,pe,"f").enterGroup(e))}exitGroup(e){return ne("id",e,K()),w(me(this,pe,"f").exitGroup(e))}setName(e,t){return ne("id",e,X()),ne("name",t,Z()),w(me(this,pe,"f").setName(e,t))}getName(e){return ne("id",e,X()),w(me(this,pe,"f").getName(e))}getUUID(e){return ne("id",e,X()),w(me(this,pe,"f").getUUID(e))}findByName(e){ne("name",e,Z());const t=me(this,pe,"f").findByName(e);return _(t)}findByType(e){ne("type",e,Z());const t=w(me(this,pe,"f").findByType(e));return _(t)}findByKind(e){ne("kind",e,Z());const t=w(me(this,pe,"f").findByKind(e));return _(t)}findAll(){return _(me(this,pe,"f").findAll())}findAllPlaceholders(){return _(me(this,pe,"f").findAllPlaceholders())}createShape(e){return ne("type",e,Z()),w(me(this,pe,"f").createShape(e))}hasShape(e){return ne("id",e,X()),w(me(this,pe,"f").hasShape(e))}getShape(e){return ne("id",e,X()),w(me(this,pe,"f").getShape(e))}setShape(e,t){return ne("id",e,X()),ne("shape",t,X()),w(me(this,pe,"f").setShape(e,t))}isVisible(e){return ne("id",e,X()),w(me(this,pe,"f").isVisible(e))}setVisible(e,t){return ne("id",e,X()),ne("visible",t,Y()),w(me(this,pe,"f").setVisible(e,t))}isClipped(e){return ne("id",e,X()),w(me(this,pe,"f").isClipped(e))}setClipped(e,t){return ne("id",e,X()),ne("clipped",t,Y()),w(me(this,pe,"f").setClipped(e,t))}getPositionX(e){return ne("id",e,X()),w(me(this,pe,"f").getPositionX(e))}getPositionXMode(e){return ne("id",e,X()),w(me(this,pe,"f").getPositionXMode(e))}getPositionY(e){return ne("id",e,X()),w(me(this,pe,"f").getPositionY(e))}getPositionYMode(e){return ne("id",e,X()),w(me(this,pe,"f").getPositionYMode(e))}setPositionX(e,t){return ne("id",e,X()),ne("value",t,K()),w(me(this,pe,"f").setPositionX(e,t))}setPositionXMode(e,t){return ne("id",e,X()),w(me(this,pe,"f").setPositionXMode(e,t))}setPositionY(e,t){return ne("id",e,X()),ne("value",t,K()),w(me(this,pe,"f").setPositionY(e,t))}setPositionYMode(e,t){return ne("id",e,X()),w(me(this,pe,"f").setPositionYMode(e,t))}setAlwaysOnTop(e,t){return ne("id",e,X()),ne("enabled",t,Y()),w(me(this,pe,"f").setAlwaysOnTop(e,t))}setAlwaysOnBottom(e,t){return ne("id",e,X()),ne("enabled",t,Y()),w(me(this,pe,"f").setAlwaysOnBottom(e,t))}isAlwaysOnTop(e){return ne("id",e,X()),w(me(this,pe,"f").isAlwaysOnTop(e))}isAlwaysOnBottom(e){return ne("id",e,X()),w(me(this,pe,"f").isAlwaysOnBottom(e))}bringToFront(e){return ne("id",e,K()),w(me(this,pe,"f").bringToFront(e))}sendToBack(e){return ne("id",e,K()),w(me(this,pe,"f").sendToBack(e))}bringForward(e){return ne("id",e,K()),w(me(this,pe,"f").bringForward(e))}sendBackward(e){return ne("id",e,K()),w(me(this,pe,"f").sendBackward(e))}getRotation(e){return ne("id",e,X()),w(me(this,pe,"f").getRotation(e))}setRotation(e,t){return ne("id",e,X()),ne("radians",t,K()),w(me(this,pe,"f").setRotation(e,t))}getFlipHorizontal(e){return ne("id",e,X()),w(me(this,pe,"f").getFlip(e)).horizontal}getFlipVertical(e){return ne("id",e,X()),w(me(this,pe,"f").getFlip(e)).vertical}setFlipHorizontal(e,t){return ne("id",e,X()),ne("flip",t,Y()),w(me(this,pe,"f").setFlipHorizontal(e,t))}setFlipVertical(e,t){return ne("id",e,X()),ne("flip",t,Y()),w(me(this,pe,"f").setFlipVertical(e,t))}hasContentFillMode(e){return ne("id",e,X()),w(me(this,pe,"f").hasContentFillMode(e))}getWidth(e){return ne("id",e,X()),w(me(this,pe,"f").getWidth(e))}getWidthMode(e){return ne("id",e,X()),w(me(this,pe,"f").getWidthMode(e))}getHeight(e){return ne("id",e,X()),w(me(this,pe,"f").getHeight(e))}getHeightMode(e){return ne("id",e,X()),w(me(this,pe,"f").getHeightMode(e))}setWidth(e,t){return ne("id",e,X()),ne("value",t,K()),w(me(this,pe,"f").setWidth(e,t))}setWidthMode(e,t){return ne("id",e,X()),w(me(this,pe,"f").setWidthMode(e,t))}setHeight(e,t){return ne("id",e,X()),ne("value",t,K()),w(me(this,pe,"f").setHeight(e,t))}setHeightMode(e,t){return ne("id",e,X()),w(me(this,pe,"f").setHeightMode(e,t))}getFrameX(e){return ne("id",e,X()),w(me(this,pe,"f").getLastFrameX(e))}getFrameY(e){return ne("id",e,X()),w(me(this,pe,"f").getLastFrameY(e))}getFrameWidth(e){return ne("id",e,X()),w(me(this,pe,"f").getLastFrameWidth(e))}getFrameHeight(e){return ne("id",e,X()),w(me(this,pe,"f").getLastFrameHeight(e))}setContentFillMode(e,t){return ne("id",e,X()),w(me(this,pe,"f").setContentFillMode(e,t))}getContentFillMode(e){return ne("id",e,X()),w(me(this,pe,"f").getContentFillMode(e))}duplicate(e){return ne("id",e,X()),w(me(this,pe,"f").duplicate(e))}destroy(e){return ne("id",e,X()),w(me(this,pe,"f").destroy(e))}isValid(e){return ne("id",e,X()),me(this,pe,"f").isValid(e)}getParent(e){return ne("id",e,X()),w(me(this,pe,"f").hasParent(e))?w(me(this,pe,"f").getParent(e)):null}getChildren(e){ne("id",e,X());const t=w(me(this,pe,"f").getChildren(e));return _(t)}insertChild(e,t,r){return ne("parent",e,K()),ne("child",t,K()),ne("index",r,ee(K(),0)),w(me(this,pe,"f").insertChild(e,t,r))}appendChild(e,t){return ne("parent",e,K()),ne("child",t,K()),w(me(this,pe,"f").appendChild(e,t))}referencesAnyVariables(e){return ne("id",e,X()),w(me(this,pe,"f").referencesAnyVariables(e))}getGlobalBoundingBoxX(e){return ne("id",e,X()),w(me(this,pe,"f").getGlobalBoundingBoxX(e))}getGlobalBoundingBoxY(e){return ne("id",e,X()),w(me(this,pe,"f").getGlobalBoundingBoxY(e))}getGlobalBoundingBoxWidth(e){return ne("id",e,X()),w(me(this,pe,"f").getGlobalBoundingBoxWidth(e))}getGlobalBoundingBoxHeight(e){return ne("id",e,X()),w(me(this,pe,"f").getGlobalBoundingBoxHeight(e))}getScreenSpaceBoundingBoxXYWH(e){return ne("ids",e,z(K())),w(me(this,pe,"f").getScreenSpaceBoundingBoxXYWH(e))}alignHorizontally(e,t){return ne("ids",e,te(z(K()))),w(me(this,pe,"f").alignHorizontally(e,t))}alignVertically(e,t){return ne("ids",e,te(z(K()))),w(me(this,pe,"f").alignVertically(e,t))}isAlignable(e){return ne("ids",e,z(K())),w(me(this,pe,"f").isAlignable(e))}distributeHorizontally(e){return ne("ids",e,te(z(K()))),w(me(this,pe,"f").distributeHorizontally(e))}distributeVertically(e){return ne("ids",e,te(z(K()))),w(me(this,pe,"f").distributeVertically(e))}isDistributable(e){return ne("ids",e,z(K())),w(me(this,pe,"f").isDistributable(e))}fillParent(e){return ne("id",e,X()),w(me(this,pe,"f").fillParent(e))}resizeContentAware(e,t,r){return ne("ids",e,z(K())),ne("width",t,K()),ne("height",r,K()),w(me(this,pe,"f").resizeContentAware(e,t,r))}scale(e,t,r=0,n=0){return ne("id",e,X()),w(me(this,pe,"f").scale(e,t,r,n))}findAllProperties(e){return ne("id",e,X()),_(w(me(this,pe,"f").findAllProperties(e)))}isPropertyReadable(e){return ne("property",e,Z()),me(this,pe,"f").isPropertyReadable(e)}isPropertyWritable(e){return ne("property",e,Z()),me(this,pe,"f").isPropertyWritable(e)}getPropertyType(e){return ne("property",e,Z()),w(me(this,pe,"f").getPropertyType(e))}getEnumValues(e){return ne("enumProperty",e,Z()),_(w(me(this,pe,"f").getEnumValues(e)))}setBool(e,t,r){return ne("id",e,X()),ne("property",t,Z()),ne("value",r,Y()),w(me(this,pe,"f").setBool(e,t,r))}getBool(e,t){return ne("id",e,X()),ne("property",t,Z()),w(me(this,pe,"f").getBool(e,t))}setInt(e,t,r){return ne("id",e,X()),ne("property",t,Z()),ne("value",r,X()),w(me(this,pe,"f").setInt(e,t,r))}getInt(e,t){return ne("id",e,X()),ne("property",t,Z()),w(me(this,pe,"f").getInt(e,t))}setFloat(e,t,r){return ne("id",e,X()),ne("property",t,Z()),ne("value",r,K()),w(me(this,pe,"f").setFloat(e,t,r))}getFloat(e,t){return ne("id",e,X()),ne("property",t,Z()),w(me(this,pe,"f").getFloat(e,t))}setDouble(e,t,r){return ne("id",e,X()),ne("property",t,Z()),ne("value",r,K()),w(me(this,pe,"f").setDouble(e,t,r))}getDouble(e,t){return ne("id",e,X()),ne("property",t,Z()),w(me(this,pe,"f").getDouble(e,t))}setString(e,t,r){return ne("id",e,X()),ne("property",t,Z()),ne("value",r,Z()),w(me(this,pe,"f").setString(e,t,r))}getString(e,t){return ne("id",e,X()),ne("property",t,Z()),w(me(this,pe,"f").getString(e,t))}setColor(e,t,r){return ne("id",e,X()),ne("property",t,Z()),w(me(this,pe,"f").setColor(e,t,i.fromColor(r)))}getColor(e,t){return ne("id",e,X()),ne("property",t,Z()),i.toColor(w(me(this,pe,"f").getColor(e,t)))}setColorRGBA(e,t,r,n,o,i=1){return ne("id",e,X()),ne("property",t,Z()),ne("r",r,K()),ne("g",n,K()),ne("b",o,K()),ne("a",i,K()),w(me(this,pe,"f").setColorRGBA(e,t,r,n,o,i))}getColorRGBA(e,t){return ne("id",e,X()),ne("property",t,Z()),w(me(this,pe,"f").getColorRGBA(e,t))}setColorSpot(e,t,r,n=1){return ne("id",e,X()),ne("property",t,Z()),ne("name",r,Z()),ne("tint",n,K()),w(me(this,pe,"f").setColorSpot(e,t,r,n))}getColorSpotName(e,t){return ne("id",e,X()),ne("property",t,Z()),w(me(this,pe,"f").getColorSpotName(e,t))}getColorSpotTint(e,t){return ne("id",e,X()),ne("property",t,Z()),w(me(this,pe,"f").getColorSpotTint(e,t))}setGradientColorStops(e,t,r){ne("id",e,X()),ne("property",t,Z());const n=r.map((e=>({color:i.fromColor(e.color),stop:e.stop})));return w(me(this,pe,"f").setGradientColorStops(e,t,n))}getGradientColorStops(e,t){ne("id",e,X()),ne("property",t,Z());const r=w(me(this,pe,"f").getGradientColorStops(e,t));return _(r).map((e=>({color:i.toColor(e.color),stop:e.stop})))}setEnum(e,t,r){return ne("id",e,X()),ne("property",t,Z()),ne("value",r,Z()),w(me(this,pe,"f").setEnum(e,t,r))}getEnum(e,t){return ne("id",e,X()),ne("property",t,Z()),w(me(this,pe,"f").getEnum(e,t))}hasCrop(e){return ne("id",e,X()),w(me(this,pe,"f").hasCrop(e))}setCropScaleX(e,t){return ne("id",e,X()),ne("scaleX",t,K()),w(me(this,pe,"f").setCropScaleX(e,t))}setCropScaleY(e,t){return ne("id",e,X()),ne("scaleY",t,K()),w(me(this,pe,"f").setCropScaleY(e,t))}setCropRotation(e,t){return ne("id",e,X()),ne("rotation",t,K()),w(me(this,pe,"f").setCropRotation(e,t))}setCropScaleRatio(e,t){return ne("id",e,X()),ne("scaleRatio",t,K()),w(me(this,pe,"f").setCropScaleRatio(e,t))}setCropTranslationX(e,t){return ne("id",e,X()),ne("translationX",t,K()),w(me(this,pe,"f").setCropTranslationX(e,t))}setCropTranslationY(e,t){return ne("id",e,X()),ne("translationY",t,K()),w(me(this,pe,"f").setCropTranslationY(e,t))}resetCrop(e){return ne("id",e,X()),w(me(this,pe,"f").resetCrop(e))}getCropScaleX(e){return ne("id",e,X()),w(me(this,pe,"f").getCropScaleX(e))}getCropScaleY(e){return ne("id",e,X()),w(me(this,pe,"f").getCropScaleY(e))}getCropRotation(e){return ne("id",e,X()),w(me(this,pe,"f").getCropRotation(e))}getCropScaleRatio(e){return ne("id",e,X()),w(me(this,pe,"f").getCropScaleRatio(e))}getCropTranslationX(e){return ne("id",e,X()),w(me(this,pe,"f").getCropTranslationX(e))}getCropTranslationY(e){return ne("id",e,X()),w(me(this,pe,"f").getCropTranslationY(e))}adjustCropToFillFrame(e,t){return ne("id",e,X()),ne("minScaleRatio",t,K()),w(me(this,pe,"f").adjustCropToFillFrame(e,t))}flipCropHorizontal(e){return ne("id",e,X()),w(me(this,pe,"f").flipCropHorizontal(e))}flipCropVertical(e){return ne("id",e,X()),w(me(this,pe,"f").flipCropVertical(e))}hasOpacity(e){return ne("id",e,X()),w(me(this,pe,"f").hasOpacity(e))}setOpacity(e,t){return ne("id",e,X()),ne("opacity",t,K()),w(me(this,pe,"f").setOpacity(e,t))}getOpacity(e){return ne("id",e,X()),w(me(this,pe,"f").getOpacity(e))}hasBlendMode(e){return ne("id",e,X()),w(me(this,pe,"f").hasBlendMode(e))}setBlendMode(e,t){return ne("id",e,X()),ne("blendMode",t,Z()),w(me(this,pe,"f").setBlendMode(e,t))}getBlendMode(e){return ne("id",e,X()),w(me(this,pe,"f").getBlendMode(e))}hasFillColor(e){return ne("id",e,X()),w(me(this,pe,"f").hasFillColor(e))}setFillColorRGBA(e,t,r,n,o=1){return ne("id",e,X()),ne("r",t,K()),ne("g",r,K()),ne("b",n,K()),ne("a",o,K()),w(me(this,pe,"f").setFillColorRGBA(e,t,r,n,o))}getFillColorRGBA(e){return ne("id",e,X()),w(me(this,pe,"f").getFillColorRGBA(e))}setFillColorEnabled(e,t){return ne("id",e,X()),ne("enabled",t,Y()),w(me(this,pe,"f").setFillColorEnabled(e,t))}isFillColorEnabled(e){return ne("id",e,X()),w(me(this,pe,"f").isFillColorEnabled(e))}createEffect(e){return ne("type",e,Z()),w(me(this,pe,"f").createEffect(e))}hasEffects(e){return ne("id",e,X()),w(me(this,pe,"f").hasEffects(e))}getEffects(e){ne("id",e,X());const t=w(me(this,pe,"f").getEffects(e));return _(t)}insertEffect(e,t,r){ne("id",e,X()),ne("effectId",t,X()),ne("index",r,ee(X(),0)),w(me(this,pe,"f").insertEffect(e,t,r))}appendEffect(e,t){ne("id",e,X()),ne("effectId",t,X()),w(me(this,pe,"f").appendEffect(e,t))}removeEffect(e,t){ne("id",e,X()),ne("index",t,ee(X(),0)),w(me(this,pe,"f").removeEffect(e,t))}hasEffectEnabled(e){return ne("effectId",e,X()),w(me(this,pe,"f").hasEffectEnabled(e))}setEffectEnabled(e,t){ne("effectId",e,X()),ne("enabled",t,Y()),w(me(this,pe,"f").setEffectEnabled(e,t))}isEffectEnabled(e){return ne("effectId",e,X()),w(me(this,pe,"f").isEffectEnabled(e))}createBlur(e){return ne("type",e,Z()),w(me(this,pe,"f").createBlur(e))}hasBlur(e){return ne("id",e,X()),w(me(this,pe,"f").hasBlur(e))}setBlur(e,t){ne("id",e,X()),ne("blurId",t,X()),w(me(this,pe,"f").setBlur(e,t))}getBlur(e){return ne("id",e,X()),w(me(this,pe,"f").getBlur(e))}setBlurEnabled(e,t){ne("id",e,X()),ne("enabled",t,Y()),w(me(this,pe,"f").setBlurEnabled(e,t))}isBlurEnabled(e){return ne("id",e,X()),w(me(this,pe,"f").isBlurEnabled(e))}hasBackgroundColor(e){return ne("id",e,X()),w(me(this,pe,"f").hasBackgroundColor(e))}setBackgroundColorRGBA(e,t,r,n,o=1){return ne("id",e,X()),ne("r",t,K()),ne("g",r,K()),ne("b",n,K()),ne("a",o,K()),w(me(this,pe,"f").setBackgroundColorRGBA(e,t,r,n,o))}getBackgroundColorRGBA(e){return ne("id",e,X()),w(me(this,pe,"f").getBackgroundColorRGBA(e))}setBackgroundColorEnabled(e,t){return ne("id",e,X()),ne("enabled",t,Y()),w(me(this,pe,"f").setBackgroundColorEnabled(e,t))}isBackgroundColorEnabled(e){return ne("id",e,X()),w(me(this,pe,"f").isBackgroundColorEnabled(e))}hasStroke(e){return ne("id",e,X()),w(me(this,pe,"f").hasStroke(e))}setStrokeEnabled(e,t){return ne("id",e,X()),ne("enabled",t,Y()),w(me(this,pe,"f").setStrokeEnabled(e,t))}isStrokeEnabled(e){return ne("id",e,X()),w(me(this,pe,"f").isStrokeEnabled(e))}setStrokeColorRGBA(e,t,r,n,o=1){return ne("id",e,X()),ne("r",t,K()),ne("g",r,K()),ne("b",n,K()),ne("a",o,K()),w(me(this,pe,"f").setStrokeColorRGBA(e,t,r,n,o))}setStrokeColor(e,t){return ne("id",e,X()),w(me(this,pe,"f").setStrokeColor(e,i.fromColor(t)))}getStrokeColorRGBA(e){return ne("id",e,X()),w(me(this,pe,"f").getStrokeColorRGBA(e))}getStrokeColor(e){return ne("id",e,X()),i.toColor(w(me(this,pe,"f").getStrokeColor(e)))}setStrokeWidth(e,t){return ne("id",e,X()),ne("width",t,K()),w(me(this,pe,"f").setStrokeWidth(e,t))}getStrokeWidth(e){return ne("id",e,X()),w(me(this,pe,"f").getStrokeWidth(e))}setStrokeStyle(e,t){return ne("id",e,X()),w(me(this,pe,"f").setStrokeStyle(e,t))}getStrokeStyle(e){return ne("id",e,X()),w(me(this,pe,"f").getStrokeStyle(e))}setStrokePosition(e,t){return ne("id",e,X()),w(me(this,pe,"f").setStrokePosition(e,t))}getStrokePosition(e){return ne("id",e,X()),w(me(this,pe,"f").getStrokePosition(e))}setStrokeCornerGeometry(e,t){return ne("id",e,X()),w(me(this,pe,"f").setStrokeCornerGeometry(e,t))}getStrokeCornerGeometry(e){return ne("id",e,X()),w(me(this,pe,"f").getStrokeCornerGeometry(e))}hasDropShadow(e){return ne("id",e,X()),w(me(this,pe,"f").hasDropShadow(e))}setDropShadowEnabled(e,t){return ne("id",e,X()),ne("enabled",t,Y()),w(me(this,pe,"f").setDropShadowEnabled(e,t))}isDropShadowEnabled(e){return ne("id",e,X()),w(me(this,pe,"f").isDropShadowEnabled(e))}setDropShadowColorRGBA(e,t,r,n,o=1){return ne("id",e,X()),ne("r",t,K()),ne("g",r,K()),ne("b",n,K()),ne("a",o,K()),w(me(this,pe,"f").setDropShadowColorRGBA(e,t,r,n,o))}setDropShadowColor(e,t){return ne("id",e,X()),w(me(this,pe,"f").setDropShadowColor(e,i.fromColor(t)))}getDropShadowColorRGBA(e){return ne("id",e,X()),w(me(this,pe,"f").getDropShadowColorRGBA(e))}getDropShadowColor(e){return ne("id",e,X()),i.toColor(w(me(this,pe,"f").getDropShadowColor(e)))}setDropShadowOffsetX(e,t){return ne("id",e,X()),ne("offsetX",t,K()),w(me(this,pe,"f").setDropShadowOffsetX(e,t))}getDropShadowOffsetX(e){return ne("id",e,X()),w(me(this,pe,"f").getDropShadowOffsetX(e))}setDropShadowOffsetY(e,t){return ne("id",e,X()),ne("offsetY",t,K()),w(me(this,pe,"f").setDropShadowOffsetY(e,t))}getDropShadowOffsetY(e){return ne("id",e,X()),w(me(this,pe,"f").getDropShadowOffsetY(e))}setDropShadowBlurRadiusX(e,t){return ne("id",e,X()),ne("blurRadiusX",t,K()),w(me(this,pe,"f").setDropShadowBlurRadiusX(e,t))}getDropShadowBlurRadiusX(e){return ne("id",e,X()),w(me(this,pe,"f").getDropShadowBlurRadiusX(e))}setDropShadowBlurRadiusY(e,t){return ne("id",e,X()),ne("blurRadiusY",t,K()),w(me(this,pe,"f").setDropShadowBlurRadiusY(e,t))}getDropShadowBlurRadiusY(e){return ne("id",e,X()),w(me(this,pe,"f").getDropShadowBlurRadiusY(e))}setDropShadowClip(e,t){return ne("id",e,X()),w(me(this,pe,"f").setDropShadowClip(e,t))}getDropShadowClip(e){return ne("id",e,X()),w(me(this,pe,"f").getDropShadowClip(e))}createCutoutFromBlocks(e,t=2,r=4){return ne("ids",e,z(X())),ne("vectorizeDistanceThreshold",t,K()),ne("maxSmoothingDistance",r,K()),w(me(this,pe,"f").createCutoutFromBlocks(e,t,r))}createCutoutFromPath(e){return ne("path",e,Z()),w(me(this,pe,"f").createCutoutFromPath(e))}createCutoutFromOperation(e,t){return ne("ids",e,z(X())),ne("op",t,function(){const e=["Difference","Intersection","Union","XOR"];return G("CutoutOperation",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}()),w(me(this,pe,"f").createCutoutFromOperation(e,t))}replaceText(e,t,r=-1,n=-1){ne("id",e,X()),ne("text",t,Z()),ne("from",r,X()),ne("to",n,X()),w(me(this,pe,"f").replaceText(e,t,r,n))}removeText(e,t=-1,r=-1){ne("id",e,X()),ne("from",t,X()),ne("to",r,X()),w(me(this,pe,"f").removeText(e,t,r))}setTextColor(e,t,r=-1,n=-1){ne("id",e,X()),ne("from",r,X()),ne("to",n,X()),w(me(this,pe,"f").setTextColor(e,i.fromColor(t),r,n))}getTextColors(e,t=-1,r=-1){ne("id",e,X()),ne("from",t,X()),ne("to",r,X());const n=me(this,pe,"f").getTextColors(e,t,r);return _(w(n)).map((e=>i.toColor(e)))}getTextFontWeights(e,t=-1,r=-1){return ne("id",e,X()),ne("from",t,X()),ne("to",r,X()),_(w(me(this,pe,"f").getTextFontWeights(e,t,r)))}getTextFontStyles(e,t=-1,r=-1){return ne("id",e,X()),ne("from",t,X()),ne("to",r,X()),_(w(me(this,pe,"f").getTextFontStyles(e,t,r)))}getTextCases(e,t=-1,r=-1){return ne("id",e,X()),ne("from",t,X()),ne("to",r,X()),_(w(me(this,pe,"f").getTextCases(e,t,r)))}setTextCase(e,t,r=-1,n=-1){ne("id",e,X()),ne("textCase",t,Z()),ne("from",r,X()),ne("to",n,X()),w(me(this,pe,"f").setTextCase(e,t,r,n))}getTextCursorRange(){return w(me(this,pe,"f").getTextCursorRange())}hasFill(e){return ne("id",e,X()),w(me(this,pe,"f").hasFill(e))}isFillEnabled(e){return ne("id",e,X()),w(me(this,pe,"f").isFillEnabled(e))}setFillEnabled(e,t){return ne("id",e,X()),w(me(this,pe,"f").setFillEnabled(e,t))}getFill(e){return ne("id",e,X()),w(me(this,pe,"f").getFill(e))}setFill(e,t){return ne("id",e,X()),ne("fill",t,X()),w(me(this,pe,"f").setFill(e,t))}setFillSolidColor(e,t,r,n,o=1){ne("id",e,X()),w(me(this,pe,"f").setFillSolidColor(e,t,r,n,o))}getFillSolidColor(e){return ne("id",e,X()),w(me(this,pe,"f").getFillSolidColor(e))}setPlaceholderEnabled(e,t){ne("id",e,X()),ne("enabled",t,Y()),w(me(this,pe,"f").setPlaceholderEnabled(e,t))}isPlaceholderEnabled(e){return ne("id",e,X()),w(me(this,pe,"f").isPlaceholderEnabled(e))}hasPlaceholderBehavior(e){return ne("id",e,X()),w(me(this,pe,"f").hasPlaceholderBehavior(e))}setPlaceholderBehaviorEnabled(e,t){ne("id",e,X()),w(me(this,pe,"f").setPlaceholderBehaviorEnabled(e,t))}isPlaceholderBehaviorEnabled(e){return ne("id",e,X()),w(me(this,pe,"f").isPlaceholderBehaviorEnabled(e))}hasPlaceholderControls(e){return ne("id",e,X()),w(me(this,pe,"f").hasPlaceholderControls(e))}setPlaceholderControlsOverlayEnabled(e,t){return ne("id",e,X()),ne("enabled",t,Y()),w(me(this,pe,"f").setPlaceholderControlsOverlayEnabled(e,t))}isPlaceholderControlsOverlayEnabled(e){return ne("id",e,X()),w(me(this,pe,"f").isPlaceholderControlsOverlayEnabled(e))}setPlaceholderControlsButtonEnabled(e,t){return ne("id",e,X()),ne("enabled",t,Y()),w(me(this,pe,"f").setPlaceholderControlsButtonEnabled(e,t))}isPlaceholderControlsButtonEnabled(e){return ne("id",e,X()),w(me(this,pe,"f").isPlaceholderControlsButtonEnabled(e))}setMetadata(e,t,r){ne("id",e,X()),ne("key",t,Z()),ne("value",r,Z()),w(me(this,pe,"f").setMetadata(e,t,r))}getMetadata(e,t){return ne("id",e,X()),ne("key",t,Z()),w(me(this,pe,"f").getMetadata(e,t))}hasMetadata(e,t){return ne("id",e,X()),ne("key",t,Z()),w(me(this,pe,"f").hasMetadata(e,t))}findAllMetadata(e){return ne("id",e,X()),_(w(me(this,pe,"f").findAllMetadata(e)))}removeMetadata(e,t){ne("id",e,X()),ne("key",t,Z()),w(me(this,pe,"f").removeMetadata(e,t))}setScopeEnabled(e,t,r){ne("id",e,X()),ne("key",t,Z()),ne("enabled",r,Y()),w(me(this,pe,"f").setScopeEnabled(e,t,r))}isScopeEnabled(e,t){return ne("id",e,X()),ne("key",t,Z()),w(me(this,pe,"f").isScopeEnabled(e,t))}isAllowedByScope(e,t){return ne("id",e,X()),ne("key",t,Z()),w(me(this,pe,"f").isAllowedByScope(e,t))}hasDuration(e){return ne("id",e,X()),w(me(this,pe,"f").hasDuration(e))}setDuration(e,t){return ne("id",e,X()),ne("duration",t,K()),w(me(this,pe,"f").setDuration(e,t))}getDuration(e){return ne("id",e,X()),w(me(this,pe,"f").getDuration(e))}hasTimeOffset(e){return ne("id",e,X()),w(me(this,pe,"f").hasTimeOffset(e))}setTimeOffset(e,t){return ne("id",e,X()),ne("offset",t,K()),w(me(this,pe,"f").setTimeOffset(e,t))}getTimeOffset(e){return ne("id",e,X()),w(me(this,pe,"f").getTimeOffset(e))}hasTrim(e){return ne("id",e,X()),w(me(this,pe,"f").hasTrim(e))}setTrimOffset(e,t){return ne("id",e,X()),ne("offset",t,K()),w(me(this,pe,"f").setTrimOffset(e,t))}getTrimOffset(e){return ne("id",e,X()),w(me(this,pe,"f").getTrimOffset(e))}setTrimLength(e,t){return ne("id",e,X()),ne("length",t,K()),w(me(this,pe,"f").setTrimLength(e,t))}getTrimLength(e){return ne("id",e,X()),w(me(this,pe,"f").getTrimLength(e))}getTotalSceneDuration(e){return ne("scene",e,X()),w(me(this,pe,"f").getTotalSceneDuration(e))}setPlaying(e,t){return ne("id",e,X()),ne("enabled",t,Y()),w(me(this,pe,"f").setPlaying(e,t))}isPlaying(e){return ne("id",e,X()),w(me(this,pe,"f").isPlaying(e))}hasPlaybackTime(e){return ne("id",e,X()),w(me(this,pe,"f").hasPlaybackTime(e))}setPlaybackTime(e,t){return ne("id",e,X()),ne("time",t,K()),w(me(this,pe,"f").setPlaybackTime(e,t))}getPlaybackTime(e){return ne("id",e,X()),w(me(this,pe,"f").getPlaybackTime(e))}setSoloPlaybackEnabled(e,t){return ne("id",e,X()),ne("enabled",t,Y()),w(me(this,pe,"f").setSoloPlaybackEnabled(e,t))}isSoloPlaybackEnabled(e){return ne("id",e,X()),w(me(this,pe,"f").isSoloPlaybackEnabled(e))}hasPlaybackControl(e){return ne("id",e,X()),w(me(this,pe,"f").hasPlaybackControl(e))}setLooping(e,t){ne("id",e,X()),ne("looping",t,Y()),w(me(this,pe,"f").setLooping(e,t))}isLooping(e){return ne("id",e,X()),w(me(this,pe,"f").isLooping(e))}setMuted(e,t){ne("id",e,X()),ne("muted",t,Y()),w(me(this,pe,"f").setMuted(e,t))}isMuted(e){return ne("id",e,X()),w(me(this,pe,"f").isMuted(e))}setVolume(e,t){ne("id",e,X()),ne("volume",t,K()),w(me(this,pe,"f").setVolume(e,t))}getVolume(e){return ne("id",e,X()),w(me(this,pe,"f").getVolume(e))}async forceLoadAVResource(e){return ne("id",e,X()),E((t=>me(this,pe,"f").forceLoadAVResource(e,t)))}getAVResourceTotalDuration(e){return ne("id",e,X()),w(me(this,pe,"f").getAVResourceTotalDuration(e))}getVideoWidth(e){return ne("id",e,X()),w(me(this,pe,"f").getVideoWidth(e))}getVideoHeight(e){return ne("id",e,X()),w(me(this,pe,"f").getVideoHeight(e))}generateVideoThumbnailSequence(e,t,r,n,o,i){return ne("id",e,X()),ne("thumbnailHeight",t,X()),ne("timeBegin",r,K()),ne("timeEnd",n,K()),ne("numberOfFrames",o,X()),me(this,pe,"f").generateVideoThumbnailSequence(e,t,r,n,o,(e=>{"error"in e?i(0,new Error(e.error)):i(e.frameIndex,new ImageData(new Uint8ClampedArray(e.imageData),e.width,e.height))})),()=>{w(me(this,pe,"f").cancelVideoThumbnailSequenceGeneration(e))}}async getVideoFillThumbnail(e,t){return ne("id",e,X()),ne("thumbnailHeight",t,X()),new Promise(((r,n)=>{me(this,pe,"f").getVideoFillThumbnail(e,t,(e=>{"error"in e?n(e.error):r(new ue([e],{type:"image/jpeg"}))}))}))}async getVideoFillThumbnailAtlas(e,t,r,n){return ne("id",e,X()),ne("numberOfColumns",t,X()),ne("numberOfRows",r,X()),ne("thumbnailHeight",n,X()),new Promise(((o,i)=>{me(this,pe,"f").getVideoFillThumbnailAtlas(e,t,r,n,(e=>{"error"in e?i(e.error):o(new ue([e],{type:"image/jpeg"}))}))}))}async getPageThumbnailAtlas(e,t,r,n){return ne("id",e,X()),ne("numberOfColumns",t,X()),ne("numberOfRows",r,X()),new Promise(((o,i)=>{me(this,pe,"f").getPageThumbnailAtlas(e,t,r,n,(e=>{"error"in e?i(e.error):o(new ue([e],{type:"image/jpeg"}))}))}))}setNativePixelBuffer(e,t){t instanceof HTMLVideoElement&&(t.width=t.videoWidth,t.height=t.videoHeight),w(me(this,pe,"f").setNativePixelBuffer(e,t))}}pe=new WeakMap,he([o],ge.prototype,"loadFromString",null),he([o],ge.prototype,"create",null),he([o],ge.prototype,"createFill",null),he([t],ge.prototype,"getType",null),he([o],ge.prototype,"select",null),he([o],ge.prototype,"setSelected",null),he([t],ge.prototype,"isSelected",null),he([t],ge.prototype,"findAllSelected",null),he([t],ge.prototype,"isGroupable",null),he([o],ge.prototype,"group",null),he([o],ge.prototype,"ungroup",null),he([o],ge.prototype,"enterGroup",null),he([o],ge.prototype,"exitGroup",null),he([o],ge.prototype,"setName",null),he([t],ge.prototype,"getName",null),he([t],ge.prototype,"getUUID",null),he([t],ge.prototype,"findByName",null),he([t],ge.prototype,"findByType",null),he([t],ge.prototype,"findAll",null),he([t],ge.prototype,"findAllPlaceholders",null),he([o],ge.prototype,"createShape",null),he([t],ge.prototype,"hasShape",null),he([t],ge.prototype,"getShape",null),he([o],ge.prototype,"setShape",null),he([t],ge.prototype,"isVisible",null),he([o],ge.prototype,"setVisible",null),he([t],ge.prototype,"isClipped",null),he([o],ge.prototype,"setClipped",null),he([t],ge.prototype,"getPositionX",null),he([t],ge.prototype,"getPositionXMode",null),he([t],ge.prototype,"getPositionY",null),he([t],ge.prototype,"getPositionYMode",null),he([o],ge.prototype,"setPositionX",null),he([o],ge.prototype,"setPositionXMode",null),he([o],ge.prototype,"setPositionY",null),he([o],ge.prototype,"setPositionYMode",null),he([o],ge.prototype,"setAlwaysOnTop",null),he([o],ge.prototype,"setAlwaysOnBottom",null),he([t],ge.prototype,"isAlwaysOnTop",null),he([t],ge.prototype,"isAlwaysOnBottom",null),he([o],ge.prototype,"bringToFront",null),he([o],ge.prototype,"sendToBack",null),he([o],ge.prototype,"bringForward",null),he([o],ge.prototype,"sendBackward",null),he([t],ge.prototype,"getRotation",null),he([o],ge.prototype,"setRotation",null),he([t],ge.prototype,"getFlipHorizontal",null),he([t],ge.prototype,"getFlipVertical",null),he([o],ge.prototype,"setFlipHorizontal",null),he([o],ge.prototype,"setFlipVertical",null),he([t],ge.prototype,"hasContentFillMode",null),he([t],ge.prototype,"getWidth",null),he([t],ge.prototype,"getWidthMode",null),he([t],ge.prototype,"getHeight",null),he([t],ge.prototype,"getHeightMode",null),he([o],ge.prototype,"setWidth",null),he([o],ge.prototype,"setWidthMode",null),he([o],ge.prototype,"setHeight",null),he([o],ge.prototype,"setHeightMode",null),he([t],ge.prototype,"getFrameX",null),he([t],ge.prototype,"getFrameY",null),he([t],ge.prototype,"getFrameWidth",null),he([t],ge.prototype,"getFrameHeight",null),he([o],ge.prototype,"setContentFillMode",null),he([t],ge.prototype,"getContentFillMode",null),he([o],ge.prototype,"duplicate",null),he([o],ge.prototype,"destroy",null),he([t],ge.prototype,"isValid",null),he([t],ge.prototype,"getParent",null),he([t],ge.prototype,"getChildren",null),he([o],ge.prototype,"insertChild",null),he([o],ge.prototype,"appendChild",null),he([t],ge.prototype,"referencesAnyVariables",null),he([t],ge.prototype,"getGlobalBoundingBoxX",null),he([t],ge.prototype,"getGlobalBoundingBoxY",null),he([t],ge.prototype,"getGlobalBoundingBoxWidth",null),he([t],ge.prototype,"getGlobalBoundingBoxHeight",null),he([t],ge.prototype,"getScreenSpaceBoundingBoxXYWH",null),he([o],ge.prototype,"alignHorizontally",null),he([o],ge.prototype,"alignVertically",null),he([t],ge.prototype,"isAlignable",null),he([o],ge.prototype,"distributeHorizontally",null),he([o],ge.prototype,"distributeVertically",null),he([o],ge.prototype,"isDistributable",null),he([o],ge.prototype,"fillParent",null),he([o],ge.prototype,"resizeContentAware",null),he([o],ge.prototype,"scale",null),he([t],ge.prototype,"findAllProperties",null),he([t],ge.prototype,"isPropertyReadable",null),he([t],ge.prototype,"isPropertyWritable",null),he([t],ge.prototype,"getPropertyType",null),he([t],ge.prototype,"getEnumValues",null),he([o],ge.prototype,"setBool",null),he([t],ge.prototype,"getBool",null),he([o],ge.prototype,"setInt",null),he([t],ge.prototype,"getInt",null),he([o],ge.prototype,"setFloat",null),he([t],ge.prototype,"getFloat",null),he([o],ge.prototype,"setDouble",null),he([t],ge.prototype,"getDouble",null),he([o],ge.prototype,"setString",null),he([t],ge.prototype,"getString",null),he([o],ge.prototype,"setColor",null),he([t],ge.prototype,"getColor",null),he([o],ge.prototype,"setColorRGBA",null),he([t],ge.prototype,"getColorRGBA",null),he([o],ge.prototype,"setColorSpot",null),he([t],ge.prototype,"getColorSpotName",null),he([t],ge.prototype,"getColorSpotTint",null),he([o],ge.prototype,"setGradientColorStops",null),he([t],ge.prototype,"getGradientColorStops",null),he([o],ge.prototype,"setEnum",null),he([t],ge.prototype,"getEnum",null),he([t],ge.prototype,"hasCrop",null),he([o],ge.prototype,"setCropScaleX",null),he([o],ge.prototype,"setCropScaleY",null),he([o],ge.prototype,"setCropRotation",null),he([o],ge.prototype,"setCropScaleRatio",null),he([o],ge.prototype,"setCropTranslationX",null),he([o],ge.prototype,"setCropTranslationY",null),he([o],ge.prototype,"resetCrop",null),he([t],ge.prototype,"getCropScaleX",null),he([t],ge.prototype,"getCropScaleY",null),he([t],ge.prototype,"getCropRotation",null),he([t],ge.prototype,"getCropScaleRatio",null),he([t],ge.prototype,"getCropTranslationX",null),he([t],ge.prototype,"getCropTranslationY",null),he([o],ge.prototype,"adjustCropToFillFrame",null),he([o],ge.prototype,"flipCropHorizontal",null),he([o],ge.prototype,"flipCropVertical",null),he([t],ge.prototype,"hasOpacity",null),he([o],ge.prototype,"setOpacity",null),he([t],ge.prototype,"getOpacity",null),he([t],ge.prototype,"hasBlendMode",null),he([o],ge.prototype,"setBlendMode",null),he([t],ge.prototype,"getBlendMode",null),he([t],ge.prototype,"hasFillColor",null),he([o],ge.prototype,"setFillColorRGBA",null),he([t],ge.prototype,"getFillColorRGBA",null),he([o],ge.prototype,"setFillColorEnabled",null),he([t],ge.prototype,"isFillColorEnabled",null),he([o],ge.prototype,"createEffect",null),he([t],ge.prototype,"hasEffects",null),he([t],ge.prototype,"getEffects",null),he([o],ge.prototype,"insertEffect",null),he([o],ge.prototype,"appendEffect",null),he([o],ge.prototype,"removeEffect",null),he([t],ge.prototype,"hasEffectEnabled",null),he([o],ge.prototype,"setEffectEnabled",null),he([t],ge.prototype,"isEffectEnabled",null),he([o],ge.prototype,"createBlur",null),he([t],ge.prototype,"hasBlur",null),he([o],ge.prototype,"setBlur",null),he([t],ge.prototype,"getBlur",null),he([o],ge.prototype,"setBlurEnabled",null),he([t],ge.prototype,"isBlurEnabled",null),he([t],ge.prototype,"hasBackgroundColor",null),he([o],ge.prototype,"setBackgroundColorRGBA",null),he([t],ge.prototype,"getBackgroundColorRGBA",null),he([o],ge.prototype,"setBackgroundColorEnabled",null),he([t],ge.prototype,"isBackgroundColorEnabled",null),he([t],ge.prototype,"hasStroke",null),he([o],ge.prototype,"setStrokeEnabled",null),he([t],ge.prototype,"isStrokeEnabled",null),he([o],ge.prototype,"setStrokeColorRGBA",null),he([o],ge.prototype,"setStrokeColor",null),he([t],ge.prototype,"getStrokeColorRGBA",null),he([t],ge.prototype,"getStrokeColor",null),he([o],ge.prototype,"setStrokeWidth",null),he([t],ge.prototype,"getStrokeWidth",null),he([o],ge.prototype,"setStrokeStyle",null),he([t],ge.prototype,"getStrokeStyle",null),he([o],ge.prototype,"setStrokePosition",null),he([t],ge.prototype,"getStrokePosition",null),he([o],ge.prototype,"setStrokeCornerGeometry",null),he([t],ge.prototype,"getStrokeCornerGeometry",null),he([t],ge.prototype,"hasDropShadow",null),he([o],ge.prototype,"setDropShadowEnabled",null),he([t],ge.prototype,"isDropShadowEnabled",null),he([o],ge.prototype,"setDropShadowColorRGBA",null),he([o],ge.prototype,"setDropShadowColor",null),he([t],ge.prototype,"getDropShadowColorRGBA",null),he([t],ge.prototype,"getDropShadowColor",null),he([o],ge.prototype,"setDropShadowOffsetX",null),he([t],ge.prototype,"getDropShadowOffsetX",null),he([o],ge.prototype,"setDropShadowOffsetY",null),he([t],ge.prototype,"getDropShadowOffsetY",null),he([o],ge.prototype,"setDropShadowBlurRadiusX",null),he([t],ge.prototype,"getDropShadowBlurRadiusX",null),he([o],ge.prototype,"setDropShadowBlurRadiusY",null),he([t],ge.prototype,"getDropShadowBlurRadiusY",null),he([o],ge.prototype,"setDropShadowClip",null),he([t],ge.prototype,"getDropShadowClip",null),he([o],ge.prototype,"createCutoutFromBlocks",null),he([o],ge.prototype,"createCutoutFromPath",null),he([o],ge.prototype,"createCutoutFromOperation",null),he([o],ge.prototype,"replaceText",null),he([o],ge.prototype,"removeText",null),he([o],ge.prototype,"setTextColor",null),he([t],ge.prototype,"getTextColors",null),he([t],ge.prototype,"getTextFontWeights",null),he([t],ge.prototype,"getTextFontStyles",null),he([t],ge.prototype,"getTextCases",null),he([o],ge.prototype,"setTextCase",null),he([t],ge.prototype,"getTextCursorRange",null),he([t],ge.prototype,"hasFill",null),he([t],ge.prototype,"isFillEnabled",null),he([o],ge.prototype,"setFillEnabled",null),he([t],ge.prototype,"getFill",null),he([o],ge.prototype,"setFill",null),he([o],ge.prototype,"setFillSolidColor",null),he([t],ge.prototype,"getFillSolidColor",null),he([o],ge.prototype,"setPlaceholderEnabled",null),he([t],ge.prototype,"isPlaceholderEnabled",null),he([t],ge.prototype,"hasPlaceholderBehavior",null),he([o],ge.prototype,"setPlaceholderBehaviorEnabled",null),he([t],ge.prototype,"isPlaceholderBehaviorEnabled",null),he([t],ge.prototype,"hasPlaceholderControls",null),he([o],ge.prototype,"setPlaceholderControlsOverlayEnabled",null),he([t],ge.prototype,"isPlaceholderControlsOverlayEnabled",null),he([o],ge.prototype,"setPlaceholderControlsButtonEnabled",null),he([t],ge.prototype,"isPlaceholderControlsButtonEnabled",null),he([o],ge.prototype,"setMetadata",null),he([t],ge.prototype,"getMetadata",null),he([t],ge.prototype,"hasMetadata",null),he([t],ge.prototype,"findAllMetadata",null),he([o],ge.prototype,"removeMetadata",null),he([o],ge.prototype,"setScopeEnabled",null),he([t],ge.prototype,"isScopeEnabled",null),he([t],ge.prototype,"isAllowedByScope",null),he([t],ge.prototype,"hasDuration",null),he([o],ge.prototype,"setDuration",null),he([t],ge.prototype,"getDuration",null),he([t],ge.prototype,"hasTimeOffset",null),he([o],ge.prototype,"setTimeOffset",null),he([t],ge.prototype,"getTimeOffset",null),he([t],ge.prototype,"hasTrim",null),he([o],ge.prototype,"setTrimOffset",null),he([t],ge.prototype,"getTrimOffset",null),he([o],ge.prototype,"setTrimLength",null),he([t],ge.prototype,"getTrimLength",null),he([t],ge.prototype,"getTotalSceneDuration",null),he([o],ge.prototype,"setPlaying",null),he([t],ge.prototype,"isPlaying",null),he([t],ge.prototype,"hasPlaybackTime",null),he([o],ge.prototype,"setPlaybackTime",null),he([t],ge.prototype,"getPlaybackTime",null),he([o],ge.prototype,"setSoloPlaybackEnabled",null),he([t],ge.prototype,"isSoloPlaybackEnabled",null),he([t],ge.prototype,"hasPlaybackControl",null),he([o],ge.prototype,"setLooping",null),he([t],ge.prototype,"isLooping",null),he([o],ge.prototype,"setMuted",null),he([t],ge.prototype,"isMuted",null),he([o],ge.prototype,"setVolume",null),he([t],ge.prototype,"getVolume",null),he([o],ge.prototype,"forceLoadAVResource",null),he([t],ge.prototype,"getAVResourceTotalDuration",null),he([t],ge.prototype,"getVideoWidth",null),he([t],ge.prototype,"getVideoHeight",null),he([t],ge.prototype,"getVideoFillThumbnail",null),he([t],ge.prototype,"getVideoFillThumbnailAtlas",null),he([t],ge.prototype,"getPageThumbnailAtlas",null);var ye,ve=function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},be=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class we{constructor(e){ye.set(this,void 0),Object.defineProperty(this,"onStateChanged",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=be(this,ye,"f").subscribeToEditorState(e);return()=>{be(this,ye,"f").isDeleted()||w(be(this,ye,"f").unsubscribe(t))}}}),Object.defineProperty(this,"onHistoryUpdated",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=be(this,ye,"f").subscribeToHistory(e);return()=>{be(this,ye,"f").isDeleted()||be(this,ye,"f").unsubscribe(t)}}}),Object.defineProperty(this,"onSettingsChanged",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=be(this,ye,"f").subscribeToSettings(e);return()=>{be(this,ye,"f").isDeleted()||w(be(this,ye,"f").unsubscribe(t))}}}),function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?o.call(e,r):o?o.value=r:t.set(e,r)}(this,ye,e,"f")}setEditMode(e){ne("keypath",e,Z()),be(this,ye,"f").setEditMode(e)}getEditMode(){return be(this,ye,"f").getEditMode()}getCursorType(){return be(this,ye,"f").getCursorType()}getCursorRotation(){return be(this,ye,"f").getCursorRotation()}getTextCursorPositionInScreenSpaceX(){return be(this,ye,"f").getTextCursorPositionInScreenSpaceX()}getTextCursorPositionInScreenSpaceY(){return be(this,ye,"f").getTextCursorPositionInScreenSpaceY()}createHistory(){return be(this,ye,"f").createHistory()}destroyHistory(e){w(be(this,ye,"f").destroyHistory(e))}setActiveHistory(e){w(be(this,ye,"f").setActiveHistory(e))}getActiveHistory(){return be(this,ye,"f").getActiveHistory()}addUndoStep(){w(be(this,ye,"f").addUndoStep())}undo(){w(be(this,ye,"f").undo())}redo(){w(be(this,ye,"f").redo())}canUndo(){return w(be(this,ye,"f").canUndo())}canRedo(){return w(be(this,ye,"f").canRedo())}setSettingBool(e,t){return ne("keypath",e,Z()),ne("value",t,Y()),w(be(this,ye,"f").setSettingBool(e,t))}getSettingBool(e){return ne("keypath",e,Z()),w(be(this,ye,"f").getSettingBool(e))}setSettingInt(e,t){return ne("keypath",e,Z()),ne("value",t,X()),w(be(this,ye,"f").setSettingInt(e,t))}getSettingInt(e){return ne("keypath",e,Z()),w(be(this,ye,"f").getSettingInt(e))}setSettingFloat(e,t){return ne("keypath",e,Z()),ne("value",t,K()),w(be(this,ye,"f").setSettingFloat(e,t))}getSettingFloat(e){return ne("keypath",e,Z()),w(be(this,ye,"f").getSettingFloat(e))}setSettingString(e,t){return ne("keypath",e,Z()),ne("value",t,Z()),w(be(this,ye,"f").setSettingString(e,t))}getSettingString(e){return ne("keypath",e,Z()),w(be(this,ye,"f").getSettingString(e))}setSettingColor(e,t){return ne("keypath",e,Z()),w(be(this,ye,"f").setSettingColor(e,i.fromColor(t)))}getSettingColor(e){return ne("keypath",e,Z()),i.toColor(w(be(this,ye,"f").getSettingColor(e)))}setSettingColorRGBA(e,t,r,n,o=1){return ne("keypath",e,Z()),ne("r",t,K()),ne("g",r,K()),ne("b",n,K()),ne("a",o,K()),w(be(this,ye,"f").setSettingColorRGBA(e,t,r,n,o))}getSettingColorRGBA(e){return ne("keypath",e,Z()),w(be(this,ye,"f").getSettingColorRGBA(e))}setSettingEnum(e,t){return ne("keypath",e,Z()),ne("value",t,Z()),w(be(this,ye,"f").setSettingEnum(e,t))}getSettingEnum(e){return ne("keypath",e,Z()),w(be(this,ye,"f").getSettingEnum(e))}getSettingEnumOptions(e){return ne("keypath",e,Z()),_(w(be(this,ye,"f").getSettingEnumOptions(e)))}findAllSettings(){return _(be(this,ye,"f").findAllSettings())}getSettingType(e){return ne("keypath",e,Z()),w(be(this,ye,"f").getSettingType(e))}getAvailableMemory(){return w(be(this,ye,"f").getAvailableMemory())}getUsedMemory(){return w(be(this,ye,"f").getUsedMemory())}setURIResolver(e){return w(be(this,ye,"f").setURIResolver(e))}defaultURIResolver(e){return be(this,ye,"f").defaultURIResolver(e)}getAbsoluteURI(e){return w(be(this,ye,"f").getAbsoluteURI(e))}setGlobalScope(e,t){ne("key",e,Z()),ne("value",t,Z()),w(be(this,ye,"f").setGlobalScope(e,t))}getGlobalScope(e){return ne("key",e,Z()),w(be(this,ye,"f").getGlobalScope(e))}findAllSpotColors(){return _(be(this,ye,"f").findAllSpotColors())}getSpotColorRGBA(e){return ne("name",e,Z()),be(this,ye,"f").getSpotColorRGB(e)}getSpotColorCMYK(e){return ne("name",e,Z()),be(this,ye,"f").getSpotColorCMYK(e)}setSpotColorRGB(e,t,r,n){return ne("name",e,Z()),ne("r",t,K()),ne("g",r,K()),ne("b",n,K()),be(this,ye,"f").setSpotColorRGB(e,t,r,n)}setSpotColorCMYK(e,t,r,n,o){return ne("name",e,Z()),ne("c",t,K()),ne("m",r,K()),ne("y",n,K()),ne("k",o,K()),be(this,ye,"f").setSpotColorCMYK(e,t,r,n,o)}removeSpotColor(e){return ne("name",e,Z()),w(be(this,ye,"f").removeSpotColor(e))}setSpotColorForCutoutType(e,t){return ne("type",e,Z()),ne("color",t,Z()),w(be(this,ye,"f").setSpotColorForCutoutType(e,t))}getSpotColorForCutoutType(e){return ne("type",e,Z()),w(be(this,ye,"f").getSpotColorForCutoutType(e))}convertColorToColorSpace(e,t){return ne("colorSpace",t,Z()),i.toColor(w(be(this,ye,"f").convertColorToColorSpace(i.fromColor(e),t)))}}ye=new WeakMap,ve([o],we.prototype,"setEditMode",null),ve([t],we.prototype,"getEditMode",null),ve([t],we.prototype,"getCursorType",null),ve([t],we.prototype,"getCursorRotation",null),ve([t],we.prototype,"getTextCursorPositionInScreenSpaceX",null),ve([t],we.prototype,"getTextCursorPositionInScreenSpaceY",null),ve([o],we.prototype,"createHistory",null),ve([o],we.prototype,"destroyHistory",null),ve([o],we.prototype,"setActiveHistory",null),ve([t],we.prototype,"getActiveHistory",null),ve([o],we.prototype,"addUndoStep",null),ve([o],we.prototype,"undo",null),ve([o],we.prototype,"redo",null),ve([t],we.prototype,"canUndo",null),ve([t],we.prototype,"canRedo",null),ve([o],we.prototype,"setSettingBool",null),ve([t],we.prototype,"getSettingBool",null),ve([o],we.prototype,"setSettingInt",null),ve([t],we.prototype,"getSettingInt",null),ve([o],we.prototype,"setSettingFloat",null),ve([t],we.prototype,"getSettingFloat",null),ve([o],we.prototype,"setSettingString",null),ve([t],we.prototype,"getSettingString",null),ve([o],we.prototype,"setSettingColor",null),ve([t],we.prototype,"getSettingColor",null),ve([o],we.prototype,"setSettingColorRGBA",null),ve([t],we.prototype,"getSettingColorRGBA",null),ve([o],we.prototype,"setSettingEnum",null),ve([t],we.prototype,"getSettingEnum",null),ve([t],we.prototype,"getAvailableMemory",null),ve([t],we.prototype,"getUsedMemory",null),ve([o],we.prototype,"setURIResolver",null),ve([t],we.prototype,"defaultURIResolver",null),ve([t],we.prototype,"getAbsoluteURI",null),ve([o],we.prototype,"setGlobalScope",null),ve([t],we.prototype,"getGlobalScope",null),ve([t],we.prototype,"findAllSpotColors",null),ve([t],we.prototype,"getSpotColorRGBA",null),ve([t],we.prototype,"getSpotColorCMYK",null),ve([o],we.prototype,"setSpotColorRGB",null),ve([o],we.prototype,"setSpotColorCMYK",null),ve([o],we.prototype,"removeSpotColor",null),ve([o],we.prototype,"setSpotColorForCutoutType",null),ve([o],we.prototype,"getSpotColorForCutoutType",null);var Ee,_e=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class Ce{constructor(e){Ee.set(this,void 0),Object.defineProperty(this,"subscribe",{enumerable:!0,configurable:!0,writable:!0,value:(e,t)=>{ne("blocks",e,z());const r=_e(this,Ee,"f").subscribe(e,(e=>{try{t(_(e,!0))}catch(e){console.error(e)}}));return()=>{_e(this,Ee,"f").isDeleted()||w(_e(this,Ee,"f").unsubscribe(r))}}}),function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?o.call(e,r):o?o.value=r:t.set(e,r)}(this,Ee,e,"f")}}Ee=new WeakMap;var Se,ke=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class xe{constructor(e){Se.set(this,void 0),function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?o.call(e,r):o?o.value=r:t.set(e,r)}(this,Se,e,"f")}findAll(){return _(ke(this,Se,"f").findAllVariables())}setString(e,t){return ne("key",e,Z()),ne("value",t,Z()),w(ke(this,Se,"f").setVariableString(e,t))}getString(e){return ne("key",e,Z()),w(ke(this,Se,"f").getVariableString(e))}remove(e){return ne("key",e,Z()),w(ke(this,Se,"f").removeVariable(e))}}Se=new WeakMap;const Pe=require("fs/promises");var Te=r.n(Pe),Fe=r(310);const Ae=function(){if("undefined"!=typeof fetch)return fetch;if("undefined"!=typeof window)throw new Error("Could not find `fetch` API");try{return r(809)}catch(e){throw new Error("Could not find a `fetch` implementation. Please make sure you're using Node.JS >= 18, or install the node-fetch@cjs package, or provide another polyfill.")}}();async function De(e){if(!e.match(/^file:/))return Ae(e);try{const t=await Te().readFile((0,Fe.fileURLToPath)(e),{encoding:"utf8"}),r=JSON.parse(t);return{ok:!0,json:async()=>r}}catch(e){return{ok:!1,statusText:e.message}}}const Be=Ae;var Le=r(502),Re=r.n(Le);const Me=r.p+"assets/core/cesdk-v1.18.0-rc.1-d92fadafda0b5129818d.data",Oe=r.p+"assets/core/cesdk-v1.18.0-rc.1-d2b891550f738fce0f7f.wasm",Ie=Re();function Ue(e,t){const r=t.split("/").pop(),n=new URL(r,e.core.baseURL);return"file:"===n.protocol?(0,Fe.fileURLToPath)(n):new URL(r,e.core.baseURL).toString()}var $e,je,qe,Ne,He,Ve,We,Ge,ze=function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},Ye=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class Xe{constructor(e,t){$e.add(this),Object.defineProperty(this,"asset",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"block",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"editor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"event",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"scene",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"variable",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),je.set(this,void 0),qe.set(this,void 0),Ne.set(this,void 0),ze(this,qe,e,"f"),ze(this,je,new b(e),"f"),this.asset=new D(e),this.block=new ge(e),this.editor=new we(e),this.event=new Ce(e),this.scene=new fe(e),this.variable=new xe(e),this.block.exportVideo=()=>{throw new Error("Exporting video is currently not supported on Node.JS")},Ye(this,$e,"m",He).call(this),"undefined"!=typeof window&&window.Cypress&&(this.config=t,this.helper=Ye(this,je,"f"))}update(){Ye(this,qe,"f").update()}dispose(){Ye(this,$e,"m",We).call(this),ze(this,je,null,"f"),this.block=null,this.scene=null,this.variable=null,Ye(this,qe,"f").delete(),ze(this,qe,null,"f")}static async init(e){console.log("[CreativeEngine] Revision 73664cfc6ce555826cace6c4dc5c5a11ce4f96c5");const t=function(e){var t;return e&&"callbacks"in e&&(null===(t=e.callbacks)||void 0===t?void 0:t.log)&&!e.logger?Object.assign(Object.assign({},e),{logger:e.callbacks.log}):e}(e),r=function(e={},t="https://cdn.img.ly/packages/imgly/cesdk-engine/1.18.0-rc.1/assets"){var r,n,o,i,a,s,u,l,c,d;const f=Object.assign(Object.assign({},e),{license:e.license,featureFlags:null!==(r=e.featureFlags)&&void 0!==r?r:{},baseURL:null!==(n=e.baseURL)&&void 0!==n?n:t,core:null!==(o=e.core)&&void 0!==o?o:{baseURL:"core/"},extensions:null!==(i=e.extensions)&&void 0!==i?i:Object.assign({},R),logger:null!==(a=e.logger)&&void 0!==a?a:L,presets:null!==(s=e.presets)&&void 0!==s?s:{}});return null!==(u=(c=f.extensions).baseURL)&&void 0!==u||(c.baseURL=R.baseURL),null!==(l=(d=f.extensions).entries)&&void 0!==l||(d.entries=Object.assign({},R.entries)),f.baseURL=M(f.baseURL),f.baseURL=O(f.baseURL),f.core.baseURL=M(f.core.baseURL,f.baseURL),f.core.baseURL=O(f.core.baseURL),f.extensions.baseURL=O(f.extensions.baseURL),f.extensions.entries=f.extensions.entries.map((e=>O(e))),f}(t,`file://${__dirname}/assets/`);for(const t of function(e){var t;const r=[];return e?("callbacks"in e&&(null===(t=e.callbacks)||void 0===t?void 0:t.log)&&r.push("config.callbacks.log has been moved to config.logger"),e.scene&&r.push("config.scene options have been removed. You can set a scene's dpi and pixelScaleFactor via the BlockApi's setInt(sceneId, 'scene/dpi', dpi) and setInt(sceneId, 'scene/pixelScaleFactor', factor)."),e.page&&r.push("config.page options have been moved to the EditorAPI"),e.variables&&r.push("config.variables has been removed. Please use the VariableAPI instead"),r):r}(e))r.logger(t,"Warning");const n=new this(await async function(e){const t=e.logger,{getPreloadedPackage:r,instantiateWasm:n}=await async function(e){if(!e.core.baseURL.startsWith("http"))return{};const t=Ue(e,Me),r=Ue(e,Oe),n=Be(t).then((e=>{if(e.status>=400)throw new Error(`Failed to fetch DATA package: ${e.status} ${e.statusText}`);return e.arrayBuffer()})),o=await n;return{getPreloadedPackage:function(e,r){if(e===t){if(r!==o.byteLength)throw new Error(`Attempt to get preloaded data package of incorrect size. Expected: ${r} Actual: ${o.byteLength}`);return o}return null},instantiateWasm:function(e,t){const n=e,o=Be(r).then((e=>{if(e.status>=400)throw new Error(`Failed to fetch WASM package: ${e.status} ${e.statusText}`);return e}));return void 0!==WebAssembly.instantiateStreaming?o.then((e=>WebAssembly.instantiateStreaming(e,n))).then((({instance:e})=>t(e))):o.then((e=>e.arrayBuffer())).then((e=>WebAssembly.compile(e))).then((e=>WebAssembly.instantiate(e,n))).then(t),{}}}}(e),o={locateFile:t=>t.endsWith(".wasm")?Ue(e,Oe):t.endsWith(".data")?Ue(e,Me):Ue(e,t),instantiateWasm:n,getPreloadedPackage:r,print:e=>{e&&t(e,"Info")},printErr:e=>{e&&t(e,"Error")},onRuntimeInitialized:()=>{t("Engine has been initialized.","Info")},logReadFiles:!1,printWithColors:!0},i=await Ie(o);i.emscripten_ubq_asyncFetchManager.setFetch(Be);const a=w(i.createEngine("","auto"));return function(e,t){var r,n;const o=new b(e),i=new we(e),a=new D(e);i.setSettingString("license",t.license||""),i.setSettingEnum("role",null!==(r=t.role)&&void 0!==r?r:"Creator"),"Adopter"===t.role&&i.setSettingEnum("doubleClickSelectionMode","Direct"),i.setSettingString("basePath",t.baseURL),i.setSettingBool("showBuildVersion",!1),(null===(n=t.featureFlags)||void 0===n?void 0:n.preventScrolling)&&(i.setSettingBool("touch/singlePointPanning",!1),i.setSettingBool("touch/dragStartCanSelect",!1)),a.addLocalSource("ly.img.text"),Object.entries(t.presets.typefaces||{}).forEach((([e,t])=>{(t.fonts||[]).forEach((r=>{const n=`${e}_${r.weight}_${r.style}`;o.execute("ubq/assets/registerFont",[n,r.fontURL,t.family,r.weight,r.style])}))})),function(){var e;const r=!!(null===(e=t.featureFlags)||void 0===e?void 0:e.singlePageMode);i.setSettingBool("features/singlePageModeEnabled",r),i.setSettingBool("features/effectsEnabled",!0)}(),function(){var e;const r=null!==(e=t.extensions)&&void 0!==e?e:[];r.entries.forEach((e=>{o.execute("ubq/extension/register",`${r.baseURL+e}`)}))}(),function(){const t=new xe(e);"undefined"!=typeof window&&window.Cypress&&(t.setString("company_name","img.ly"),t.setString("first_name","Charly"),t.setString("last_name","Williams"),t.setString("address","742 Evergreen Terrace"),t.setString("city","Springfield"))}()}(a,e),a}(r),r);return function(e,t){var r,n,o,i,a,s,u,l;if(e)try{const c=t.editor;if(null!=(null===(n=null===(r=e.page)||void 0===r?void 0:r.title)||void 0===n?void 0:n.show)&&c.setSettingBool("page/title/show",e.page.title.show),null!=(null===(i=null===(o=e.page)||void 0===o?void 0:o.title)||void 0===i?void 0:i.fontFileUri)&&c.setSettingString("page/title/fontFileUri",null===(s=null===(a=e.page)||void 0===a?void 0:a.title)||void 0===s?void 0:s.fontFileUri),null!=(null===(u=e.page)||void 0===u?void 0:u.dimOutOfPageAreas)&&c.setSettingBool("page/dimOutOfPageAreas",null===(l=e.page)||void 0===l?void 0:l.dimOutOfPageAreas),e.variables)for(const r in e.variables)if(Object.prototype.hasOwnProperty.call(e.variables,r)){const n=e.variables[r];t.variable.setString(r,String(n.value))}}catch(e){console.error(e)}}(e,n),n}async addDefaultAssetSources({baseURL:e="https://cdn.img.ly/assets/v1",excludeAssetSourceIds:t=[]}={}){return async function(e,t,r,n){const o=["ly.img.sticker","ly.img.vectorpath","ly.img.filter.lut","ly.img.filter.duotone","ly.img.colors.defaultPalette"].filter((e=>!r.includes(e)));await I(o,t,n,e)}(this.asset,e,t,De)}async addDemoAssetSources({excludeAssetSourceIds:e=[],sceneMode:t="Design",withUploadAssetSources:r=!1}={}){return async function(e,t,r,n,o,i,a="https://cdn.img.ly/assets/demo/v1"){const s=new Set(e.findAllSources()),u="ly.img.image.upload";!o||r.includes(u)||s.has(u)||e.addLocalSource(u,["image/jpeg","image/png","image/webp","image/svg+xml","image/gif","image/bmp"]);const l="ly.img.video.upload";"Video"!==n||!o||r.includes(l)||s.has(l)||e.addLocalSource(l,["video/mp4","video/quicktime"]);const c="ly.img.audio.upload";"Video"!==n||!o||r.includes(c)||s.has(c)||e.addLocalSource(c,["audio/mpeg","audio/x-m4a","audio/m4a","audio/mp3"]);const d=["ly.img.image","ly.img.video","ly.img.audio"].filter((e=>!r.includes(e)));s.has("ly.img.template")||r.includes("ly.img.template")||(e.addLocalSource("ly.img.template",void 0,(async e=>{var r;const n=null===(r=e.meta)||void 0===r?void 0:r.uri;if(n)if(n.startsWith("UBQ1"))t.applyTemplateFromString(n);else{const e=new URL(n,window.location.href);t.applyTemplateFromURL(e.href)}})),d.push("ly.img.template")),await I(d,a,i,e)}(this.asset,this.scene,e,t,r,De)}}je=new WeakMap,qe=new WeakMap,Ne=new WeakMap,$e=new WeakSet,He=function(){Ye(this,$e,"m",Ve).call(this)},Ve=function(){if(Ye(this,Ne,"f"))return;const e=()=>{this.update(),ze(this,Ne,setTimeout(e,16),"f")};ze(this,Ne,setTimeout(e,16),"f")},We=function(){Ye(this,Ne,"f")&&(clearTimeout(Ye(this,Ne,"f")),ze(this,Ne,null,"f"))},function(e){e.Scene="//ly.img.ubq/scene",e.Stack="//ly.img.ubq/stack",e.Camera="//ly.img.ubq/camera",e.Page="//ly.img.ubq/page",e.Image="//ly.img.ubq/image",e.Graphic="//ly.img.ubq/graphic",e.Video="//ly.img.ubq/video",e.VideoFill="//ly.img.ubq/fill/video",e.ImageFill="//ly.img.ubq/fill/image",e.Audio="//ly.img.ubq/audio",e.Text="//ly.img.ubq/text",e.Sticker="//ly.img.ubq/sticker",e.VectorPath="//ly.img.ubq/vector_path",e.RectShape="//ly.img.ubq/shapes/rect",e.LineShape="//ly.img.ubq/shapes/line",e.StarShape="//ly.img.ubq/shapes/star",e.PolygonShape="//ly.img.ubq/shapes/polygon",e.EllipseShape="//ly.img.ubq/shapes/ellipse",e.Group="//ly.img.ubq/group",e.Cutout="//ly.img.ubq/cutout",e.ColorFill="//ly.img.ubq/fill/color",e.LinearGradientFill="//ly.img.ubq/fill/gradient/linear",e.RadialGradientFill="//ly.img.ubq/fill/gradient/radial",e.ConicalGradientFill="//ly.img.ubq/fill/gradient/conical"}(Ge||(Ge={}));const Ke=Ge,Qe=Xe,Ze=Xe;Object.defineProperty(Ze,"__esModule",{value:!0}),Object.defineProperty(Ze,"default",{value:Xe}),Object.defineProperty(Ze,"LogLevel",{value:{Info:"Info",Warning:"Warning",Error:"Error"}}),Object.defineProperty(Ze,"DesignBlockType",{value:Ke}),Object.defineProperty(Ze,"MimeType",{value:se})})(),n.default})()));
|