@cesdk/engine 1.18.1-rc.0 → 1.18.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,2 +1,2 @@
1
1
  /*! For license information please see index.js.LICENSE.txt */
2
- var e={789:(e,t,r)=>{var n,o=(n=(n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",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,x("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(5339).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 r.g&&"object"==typeof r.g.perf_hooks&&"object"==typeof r.g.perf_hooks.performance?s.performance=r.g.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(5339),{fileURLToPath:n}=r(3260),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(5339),C=r(9027);w=v?C.dirname(w)+"/":"//",d=(e,t)=>(e=ie(e)?new URL(e):C.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=ie(e)?new URL(e):C.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 _,S=s.print||console.log.bind(console),x=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&&(_=s.wasmBinary);var k,T,P=s.noExitRuntime||!0;"object"!=typeof WebAssembly&&ne("no native wasm support detected");var A,F,L,D,B,R,O,M,j,I,U,q=!1;function $(e,t){e||ne(t)}function H(){var e=k.buffer;s.HEAP8=F=new Int8Array(e),s.HEAP16=D=new Int16Array(e),s.HEAP32=R=new Int32Array(e),s.HEAPU8=L=new Uint8Array(e),s.HEAPU16=B=new Uint16Array(e),s.HEAPU32=O=new Uint32Array(e),s.HEAPF32=M=new Float32Array(e),s.HEAPF64=U=new Float64Array(e),s.HEAP64=j=new BigInt64Array(e),s.HEAPU64=I=new BigUint64Array(e)}var N,V=s.INITIAL_MEMORY||16777216;$(V>=65536,"INITIAL_MEMORY should be larger than STACK_SIZE, was "+V+"! (STACK_SIZE=65536)"),k=s.wasmMemory?s.wasmMemory:new WebAssembly.Memory({initial:V/65536,maximum:32768}),H(),V=k.buffer.byteLength;var W=[],z=[],G=[],Y=[];function X(){return P||!1}var K,Q,Z=0,J=null,ee=null;function te(e){Z++,s.monitorRunDependencies&&s.monitorRunDependencies(Z)}function re(e){if(Z--,s.monitorRunDependencies&&s.monitorRunDependencies(Z),0==Z&&(null!==J&&(clearInterval(J),J=null),ee)){var t=ee;ee=null,t()}}function ne(e){s.onAbort&&s.onAbort(e),x(e="Aborted("+e+")"),q=!0,A=1,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw o(t),t}function oe(e){return e.startsWith("data:application/octet-stream;base64,")}function ie(e){return e.startsWith("file://")}function ae(e){if(e==K&&_)return new Uint8Array(_);if(p)return p(e);throw"both async and sync fetching of the wasm failed"}function se(e,t,r){return function(e){return _||!y&&!v||"function"!=typeof fetch?Promise.resolve().then((()=>ae(e))):fetch(e,{credentials:"same-origin"}).then((t=>{if(!t.ok)throw"failed to load wasm binary file at '"+e+"'";return t.arrayBuffer()})).catch((()=>ae(e)))}(e).then((e=>WebAssembly.instantiate(e,t))).then((e=>e)).then(r,(e=>{x("failed to asynchronously prepare wasm: "+e),ne(e)}))}oe(K="cesdk.wasm")||(Q=K,K=s.locateFile?s.locateFile(Q,w):w+Q);var ue={2357208:(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),2359198:()=>{void 0!==window.miniaudio&&(window.miniaudio.referenceCount-=1,0===window.miniaudio.referenceCount&&delete window.miniaudio)},2359362:()=>void 0!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia,2359466:()=>{try{var e=new(window.AudioContext||window.webkitAudioContext),t=e.sampleRate;return e.close(),t}catch(e){return 0}},2359637:(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];Qn(f,c,d)}if(a==miniaudio.device_type.playback||a==miniaudio.device_type.duplex)for(Zn(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)},2362420:e=>miniaudio.get_device_by_index(e).webaudio.sampleRate,2362486: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},2362851:e=>{miniaudio.untrack_device_by_index(e)},2362894:e=>{var t=miniaudio.get_device_by_index(e);t.webaudio.resume(),t.state=miniaudio.device_state.started},2363019:e=>{var t=miniaudio.get_device_by_index(e);t.webaudio.suspend(),t.state=miniaudio.device_state.stopped},2363145:()=>!!globalThis.ubq_browserTabHidden,2363191:()=>F.length};function le(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var ce=e=>{for(;e.length>0;)e.shift()(s)},de=[],fe=0;function pe(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){O[this.ptr+4>>2]=e},this.get_type=function(){return O[this.ptr+4>>2]},this.set_destructor=function(e){O[this.ptr+8>>2]=e},this.get_destructor=function(){return O[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,F[this.ptr+12>>0]=e},this.get_caught=function(){return 0!=F[this.ptr+12>>0]},this.set_rethrown=function(e){e=e?1:0,F[this.ptr+13>>0]=e},this.get_rethrown=function(){return 0!=F[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){O[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return O[this.ptr+16>>2]},this.get_exception_ptr=function(){if(lo(this.get_type()))return O[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}var he=e=>{var t=fe;if(!t)return Jn(0),0;var r=new pe(t);r.set_adjusted_ptr(t);var n=r.get_type();if(!n)return Jn(0),t;for(var o in e){var i=e[o];if(0===i||i===n)break;var a=r.ptr+16;if(uo(i,n,a))return Jn(i),t}return Jn(n),t},me={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=me.isAbs(e),r="/"===e.substr(-1);return(e=me.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=me.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=me.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments);return me.normalize(e.join("/"))},join2:(e,t)=>me.normalize(e+"/"+t)},ge=e=>(ge=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>crypto.getRandomValues(e);if(b)try{var e=r(9758);if(e.randomFillSync)return t=>e.randomFillSync(t);var t=e.randomBytes;return e=>(e.set(t(e.byteLength)),e)}catch(e){}ne("initRandomDevice")})())(e),ye={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:Ae.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,t=me.isAbs(n)}return(t?"/":"")+(e=me.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=ye.resolve(e).substr(1),t=ye.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("/")}},ve="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,be=(e,t,r)=>{for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.buffer&&ve)return ve.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},we=[],Ee=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},Ce=(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:Ee(e)+1,o=new Array(n),i=Ce(e,o,0,o.length);return t&&(o.length=i),o}var Se={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){Se.ttys[e]={input:[],output:[],ops:t},Ae.registerDevice(e,Se.stream_ops)},stream_ops:{open:function(e){var t=Se.ttys[e.node.rdev];if(!t)throw new Ae.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 Ae.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 Ae.ErrnoError(29)}if(void 0===s&&0===i)throw new Ae.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 Ae.ErrnoError(60);try{for(var i=0;i<n;i++)e.tty.ops.put_char(e.tty,t[r+i])}catch(e){throw new Ae.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(e){return(()=>{if(!we.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;we=_e(e,!0)}return we.shift()})()},put_char:function(e,t){null===t||10===t?(S(be(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync:function(e){e.output&&e.output.length>0&&(S(be(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?(x(be(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync:function(e){e.output&&e.output.length>0&&(x(be(e.output,0)),e.output=[])}}},xe=e=>{e=((e,t)=>65536*Math.ceil(e/65536))(e);var t=to(65536,e);return t?((e,t)=>(L.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(Ae.isBlkdev(r)||Ae.isFIFO(r))throw new Ae.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:Ae.chrdev_stream_ops}});var o=Ae.createNode(e,t,r,n);return Ae.isDir(o.mode)?(o.node_ops=ke.ops_table.dir.node,o.stream_ops=ke.ops_table.dir.stream,o.contents={}):Ae.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):Ae.isLink(o.mode)?(o.node_ops=ke.ops_table.link.node,o.stream_ops=ke.ops_table.link.stream):Ae.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=Ae.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,Ae.isDir(e.mode)?t.size=4096:Ae.isFile(e.mode)?t.size=e.usedBytes:Ae.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 Ae.genericErrors[44]},mknod:(e,t,r,n)=>ke.createNode(e,t,r,n),rename(e,t,r){if(Ae.isDir(e.mode)){var n;try{n=Ae.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new Ae.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=Ae.lookupNode(e,t);for(var n in r.contents)throw new Ae.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(!Ae.isLink(e.mode))throw new Ae.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===F.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&&Ae.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new Ae.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(!Ae.isFile(e.node.mode))throw new Ae.ErrnoError(43);var i,a,s=e.node.contents;if(2&o||s.buffer!==F.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=xe(t)))throw new Ae.ErrnoError(48);F.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)}},Te=s.preloadPlugins||[];function Pe(e,t){var r=0;return e&&(r|=365),t&&(r|=146),r}var Ae={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=ye.resolve(e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new Ae.ErrnoError(32);for(var r=e.split("/").filter((e=>!!e)),n=Ae.root,o="/",i=0;i<r.length;i++){var a=i===r.length-1;if(a&&t.parent)break;if(n=Ae.lookupNode(n,r[i]),o=me.join2(o,r[i]),Ae.isMountpoint(n)&&(!a||a&&t.follow_mount)&&(n=n.mounted.root),!a||t.follow)for(var s=0;Ae.isLink(n.mode);){var u=Ae.readlink(o);if(o=ye.resolve(me.dirname(o),u),n=Ae.lookupPath(o,{recurse_count:t.recurse_count+1}).node,s++>40)throw new Ae.ErrnoError(32)}}return{path:o,node:n}},getPath:e=>{for(var t;;){if(Ae.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)%Ae.nameTable.length},hashAddNode:e=>{var t=Ae.hashName(e.parent.id,e.name);e.name_next=Ae.nameTable[t],Ae.nameTable[t]=e},hashRemoveNode:e=>{var t=Ae.hashName(e.parent.id,e.name);if(Ae.nameTable[t]===e)Ae.nameTable[t]=e.name_next;else for(var r=Ae.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode:(e,t)=>{var r=Ae.mayLookup(e);if(r)throw new Ae.ErrnoError(r,e);for(var n=Ae.hashName(e.id,t),o=Ae.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===t)return o}return Ae.lookup(e,t)},createNode:(e,t,r,n)=>{var o=new Ae.FSNode(e,t,r,n);return Ae.hashAddNode(o),o},destroyNode:e=>{Ae.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)=>Ae.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2,mayLookup:e=>Ae.nodePermissions(e,"x")||(e.node_ops.lookup?0:2),mayCreate:(e,t)=>{try{return Ae.lookupNode(e,t),20}catch(e){}return Ae.nodePermissions(e,"wx")},mayDelete:(e,t,r)=>{var n;try{n=Ae.lookupNode(e,t)}catch(e){return e.errno}var o=Ae.nodePermissions(e,"wx");if(o)return o;if(r){if(!Ae.isDir(n.mode))return 54;if(Ae.isRoot(n)||Ae.getPath(n)===Ae.cwd())return 10}else if(Ae.isDir(n.mode))return 31;return 0},mayOpen:(e,t)=>e?Ae.isLink(e.mode)?32:Ae.isDir(e.mode)&&("r"!==Ae.flagsToPermissionString(t)||512&t)?31:Ae.nodePermissions(e,Ae.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd:()=>{for(var e=0;e<=Ae.MAX_OPEN_FDS;e++)if(!Ae.streams[e])return e;throw new Ae.ErrnoError(33)},getStreamChecked:e=>{var t=Ae.getStream(e);if(!t)throw new Ae.ErrnoError(8);return t},getStream:e=>Ae.streams[e],createStream:(e,t=-1)=>(Ae.FSStream||(Ae.FSStream=function(){this.shared={}},Ae.FSStream.prototype={},Object.defineProperties(Ae.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 Ae.FSStream,e),-1==t&&(t=Ae.nextfd()),e.fd=t,Ae.streams[t]=e,e),closeStream:e=>{Ae.streams[e]=null},chrdev_stream_ops:{open:e=>{var t=Ae.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:()=>{throw new Ae.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice:(e,t)=>{Ae.devices[e]={stream_ops:t}},getDevice:e=>Ae.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),Ae.syncFSRequests++,Ae.syncFSRequests>1&&x(`warning: ${Ae.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var r=Ae.getMounts(Ae.root.mount),n=0;function o(e){return Ae.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&&Ae.root)throw new Ae.ErrnoError(10);if(!o&&!i){var a=Ae.lookupPath(r,{follow_mount:!1});if(r=a.path,n=a.node,Ae.isMountpoint(n))throw new Ae.ErrnoError(10);if(!Ae.isDir(n.mode))throw new Ae.ErrnoError(54)}var s={type:e,opts:t,mountpoint:r,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,o?Ae.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:e=>{var t=Ae.lookupPath(e,{follow_mount:!1});if(!Ae.isMountpoint(t.node))throw new Ae.ErrnoError(28);var r=t.node,n=r.mounted,o=Ae.getMounts(n);Object.keys(Ae.nameTable).forEach((e=>{for(var t=Ae.nameTable[e];t;){var r=t.name_next;o.includes(t.mount)&&Ae.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=Ae.lookupPath(e,{parent:!0}).node,o=me.basename(e);if(!o||"."===o||".."===o)throw new Ae.ErrnoError(28);var i=Ae.mayCreate(n,o);if(i)throw new Ae.ErrnoError(i);if(!n.node_ops.mknod)throw new Ae.ErrnoError(63);return n.node_ops.mknod(n,o,t,r)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,Ae.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,Ae.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{Ae.mkdir(n,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,r)=>(void 0===r&&(r=t,t=438),t|=8192,Ae.mknod(e,t,r)),symlink:(e,t)=>{if(!ye.resolve(e))throw new Ae.ErrnoError(44);var r=Ae.lookupPath(t,{parent:!0}).node;if(!r)throw new Ae.ErrnoError(44);var n=me.basename(t),o=Ae.mayCreate(r,n);if(o)throw new Ae.ErrnoError(o);if(!r.node_ops.symlink)throw new Ae.ErrnoError(63);return r.node_ops.symlink(r,n,e)},rename:(e,t)=>{var r,n,o=me.dirname(e),i=me.dirname(t),a=me.basename(e),s=me.basename(t);if(r=Ae.lookupPath(e,{parent:!0}).node,n=Ae.lookupPath(t,{parent:!0}).node,!r||!n)throw new Ae.ErrnoError(44);if(r.mount!==n.mount)throw new Ae.ErrnoError(75);var u,l=Ae.lookupNode(r,a),c=ye.relative(e,i);if("."!==c.charAt(0))throw new Ae.ErrnoError(28);if("."!==(c=ye.relative(t,o)).charAt(0))throw new Ae.ErrnoError(55);try{u=Ae.lookupNode(n,s)}catch(e){}if(l!==u){var d=Ae.isDir(l.mode),f=Ae.mayDelete(r,a,d);if(f)throw new Ae.ErrnoError(f);if(f=u?Ae.mayDelete(n,s,d):Ae.mayCreate(n,s))throw new Ae.ErrnoError(f);if(!r.node_ops.rename)throw new Ae.ErrnoError(63);if(Ae.isMountpoint(l)||u&&Ae.isMountpoint(u))throw new Ae.ErrnoError(10);if(n!==r&&(f=Ae.nodePermissions(r,"w")))throw new Ae.ErrnoError(f);Ae.hashRemoveNode(l);try{r.node_ops.rename(l,n,s)}catch(e){throw e}finally{Ae.hashAddNode(l)}}},rmdir:e=>{var t=Ae.lookupPath(e,{parent:!0}).node,r=me.basename(e),n=Ae.lookupNode(t,r),o=Ae.mayDelete(t,r,!0);if(o)throw new Ae.ErrnoError(o);if(!t.node_ops.rmdir)throw new Ae.ErrnoError(63);if(Ae.isMountpoint(n))throw new Ae.ErrnoError(10);t.node_ops.rmdir(t,r),Ae.destroyNode(n)},readdir:e=>{var t=Ae.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new Ae.ErrnoError(54);return t.node_ops.readdir(t)},unlink:e=>{var t=Ae.lookupPath(e,{parent:!0}).node;if(!t)throw new Ae.ErrnoError(44);var r=me.basename(e),n=Ae.lookupNode(t,r),o=Ae.mayDelete(t,r,!1);if(o)throw new Ae.ErrnoError(o);if(!t.node_ops.unlink)throw new Ae.ErrnoError(63);if(Ae.isMountpoint(n))throw new Ae.ErrnoError(10);t.node_ops.unlink(t,r),Ae.destroyNode(n)},readlink:e=>{var t=Ae.lookupPath(e).node;if(!t)throw new Ae.ErrnoError(44);if(!t.node_ops.readlink)throw new Ae.ErrnoError(28);return ye.resolve(Ae.getPath(t.parent),t.node_ops.readlink(t))},stat:(e,t)=>{var r=Ae.lookupPath(e,{follow:!t}).node;if(!r)throw new Ae.ErrnoError(44);if(!r.node_ops.getattr)throw new Ae.ErrnoError(63);return r.node_ops.getattr(r)},lstat:e=>Ae.stat(e,!0),chmod:(e,t,r)=>{var n;if(!(n="string"==typeof e?Ae.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new Ae.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod:(e,t)=>{Ae.chmod(e,t,!0)},fchmod:(e,t)=>{var r=Ae.getStreamChecked(e);Ae.chmod(r.node,t)},chown:(e,t,r,n)=>{var o;if(!(o="string"==typeof e?Ae.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new Ae.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(e,t,r)=>{Ae.chown(e,t,r,!0)},fchown:(e,t,r)=>{var n=Ae.getStreamChecked(e);Ae.chown(n.node,t,r)},truncate:(e,t)=>{if(t<0)throw new Ae.ErrnoError(28);var r;if(!(r="string"==typeof e?Ae.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new Ae.ErrnoError(63);if(Ae.isDir(r.mode))throw new Ae.ErrnoError(31);if(!Ae.isFile(r.mode))throw new Ae.ErrnoError(28);var n=Ae.nodePermissions(r,"w");if(n)throw new Ae.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate:(e,t)=>{var r=Ae.getStreamChecked(e);if(0==(2097155&r.flags))throw new Ae.ErrnoError(28);Ae.truncate(r.node,t)},utime:(e,t,r)=>{var n=Ae.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open:(e,t,r)=>{if(""===e)throw new Ae.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=me.normalize(e);try{n=Ae.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var o=!1;if(64&t)if(n){if(128&t)throw new Ae.ErrnoError(20)}else n=Ae.mknod(e,r,0),o=!0;if(!n)throw new Ae.ErrnoError(44);if(Ae.isChrdev(n.mode)&&(t&=-513),65536&t&&!Ae.isDir(n.mode))throw new Ae.ErrnoError(54);if(!o){var i=Ae.mayOpen(n,t);if(i)throw new Ae.ErrnoError(i)}512&t&&!o&&Ae.truncate(n,0),t&=-131713;var a=Ae.createStream({node:n,path:Ae.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||(Ae.readFiles||(Ae.readFiles={}),e in Ae.readFiles||(Ae.readFiles[e]=1)),a},close:e=>{if(Ae.isClosed(e))throw new Ae.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{Ae.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek:(e,t,r)=>{if(Ae.isClosed(e))throw new Ae.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new Ae.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new Ae.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 Ae.ErrnoError(28);if(Ae.isClosed(e))throw new Ae.ErrnoError(8);if(1==(2097155&e.flags))throw new Ae.ErrnoError(8);if(Ae.isDir(e.node.mode))throw new Ae.ErrnoError(31);if(!e.stream_ops.read)throw new Ae.ErrnoError(28);var i=void 0!==o;if(i){if(!e.seekable)throw new Ae.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 Ae.ErrnoError(28);if(Ae.isClosed(e))throw new Ae.ErrnoError(8);if(0==(2097155&e.flags))throw new Ae.ErrnoError(8);if(Ae.isDir(e.node.mode))throw new Ae.ErrnoError(31);if(!e.stream_ops.write)throw new Ae.ErrnoError(28);e.seekable&&1024&e.flags&&Ae.llseek(e,0,2);var a=void 0!==o;if(a){if(!e.seekable)throw new Ae.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(Ae.isClosed(e))throw new Ae.ErrnoError(8);if(t<0||r<=0)throw new Ae.ErrnoError(28);if(0==(2097155&e.flags))throw new Ae.ErrnoError(8);if(!Ae.isFile(e.node.mode)&&!Ae.isDir(e.node.mode))throw new Ae.ErrnoError(43);if(!e.stream_ops.allocate)throw new Ae.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 Ae.ErrnoError(2);if(1==(2097155&e.flags))throw new Ae.ErrnoError(2);if(!e.stream_ops.mmap)throw new Ae.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 Ae.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=Ae.open(e,t.flags),o=Ae.stat(e).size,i=new Uint8Array(o);return Ae.read(n,i,0,o,0),"utf8"===t.encoding?r=be(i,0):"binary"===t.encoding&&(r=i),Ae.close(n),r},writeFile:(e,t,r={})=>{r.flags=r.flags||577;var n=Ae.open(e,r.flags,r.mode);if("string"==typeof t){var o=new Uint8Array(Ee(t)+1),i=Ce(t,o,0,o.length);Ae.write(n,o,0,i,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");Ae.write(n,t,0,t.byteLength,void 0,r.canOwn)}Ae.close(n)},cwd:()=>Ae.currentPath,chdir:e=>{var t=Ae.lookupPath(e,{follow:!0});if(null===t.node)throw new Ae.ErrnoError(44);if(!Ae.isDir(t.node.mode))throw new Ae.ErrnoError(54);var r=Ae.nodePermissions(t.node,"x");if(r)throw new Ae.ErrnoError(r);Ae.currentPath=t.path},createDefaultDirectories:()=>{Ae.mkdir("/tmp"),Ae.mkdir("/home"),Ae.mkdir("/home/web_user")},createDefaultDevices:()=>{Ae.mkdir("/dev"),Ae.registerDevice(Ae.makedev(1,3),{read:()=>0,write:(e,t,r,n,o)=>n}),Ae.mkdev("/dev/null",Ae.makedev(1,3)),Se.register(Ae.makedev(5,0),Se.default_tty_ops),Se.register(Ae.makedev(6,0),Se.default_tty1_ops),Ae.mkdev("/dev/tty",Ae.makedev(5,0)),Ae.mkdev("/dev/tty1",Ae.makedev(6,0));var e=new Uint8Array(1024),t=0,r=()=>(0===t&&(t=ge(e).byteLength),e[--t]);Ae.createDevice("/dev","random",r),Ae.createDevice("/dev","urandom",r),Ae.mkdir("/dev/shm"),Ae.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{Ae.mkdir("/proc");var e=Ae.mkdir("/proc/self");Ae.mkdir("/proc/self/fd"),Ae.mount({mount:()=>{var t=Ae.createNode(e,"fd",16895,73);return t.node_ops={lookup:(e,t)=>{var r=+t,n=Ae.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?Ae.createDevice("/dev","stdin",s.stdin):Ae.symlink("/dev/tty","/dev/stdin"),s.stdout?Ae.createDevice("/dev","stdout",null,s.stdout):Ae.symlink("/dev/tty","/dev/stdout"),s.stderr?Ae.createDevice("/dev","stderr",null,s.stderr):Ae.symlink("/dev/tty1","/dev/stderr"),Ae.open("/dev/stdin",0),Ae.open("/dev/stdout",1),Ae.open("/dev/stderr",1)},ensureErrnoError:()=>{Ae.ErrnoError||(Ae.ErrnoError=function(e,t){this.name="ErrnoError",this.node=t,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},Ae.ErrnoError.prototype=new Error,Ae.ErrnoError.prototype.constructor=Ae.ErrnoError,[44].forEach((e=>{Ae.genericErrors[e]=new Ae.ErrnoError(e),Ae.genericErrors[e].stack="<generic error, no stack>"})))},staticInit:()=>{Ae.ensureErrnoError(),Ae.nameTable=new Array(4096),Ae.mount(ke,{},"/"),Ae.createDefaultDirectories(),Ae.createDefaultDevices(),Ae.createSpecialDirectories(),Ae.filesystems={MEMFS:ke}},init:(e,t,r)=>{Ae.init.initialized=!0,Ae.ensureErrnoError(),s.stdin=e||s.stdin,s.stdout=t||s.stdout,s.stderr=r||s.stderr,Ae.createStandardStreams()},quit:()=>{Ae.init.initialized=!1;for(var e=0;e<Ae.streams.length;e++){var t=Ae.streams[e];t&&Ae.close(t)}},findObject:(e,t)=>{var r=Ae.analyzePath(e,t);return r.exists?r.object:null},analyzePath:(e,t)=>{try{e=(n=Ae.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=Ae.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=me.basename(e),n=Ae.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:Ae.getPath(e);for(var o=t.split("/").reverse();o.length;){var i=o.pop();if(i){var a=me.join2(e,i);try{Ae.mkdir(a)}catch(e){}e=a}}return a},createFile:(e,t,r,n,o)=>{var i=me.join2("string"==typeof e?e:Ae.getPath(e),t),a=Pe(n,o);return Ae.create(i,a)},createDataFile:(e,t,r,n,o,i)=>{var a=t;e&&(e="string"==typeof e?e:Ae.getPath(e),a=t?me.join2(e,t):e);var s=Pe(n,o),u=Ae.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}Ae.chmod(u,146|s);var f=Ae.open(u,577);Ae.write(f,r,0,r.length,0,i),Ae.close(f),Ae.chmod(u,s)}return u},createDevice:(e,t,r,n)=>{var o=me.join2("string"==typeof e?e:Ae.getPath(e),t),i=Pe(!!r,!!n);Ae.createDevice.major||(Ae.createDevice.major=64);var a=Ae.makedev(Ae.createDevice.major++,0);return Ae.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 Ae.ErrnoError(29)}if(void 0===u&&0===a)throw new Ae.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 Ae.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),a}}),Ae.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 Ae.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=Ae.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 Ae.forceLoadFile(u),t.apply(null,arguments)}})),l.read=(e,t,r,n,o)=>(Ae.forceLoadFile(u),c(e,t,r,n,o)),l.mmap=(e,t,r,n,o)=>{Ae.forceLoadFile(u);var i=xe(t);if(!i)throw new Ae.ErrnoError(48);return c(e,F,i,t,r),{ptr:i,allocated:!0}},u.stream_ops=l,u}},Fe=(e,t)=>e?be(L,e,t):"",Le={DEFAULT_POLLMASK:5,calculateAt:function(e,t,r){if(me.isAbs(t))return t;var n;if(n=-100===e?Ae.cwd():Le.getStreamFromFD(e).path,0==t.length){if(!r)throw new Ae.ErrnoError(44);return n}return me.join2(n,t)},doStat:function(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&me.normalize(t)!==me.normalize(Ae.getPath(e.node)))return-54;throw e}R[r>>2]=n.dev,R[r+4>>2]=n.mode,O[r+8>>2]=n.nlink,R[r+12>>2]=n.uid,R[r+16>>2]=n.gid,R[r+20>>2]=n.rdev,j[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 j[r+40>>3]=BigInt(Math.floor(o/1e3)),O[r+48>>2]=o%1e3*1e3,j[r+56>>3]=BigInt(Math.floor(i/1e3)),O[r+64>>2]=i%1e3*1e3,j[r+72>>3]=BigInt(Math.floor(a/1e3)),O[r+80>>2]=a%1e3*1e3,j[r+88>>3]=BigInt(n.ino),0},doMsync:function(e,t,r,n,o){if(!Ae.isFile(t.node.mode))throw new Ae.ErrnoError(43);if(2&n)return 0;var i=L.slice(e,e+r);Ae.msync(t,i,o,r,n)},varargs:void 0,get:()=>(Le.varargs+=4,R[Le.varargs-4>>2]),getStr:e=>Fe(e),getStreamFromFD:function(e){return Ae.getStreamChecked(e)}},De={};function Be(e){for(;e.length;){var t=e.pop();e.pop()(t)}}function Re(e){return this.fromWireType(R[e>>2])}var Oe={},Me={},je={},Ie=void 0;function Ue(e){throw new Ie(e)}function qe(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){je[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),Oe.hasOwnProperty(e)||(Oe[e]=[]),Oe[e].push((()=>{o[t]=Me[e],++a===i.length&&n(o)})))})),0===i.length&&n(o)}var $e={};function He(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 Ve(e){for(var t="",r=e;L[r];)t+=Ne[L[r++]];return t}var We=void 0;function ze(e){throw new We(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||ze(`type "${n}" must have a positive integer typeid pointer`),Me.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;ze(`Cannot register type '${n}' twice`)}if(Me[e]=t,delete je[e],Oe.hasOwnProperty(e)){var o=Oe[e];delete Oe[e],o.forEach((e=>e()))}}(e,t,r)}function Ye(e,t,r){switch(t){case 0:return r?function(e){return F[e]}:function(e){return L[e]};case 1:return r?function(e){return D[e>>1]}:function(e){return B[e>>1]};case 2:return r?function(e){return R[e>>2]}:function(e){return O[e>>2]};case 3:return r?function(e){return j[e>>3]}:function(e){return I[e>>3]};default:throw new TypeError("Unknown integer type: "+e)}}function Xe(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 Ke(e){ze(e.$$.ptrType.registeredClass.name+" instance already deleted")}var Qe=!1;function Ze(e){}function Je(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 et(e,t,r){if(t===r)return e;if(void 0===r.baseClass)return null;var n=et(e,t,r.baseClass);return null===n?null:r.downcast(n)}var tt={};var rt=[];function nt(){for(;rt.length;){var e=rt.pop();e.$$.deleteScheduled=!1,e.delete()}}var ot=void 0;var it={};function at(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},st(Object.create(e,{$$:{value:t}}))}var st=function(e){return"undefined"==typeof FinalizationRegistry?(st=e=>e,e):(Qe=new FinalizationRegistry((e=>{Je(e.$$)})),st=e=>{var t=e.$$;if(t.smartPtr){var r={$$:t};Qe.register(e,r,e)}return e},Ze=e=>Qe.unregister(e),st(e))};function ut(){}function lt(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 ct(e,t){return{[e=lt(e)]:function(){return t.apply(this,arguments)}}[e]}function dt(e,t,r){if(void 0===e[t].overloadTable){var n=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||ze(`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 ft(e,t,r){s.hasOwnProperty(e)?((void 0===r||void 0!==s[e].overloadTable&&void 0!==s[e].overloadTable[r])&&ze(`Cannot register public name '${e}' twice`),dt(s,e,e),s.hasOwnProperty(r)&&ze(`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 pt(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 ht(e,t,r){for(;t!==r;)t.upcast||ze(`Expected null or instance of ${r.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e}function mt(e,t){if(null===t)return this.isReference&&ze(`null is not a valid ${this.name}`),0;t.$$||ze(`Cannot pass "${He(t)}" as a ${this.name}`),t.$$.ptr||ze(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=t.$$.ptrType.registeredClass;return ht(t.$$.ptr,r,this.registeredClass)}function gt(e,t){var r;if(null===t)return this.isReference&&ze(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,r),r):0;t.$$||ze(`Cannot pass "${He(t)}" as a ${this.name}`),t.$$.ptr||ze(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&ze(`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=ht(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&ze("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:ze(`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:ze("Unsupporting sharing policy")}return r}function yt(e,t){if(null===t)return this.isReference&&ze(`null is not a valid ${this.name}`),0;t.$$||ze(`Cannot pass "${He(t)}" as a ${this.name}`),t.$$.ptr||ze(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&ze(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass;return ht(t.$$.ptr,r,this.registeredClass)}function vt(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=gt:n?(this.toWireType=mt,this.destructorFunction=null):(this.toWireType=yt,this.destructorFunction=null)}function bt(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 wt=[],Et=e=>{var t=wt[e];return t||(e>=wt.length&&(wt.length=e+1),wt[e]=t=N.get(e)),t};function Ct(e,t){e=Ve(e);var r=Et(t);return"function"!=typeof r&&ze(`unknown function pointer with signature ${e}: ${t}`),r}var _t=void 0;function St(e){var t=eo(e),r=Ve(t);return Xn(t),r}function xt(e,t){var r=[],n={};throw t.forEach((function e(t){n[t]||Me[t]||(je[t]?je[t].forEach(e):(r.push(t),n[t]=!0))})),new _t(`${e}: `+r.map(St).join([", "]))}function kt(e,t){for(var r=[],n=0;n<e;n++)r.push(O[t+4*n>>2]);return r}function Tt(e,t){if(!(e instanceof Function))throw new TypeError(`new_ called with constructor type ${typeof e} which is not a function`);var r=ct(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&&ze("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 ${lt(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=[ze,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),Tt(Function,m).apply(null,g)}function At(){this.allocated=[void 0],this.freelist=[]}var Ft=new At;function Lt(e){e>=Ft.reserved&&0==--Ft.get(e).refcount&&Ft.free(e)}var Dt={toValue:e=>(e||ze("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?F:L;return this.fromWireType(t[e])};case 1:return function(e){var t=r?D:B;return this.fromWireType(t[e>>1])};case 2:return function(e){var t=r?R:O;return this.fromWireType(t[e>>2])};default:throw new TypeError("Unknown integer type: "+e)}}function Rt(e,t){var r=Me[e];return void 0===r&&ze(t+" has unknown type "+St(e)),r}function Ot(e,t){switch(t){case 2:return function(e){return this.fromWireType(M[e>>2])};case 3:return function(e){return this.fromWireType(U[e>>3])};default:throw new TypeError("Unknown float type: "+e)}}var Mt=(e,t,r)=>Ce(e,L,t,r),jt="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)&&B[n];)++n;if((r=n<<1)-e>32&&jt)return jt.decode(L.subarray(e,r));for(var i="",a=0;!(a>=t/2);++a){var s=D[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);D[t>>1]=a,t+=2}return D[t>>1]=0,t-n},qt=e=>2*e.length,$t=(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},Ht=(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 Vt(e,t){for(var r=new Array(e),n=0;n<e;++n)r[n]=Rt(O[t+4*n>>2],"parameter "+n);return r}var Wt={};function zt(e){var t=Wt[e];return void 0===t?Ve(e):t}var Gt=[];function Yt(){return"object"==typeof globalThis?globalThis:Function("return this")()}var Xt=[],Kt={};function Qt(e){return e<-9007199254740992||e>9007199254740992?NaN:Number(e)}var Zt,Jt=e=>e%4==0&&(e%100!=0||e%400==0),er=[0,31,60,91,121,152,182,213,244,274,305,335],tr=[0,31,59,90,120,151,181,212,243,273,304,334],rr=e=>(Jt(e.getFullYear())?er:tr)[e.getMonth()]+e.getDate()-1,nr=e=>{var t=Ee(e)+1,r=Yn(t);return r&&Mt(e,r,t),r};function or(e,t){if(lr.mainLoop.timingMode=e,lr.mainLoop.timingValue=t,!lr.mainLoop.func)return 1;if(lr.mainLoop.running||(lr.mainLoop.running=!0),0==e)lr.mainLoop.scheduler=function(){var e=0|Math.max(0,lr.mainLoop.tickStartTime+t-Zt());setTimeout(lr.mainLoop.runner,e)},lr.mainLoop.method="timeout";else if(1==e)lr.mainLoop.scheduler=function(){lr.requestAnimationFrame(lr.mainLoop.runner)},lr.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,"*")}}lr.mainLoop.scheduler=function(){setImmediate(lr.mainLoop.runner)},lr.mainLoop.method="immediate"}return 0}Zt=()=>performance.now();var ir=e=>{if(e instanceof le||"unwind"==e)return A;g(1,e)},ar=(e,t)=>{var r;A=e,A=r=e,X()||(s.onExit&&s.onExit(r),q=!0),g(r,new le(r))},sr=e=>{if(!q)try{e(),(()=>{if(!X())try{ar(A)}catch(e){ir(e)}})()}catch(e){ir(e)}},ur=(e,t)=>setTimeout((()=>{sr(e)}),t),lr={mainLoop:{running:!1,scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function(){lr.mainLoop.scheduler=null,lr.mainLoop.currentlyRunningMainloop++},resume:function(){lr.mainLoop.currentlyRunningMainloop++;var e=lr.mainLoop.timingMode,t=lr.mainLoop.timingValue,r=lr.mainLoop.func;lr.mainLoop.func=null,function(e,t,r,n,o){$(!lr.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."),lr.mainLoop.func=e,lr.mainLoop.arg=n;var i=lr.mainLoop.currentlyRunningMainloop;function a(){return!(i<lr.mainLoop.currentlyRunningMainloop)}lr.mainLoop.running=!1,lr.mainLoop.runner=function(){if(!q)if(lr.mainLoop.queue.length>0){var t=Date.now(),r=lr.mainLoop.queue.shift();if(r.func(r.arg),lr.mainLoop.remainingBlockers){var n=lr.mainLoop.remainingBlockers,o=n%1==0?n-1:Math.floor(n);r.counted?lr.mainLoop.remainingBlockers=o:(o+=.5,lr.mainLoop.remainingBlockers=(8*n+o)/9)}if(S('main loop blocker "'+r.name+'" took '+(Date.now()-t)+" ms"),lr.mainLoop.updateStatus(),!a())return;setTimeout(lr.mainLoop.runner,0)}else a()&&(lr.mainLoop.currentFrameNumber=lr.mainLoop.currentFrameNumber+1|0,1==lr.mainLoop.timingMode&&lr.mainLoop.timingValue>1&&lr.mainLoop.currentFrameNumber%lr.mainLoop.timingValue!=0?lr.mainLoop.scheduler():(0==lr.mainLoop.timingMode&&(lr.mainLoop.tickStartTime=Zt()),lr.mainLoop.runIter(e),a()&&("object"==typeof SDL&&SDL.audio&&SDL.audio.queueNewAudioData&&SDL.audio.queueNewAudioData(),lr.mainLoop.scheduler())))}}(r,0,0,lr.mainLoop.arg),or(e,t),lr.mainLoop.scheduler()},updateStatus:function(){if(s.setStatus){var e=s.statusMessage||"Please wait...",t=lr.mainLoop.remainingBlockers,r=lr.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;sr(e),s.postMainLoop&&s.postMainLoop()}}},isFullscreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init:function(){if(!lr.initted){lr.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:lr.getMimetype(t)});o.size!==e.length&&(o=new Blob([new Uint8Array(e).buffer],{type:lr.getMimetype(t)}));var i=URL.createObjectURL(o),a=new Image;a.onload=()=>{$(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),$n[t]=n,URL.revokeObjectURL(i),r&&r(e)},a.onerror=e=>{S("Image "+i+" could not be decoded"),n&&n()},a.src=i}};Te.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,Hn[t]=n,r&&r(e))}var a=new Blob([e],{type:lr.getMimetype(t)}),s=URL.createObjectURL(a),u=new Audio;u.addEventListener("canplaythrough",(()=>i(u)),!1),u.onerror=function(r){o||(x("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,ur((()=>{i(u)}),1e4)}};Te.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=>{!lr.pointerLock&&s.canvas.requestPointerLock&&(s.canvas.requestPointerLock(),e.preventDefault())}),!1))}function n(){lr.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!==yr&&(i=yr.createContext(e,a))&&(o=yr.getContext(i).GLctx)}else o=e.getContext("2d");return o?(r&&(t||$(void 0===qn,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),s.ctx=o,t&&yr.makeContextCurrent(i),s.useWebGL=t,lr.moduleContextCreatedCallbacks.forEach((e=>e())),lr.init()),o):null},destroyContext:function(e,t,r){},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen:function(e,t){lr.lockPointer=e,lr.resizeCanvas=t,void 0===lr.lockPointer&&(lr.lockPointer=!0),void 0===lr.resizeCanvas&&(lr.resizeCanvas=!1);var r=s.canvas;function n(){lr.isFullscreen=!1;var e=r.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e?(r.exitFullscreen=lr.exitFullscreen,lr.lockPointer&&r.requestPointerLock(),lr.isFullscreen=!0,lr.resizeCanvas?lr.setFullscreenCanvasSize():lr.updateCanvasDimensions(r)):(e.parentNode.insertBefore(r,e),e.parentNode.removeChild(e),lr.resizeCanvas?lr.setWindowedCanvasSize():lr.updateCanvasDimensions(r)),s.onFullScreen&&s.onFullScreen(lr.isFullscreen),s.onFullscreen&&s.onFullscreen(lr.isFullscreen)}lr.fullscreenHandlersInstalled||(lr.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!!lr.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===lr.nextRAF)lr.nextRAF=t+1e3/60;else for(;t+2>=lr.nextRAF;)lr.nextRAF+=1e3/60;var r=Math.max(lr.nextRAF-t,0);setTimeout(e,r)},requestAnimationFrame:function(e){"function"!=typeof requestAnimationFrame?(0,lr.fakeRequestAnimationFrame)(e):requestAnimationFrame(e)},safeSetTimeout:function(e,t){return ur(e,t)},safeRequestAnimationFrame:function(e){return lr.requestAnimationFrame((()=>{sr(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(lr.pointerLock)"mousemove"!=e.type&&"mozMovementX"in e?lr.mouseMovementX=lr.mouseMovementY=0:(lr.mouseMovementX=lr.getMovementX(e),lr.mouseMovementY=lr.getMovementY(e)),"undefined"!=typeof SDL?(lr.mouseX=SDL.mouseX+lr.mouseMovementX,lr.mouseY=SDL.mouseY+lr.mouseMovementY):(lr.mouseX+=lr.mouseMovementX,lr.mouseY+=lr.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)lr.lastTouches[a.identifier]=c,lr.touches[a.identifier]=c;else if("touchend"===e.type||"touchmove"===e.type){var d=lr.touches[a.identifier];d||(d=c),lr.lastTouches[a.identifier]=d,lr.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,lr.mouseMovementX=f-lr.mouseX,lr.mouseMovementY=p-lr.mouseY,lr.mouseX=f,lr.mouseY=p}},resizeListeners:[],updateResizeListeners:function(){var e=s.canvas;lr.resizeListeners.forEach((t=>t(e.width,e.height)))},setCanvasSize:function(e,t,r){var n=s.canvas;lr.updateCanvasDimensions(n,e,t),r||lr.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize:function(){if("undefined"!=typeof SDL){var e=O[SDL.screen>>2];e|=8388608,R[SDL.screen>>2]=e}lr.updateCanvasDimensions(s.canvas),lr.updateResizeListeners()},setWindowedCanvasSize:function(){if("undefined"!=typeof SDL){var e=O[SDL.screen>>2];e&=-8388609,R[SDL.screen>>2]=e}lr.updateCanvasDimensions(s.canvas),lr.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)}lr.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"))))}},cr={errorCode:12288,defaultDisplayInitialized:!1,currentContext:0,currentReadSurface:0,currentDrawSurface:0,contextAttributes:{alpha:!1,depth:!1,stencil:!1,antialias:!1},stringCache:{},setErrorCode:function(e){cr.errorCode=e},chooseConfig:function(e,t,r,n,o){if(62e3!=e)return cr.setErrorCode(12296),0;if(t)for(;;){var i=R[t>>2];if(12321==i){var a=R[t+4>>2];cr.contextAttributes.alpha=a>0}else if(12325==i){var s=R[t+4>>2];cr.contextAttributes.depth=s>0}else if(12326==i){var u=R[t+4>>2];cr.contextAttributes.stencil=u>0}else if(12337==i){var l=R[t+4>>2];cr.contextAttributes.antialias=l>0}else if(12338==i)l=R[t+4>>2],cr.contextAttributes.antialias=1==l;else if(12544==i){var c=R[t+4>>2];cr.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),cr.setErrorCode(12288),1):(cr.setErrorCode(12300),0)}};function dr(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 fr(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 pr(e){var t=e.getExtension("WEBGL_draw_buffers");if(t)return e.drawBuffers=function(e,r){t.drawBuffersWEBGL(e,r)},1}function hr(e){return!!(e.dibvbi=e.getExtension("WEBGL_draw_instanced_base_vertex_base_instance"))}function mr(e){return!!(e.mdibvbi=e.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance"))}function gr(e){return!!(e.multiDrawWebgl=e.getExtension("WEBGL_multi_draw"))}var yr={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:[],offscreenCanvases:{},queries:[],samplers:[],transformFeedbacks:[],syncs:[],stringCache:{},stringiCache:{},unpackAlignment:4,recordError:function(e){yr.lastError||(yr.lastError=e)},getNewId:function(e){for(var t=yr.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?yr.registerContext(r,t):0},registerContext:function(e,t){var r=yr.getNewId(yr.contexts),n={handle:r,attributes:t,version:t.majorVersion,GLctx:e};return e.canvas&&(e.canvas.GLctxObject=n),yr.contexts[r]=n,(void 0===t.enableExtensionsByDefault||t.enableExtensionsByDefault)&&yr.initExtensions(n),r},makeContextCurrent:function(e){return yr.currentContext=yr.contexts[e],s.ctx=qn=yr.currentContext&&yr.currentContext.GLctx,!(e&&!qn)},getContext:function(e){return yr.contexts[e]},deleteContext:function(e){yr.currentContext===yr.contexts[e]&&(yr.currentContext=null),"object"==typeof Pn&&Pn.removeAllHandlersOnTarget(yr.contexts[e].GLctx.canvas),yr.contexts[e]&&yr.contexts[e].GLctx.canvas&&(yr.contexts[e].GLctx.canvas.GLctxObject=void 0),yr.contexts[e]=null},initExtensions:function(e){if(e||(e=yr.currentContext),!e.initExtensionsDone){e.initExtensionsDone=!0;var t=e.GLctx;dr(t),fr(t),pr(t),hr(t),mr(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")),gr(t),(t.getSupportedExtensions()||[]).forEach((function(e){e.includes("lose_context")||e.includes("debug")||t.getExtension(e)}))}}},vr=[];function br(e){qn.bindVertexArray(yr.vaos[e])}var wr=br,Er=br;function Cr(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2];qn.deleteVertexArray(yr.vaos[n]),yr.vaos[n]=null}}var _r=Cr,Sr=Cr;function xr(e,t,r,n){qn.drawArraysInstanced(e,t,r,n)}var kr=xr,Tr=xr,Pr=xr,Ar=xr,Fr=xr,Lr=[];function Dr(e,t){for(var r=Lr[e],n=0;n<e;n++)r[n]=R[t+4*n>>2];qn.drawBuffers(r)}var Br=Dr,Rr=Dr,Or=Dr;function Mr(e,t,r,n){qn.drawElements(e,t,r,n)}var jr=Mr;function Ir(e,t,r,n,o){qn.drawElementsInstanced(e,t,r,n,o)}var Ur=Ir,qr=Ir,$r=Ir,Hr=Ir,Nr=Ir;function Vr(e,t,r,n){for(var o=0;o<e;o++){var i=qn[r](),a=i&&yr.getNewId(n);i?(i.name=a,n[a]=i):yr.recordError(1282),R[t+4*o>>2]=a}}function Wr(e,t){Vr(e,t,"createVertexArray",yr.vaos)}var zr=Wr,Gr=Wr;function Yr(e,t,r,n,o,i,a,s){t=yr.programs[t];var u=qn[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 Xr(e,t){O[e>>2]=t,O[e+4>>2]=(t-O[e>>2])/4294967296}function Kr(e,t,r){if(t){var n=void 0;switch(e){case 36346:n=1;break;case 36344:return void(0!=r&&1!=r&&yr.recordError(1280));case 34814:case 36345:n=0;break;case 34466:var o=qn.getParameter(34467);n=o?o.length:0;break;case 33309:if(yr.currentContext.version<2)return void yr.recordError(1282);n=2*(qn.getSupportedExtensions()||[]).length;break;case 33307:case 33308:if(yr.currentContext.version<2)return void yr.recordError(1280);n=33307==e?3:0}if(void 0===n){var i=qn.getParameter(e);switch(typeof i){case"number":n=i;break;case"boolean":n=i?1:0;break;case"string":return void yr.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 yr.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:M[t+4*a>>2]=i[a];break;case 4:F[t+a>>0]=i[a]?1:0}return}try{n=0|i.name}catch(t){return yr.recordError(1280),void x("GL_INVALID_ENUM in glGet"+r+"v: Unknown object returned from WebGL getParameter("+e+")! (error: "+t+")")}}break;default:return yr.recordError(1280),void x("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:Xr(t,n);break;case 0:R[t>>2]=n;break;case 2:M[t>>2]=n;break;case 4:F[t>>0]=n?1:0}}else yr.recordError(1281)}function Qr(e,t,r,n){if(r){var o,i=qn.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 yr.recordError(1280)}else{if(!(i instanceof WebGLBuffer))return void yr.recordError(1280);o=0|i.name}break;default:return void yr.recordError(1280)}switch(n){case 1:Xr(r,o);break;case 0:R[r>>2]=o;break;case 2:M[r>>2]=o;break;case 4:F[r>>0]=o?1:0;break;default:throw"internal emscriptenWebGLGetIndexed() error, bad type: "+n}}else yr.recordError(1281)}function Zr(e,t,r){if(r){var n,o=yr.queries[e];Xr(r,"boolean"==typeof(n=yr.currentContext.version<2?qn.disjointTimerQueryExt.getQueryObjectEXT(o,t):qn.getQueryParameter(o,t))?n?1:0:n)}else yr.recordError(1281)}var Jr=Zr;function en(e,t,r){if(r){var n,o=yr.queries[e],i=qn.disjointTimerQueryExt.getQueryObjectEXT(o,t);n="boolean"==typeof i?i?1:0:i,R[r>>2]=n}else yr.recordError(1281)}var tn=en,rn=Zr,nn=en;function on(e){return"]"==e.slice(-1)&&e.lastIndexOf("[")}function an(e){var t,r,n=e.uniformLocsById,o=e.uniformSizeAndIdsByName;if(!n)for(e.uniformLocsById=n={},e.uniformArrayNamesById={},t=0;t<qn.getProgramParameter(e,35718);++t){var i=qn.getActiveUniform(e,t),a=i.name,s=i.size,u=on(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 sn(e){var t=qn.currentProgram;if(t){var r=t.uniformLocsById[e];return"number"==typeof r&&(t.uniformLocsById[e]=r=qn.getUniformLocation(t,t.uniformArrayNamesById[e]+(r>0?"["+r+"]":""))),r}yr.recordError(1282)}function un(e,t,r,n){if(r){an(e=yr.programs[e]);var o=qn.getUniform(e,sn(t));if("number"==typeof o||"boolean"==typeof o)switch(n){case 0:R[r>>2]=o;break;case 2:M[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:M[r+4*i>>2]=o[i]}}else yr.recordError(1281)}function ln(e,t,r,n){if(r){var o=qn.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:M[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:M[r+4*i>>2]=o[i];break;case 5:R[r+4*i>>2]=Math.fround(o[i])}}else yr.recordError(1281)}function cn(e,t,r){ln(e,t,r,0)}var dn=cn,fn=cn;function pn(e){var t=yr.vaos[e];return t?qn.isVertexArray(t):0}var hn=pn,mn=pn;function gn(e){return 0==(e-=5120)?F:1==e?L:2==e?D:4==e?R:6==e?M:5==e||28922==e||28520==e||30779==e||30782==e?O:B}function yn(e){return 31-Math.clz32(e.BYTES_PER_ELEMENT)}function vn(e,t,r,n,o,i){var a=gn(e),s=yn(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,yr.unpackAlignment);return a.subarray(o>>s,o+c>>s)}var bn=[],wn=[];function En(e,t){qn.vertexAttribDivisor(e,t)}var Cn=En,_n=En,Sn=En,xn=En,kn=En,Tn=e=>{var t=e-k.buffer.byteLength+65535>>>16;try{return k.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}},An=["default","low-power","high-performance"],Fn=[0,"undefined"!=typeof document?document:0,"undefined"!=typeof window?window:0];var Ln,Dn,Bn={},Rn=()=>{if(!Rn.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]}`);Rn.strings=r}return Rn.strings},On=(e,t,r,n)=>{for(var o=0,i=0;i<r;i++){var a=O[t>>2],s=O[t+4>>2];t+=8;var u=Ae.read(e,F,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],jn=[31,28,31,30,31,30,31,31,30,31,30,31],In=(e,t)=>{F.set(e,t)},Un=function(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=Ae.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 Ae.isDir(this.mode)}},isDevice:{get:function(){return Ae.isChrdev(this.mode)}}}),Ae.FSNode=Un,Ae.createPreloadedFile=function(e,t,r,n,o,i,a,s,u,l){var c=t?ye.resolve(me.join2(e,t)):e;function d(r){function d(r){l&&l(),s||Ae.createDataFile(e,t,r,n,o,u),i&&i(),re()}(function(e,t,r,n){void 0!==lr&&lr.init();var o=!1;return Te.forEach((function(i){o||i.canHandle(t)&&(i.handle(e,t,r,n),o=!0)})),o})(r,c,d,(()=>{a&&a(),re()}))||d(r)}te(),"string"==typeof r?((e,t,r,n)=>{var o=`al ${e}`;f(e,(t=>{$(t,`Loading data file "${e}" failed (no arrayBuffer).`),d(new Uint8Array(t)),o&&re()}),(t=>{if(!r)throw`Loading data file "${e}" failed.`;r()})),o&&te()})(r,0,a):d(r)},Ae.staticInit(),s.FS_createPath=Ae.createPath,s.FS_createDataFile=Ae.createDataFile,s.FS_createPreloadedFile=Ae.createPreloadedFile,s.FS_unlink=Ae.unlink,s.FS_createLazyFile=Ae.createLazyFile,s.FS_createDevice=Ae.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}(),We=s.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},ut.prototype.isAliasOf=function(e){if(!(this instanceof ut))return!1;if(!(e instanceof ut))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},ut.prototype.clone=function(){if(this.$$.ptr||Ke(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,t=st(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},ut.prototype.delete=function(){this.$$.ptr||Ke(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ze("Object already scheduled for deletion"),Ze(this),Je(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},ut.prototype.isDeleted=function(){return!this.$$.ptr},ut.prototype.deleteLater=function(){return this.$$.ptr||Ke(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ze("Object already scheduled for deletion"),rt.push(this),1===rt.length&&ot&&ot(nt),this.$$.deleteScheduled=!0,this},s.getInheritedInstanceCount=function(){return Object.keys(it).length},s.getLiveInheritedInstances=function(){var e=[];for(var t in it)it.hasOwnProperty(t)&&e.push(it[t]);return e},s.flushPendingDeletes=nt,s.setDelayFunction=function(e){ot=e,rt.length&&ot&&ot(nt)},vt.prototype.getPointee=function(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},vt.prototype.destructor=function(e){this.rawDestructor&&this.rawDestructor(e)},vt.prototype.argPackAdvance=8,vt.prototype.readValueFromPointer=Re,vt.prototype.deleteObject=function(e){null!==e&&e.delete()},vt.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&&ze("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t}(e,t),it[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?at(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):at(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var i,a=this.registeredClass.getActualType(t),s=tt[a];if(!s)return o.call(this);i=this.isConst?s.constPointerType:s.pointerType;var u=et(t,this.registeredClass,i.registeredClass);return null===u?o.call(this):this.isSmartPointer?at(i.registeredClass.instancePrototype,{ptrType:i,ptr:u,smartPtrType:this,smartPtr:e}):at(i.registeredClass.instancePrototype,{ptrType:i,ptr:u})},_t=s.UnboundTypeError=(Ln=Error,(Dn=ct("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(Ln.prototype),Dn.prototype.constructor=Dn,Dn.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},Dn),Object.assign(At.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){lr.requestFullscreen(e,t)},s.requestAnimationFrame=function(e){lr.requestAnimationFrame(e)},s.setCanvasSize=function(e,t,r){lr.setCanvasSize(e,t,r)},s.pauseMainLoop=function(){lr.mainLoop.pause()},s.resumeMainLoop=function(){lr.mainLoop.resume()},s.getUserMedia=function(){lr.getUserMedia()},s.createContext=function(e,t,r,n){return lr.createContext(e,t,r,n)};for(var qn,$n={},Hn={},Nn=0;Nn<32;++Nn)Lr.push(new Array(Nn));var Vn=new Float32Array(288);for(Nn=0;Nn<288;++Nn)bn[Nn]=Vn.subarray(0,Nn+1);var Wn=new Int32Array(288);for(Nn=0;Nn<288;++Nn)wn[Nn]=Wn.subarray(0,Nn+1);var zn,Gn={Ha:function(e){var t=new pe(e);return t.get_caught()||t.set_caught(!0),t.set_rethrown(!1),de.push(t),so(t.excPtr),t.get_exception_ptr()},Ga:function(){ro(0,0);var e=de.pop();ao(e.excPtr),fe=0},n:()=>he([]),_:e=>he([e]),i:function(e,t,r){throw new pe(e).init(t,r),fe=e},L:function(e){throw fe||(fe=e),fe},ca:function(e,t,r){Le.varargs=r;try{var n=Le.getStreamFromFD(e);switch(t){case 0:return(o=Le.get())<0?-28:Ae.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=Le.get();return n.flags|=o,0;case 5:return o=Le.get(),D[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return 28,R[Kn()>>2]=28,-1}}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},zb:function(e,t){try{var r=Le.getStreamFromFD(e);return Le.doStat(Ae.stat,r.path,t)}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},Db:function(e,t,r){Le.varargs=r;try{var n=Le.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=Le.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++)F[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=Le.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(F[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=Le.get(),R[i>>2]=0,0):-59;case 21520:return n.tty?-28:-59;case 21531:return i=Le.get(),Ae.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=Le.get(),D[i>>1]=f[0],D[i+2>>1]=f[1]}return 0;default:return-28}}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},vb:function(e,t){try{return e=Le.getStr(e),Le.doStat(Ae.lstat,e,t)}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},wb:function(e,t,r,n){try{t=Le.getStr(t);var o=256&n,i=4096&n;return n&=-6401,t=Le.calculateAt(e,t,i),Le.doStat(o?Ae.lstat:Ae.stat,t,r)}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},pa:function(e,t,r,n){Le.varargs=n;try{t=Le.getStr(t),t=Le.calculateAt(e,t);var o=n?Le.get():0;return Ae.open(t,r,o).fd}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},xb:function(e,t){try{return e=Le.getStr(e),Le.doStat(Ae.stat,e,t)}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},ta: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;qe([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:Re,destructorFunction:a}]}))},y:function(e){var t=$e[e];delete $e[e];var r=t.rawConstructor,n=t.rawDestructor,o=t.fields;qe([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:Re,destructorFunction:n}]}))},xa:function(e,t,r,n,o){t=Ve(t);var i=Xe(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 "${He(r)}" to ${this.name}`);if(r<n||r>o)throw new TypeError(`Passing a number "${He(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:Ye(t,i,!a),destructorFunction:null})},je:function(e,t,r,n,o){var i=Xe(r);Ge(e,{name:t=Ve(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=F;else if(2===r)n=D;else{if(4!==r)throw new TypeError("Unknown boolean type size: "+t);n=R}return this.fromWireType(n[e>>i])},destructorFunction:null})},u:function(e,t,r,n,o,i,a,s,u,l,c,d,f){c=Ve(c),i=Ct(o,i),s&&(s=Ct(a,s)),l&&(l=Ct(u,l)),f=Ct(d,f);var p=lt(c);ft(p,(function(){xt(`Cannot construct ${c} due to unbound types`,[n])})),qe([e,t,r],n?[n]:[],(function(t){var r,o;t=t[0],o=n?(r=t.registeredClass).instancePrototype:ut.prototype;var a=ct(p,(function(){if(Object.getPrototypeOf(this)!==u)throw new We("Use 'new' to construct "+c);if(void 0===d.constructor_body)throw new We(c+" has no accessible constructor");var e=d.constructor_body[arguments.length];if(void 0===e)throw new We(`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 pt(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 vt(c,d,!0,!1,!1),m=new vt(c+"*",d,!1,!1,!1),g=new vt(c+" const*",d,!1,!0,!1);return tt[e]={pointerType:m,constPointerType:g},bt(p,a),[h,m,g]}))},w:function(e,t,r,n,o,i){var a=kt(t,r);o=Ct(n,o),qe([],[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 We(`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]=()=>{xt(`Cannot construct ${e.name} due to unbound types`,a)},qe([],a,(function(n){return n.splice(1,0,null),e.registeredClass.constructor_body[t-1]=Pt(r,n,null,o,i),[]})),[]}))},d:function(e,t,r,n,o,i,a,s,u){var l=kt(r,n);t=Ve(t),i=Ct(o,i),qe([],[e],(function(e){var n=`${(e=e[0]).name}.${t}`;function o(){xt(`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):(dt(c,t,n),c[t].overloadTable[r-2]=o),qe([],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,[]})),[]}))},ie:function(e,t){Ge(e,{name:t=Ve(t),fromWireType:function(e){var t=Dt.toValue(e);return Lt(e),t},toWireType:function(e,t){return Dt.toHandle(t)},argPackAdvance:8,readValueFromPointer:Re,destructorFunction:null})},U:function(e,t,r,n){var o=Xe(r);function i(){}t=Ve(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}),ft(t,i)},A:function(e,t,r){var n=Rt(e,"enum");t=Ve(t);var o=n.constructor,i=Object.create(n.constructor.prototype,{value:{value:r},constructor:{value:ct(`${n.name}_${t}`,(function(){}))}});o.values[r]=i,o[t]=i},wa:function(e,t,r){var n=Xe(r);Ge(e,{name:t=Ve(t),fromWireType:function(e){return e},toWireType:function(e,t){return t},argPackAdvance:8,readValueFromPointer:Ot(t,n),destructorFunction:null})},K:function(e,t,r,n,o,i,a){var s=kt(t,r);e=Ve(e),o=Ct(n,o),ft(e,(function(){xt(`Cannot call ${e} due to unbound types`,s)}),t-1),qe([],s,(function(r){var n=[r[0],null].concat(r.slice(1));return bt(e,Pt(e,n,null,o,i,a),t-1),[]}))},Q:function(e,t,r,n,o){t=Ve(t),-1===o&&(o=4294967295);var i=Xe(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:Ye(t,i,0!==n),destructorFunction:null})},C:function(e,t,r){var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][t];function o(e){var t=O,r=t[e>>=2],o=t[e+1];return new n(t.buffer,o,r)}Ge(e,{name:r=Ve(r),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},Fe:function(e,t,r,n,o,i,a,s,u,l,c,d){r=Ve(r),i=Ct(o,i),s=Ct(a,s),l=Ct(u,l),d=Ct(c,d),qe([e],[t],(function(e){return e=e[0],[new vt(r,e.registeredClass,!1,!1,!0,e,n,i,s,l,d)]}))},va:function(e,t){var r="std::string"===(t=Ve(t));Ge(e,{name:t,fromWireType:function(e){var t,n=O[e>>2],o=e+4;if(r)for(var i=o,a=0;a<=n;++a){var s=o+a;if(a==n||0==L[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(L[o+a]);t=l.join("")}return Xn(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||ze("Cannot pass non-string to std::string"),n=r&&o?Ee(t):t.length;var i=Yn(4+n+1),a=i+4;if(O[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&&(Xn(a),ze("String has UTF-16 code units that do not fit in 8 bits")),L[a+s]=u}else for(s=0;s<n;++s)L[a+s]=t[s];return null!==e&&e.push(Xn,i),i},argPackAdvance:8,readValueFromPointer:Re,destructorFunction:function(e){Xn(e)}})},ea:function(e,t,r){var n,o,i,a,s;r=Ve(r),2===t?(n=It,o=Ut,a=qt,i=()=>B,s=1):4===t&&(n=$t,o=Ht,a=Nt,i=()=>O,s=2),Ge(e,{name:r,fromWireType:function(e){for(var r,o=O[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 Xn(e),r},toWireType:function(e,n){"string"!=typeof n&&ze(`Cannot pass non-string to C++ string type ${r}`);var i=a(n),u=Yn(4+i+t);return O[u>>2]=i>>s,o(n,u+4,i+t),null!==e&&e.push(Xn,u),u},argPackAdvance:8,readValueFromPointer:Re,destructorFunction:function(e){Xn(e)}})},ua:function(e,t,r,n,o,i){De[e]={name:Ve(t),rawConstructor:Ct(r,n),rawDestructor:Ct(o,i),elements:[]}},P:function(e,t,r,n,o,i,a,s,u){De[e].elements.push({getterReturnType:t,getter:Ct(r,n),getterContext:o,setterArgumentType:i,setter:Ct(a,s),setterContext:u})},z:function(e,t,r,n,o,i){$e[e]={name:Ve(t),rawConstructor:Ct(r,n),rawDestructor:Ct(o,i),fields:[]}},j:function(e,t,r,n,o,i,a,s,u,l){$e[e].fields.push({fieldName:Ve(t),getterReturnType:r,getter:Ct(n,o),getterContext:i,setterArgumentType:a,setter:Ct(s,u),setterContext:l})},ke:function(e,t){Ge(e,{isVoid:!0,name:t=Ve(t),argPackAdvance:0,fromWireType:function(){},toWireType:function(e,t){}})},Bb:()=>!0,hb:()=>{throw 1/0},m:function(e,t,r){e=Dt.toValue(e),t=Rt(t,"emval::as");var n=[],o=Dt.toHandle(n);return O[r>>2]=o,t.toWireType(n,e)},t:function(e,t,r,n){e=Dt.toValue(e);for(var o=Vt(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)},V:function(e,t,r,n,o){return(e=Gt[e])(t=Dt.toValue(t),r=zt(r),function(e){var t=[];return O[e>>2]=Dt.toHandle(t),t}(n),o)},X:function(e,t,r,n){(e=Gt[e])(t=Dt.toValue(t),r=zt(r),null,n)},c:Lt,ce:function(e,t){return(e=Dt.toValue(e))==Dt.toValue(t)},E:function(e){return 0===e?Dt.toHandle(Yt()):(e=zt(e),Dt.toHandle(Yt()[e]))},J:function(e,t){var r=Vt(e,t),n=r[0],o=n.name+"_$"+r.slice(1).map((function(e){return e.name})).join("_")+"$",i=Xt[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 "+lt("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=Tt(Function,a).apply(null,s),d=Gt.length,Gt.push(c),i=d,Xt[o]=i,i},h:function(e,t){return e=Dt.toValue(e),t=Dt.toValue(t),Dt.toHandle(e[t])},e:function(e){e>4&&(Ft.get(e).refcount+=1)},Ba:function(e,t){return(e=Dt.toValue(e))instanceof Dt.toValue(t)},da:function(e){return"number"==typeof(e=Dt.toValue(e))},M:function(e){return"string"==typeof(e=Dt.toValue(e))},ye:function(e,t,r,n){e=Dt.toValue(e);var o=Kt[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)(Rt,s,Dt.toHandle,(()=>O))}(t),Kt[t]=o),o(e,r,n)},O:function(){return Dt.toHandle([])},g:function(e){return Dt.toHandle(zt(e))},I:function(){return Dt.toHandle({})},k:function(e){Be(Dt.toValue(e)),Lt(e)},v:function(e,t,r){e=Dt.toValue(e),t=Dt.toValue(t),r=Dt.toValue(r),e[t]=r},f:function(e,t){var r=(e=Rt(e,"_emval_take_value")).readValueFromPointer(t);return Dt.toHandle(r)},re:function(e){throw Dt.toValue(e)},Nc:function(e){return e=Dt.toValue(e),Dt.toHandle(typeof e)},pb:function(e,t){e=Qt(e),t=Qt(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},qb:function(e,t){e=Qt(e),t=Qt(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|rr(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},rb:function(e){e=Qt(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|rr(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)},mb:function(e,t,r,n,o,i,a){e=Qt(e),o=Qt(o),i=Qt(i),a=Qt(a);try{if(isNaN(o))return 61;var s=Le.getStreamFromFD(n),u=Ae.mmap(s,e,o,t,r),l=u.ptr;return R[i>>2]=u.allocated,O[a>>2]=l,0}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},ob:function(e,t,r,n,o,i){e=Qt(e),t=Qt(t),i=Qt(i);try{if(isNaN(i))return 61;var a=Le.getStreamFromFD(o);2&r&&Le.doMsync(e,a,t,n,i),Ae.munmap(a)}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},ib:(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"}O[e>>2]=60*u,R[t>>2]=Number(a!=s);var c=l(o),d=l(i),f=nr(c),p=nr(d);s<a?(O[r>>2]=f,O[r+4>>2]=p):(O[r>>2]=p,O[r+4>>2]=f)},b:()=>{ne("")},na:function(e,t,r,n,o){return cr.chooseConfig(e,t,r,n,o)},oa:function(e,t,r,n){if(62e3!=e)return cr.setErrorCode(12296),0;for(var o=1;;){var i=R[n>>2];if(12440!=i){if(12344==i)break;return cr.setErrorCode(12292),0}o=R[n+4>>2],n+=8}return o<2||o>3?(cr.setErrorCode(12293),0):(cr.contextAttributes.majorVersion=o-1,cr.contextAttributes.minorVersion=0,cr.context=yr.createContext(s.canvas,cr.contextAttributes),0!=cr.context?(cr.setErrorCode(12288),yr.makeContextCurrent(cr.context),s.useWebGL=!0,lr.moduleContextCreatedCallbacks.forEach((function(e){e()})),yr.makeContextCurrent(null),62004):(cr.setErrorCode(12297),0))},$a:function(e,t,r,n){return 62e3!=e?(cr.setErrorCode(12296),0):62002!=t?(cr.setErrorCode(12293),0):(cr.setErrorCode(12288),62006)},hc:function(e,t){return 62e3!=e?(cr.setErrorCode(12296),0):62004!=t?(cr.setErrorCode(12294),0):(yr.deleteContext(cr.context),cr.setErrorCode(12288),cr.currentContext==t&&(cr.currentContext=0),1)},Yb:function(e,t){return 62e3!=e?(cr.setErrorCode(12296),0):62006!=t?(cr.setErrorCode(12301),1):(cr.currentReadSurface==t&&(cr.currentReadSurface=0),cr.currentDrawSurface==t&&(cr.currentDrawSurface=0),cr.setErrorCode(12288),1)},S:function(e,t,r,n){if(62e3!=e)return cr.setErrorCode(12296),0;if(62002!=t)return cr.setErrorCode(12293),0;if(!n)return cr.setErrorCode(12300),0;switch(cr.setErrorCode(12288),r){case 12320:return R[n>>2]=cr.contextAttributes.alpha?32:24,1;case 12321:return R[n>>2]=cr.contextAttributes.alpha?8:0,1;case 12322:case 12323:case 12324:return R[n>>2]=8,1;case 12325:return R[n>>2]=cr.contextAttributes.depth?24:0,1;case 12326:return R[n>>2]=cr.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]=cr.contextAttributes.antialias?4:0,1;case 12338:return R[n>>2]=cr.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 cr.setErrorCode(12292),0}},nb:function(e){return cr.setErrorCode(12288),62e3},sa:function(){return cr.errorCode},eb:function(e,t,r){return 62e3!=e?(cr.setErrorCode(12296),0):(t&&(R[t>>2]=1),r&&(R[r>>2]=4),cr.defaultDisplayInitialized=!0,cr.setErrorCode(12288),1)},yb:function(e,t,r,n){return 62e3!=e?(cr.setErrorCode(12296),0):0!=n&&62004!=n?(cr.setErrorCode(12294),0):0!=r&&62006!=r||0!=t&&62006!=t?(cr.setErrorCode(12301),0):(yr.makeContextCurrent(n?cr.context:null),cr.currentContext=n,cr.currentDrawSurface=t,cr.currentReadSurface=r,cr.setErrorCode(12288),1)},sc:function(e,t){if(cr.defaultDisplayInitialized)if(s.ctx){if(!s.ctx.isContextLost())return cr.setErrorCode(12288),1;cr.setErrorCode(12302)}else cr.setErrorCode(12290);else cr.setErrorCode(12289);return 0},Nb:function(e){return 62e3!=e?(cr.setErrorCode(12296),0):(cr.currentContext=0,cr.currentReadSurface=0,cr.currentDrawSurface=0,cr.defaultDisplayInitialized=!1,cr.setErrorCode(12288),1)},H:(e,t,r)=>((e,t,r)=>{var n=((e,t)=>{var r;for(vr.length=0,t>>=2;r=L[e++];)t+=105!=r&t,vr.push(105==r?R[t]:(106==r?j:U)[t++>>1]),++t;return vr})(t,r);return ue[e].apply(null,n)})(e,t,r),ve:e=>{console.error(Fe(e))},we:e=>{console.log(Fe(e))},ga:e=>{console.warn(Fe(e))},aa:function(){return Date.now()},le:function(){},jb:()=>2147483648,Ab:Zt,Vf:function(e){qn.activeTexture(e)},Wf:function(e,t){qn.attachShader(yr.programs[e],yr.shaders[t])},Yc:function(e,t){qn.beginQuery(e,yr.queries[t])},ee:function(e,t){qn.disjointTimerQueryExt.beginQueryEXT(e,yr.queries[t])},Kc:function(e){qn.beginTransformFeedback(e)},Xf:function(e,t,r){qn.bindAttribLocation(yr.programs[e],t,Fe(r))},Yf:function(e,t){35051==e?qn.currentPixelPackBufferBinding=t:35052==e&&(qn.currentPixelUnpackBufferBinding=t),qn.bindBuffer(e,yr.buffers[t])},Hc:function(e,t,r){qn.bindBufferBase(e,t,yr.buffers[r])},Ic:function(e,t,r,n,o){qn.bindBufferRange(e,t,yr.buffers[r],n,o)},Xe:function(e,t){qn.bindFramebuffer(e,yr.framebuffers[t])},Ye:function(e,t){qn.bindRenderbuffer(e,yr.renderbuffers[t])},He:function(e,t){qn.bindSampler(e,yr.samplers[t])},Zf:function(e,t){qn.bindTexture(e,yr.textures[t])},Vb:function(e,t){qn.bindTransformFeedback(e,yr.transformFeedbacks[t])},rf:wr,uf:Er,_f:function(e,t,r,n){qn.blendColor(e,t,r,n)},$f:function(e){qn.blendEquation(e)},Sd:function(e,t){qn.blendEquationSeparate(e,t)},ag:function(e,t){qn.blendFunc(e,t)},Rd:function(e,t,r,n){qn.blendFuncSeparate(e,t,r,n)},Re:function(e,t,r,n,o,i,a,s,u,l){qn.blitFramebuffer(e,t,r,n,o,i,a,s,u,l)},bg:function(e,t,r,n){yr.currentContext.version>=2?r&&t?qn.bufferData(e,L,n,r,t):qn.bufferData(e,t,n):qn.bufferData(e,r?L.subarray(r,r+t):t,n)},cg:function(e,t,r,n){yr.currentContext.version>=2?r&&qn.bufferSubData(e,t,L,n,r):qn.bufferSubData(e,t,L.subarray(n,n+r))},Ze:function(e){return qn.checkFramebufferStatus(e)},dg:function(e){qn.clear(e)},kc:function(e,t,r,n){qn.clearBufferfi(e,t,r,n)},lc:function(e,t,r){qn.clearBufferfv(e,t,M,r>>2)},nc:function(e,t,r){qn.clearBufferiv(e,t,R,r>>2)},mc:function(e,t,r){qn.clearBufferuiv(e,t,O,r>>2)},eg:function(e,t,r,n){qn.clearColor(e,t,r,n)},Qd:function(e){qn.clearDepth(e)},fg:function(e){qn.clearStencil(e)},Da:function(e,t,r){return r=Number(r),qn.clientWaitSync(yr.syncs[e],t,r)},gg:function(e,t,r,n){qn.colorMask(!!e,!!t,!!r,!!n)},hg:function(e){qn.compileShader(yr.shaders[e])},ig:function(e,t,r,n,o,i,a,s){yr.currentContext.version>=2?qn.currentPixelUnpackBufferBinding||!a?qn.compressedTexImage2D(e,t,r,n,o,i,a,s):qn.compressedTexImage2D(e,t,r,n,o,i,L,s,a):qn.compressedTexImage2D(e,t,r,n,o,i,s?L.subarray(s,s+a):null)},bd:function(e,t,r,n,o,i,a,s,u){qn.currentPixelUnpackBufferBinding?qn.compressedTexImage3D(e,t,r,n,o,i,a,s,u):qn.compressedTexImage3D(e,t,r,n,o,i,a,L,u,s)},jg:function(e,t,r,n,o,i,a,s,u){yr.currentContext.version>=2?qn.currentPixelUnpackBufferBinding||!s?qn.compressedTexSubImage2D(e,t,r,n,o,i,a,s,u):qn.compressedTexSubImage2D(e,t,r,n,o,i,a,L,u,s):qn.compressedTexSubImage2D(e,t,r,n,o,i,a,u?L.subarray(u,u+s):null)},ad:function(e,t,r,n,o,i,a,s,u,l,c){qn.currentPixelUnpackBufferBinding?qn.compressedTexSubImage3D(e,t,r,n,o,i,a,s,u,l,c):qn.compressedTexSubImage3D(e,t,r,n,o,i,a,s,u,L,c,l)},Pe:function(e,t,r,n,o){qn.copyBufferSubData(e,t,r,n,o)},Pd:function(e,t,r,n,o,i,a,s){qn.copyTexImage2D(e,t,r,n,o,i,a,s)},kg:function(e,t,r,n,o,i,a,s){qn.copyTexSubImage2D(e,t,r,n,o,i,a,s)},cd:function(e,t,r,n,o,i,a,s,u){qn.copyTexSubImage3D(e,t,r,n,o,i,a,s,u)},lg:function(){var e=yr.getNewId(yr.programs),t=qn.createProgram();return t.name=e,t.maxUniformLength=t.maxAttributeLength=t.maxUniformBlockNameLength=0,t.uniformIdCounter=1,yr.programs[e]=t,e},mg:function(e){var t=yr.getNewId(yr.shaders);return yr.shaders[t]=qn.createShader(e),t},ng:function(e){qn.cullFace(e)},og:function(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2],o=yr.buffers[n];o&&(qn.deleteBuffer(o),o.name=0,yr.buffers[n]=null,n==qn.currentPixelPackBufferBinding&&(qn.currentPixelPackBufferBinding=0),n==qn.currentPixelUnpackBufferBinding&&(qn.currentPixelUnpackBufferBinding=0))}},_e:function(e,t){for(var r=0;r<e;++r){var n=R[t+4*r>>2],o=yr.framebuffers[n];o&&(qn.deleteFramebuffer(o),o.name=0,yr.framebuffers[n]=null)}},pg:function(e){if(e){var t=yr.programs[e];t?(qn.deleteProgram(t),t.name=0,yr.programs[e]=null):yr.recordError(1281)}},_c:function(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2],o=yr.queries[n];o&&(qn.deleteQuery(o),yr.queries[n]=null)}},ge:function(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2],o=yr.queries[n];o&&(qn.disjointTimerQueryExt.deleteQueryEXT(o),yr.queries[n]=null)}},$e:function(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2],o=yr.renderbuffers[n];o&&(qn.deleteRenderbuffer(o),o.name=0,yr.renderbuffers[n]=null)}},Ie:function(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2],o=yr.samplers[n];o&&(qn.deleteSampler(o),o.name=0,yr.samplers[n]=null)}},qg:function(e){if(e){var t=yr.shaders[e];t?(qn.deleteShader(t),yr.shaders[e]=null):yr.recordError(1281)}},Qe:function(e){if(e){var t=yr.syncs[e];t?(qn.deleteSync(t),t.name=0,yr.syncs[e]=null):yr.recordError(1281)}},rg:function(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2],o=yr.textures[n];o&&(qn.deleteTexture(o),o.name=0,yr.textures[n]=null)}},Ub:function(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2],o=yr.transformFeedbacks[n];o&&(qn.deleteTransformFeedback(o),o.name=0,yr.transformFeedbacks[n]=null)}},sf:_r,vf:Sr,Od:function(e){qn.depthFunc(e)},sg:function(e){qn.depthMask(!!e)},Nd:function(e,t){qn.depthRange(e,t)},Md:function(e,t){qn.detachShader(yr.programs[e],yr.shaders[t])},tg:function(e){qn.disable(e)},ug:function(e){qn.disableVertexAttribArray(e)},vg:function(e,t,r){qn.drawArrays(e,t,r)},pf:kr,Vd:Tr,Gb:Pr,nf:function(e,t,r,n,o){qn.dibvbi.drawArraysInstancedBaseInstanceWEBGL(e,t,r,n,o)},hd:Ar,Hb:Fr,lf:Br,fd:Rr,Wd:Or,wg:jr,qf:Ur,Ud:qr,Eb:$r,of:function(e,t,r,n,o,i,a){qn.dibvbi.drawElementsInstancedBaseVertexBaseInstanceWEBGL(e,t,r,n,o,i,a)},Fb:Hr,gd:Nr,ef:function(e,t,r,n,o,i){Mr(e,n,o,i)},xg:function(e){qn.enable(e)},yg:function(e){qn.enableVertexAttribArray(e)},Xc:function(e){qn.endQuery(e)},de:function(e){qn.disjointTimerQueryExt.endQueryEXT(e)},Jc:function(){qn.endTransformFeedback()},Ne:function(e,t){var r=qn.fenceSync(e,t);if(r){var n=yr.getNewId(yr.syncs);return r.name=n,yr.syncs[n]=r,n}return 0},zg:function(){qn.finish()},Ag:function(){qn.flush()},af:function(e,t,r,n){qn.framebufferRenderbuffer(e,t,r,yr.renderbuffers[n])},bf:function(e,t,r,n,o){qn.framebufferTexture2D(e,t,r,yr.textures[n],o)},Oc:function(e,t,r,n,o){qn.framebufferTextureLayer(e,t,yr.textures[r],n,o)},Bg:function(e){qn.frontFace(e)},Cg:function(e,t){Vr(e,t,"createBuffer",yr.buffers)},cf:function(e,t){Vr(e,t,"createFramebuffer",yr.framebuffers)},$c:function(e,t){Vr(e,t,"createQuery",yr.queries)},he:function(e,t){for(var r=0;r<e;r++){var n=qn.disjointTimerQueryExt.createQueryEXT();if(!n){for(yr.recordError(1282);r<e;)R[t+4*r++>>2]=0;return}var o=yr.getNewId(yr.queries);n.name=o,yr.queries[o]=n,R[t+4*r>>2]=o}},df:function(e,t){Vr(e,t,"createRenderbuffer",yr.renderbuffers)},Je:function(e,t){Vr(e,t,"createSampler",yr.samplers)},Dg:function(e,t){Vr(e,t,"createTexture",yr.textures)},Tb:function(e,t){Vr(e,t,"createTransformFeedback",yr.transformFeedbacks)},tf:zr,wf:Gr,Te:function(e){qn.generateMipmap(e)},Ld:function(e,t,r,n,o,i,a){Yr("getActiveAttrib",e,t,r,n,o,i,a)},Kd:function(e,t,r,n,o,i,a){Yr("getActiveUniform",e,t,r,n,o,i,a)},ec:function(e,t,r,n,o){e=yr.programs[e];var i=qn.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)},fc:function(e,t,r,n){if(n)if(e=yr.programs[e],35393!=r){var o=qn.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=qn.getActiveUniformBlockName(e,t);R[n>>2]=a.length+1}else yr.recordError(1281)},ic:function(e,t,r,n,o){if(o)if(t>0&&0==r)yr.recordError(1281);else{e=yr.programs[e];for(var i=[],a=0;a<t;a++)i.push(R[r+4*a>>2]);var s=qn.getActiveUniforms(e,i,n);if(s){var u=s.length;for(a=0;a<u;a++)R[o+4*a>>2]=s[a]}}else yr.recordError(1281)},Jd:function(e,t,r,n){var o=qn.getAttachedShaders(yr.programs[e]),i=o.length;i>t&&(i=t),R[r>>2]=i;for(var a=0;a<i;++a){var s=yr.shaders.indexOf(o[a]);R[n+4*a>>2]=s}},Id:function(e,t){return qn.getAttribLocation(yr.programs[e],Fe(t))},Hd:function(e,t){Kr(e,t,4)},$b:function(e,t,r){r?Xr(r,qn.getBufferParameter(e,t)):yr.recordError(1281)},Eg:function(e,t,r){r?R[r>>2]=qn.getBufferParameter(e,t):yr.recordError(1281)},Fg:function(){var e=qn.getError()||yr.lastError;return yr.lastError=0,e},Gg:function(e,t){Kr(e,t,2)},xc:function(e,t){return qn.getFragDataLocation(yr.programs[e],Fe(t))},Ue:function(e,t,r,n){var o=qn.getFramebufferAttachmentParameter(e,t,r);(o instanceof WebGLRenderbuffer||o instanceof WebGLTexture)&&(o=0|o.name),R[n>>2]=o},ac:function(e,t,r){Qr(e,t,r,1)},cc:function(e,t){Kr(e,t,1)},Lc:function(e,t,r){Qr(e,t,r,0)},fh:function(e,t){Kr(e,t,0)},Kb:function(e,t,r,n,o){if(n<0)yr.recordError(1281);else if(o){var i=qn.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 yr.recordError(1281)},Pb:function(e,t,r,n,o){yr.recordError(1282)},Hg:function(e,t,r,n){var o=qn.getProgramInfoLog(yr.programs[e]);null===o&&(o="(unknown error)");var i=t>0&&n?Mt(o,n,t):0;r&&(R[r>>2]=i)},Ig:function(e,t,r){if(r)if(e>=yr.counter)yr.recordError(1281);else if(e=yr.programs[e],35716==t){var n=qn.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<qn.getProgramParameter(e,35718);++o)e.maxUniformLength=Math.max(e.maxUniformLength,qn.getActiveUniform(e,o).name.length+1);R[r>>2]=e.maxUniformLength}else if(35722==t){if(!e.maxAttributeLength)for(o=0;o<qn.getProgramParameter(e,35721);++o)e.maxAttributeLength=Math.max(e.maxAttributeLength,qn.getActiveAttrib(e,o).name.length+1);R[r>>2]=e.maxAttributeLength}else if(35381==t){if(!e.maxUniformBlockNameLength)for(o=0;o<qn.getProgramParameter(e,35382);++o)e.maxUniformBlockNameLength=Math.max(e.maxUniformBlockNameLength,qn.getActiveUniformBlockName(e,o).length+1);R[r>>2]=e.maxUniformBlockNameLength}else R[r>>2]=qn.getProgramParameter(e,t);else yr.recordError(1281)},Zd:Jr,$d:tn,Yd:rn,Vc:function(e,t,r){if(r){var n,o=yr.queries[e],i=qn.getQueryParameter(o,t);n="boolean"==typeof i?i?1:0:i,R[r>>2]=n}else yr.recordError(1281)},_d:nn,Wc:function(e,t,r){r?R[r>>2]=qn.getQuery(e,t):yr.recordError(1281)},ae:function(e,t,r){r?R[r>>2]=qn.disjointTimerQueryExt.getQueryEXT(e,t):yr.recordError(1281)},Ve:function(e,t,r){r?R[r>>2]=qn.getRenderbufferParameter(e,t):yr.recordError(1281)},Wb:function(e,t,r){r?M[r>>2]=qn.getSamplerParameter(yr.samplers[e],t):yr.recordError(1281)},Xb:function(e,t,r){r?R[r>>2]=qn.getSamplerParameter(yr.samplers[e],t):yr.recordError(1281)},Jg:function(e,t,r,n){var o=qn.getShaderInfoLog(yr.shaders[e]);null===o&&(o="(unknown error)");var i=t>0&&n?Mt(o,n,t):0;r&&(R[r>>2]=i)},De:function(e,t,r,n){var o=qn.getShaderPrecisionFormat(e,t);R[r>>2]=o.rangeMin,R[r+4>>2]=o.rangeMax,R[n>>2]=o.precision},Gd:function(e,t,r,n){var o=qn.getShaderSource(yr.shaders[e]);if(o){var i=t>0&&n?Mt(o,n,t):0;r&&(R[r>>2]=i)}},Kg:function(e,t,r){if(r)if(35716==t){var n=qn.getShaderInfoLog(yr.shaders[e]);null===n&&(n="(unknown error)");var o=n?n.length+1:0;R[r>>2]=o}else if(35720==t){var i=qn.getShaderSource(yr.shaders[e]),a=i?i.length+1:0;R[r>>2]=a}else R[r>>2]=qn.getShaderParameter(yr.shaders[e],t);else yr.recordError(1281)},Ca:function(e){var t=yr.stringCache[e];if(!t){switch(e){case 7939:var r=qn.getSupportedExtensions()||[];r=r.concat(r.map((function(e){return"GL_"+e}))),t=nr(r.join(" "));break;case 7936:case 7937:case 37445:case 37446:var n=qn.getParameter(e);n||yr.recordError(1280),t=n&&nr(n);break;case 7938:var o=qn.getParameter(7938);o=yr.currentContext.version>=2?"OpenGL ES 3.0 ("+o+")":"OpenGL ES 2.0 ("+o+")",t=nr(o);break;case 35724:var i=qn.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=nr(i);break;default:yr.recordError(1280)}yr.stringCache[e]=t}return t},gh:function(e,t){if(yr.currentContext.version<2)return yr.recordError(1282),0;var r=yr.stringiCache[e];if(r)return t<0||t>=r.length?(yr.recordError(1281),0):r[t];if(7939===e){var n=qn.getSupportedExtensions()||[];return n=(n=n.concat(n.map((function(e){return"GL_"+e})))).map((function(e){return nr(e)})),r=yr.stringiCache[e]=n,t<0||t>=r.length?(yr.recordError(1281),0):r[t]}return yr.recordError(1280),0},bc:function(e,t,r,n,o){if(r<0)yr.recordError(1281);else if(o){var i=qn.getSyncParameter(yr.syncs[e],t);null!==i&&(R[o>>2]=i,n&&(R[n>>2]=1))}else yr.recordError(1281)},Fd:function(e,t,r){r?M[r>>2]=qn.getTexParameter(e,t):yr.recordError(1281)},Ed:function(e,t,r){r?R[r>>2]=qn.getTexParameter(e,t):yr.recordError(1281)},Fc:function(e,t,r,n,o,i,a){e=yr.programs[e];var s=qn.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)}},gc:function(e,t){return qn.getUniformBlockIndex(yr.programs[e],Fe(t))},jc:function(e,t,r,n){if(n)if(t>0&&(0==r||0==n))yr.recordError(1281);else{e=yr.programs[e];for(var o=[],i=0;i<t;i++)o.push(Fe(R[r+4*i>>2]));var a=qn.getUniformIndices(e,o);if(a){var s=a.length;for(i=0;i<s;i++)R[n+4*i>>2]=a[i]}}else yr.recordError(1281)},Lg:function(e,t){if(t=Fe(t),e=yr.programs[e]){an(e);var r=e.uniformLocsById,n=0,o=t,i=on(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]||qn.getUniformLocation(e,t)))return n}else yr.recordError(1281);var s;return-1},Dd:function(e,t,r){un(e,t,r,2)},Cd:function(e,t,r){un(e,t,r,0)},yc:function(e,t,r){un(e,t,r,0)},Ec:dn,Dc:fn,zd:function(e,t,r){r?R[r>>2]=qn.getVertexAttribOffset(e,t):yr.recordError(1281)},Bd:function(e,t,r){ln(e,t,r,2)},Ad:function(e,t,r){ln(e,t,r,5)},yd:function(e,t){qn.hint(e,t)},Ee:function(e,t,r){for(var n=Lr[t],o=0;o<t;o++)n[o]=R[r+4*o>>2];qn.invalidateFramebuffer(e,n)},Ge:function(e,t,r,n,o,i,a){for(var s=Lr[t],u=0;u<t;u++)s[u]=R[r+4*u>>2];qn.invalidateSubFramebuffer(e,s,n,o,i,a)},xd:function(e){var t=yr.buffers[e];return t?qn.isBuffer(t):0},wd:function(e){return qn.isEnabled(e)},vd:function(e){var t=yr.framebuffers[e];return t?qn.isFramebuffer(t):0},ud:function(e){return(e=yr.programs[e])?qn.isProgram(e):0},Zc:function(e){var t=yr.queries[e];return t?qn.isQuery(t):0},fe:function(e){var t=yr.queries[e];return t?qn.disjointTimerQueryExt.isQueryEXT(t):0},td:function(e){var t=yr.renderbuffers[e];return t?qn.isRenderbuffer(t):0},_b:function(e){var t=yr.samplers[e];return t?qn.isSampler(t):0},sd:function(e){var t=yr.shaders[e];return t?qn.isShader(t):0},Oe:function(e){return qn.isSync(yr.syncs[e])},Mg:function(e){var t=yr.textures[e];return t?qn.isTexture(t):0},Sb:function(e){return qn.isTransformFeedback(yr.transformFeedbacks[e])},Mc:hn,Xd:mn,Ng:function(e){qn.lineWidth(e)},Og:function(e){e=yr.programs[e],qn.linkProgram(e),e.uniformLocsById=0,e.uniformSizeAndIdsByName={}},jf:function(e,t,r,n,o,i){qn.mdibvbi.multiDrawArraysInstancedBaseInstanceWEBGL(e,R,t>>2,R,r>>2,R,n>>2,O,o>>2,i)},kf:function(e,t,r,n,o,i,a,s){qn.mdibvbi.multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL(e,R,t>>2,r,R,n>>2,R,o>>2,R,i>>2,O,a>>2,s)},Rb:function(){qn.pauseTransformFeedback()},Pg:function(e,t){3317==e&&(yr.unpackAlignment=t),qn.pixelStorei(e,t)},rd:function(e,t){qn.polygonOffset(e,t)},Ob:function(e,t,r,n){yr.recordError(1280)},Mb:function(e,t,r){yr.recordError(1280)},be:function(e,t){qn.disjointTimerQueryExt.queryCounterEXT(yr.queries[e],t)},mf:function(e){qn.readBuffer(e)},Qg:function(e,t,r,n,o,i,a){if(yr.currentContext.version>=2)if(qn.currentPixelPackBufferBinding)qn.readPixels(e,t,r,n,o,i,a);else{var s=gn(i);qn.readPixels(e,t,r,n,o,i,s,a>>yn(s))}else{var u=vn(i,o,r,n,a);u?qn.readPixels(e,t,r,n,o,i,u):yr.recordError(1280)}},qd:function(){},We:function(e,t,r,n){qn.renderbufferStorage(e,t,r,n)},Se:function(e,t,r,n,o){qn.renderbufferStorageMultisample(e,t,r,n,o)},Qb:function(){qn.resumeTransformFeedback()},pd:function(e,t){qn.sampleCoverage(e,!!t)},Ke:function(e,t,r){qn.samplerParameterf(yr.samplers[e],t,r)},Zb:function(e,t,r){var n=M[r>>2];qn.samplerParameterf(yr.samplers[e],t,n)},Le:function(e,t,r){qn.samplerParameteri(yr.samplers[e],t,r)},Me:function(e,t,r){var n=R[r>>2];qn.samplerParameteri(yr.samplers[e],t,n)},Rg:function(e,t,r,n){qn.scissor(e,t,r,n)},od:function(e,t,r,n,o){yr.recordError(1280)},Sg:function(e,t,r,n){var o=yr.getSource(e,t,r,n);if(yr.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)}qn.shaderSource(yr.shaders[e],o)},Tg:function(e,t,r){qn.stencilFunc(e,t,r)},Ug:function(e,t,r,n){qn.stencilFuncSeparate(e,t,r,n)},Vg:function(e){qn.stencilMask(e)},Wg:function(e,t){qn.stencilMaskSeparate(e,t)},Xg:function(e,t,r){qn.stencilOp(e,t,r)},Yg:function(e,t,r,n){qn.stencilOpSeparate(e,t,r,n)},Zg:function(e,t,r,n,o,i,a,s,u){if(yr.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)),yr.currentContext.version>=2)if(qn.currentPixelUnpackBufferBinding)qn.texImage2D(e,t,r,n,o,i,a,s,u);else if(u){var l=gn(s);qn.texImage2D(e,t,r,n,o,i,a,s,l,u>>yn(l))}else qn.texImage2D(e,t,r,n,o,i,a,s,null);else qn.texImage2D(e,t,r,n,o,i,a,s,u?vn(s,a,n,o,u):null)},ed:function(e,t,r,n,o,i,a,s,u,l){if(qn.currentPixelUnpackBufferBinding)qn.texImage3D(e,t,r,n,o,i,a,s,u,l);else if(l){var c=gn(u);qn.texImage3D(e,t,r,n,o,i,a,s,u,c,l>>yn(c))}else qn.texImage3D(e,t,r,n,o,i,a,s,u,null)},_g:function(e,t,r){qn.texParameterf(e,t,r)},$g:function(e,t,r){var n=M[r>>2];qn.texParameterf(e,t,n)},ah:function(e,t,r){qn.texParameteri(e,t,r)},bh:function(e,t,r){var n=R[r>>2];qn.texParameteri(e,t,n)},ff:function(e,t,r,n,o){qn.texStorage2D(e,t,r,n,o)},Lb:function(e,t,r,n,o,i){qn.texStorage3D(e,t,r,n,o,i)},ch:function(e,t,r,n,o,i,a,s,u){if(yr.currentContext.version>=2&&36193==s&&(s=5131),yr.currentContext.version>=2)if(qn.currentPixelUnpackBufferBinding)qn.texSubImage2D(e,t,r,n,o,i,a,s,u);else if(u){var l=gn(s);qn.texSubImage2D(e,t,r,n,o,i,a,s,l,u>>yn(l))}else qn.texSubImage2D(e,t,r,n,o,i,a,s,null);else{var c=null;u&&(c=vn(s,a,o,i,u)),qn.texSubImage2D(e,t,r,n,o,i,a,s,c)}},dd:function(e,t,r,n,o,i,a,s,u,l,c){if(qn.currentPixelUnpackBufferBinding)qn.texSubImage3D(e,t,r,n,o,i,a,s,u,l,c);else if(c){var d=gn(l);qn.texSubImage3D(e,t,r,n,o,i,a,s,u,l,d,c>>yn(d))}else qn.texSubImage3D(e,t,r,n,o,i,a,s,u,l,null)},Gc:function(e,t,r,n){e=yr.programs[e];for(var o=[],i=0;i<t;i++)o.push(Fe(R[r+4*i>>2]));qn.transformFeedbackVaryings(e,o,n)},dh:function(e,t){qn.uniform1f(sn(e),t)},eh:function(e,t,r){if(yr.currentContext.version>=2)t&&qn.uniform1fv(sn(e),M,r>>2,t);else{if(t<=288)for(var n=bn[t-1],o=0;o<t;++o)n[o]=M[r+4*o>>2];else n=M.subarray(r>>2,r+4*t>>2);qn.uniform1fv(sn(e),n)}},Rf:function(e,t){qn.uniform1i(sn(e),t)},Sf:function(e,t,r){if(yr.currentContext.version>=2)t&&qn.uniform1iv(sn(e),R,r>>2,t);else{if(t<=288)for(var n=wn[t-1],o=0;o<t;++o)n[o]=R[r+4*o>>2];else n=R.subarray(r>>2,r+4*t>>2);qn.uniform1iv(sn(e),n)}},wc:function(e,t){qn.uniform1ui(sn(e),t)},rc:function(e,t,r){t&&qn.uniform1uiv(sn(e),O,r>>2,t)},Tf:function(e,t,r){qn.uniform2f(sn(e),t,r)},Uf:function(e,t,r){if(yr.currentContext.version>=2)t&&qn.uniform2fv(sn(e),M,r>>2,2*t);else{if(t<=144)for(var n=bn[2*t-1],o=0;o<2*t;o+=2)n[o]=M[r+4*o>>2],n[o+1]=M[r+(4*o+4)>>2];else n=M.subarray(r>>2,r+8*t>>2);qn.uniform2fv(sn(e),n)}},Qf:function(e,t,r){qn.uniform2i(sn(e),t,r)},Pf:function(e,t,r){if(yr.currentContext.version>=2)t&&qn.uniform2iv(sn(e),R,r>>2,2*t);else{if(t<=144)for(var n=wn[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);qn.uniform2iv(sn(e),n)}},vc:function(e,t,r){qn.uniform2ui(sn(e),t,r)},qc:function(e,t,r){t&&qn.uniform2uiv(sn(e),O,r>>2,2*t)},Of:function(e,t,r,n){qn.uniform3f(sn(e),t,r,n)},Nf:function(e,t,r){if(yr.currentContext.version>=2)t&&qn.uniform3fv(sn(e),M,r>>2,3*t);else{if(t<=96)for(var n=bn[3*t-1],o=0;o<3*t;o+=3)n[o]=M[r+4*o>>2],n[o+1]=M[r+(4*o+4)>>2],n[o+2]=M[r+(4*o+8)>>2];else n=M.subarray(r>>2,r+12*t>>2);qn.uniform3fv(sn(e),n)}},Mf:function(e,t,r,n){qn.uniform3i(sn(e),t,r,n)},Lf:function(e,t,r){if(yr.currentContext.version>=2)t&&qn.uniform3iv(sn(e),R,r>>2,3*t);else{if(t<=96)for(var n=wn[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);qn.uniform3iv(sn(e),n)}},uc:function(e,t,r,n){qn.uniform3ui(sn(e),t,r,n)},pc:function(e,t,r){t&&qn.uniform3uiv(sn(e),O,r>>2,3*t)},Kf:function(e,t,r,n,o){qn.uniform4f(sn(e),t,r,n,o)},Jf:function(e,t,r){if(yr.currentContext.version>=2)t&&qn.uniform4fv(sn(e),M,r>>2,4*t);else{if(t<=72){var n=bn[4*t-1],o=M;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=M.subarray(r>>2,r+16*t>>2);qn.uniform4fv(sn(e),n)}},xf:function(e,t,r,n,o){qn.uniform4i(sn(e),t,r,n,o)},yf:function(e,t,r){if(yr.currentContext.version>=2)t&&qn.uniform4iv(sn(e),R,r>>2,4*t);else{if(t<=72)for(var n=wn[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);qn.uniform4iv(sn(e),n)}},tc:function(e,t,r,n,o){qn.uniform4ui(sn(e),t,r,n,o)},oc:function(e,t,r){t&&qn.uniform4uiv(sn(e),O,r>>2,4*t)},dc:function(e,t,r){e=yr.programs[e],qn.uniformBlockBinding(e,t,r)},zf:function(e,t,r,n){if(yr.currentContext.version>=2)t&&qn.uniformMatrix2fv(sn(e),!!r,M,n>>2,4*t);else{if(t<=72)for(var o=bn[4*t-1],i=0;i<4*t;i+=4)o[i]=M[n+4*i>>2],o[i+1]=M[n+(4*i+4)>>2],o[i+2]=M[n+(4*i+8)>>2],o[i+3]=M[n+(4*i+12)>>2];else o=M.subarray(n>>2,n+16*t>>2);qn.uniformMatrix2fv(sn(e),!!r,o)}},Uc:function(e,t,r,n){t&&qn.uniformMatrix2x3fv(sn(e),!!r,M,n>>2,6*t)},Sc:function(e,t,r,n){t&&qn.uniformMatrix2x4fv(sn(e),!!r,M,n>>2,8*t)},Af:function(e,t,r,n){if(yr.currentContext.version>=2)t&&qn.uniformMatrix3fv(sn(e),!!r,M,n>>2,9*t);else{if(t<=32)for(var o=bn[9*t-1],i=0;i<9*t;i+=9)o[i]=M[n+4*i>>2],o[i+1]=M[n+(4*i+4)>>2],o[i+2]=M[n+(4*i+8)>>2],o[i+3]=M[n+(4*i+12)>>2],o[i+4]=M[n+(4*i+16)>>2],o[i+5]=M[n+(4*i+20)>>2],o[i+6]=M[n+(4*i+24)>>2],o[i+7]=M[n+(4*i+28)>>2],o[i+8]=M[n+(4*i+32)>>2];else o=M.subarray(n>>2,n+36*t>>2);qn.uniformMatrix3fv(sn(e),!!r,o)}},Tc:function(e,t,r,n){t&&qn.uniformMatrix3x2fv(sn(e),!!r,M,n>>2,6*t)},Qc:function(e,t,r,n){t&&qn.uniformMatrix3x4fv(sn(e),!!r,M,n>>2,12*t)},Bf:function(e,t,r,n){if(yr.currentContext.version>=2)t&&qn.uniformMatrix4fv(sn(e),!!r,M,n>>2,16*t);else{if(t<=18){var o=bn[16*t-1],i=M;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=M.subarray(n>>2,n+64*t>>2);qn.uniformMatrix4fv(sn(e),!!r,o)}},Rc:function(e,t,r,n){t&&qn.uniformMatrix4x2fv(sn(e),!!r,M,n>>2,8*t)},Pc:function(e,t,r,n){t&&qn.uniformMatrix4x3fv(sn(e),!!r,M,n>>2,12*t)},Cf:function(e){e=yr.programs[e],qn.useProgram(e),qn.currentProgram=e},nd:function(e){qn.validateProgram(yr.programs[e])},Df:function(e,t){qn.vertexAttrib1f(e,t)},md:function(e,t){qn.vertexAttrib1f(e,M[t>>2])},ld:function(e,t,r){qn.vertexAttrib2f(e,t,r)},Ef:function(e,t){qn.vertexAttrib2f(e,M[t>>2],M[t+4>>2])},kd:function(e,t,r,n){qn.vertexAttrib3f(e,t,r,n)},Ff:function(e,t){qn.vertexAttrib3f(e,M[t>>2],M[t+4>>2],M[t+8>>2])},jd:function(e,t,r,n,o){qn.vertexAttrib4f(e,t,r,n,o)},Gf:function(e,t){qn.vertexAttrib4f(e,M[t>>2],M[t+4>>2],M[t+8>>2],M[t+12>>2])},gf:Cn,Td:_n,Ib:Sn,id:xn,Jb:kn,Cc:function(e,t,r,n,o){qn.vertexAttribI4i(e,t,r,n,o)},Ac:function(e,t){qn.vertexAttribI4i(e,R[t>>2],R[t+4>>2],R[t+8>>2],R[t+12>>2])},Bc:function(e,t,r,n,o){qn.vertexAttribI4ui(e,t,r,n,o)},zc:function(e,t){qn.vertexAttribI4ui(e,O[t>>2],O[t+4>>2],O[t+8>>2],O[t+12>>2])},hf:function(e,t,r,n,o){qn.vertexAttribIPointer(e,t,r,n,o)},Hf:function(e,t,r,n,o,i){qn.vertexAttribPointer(e,t,r,!!n,o,i)},If:function(e,t,r,n){qn.viewport(e,t,r,n)},Ea:function(e,t,r){r=Number(r),qn.waitSync(yr.syncs[e],t,r)},Cb:(e,t,r)=>L.copyWithin(e,t,t+r),kb:e=>{var t=L.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(Tn(a))return!0}return!1},Va: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})},Ma: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})},_a: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})},Qa: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})},Ra: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})},Ia: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})},Ua: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)}},La: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)},Ya: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)}},Pa: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)},Ka: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()},Oa: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++},Ja:async function(e,t){const r=s.emscripten_ubq_codec_audioEncoders.get(e);await r.audioEncoder.flush(),s.emscripten_ubq_codec_onFinalizedAudioEncoding(e,t)},Na:async function(e,t){const r=s.emscripten_ubq_codec_videoEncoders.get(e);await r.videoEncoder.flush(),s.emscripten_ubq_codec_onFinalizedVideoEncoding(e,t)},Ta: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},Y: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},ja:function(e){return s.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder.decodeQueueSize},ka:function(e){return s.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder.decodedFrames},$:function(e){return s.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder.writtenFrames},Sa:function(e){return s.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder.flushing},Xa:function(e){return s.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder.flushing},Z:function(){return"undefined"!=typeof VideoFrame&&"undefined"!=typeof VideoDecoder&&"undefined"!=typeof VideoEncoder&&"undefined"!=typeof AudioDecoder&&"undefined"!=typeof AudioEncoder},Wa:function(e,t){s.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder.requestedFrame=t},Za: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]=yr.textures[o[e]]},pe:function(e){const t=s.emscripten_ubq_asyncFetchManager.getProcess(e);return!!(null==t?void 0:t.allocate())},fa:function(e,t,r,n){return s.emscripten_ubq_asyncFetchManager.createHeader(e,t,r,n)},te:function(e){s.emscripten_ubq_asyncFetchManager.deleteHeader(e)},ue: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},me:function(e){return s.emscripten_ubq_asyncFetchManager.deleteProcess(e)},se: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},oe:function(e){const t=s.emscripten_ubq_asyncFetchManager.getProcess(e);return(null==t?void 0:t.isAllocated())?t.resultAddress:-1},ne:function(e){const t=s.emscripten_ubq_asyncFetchManager.getProcess(e);return(null==t?void 0:t.isAllocated())?t.resultLength:-1},ya: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},qe: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},bb:function(){return!!s.emscripten_ubq_settings_forceWebGL1},ma: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:An[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:yr.createContext(i,o):0},la:function(e){yr.currentContext==e&&(yr.currentContext=0),yr.deleteContext(e)},cb:function(e,t){var r=yr.getContext(e),n=Fe(t);return n.startsWith("GL_")&&(n=n.substr(3)),"ANGLE_instanced_arrays"==n&&dr(qn),"OES_vertex_array_object"==n&&fr(qn),"WEBGL_draw_buffers"==n&&pr(qn),"WEBGL_draw_instanced_base_vertex_base_instance"==n&&hr(qn),"WEBGL_multi_draw_instanced_base_vertex_base_instance"==n&&mr(qn),"WEBGL_multi_draw"==n&&gr(qn),!!r.GLctx.getExtension(n)},ab: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},db:function(e){return yr.makeContextCurrent(e)?0:-5},tb:(e,t)=>{var r=0;return Rn().forEach((function(n,o){var i=t+r;O[e+4*o>>2]=i,((e,t)=>{for(var r=0;r<e.length;++r)F[t++>>0]=e.charCodeAt(r);F[t>>0]=0})(n,i),r+=n.length+1})),0},ub:(e,t)=>{var r=Rn();O[e>>2]=r.length;var n=0;return r.forEach((function(e){n+=e.length+1})),O[t>>2]=n,0},xe:ar,ba:function(e){try{var t=Le.getStreamFromFD(e);return Ae.close(t),0}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return e.errno}},lb:function(e,t,r,n,o){t=Qt(t),r=Qt(r),n=Qt(n),o=Qt(o);try{if(isNaN(n))return 61;var i=Le.getStreamFromFD(e),a=On(i,t,r,n);return O[o>>2]=a,0}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return e.errno}},ra:function(e,t,r,n){try{var o=Le.getStreamFromFD(e),i=On(o,t,r);return O[n>>2]=i,0}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return e.errno}},sb:function(e,t,r,n){t=Qt(t),n=Qt(n);try{if(isNaN(t))return 61;var o=Le.getStreamFromFD(e);return Ae.llseek(o,t,r),j[n>>3]=BigInt(o.position),o.getdents&&0===t&&0===r&&(o.getdents=null),0}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return e.errno}},qa:function(e,t,r,n){try{var o=((e,t,r,n)=>{for(var o=0,i=0;i<r;i++){var a=O[t>>2],s=O[t+4>>2];t+=8;var u=Ae.write(e,F,a,s,n);if(u<0)return-1;o+=u,void 0!==n&&(n+=u)}return o})(Le.getStreamFromFD(e),t,r);return O[n>>2]=o,0}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return e.errno}},fb:(e,t)=>(ge(L.subarray(e,e+t)),0),x:function(e,t,r){var n=no();try{return Et(e)(t,r)}catch(e){if(oo(n),e!==e+0)throw e;ro(1,0)}},N:function(e,t){var r=no();try{return Et(e)(t)}catch(e){if(oo(r),e!==e+0)throw e;ro(1,0)}},G:function(e,t,r){var n=no();try{return Et(e)(t,r)}catch(e){if(oo(n),e!==e+0)throw e;ro(1,0)}},l:function(e,t,r,n){var o=no();try{return Et(e)(t,r,n)}catch(e){if(oo(o),e!==e+0)throw e;ro(1,0)}},Fa:function(e){var t=no();try{return Et(e)()}catch(e){if(oo(t),e!==e+0)throw e;ro(1,0)}},ha:function(e,t,r){var n=no();try{return Et(e)(t,r)}catch(e){if(oo(n),e!==e+0)throw e;ro(1,0)}},q:function(e,t){var r=no();try{return Et(e)(t)}catch(e){if(oo(r),e!==e+0)throw e;ro(1,0)}},W:function(e,t,r,n,o,i,a,s,u,l,c,d,f,p,h,m){var g=no();try{return Et(e)(t,r,n,o,i,a,s,u,l,c,d,f,p,h,m)}catch(e){if(oo(g),e!==e+0)throw e;ro(1,0)}},p:function(e,t,r){var n=no();try{return Et(e)(t,r)}catch(e){if(oo(n),e!==e+0)throw e;ro(1,0)}},r:function(e,t,r,n){var o=no();try{return Et(e)(t,r,n)}catch(e){if(oo(o),e!==e+0)throw e;ro(1,0)}},T:function(e,t,r,n,o){var i=no();try{return Et(e)(t,r,n,o)}catch(e){if(oo(i),e!==e+0)throw e;ro(1,0)}},Ce:function(e,t,r,n,o,i){var a=no();try{return Et(e)(t,r,n,o,i)}catch(e){if(oo(a),e!==e+0)throw e;ro(1,0)}},Aa:function(e,t,r,n,o,i,a){var s=no();try{return Et(e)(t,r,n,o,i,a)}catch(e){if(oo(s),e!==e+0)throw e;ro(1,0)}},za:function(e,t,r,n,o,i,a,s,u,l){var c=no();try{return Et(e)(t,r,n,o,i,a,s,u,l)}catch(e){if(oo(c),e!==e+0)throw e;ro(1,0)}},R:function(e){var t=no();try{Et(e)()}catch(e){if(oo(t),e!==e+0)throw e;ro(1,0)}},s:function(e,t){var r=no();try{Et(e)(t)}catch(e){if(oo(r),e!==e+0)throw e;ro(1,0)}},B:function(e,t,r,n){var o=no();try{Et(e)(t,r,n)}catch(e){if(oo(o),e!==e+0)throw e;ro(1,0)}},F:function(e,t,r){var n=no();try{Et(e)(t,r)}catch(e){if(oo(n),e!==e+0)throw e;ro(1,0)}},o:function(e,t,r,n){var o=no();try{Et(e)(t,r,n)}catch(e){if(oo(o),e!==e+0)throw e;ro(1,0)}},D:function(e,t,r,n,o){var i=no();try{Et(e)(t,r,n,o)}catch(e){if(oo(i),e!==e+0)throw e;ro(1,0)}},Be:function(e,t,r,n,o,i){var a=no();try{Et(e)(t,r,n,o,i)}catch(e){if(oo(a),e!==e+0)throw e;ro(1,0)}},ze:function(e,t,r,n,o,i,a){var s=no();try{Et(e)(t,r,n,o,i,a)}catch(e){if(oo(s),e!==e+0)throw e;ro(1,0)}},hh:function(e,t,r,n,o,i,a,s){var u=no();try{Et(e)(t,r,n,o,i,a,s)}catch(e){if(oo(u),e!==e+0)throw e;ro(1,0)}},Ae:function(e,t,r,n,o,i,a,s,u,l){var c=no();try{Et(e)(t,r,n,o,i,a,s,u,l)}catch(e){if(oo(c),e!==e+0)throw e;ro(1,0)}},ia:function(e,t){const r=Dt.toValue(t),n=s.ctx;n.bindTexture(n.TEXTURE_2D,yr.textures[e]),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,r)},a:k,gb:(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=Jt(r.getFullYear()),o=r.getMonth(),i=(n?Mn:jn)[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})(Jt(e.tm_year+1900)?Mn:jn,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&&Jt(e.tm_year)||(t=1)}}else{t=52;var n=(e.tm_wday+7-e.tm_yday-1)%7;(4==n||5==n&&Jt(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)},Yn=(function(){var e,t,r,n,i={a:Gn};function a(e,t){var r,n=e.exports;return N=(T=n).kh,r=T.ih,z.unshift(r),re(),n}if(te(),s.instantiateWasm)try{return s.instantiateWasm(i,a)}catch(e){x("Module.instantiateWasm callback failed with error: "+e),o(e)}(e=_,t=K,r=i,n=function(e){a(e.instance)},e||"function"!=typeof WebAssembly.instantiateStreaming||oe(t)||b||"function"!=typeof fetch?se(t,r,n):fetch(t,{credentials:"same-origin"}).then((e=>WebAssembly.instantiateStreaming(e,r).then(n,(function(e){return x("wasm streaming compile failed: "+e),x("falling back to ArrayBuffer instantiation"),se(t,r,n)}))))).catch(o)}(),s._malloc=e=>(Yn=s._malloc=T.jh)(e)),Xn=s._free=e=>(Xn=s._free=T.lh)(e),Kn=()=>(Kn=T.mh)(),Qn=(s._ma_malloc_emscripten=(e,t)=>(s._ma_malloc_emscripten=T.nh)(e,t),s._ma_free_emscripten=(e,t)=>(s._ma_free_emscripten=T.oh)(e,t),s._ma_device_process_pcm_frames_capture__webaudio=(e,t,r)=>(Qn=s._ma_device_process_pcm_frames_capture__webaudio=T.ph)(e,t,r)),Zn=s._ma_device_process_pcm_frames_playback__webaudio=(e,t,r)=>(Zn=s._ma_device_process_pcm_frames_playback__webaudio=T.qh)(e,t,r),Jn=e=>(Jn=T.rh)(e),eo=e=>(eo=T.sh)(e),to=(s.__embind_initialize_bindings=()=>(s.__embind_initialize_bindings=T.th)(),(e,t)=>(to=T.uh)(e,t)),ro=(e,t)=>(ro=T.vh)(e,t),no=()=>(no=T.wh)(),oo=e=>(oo=T.xh)(e),io=e=>(io=T.yh)(e),ao=e=>(ao=T.zh)(e),so=e=>(so=T.Ah)(e),uo=(e,t,r)=>(uo=T.Bh)(e,t,r),lo=e=>(lo=T.Ch)(e);function co(){function e(){zn||(zn=!0,s.calledRun=!0,q||(s.noFSInit||Ae.init.initialized||Ae.init(),Ae.ignorePermissions=!1,Se.init(),ce(z),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(),Y.unshift(e);var e;ce(Y)}()))}Z>0||(function(){if(s.preRun)for("function"==typeof s.preRun&&(s.preRun=[s.preRun]);s.preRun.length;)e=s.preRun.shift(),W.unshift(e);var e;ce(W)}(),Z>0||(s.setStatus?(s.setStatus("Running..."),setTimeout((function(){setTimeout((function(){s.setStatus("")}),1),e()}),1)):e()))}if(s.___start_em_js=2363211,s.___stop_em_js=2363462,s.addRunDependency=te,s.removeRunDependency=re,s.FS_createPath=Ae.createPath,s.FS_createDataFile=Ae.createDataFile,s.FS_createLazyFile=Ae.createLazyFile,s.FS_createDevice=Ae.createDevice,s.FS_unlink=Ae.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=Ee(e)+1,r=io(t);return Mt(e,r,t),r})(e)),t},array:e=>{var t=io(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=no()),u[c]=d(n[c])):u[c]=n[c]}var f=a.apply(null,u);return function(e){return 0!==l&&oo(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 F[e>>0];case"i16":return D[e>>1];case"i32":return R[e>>2];case"i64":return j[e>>3];case"float":return M[e>>2];case"double":return U[e>>3];case"*":return O[e>>2];default:ne(`invalid type for getValue: ${t}`)}},s.UTF8ToString=Fe,s.specialHTMLTargets=Fn,s.FS_createPreloadedFile=Ae.createPreloadedFile,ee=function e(){zn||co(),zn||(ee=e)},s.preInit)for("function"==typeof s.preInit&&(s.preInit=[s.preInit]);s.preInit.length>0;)s.preInit.pop()();return co(),e.ready});e.exports=o},2021:(e,t)=>{t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,i=u(e),a=i[0],s=i[1],l=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,s)),c=0,d=s>0?a-4:a;for(r=0;r<d;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],l[c++]=t>>16&255,l[c++]=t>>8&255,l[c++]=255&t;return 2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,l[c++]=255&t),1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,l[c++]=t>>8&255,l[c++]=255&t),l},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=16383,s=0,u=n-o;s<u;s+=a)i.push(l(e,s,s+a>u?u:s+a));return 1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=i.length;a<s;++a)r[a]=i[a],n[i.charCodeAt(a)]=a;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e,t,n){for(var o,i,a=[],s=t;s<n;s+=3)o=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},808:(e,t,r)=>{var n=r(2021),o=r(7410),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.h2=50;var a=2147483647;function s(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|m(e,t),n=s(r),o=n.write(e,t);return o!==r&&(n=n.slice(0,o)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if($(e,Uint8Array)){var t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if($(e,ArrayBuffer)||e&&$(e.buffer,ArrayBuffer))return p(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&($(e,SharedArrayBuffer)||e&&$(e.buffer,SharedArrayBuffer)))return p(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);var o=function(e){if(u.isBuffer(e)){var t=0|h(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||H(e.length)?s(0):f(e):"Buffer"===e.type&&Array.isArray(e.data)?f(e.data):void 0}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return c(e),s(e<0?0:0|h(e))}function f(e){for(var t=e.length<0?0:0|h(e.length),r=s(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function p(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,u.prototype),n}function h(e){if(e>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function m(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||$(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var o=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return I(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return U(e).length;default:if(o)return n?-1:I(e).length;t=(""+t).toLowerCase(),o=!0}}function g(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return F(this,t,r);case"utf8":case"utf-8":return k(this,t,r);case"ascii":return P(this,t,r);case"latin1":case"binary":return A(this,t,r);case"base64":return x(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function y(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function v(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),H(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,n,o){var i,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var c=-1;for(i=r;i<s;i++)if(l(e,i)===l(t,-1===c?0:i-c)){if(-1===c&&(c=i),i-c+1===u)return c*a}else-1!==c&&(i-=i-c),c=-1}else for(r+u>s&&(r=s-u),i=r;i>=0;i--){for(var d=!0,f=0;f<u;f++)if(l(e,i+f)!==l(t,f)){d=!1;break}if(d)return i}return-1}function w(e,t,r,n){r=Number(r)||0;var o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=t.length;n>i/2&&(n=i/2);for(var a=0;a<n;++a){var s=parseInt(t.substr(2*a,2),16);if(H(s))return a;e[r+a]=s}return a}function E(e,t,r,n){return q(I(t,e.length-r),e,r,n)}function C(e,t,r,n){return q(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function _(e,t,r,n){return q(U(t),e,r,n)}function S(e,t,r,n){return q(function(e,t){for(var r,n,o,i=[],a=0;a<e.length&&!((t-=2)<0);++a)n=(r=e.charCodeAt(a))>>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function x(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function k(e,t,r){r=Math.min(e.length,r);for(var n=[],o=t;o<r;){var i,a,s,u,l=e[o],c=null,d=l>239?4:l>223?3:l>191?2:1;if(o+d<=r)switch(d){case 1:l<128&&(c=l);break;case 2:128==(192&(i=e[o+1]))&&(u=(31&l)<<6|63&i)>127&&(c=u);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(u=(15&l)<<12|(63&i)<<6|63&a)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:i=e[o+1],a=e[o+2],s=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(u=(15&l)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,d=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),o+=d}return function(e){var t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=T));return r}(n)}u.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return function(e,t,r){return c(e),e<=0?s(e):void 0!==t?"string"==typeof r?s(e).fill(t,r):s(e).fill(t):s(e)}(e,t,r)},u.allocUnsafe=function(e){return d(e)},u.allocUnsafeSlow=function(e){return d(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if($(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),$(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=u.allocUnsafe(t),o=0;for(r=0;r<e.length;++r){var i=e[r];if($(i,Uint8Array))o+i.length>n.length?u.from(i).copy(n,o):Uint8Array.prototype.set.call(n,i,o);else{if(!u.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o)}o+=i.length}return n},u.byteLength=m,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)y(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},u.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?k(this,0,e):g.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",r=t.h2;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},i&&(u.prototype[i]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,o){if($(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(i,a),l=this.slice(n,o),c=e.slice(t,r),d=0;d<s;++d)if(l[d]!==c[d]){i=l[d],a=c[d];break}return i<a?-1:a<i?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return v(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return v(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return E(this,e,t,r);case"ascii":case"latin1":case"binary":return C(this,e,t,r);case"base64":return _(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var T=4096;function P(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function A(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function F(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=t;i<r;++i)o+=N[e[i]];return o}function L(e,t,r){for(var n=e.slice(t,r),o="",i=0;i<n.length-1;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function D(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function B(e,t,r,n,o,i){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function R(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function O(e,t,r,n,i){return t=+t,r>>>=0,i||R(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function M(e,t,r,n,i){return t=+t,r>>>=0,i||R(e,0,r,8),o.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);for(var n=this[e],o=1,i=0;++i<t&&(o*=256);)n+=this[e+i]*o;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);for(var n=this[e+--t],o=1;t>0&&(o*=256);)n+=this[e+--t]*o;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||D(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||D(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);for(var n=this[e],o=1,i=0;++i<t&&(o*=256);)n+=this[e+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);for(var n=t,o=1,i=this[e+--n];n>0&&(o*=256);)i+=this[e+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||D(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||D(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||D(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||D(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return e>>>=0,t||D(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||D(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||D(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||D(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||B(this,e,t,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||B(this,e,t,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var o=Math.pow(2,8*r-1);B(this,e,t,r,o-1,-o)}var i=0,a=1,s=0;for(this[t]=255&e;++i<r&&(a*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var o=Math.pow(2,8*r-1);B(this,e,t,r,o-1,-o)}var i=r-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeFloatLE=function(e,t,r){return O(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return O(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return M(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return M(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var o=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),o},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var o=e.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(e=o)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{var a=u.isBuffer(e)?e:u.from(e,n),s=a.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=a[i%s]}return this};var j=/[^+/0-9A-Za-z-_]/g;function I(e,t){var r;t=t||1/0;for(var n=e.length,o=null,i=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function U(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(j,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function q(e,t,r,n){for(var o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function $(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function H(e){return e!=e}var N=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=16*r,o=0;o<16;++o)t[n+o]=e[r]+e[o];return t}()},7410:(e,t)=>{t.read=function(e,t,r,n,o){var i,a,s=8*o-n-1,u=(1<<s)-1,l=u>>1,c=-7,d=r?o-1:0,f=r?-1:1,p=e[t+d];for(d+=f,i=p&(1<<-c)-1,p>>=-c,c+=s;c>0;i=256*i+e[t+d],d+=f,c-=8);for(a=i&(1<<-c)-1,i>>=-c,c+=n;c>0;a=256*a+e[t+d],d+=f,c-=8);if(0===i)i=1-l;else{if(i===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),i-=l}return(p?-1:1)*a*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var a,s,u,l=8*i-o-1,c=(1<<l)-1,d=c>>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,h=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+d>=1?f/u:f*Math.pow(2,1-d))*u>=2&&(a++,u/=2),a+d>=c?(s=0,a=c):a+d>=1?(s=(t*u-1)*Math.pow(2,o),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,o),a=0));o>=8;e[r+p]=255&s,p+=h,s/=256,o-=8);for(a=a<<o|s,l+=o;l>0;e[r+p]=255&a,p+=h,a/=256,l-=8);e[r+p-h]|=128*m}},8634:(e,t,r)=>{var n=r(7451)(r(6491),"DataView");e.exports=n},3871:(e,t,r)=>{var n=r(770),o=r(1464),i=r(1265),a=r(4008),s=r(8409);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=s,e.exports=u},602:(e,t,r)=>{var n=r(8924),o=r(3775),i=r(2891),a=r(4670),s=r(3985);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=s,e.exports=u},9446:(e,t,r)=>{var n=r(7451)(r(6491),"Map");e.exports=n},1341:(e,t,r)=>{var n=r(5089),o=r(2523),i=r(3950),a=r(2369),s=r(6174);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=s,e.exports=u},7418:(e,t,r)=>{var n=r(7451)(r(6491),"Promise");e.exports=n},2408:(e,t,r)=>{var n=r(7451)(r(6491),"Set");e.exports=n},6092:(e,t,r)=>{var n=r(1341),o=r(3322),i=r(4103);function a(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}a.prototype.add=a.prototype.push=o,a.prototype.has=i,e.exports=a},3192:(e,t,r)=>{var n=r(602),o=r(8562),i=r(1723),a=r(8574),s=r(5235),u=r(4298);function l(e){var t=this.__data__=new n(e);this.size=t.size}l.prototype.clear=o,l.prototype.delete=i,l.prototype.get=a,l.prototype.has=s,l.prototype.set=u,e.exports=l},7322:(e,t,r)=>{var n=r(6491).Symbol;e.exports=n},6218:(e,t,r)=>{var n=r(6491).Uint8Array;e.exports=n},3335:(e,t,r)=>{var n=r(7451)(r(6491),"WeakMap");e.exports=n},8040:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,o=0,i=[];++r<n;){var a=e[r];t(a,r,e)&&(i[o++]=a)}return i}},6221:(e,t,r)=>{var n=r(7679),o=r(5137),i=r(6848),a=r(5990),s=r(6045),u=r(7196),l=Object.prototype.hasOwnProperty;e.exports=function(e,t){var r=i(e),c=!r&&o(e),d=!r&&!c&&a(e),f=!r&&!c&&!d&&u(e),p=r||c||d||f,h=p?n(e.length,String):[],m=h.length;for(var g in e)!t&&!l.call(e,g)||p&&("length"==g||d&&("offset"==g||"parent"==g)||f&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||s(g,m))||h.push(g);return h}},1458:e=>{e.exports=function(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}},5737:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}},2622:(e,t,r)=>{var n=r(7470);e.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}},2678:(e,t,r)=>{var n=r(1458),o=r(6848);e.exports=function(e,t,r){var i=t(e);return o(e)?i:n(i,r(e))}},1407:(e,t,r)=>{var n=r(7322),o=r(7637),i=r(7573),a=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?o(e):i(e)}},8199:(e,t,r)=>{var n=r(1407),o=r(2981);e.exports=function(e){return o(e)&&"[object Arguments]"==n(e)}},9145:(e,t,r)=>{var n=r(7229),o=r(2981);e.exports=function e(t,r,i,a,s){return t===r||(null==t||null==r||!o(t)&&!o(r)?t!=t&&r!=r:n(t,r,i,a,e,s))}},7229:(e,t,r)=>{var n=r(3192),o=r(7632),i=r(1441),a=r(2340),s=r(4522),u=r(6848),l=r(5990),c=r(7196),d="[object Arguments]",f="[object Array]",p="[object Object]",h=Object.prototype.hasOwnProperty;e.exports=function(e,t,r,m,g,y){var v=u(e),b=u(t),w=v?f:s(e),E=b?f:s(t),C=(w=w==d?p:w)==p,_=(E=E==d?p:E)==p,S=w==E;if(S&&l(e)){if(!l(t))return!1;v=!0,C=!1}if(S&&!C)return y||(y=new n),v||c(e)?o(e,t,r,m,g,y):i(e,t,w,r,m,g,y);if(!(1&r)){var x=C&&h.call(e,"__wrapped__"),k=_&&h.call(t,"__wrapped__");if(x||k){var T=x?e.value():e,P=k?t.value():t;return y||(y=new n),g(T,P,r,m,y)}}return!!S&&(y||(y=new n),a(e,t,r,m,g,y))}},2791:(e,t,r)=>{var n=r(6998),o=r(193),i=r(4377),a=r(3443),s=/^\[object .+?Constructor\]$/,u=Function.prototype,l=Object.prototype,c=u.toString,d=l.hasOwnProperty,f=RegExp("^"+c.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||o(e))&&(n(e)?f:s).test(a(e))}},6516:(e,t,r)=>{var n=r(1407),o=r(7875),i=r(2981),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return i(e)&&o(e.length)&&!!a[n(e)]}},3623:(e,t,r)=>{var n=r(598),o=r(5030),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return o(e);var t=[];for(var r in Object(e))i.call(e,r)&&"constructor"!=r&&t.push(r);return t}},7679:e=>{e.exports=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}},2724:(e,t,r)=>{var n=r(377),o=/^\s+/;e.exports=function(e){return e?e.slice(0,n(e)+1).replace(o,""):e}},3629:e=>{e.exports=function(e){return function(t){return e(t)}}},4706:e=>{e.exports=function(e,t){return e.has(t)}},8015:(e,t,r)=>{var n=r(6491)["__core-js_shared__"];e.exports=n},7632:(e,t,r)=>{var n=r(6092),o=r(5737),i=r(4706);e.exports=function(e,t,r,a,s,u){var l=1&r,c=e.length,d=t.length;if(c!=d&&!(l&&d>c))return!1;var f=u.get(e),p=u.get(t);if(f&&p)return f==t&&p==e;var h=-1,m=!0,g=2&r?new n:void 0;for(u.set(e,t),u.set(t,e);++h<c;){var y=e[h],v=t[h];if(a)var b=l?a(v,y,h,t,e,u):a(y,v,h,e,t,u);if(void 0!==b){if(b)continue;m=!1;break}if(g){if(!o(t,(function(e,t){if(!i(g,t)&&(y===e||s(y,e,r,a,u)))return g.push(t)}))){m=!1;break}}else if(y!==v&&!s(y,v,r,a,u)){m=!1;break}}return u.delete(e),u.delete(t),m}},1441:(e,t,r)=>{var n=r(7322),o=r(6218),i=r(7470),a=r(7632),s=r(1264),u=r(9142),l=n?n.prototype:void 0,c=l?l.valueOf:void 0;e.exports=function(e,t,r,n,l,d,f){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!d(new o(e),new o(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return i(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var p=s;case"[object Set]":var h=1&n;if(p||(p=u),e.size!=t.size&&!h)return!1;var m=f.get(e);if(m)return m==t;n|=2,f.set(e,t);var g=a(p(e),p(t),n,l,d,f);return f.delete(e),g;case"[object Symbol]":if(c)return c.call(e)==c.call(t)}return!1}},2340:(e,t,r)=>{var n=r(1221),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,r,i,a,s){var u=1&r,l=n(e),c=l.length;if(c!=n(t).length&&!u)return!1;for(var d=c;d--;){var f=l[d];if(!(u?f in t:o.call(t,f)))return!1}var p=s.get(e),h=s.get(t);if(p&&h)return p==t&&h==e;var m=!0;s.set(e,t),s.set(t,e);for(var g=u;++d<c;){var y=e[f=l[d]],v=t[f];if(i)var b=u?i(v,y,f,t,e,s):i(y,v,f,e,t,s);if(!(void 0===b?y===v||a(y,v,r,i,s):b)){m=!1;break}g||(g="constructor"==f)}if(m&&!g){var w=e.constructor,E=t.constructor;w==E||!("constructor"in e)||!("constructor"in t)||"function"==typeof w&&w instanceof w&&"function"==typeof E&&E instanceof E||(m=!1)}return s.delete(e),s.delete(t),m}},3442:(e,t,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},1221:(e,t,r)=>{var n=r(2678),o=r(6165),i=r(5533);e.exports=function(e){return n(e,i,o)}},3661:(e,t,r)=>{var n=r(9360);e.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}},7451:(e,t,r)=>{var n=r(2791),o=r(9764);e.exports=function(e,t){var r=o(e,t);return n(r)?r:void 0}},7637:(e,t,r)=>{var n=r(7322),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,s=n?n.toStringTag:void 0;e.exports=function(e){var t=i.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var o=a.call(e);return n&&(t?e[s]=r:delete e[s]),o}},6165:(e,t,r)=>{var n=r(8040),o=r(470),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),n(a(e),(function(t){return i.call(e,t)})))}:o;e.exports=s},4522:(e,t,r)=>{var n=r(8634),o=r(9446),i=r(7418),a=r(2408),s=r(3335),u=r(1407),l=r(3443),c="[object Map]",d="[object Promise]",f="[object Set]",p="[object WeakMap]",h="[object DataView]",m=l(n),g=l(o),y=l(i),v=l(a),b=l(s),w=u;(n&&w(new n(new ArrayBuffer(1)))!=h||o&&w(new o)!=c||i&&w(i.resolve())!=d||a&&w(new a)!=f||s&&w(new s)!=p)&&(w=function(e){var t=u(e),r="[object Object]"==t?e.constructor:void 0,n=r?l(r):"";if(n)switch(n){case m:return h;case g:return c;case y:return d;case v:return f;case b:return p}return t}),e.exports=w},9764:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},770:(e,t,r)=>{var n=r(2919);e.exports=function(){this.__data__=n?n(null):{},this.size=0}},1464:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},1265:(e,t,r)=>{var n=r(2919),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(n){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return o.call(t,e)?t[e]:void 0}},4008:(e,t,r)=>{var n=r(2919),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:o.call(t,e)}},8409:(e,t,r)=>{var n=r(2919);e.exports=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}},6045:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,r){var n=typeof e;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&t.test(e))&&e>-1&&e%1==0&&e<r}},9360:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},193:(e,t,r)=>{var n,o=r(8015),i=(n=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!i&&i in e}},598:e=>{var t=Object.prototype;e.exports=function(e){var r=e&&e.constructor;return e===("function"==typeof r&&r.prototype||t)}},8924:e=>{e.exports=function(){this.__data__=[],this.size=0}},3775:(e,t,r)=>{var n=r(2622),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0||(r==t.length-1?t.pop():o.call(t,r,1),--this.size,0))}},2891:(e,t,r)=>{var n=r(2622);e.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},4670:(e,t,r)=>{var n=r(2622);e.exports=function(e){return n(this.__data__,e)>-1}},3985:(e,t,r)=>{var n=r(2622);e.exports=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}},5089:(e,t,r)=>{var n=r(3871),o=r(602),i=r(9446);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(i||o),string:new n}}},2523:(e,t,r)=>{var n=r(3661);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},3950:(e,t,r)=>{var n=r(3661);e.exports=function(e){return n(this,e).get(e)}},2369:(e,t,r)=>{var n=r(3661);e.exports=function(e){return n(this,e).has(e)}},6174:(e,t,r)=>{var n=r(3661);e.exports=function(e,t){var r=n(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}},1264:e=>{e.exports=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}},2919:(e,t,r)=>{var n=r(7451)(Object,"create");e.exports=n},5030:(e,t,r)=>{var n=r(2080)(Object.keys,Object);e.exports=n},2747:(e,t,r)=>{e=r.nmd(e);var n=r(3442),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,a=i&&i.exports===o&&n.process,s=function(){try{return i&&i.require&&i.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s},7573:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},2080:e=>{e.exports=function(e,t){return function(r){return e(t(r))}}},6491:(e,t,r)=>{var n=r(3442),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();e.exports=i},3322:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},4103:e=>{e.exports=function(e){return this.__data__.has(e)}},9142:e=>{e.exports=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}},8562:(e,t,r)=>{var n=r(602);e.exports=function(){this.__data__=new n,this.size=0}},1723:e=>{e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},8574:e=>{e.exports=function(e){return this.__data__.get(e)}},5235:e=>{e.exports=function(e){return this.__data__.has(e)}},4298:(e,t,r)=>{var n=r(602),o=r(9446),i=r(1341);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var a=r.__data__;if(!o||a.length<199)return a.push([e,t]),this.size=++r.size,this;r=this.__data__=new i(a)}return r.set(e,t),this.size=r.size,this}},3443:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},377:e=>{var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},9273:(e,t,r)=>{var n=r(2697);e.exports=function(e,t){var r;if("function"!=typeof t)throw new TypeError("Expected a function");return e=n(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}}},1945:(e,t,r)=>{var n=r(4377),o=r(6642),i=r(366),a=Math.max,s=Math.min;e.exports=function(e,t,r){var u,l,c,d,f,p,h=0,m=!1,g=!1,y=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function v(t){var r=u,n=l;return u=l=void 0,h=t,d=e.apply(n,r)}function b(e){return h=e,f=setTimeout(E,t),m?v(e):d}function w(e){var r=e-p;return void 0===p||r>=t||r<0||g&&e-h>=c}function E(){var e=o();if(w(e))return C(e);f=setTimeout(E,function(e){var r=t-(e-p);return g?s(r,c-(e-h)):r}(e))}function C(e){return f=void 0,y&&u?v(e):(u=l=void 0,d)}function _(){var e=o(),r=w(e);if(u=arguments,l=this,p=e,r){if(void 0===f)return b(p);if(g)return clearTimeout(f),f=setTimeout(E,t),v(p)}return void 0===f&&(f=setTimeout(E,t)),d}return t=i(t)||0,n(r)&&(m=!!r.leading,c=(g="maxWait"in r)?a(i(r.maxWait)||0,t):c,y="trailing"in r?!!r.trailing:y),_.cancel=function(){void 0!==f&&clearTimeout(f),h=0,u=p=l=f=void 0},_.flush=function(){return void 0===f?d:C(o())},_}},7470:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},5137:(e,t,r)=>{var n=r(8199),o=r(2981),i=Object.prototype,a=i.hasOwnProperty,s=i.propertyIsEnumerable,u=n(function(){return arguments}())?n:function(e){return o(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=u},6848:e=>{var t=Array.isArray;e.exports=t},4106:(e,t,r)=>{var n=r(6998),o=r(7875);e.exports=function(e){return null!=e&&o(e.length)&&!n(e)}},5990:(e,t,r)=>{e=r.nmd(e);var n=r(6491),o=r(2871),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,s=a&&a.exports===i?n.Buffer:void 0,u=(s?s.isBuffer:void 0)||o;e.exports=u},1710:(e,t,r)=>{var n=r(9145);e.exports=function(e,t){return n(e,t)}},6998:(e,t,r)=>{var n=r(1407),o=r(4377);e.exports=function(e){if(!o(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},7875:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},4377:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},2981:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},3551:(e,t,r)=>{var n=r(1407),o=r(2981);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==n(e)}},7196:(e,t,r)=>{var n=r(6516),o=r(3629),i=r(2747),a=i&&i.isTypedArray,s=a?o(a):n;e.exports=s},5533:(e,t,r)=>{var n=r(6221),o=r(3623),i=r(4106);e.exports=function(e){return i(e)?n(e):o(e)}},6642:(e,t,r)=>{var n=r(6491);e.exports=function(){return n.Date.now()}},9510:(e,t,r)=>{var n=r(9273);e.exports=function(e){return n(2,e)}},470:e=>{e.exports=function(){return[]}},2871:e=>{e.exports=function(){return!1}},1141:(e,t,r)=>{var n=r(366);e.exports=function(e){return e?Infinity===(e=n(e))||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},2697:(e,t,r)=>{var n=r(1141);e.exports=function(e){var t=n(e),r=t%1;return t==t?r?t-r:t:0}},366:(e,t,r)=>{var n=r(2724),o=r(4377),i=r(3551),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,l=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return NaN;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=n(e);var r=s.test(e);return r||u.test(e)?l(e.slice(2),r?2:8):a.test(e)?NaN:+e}},9758:()=>{},5339:()=>{},9027:()=>{},3260:()=>{}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n](i,i.exports,r),i.loaded=!0,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.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r.p="";var n={};(()=>{r.d(n,{Ju:()=>Dr,in:()=>Xe,HY:()=>se,F4:()=>or,ZP:()=>Lr,aY:()=>Ir,Qx:()=>Mr,Gr:()=>jr,Pf:()=>Br});var e=r(1945),t=r.n(e),o=r(1710),i=r.n(o);const a=Symbol("PROXY");function s(e,t){Object.defineProperty(e[t],a,{value:{type:"getter"},writable:!1})}function u(e,t){Object.defineProperty(e[t],a,{value:{type:"setter"},writable:!1})}Symbol("RESTORE");const l={};var c,d,f,p,h,m,g,y,v,b,w,E,C;!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!")}}(c||(c={})),function(e){e[e.Pending=0]="Pending",e[e.Ready=1]="Ready",e[e.Error=2]="Error"}(d||(d={})),function(e){e.Added="DesignBlockAddedEvent",e.Updated="DesignBlockUpdatedEvent",e.Removed="DesignBlockRemovedEvent"}(f||(f={})),function(e){e[e.Left=0]="Left",e[e.Right=1]="Right",e[e.Middle=2]="Middle",e[e.Unknown=255]="Unknown"}(p||(p={})),function(e){e[e.Up=0]="Up",e[e.Down=1]="Down"}(h||(h={})),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"}(m||(m={})),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"}(g||(g={})),function(e){e[e.Normal=0]="Normal",e[e.Italic=1]="Italic"}(y||(y={})),function(e){e.Bold="bold",e.Italic="italic"}(v||(v={})),function(e){e[e.Undefined=0]="Undefined",e[e.DesignUnit=1]="DesignUnit",e[e.Percent=2]="Percent",e[e.Auto=3]="Auto"}(b||(b={})),function(e){e[e.Free=0]="Free",e[e.VerticalStack=1]="VerticalStack",e[e.HorizontalStack=2]="HorizontalStack",e[e.DepthStack=3]="DepthStack"}(w||(w={})),function(e){e[e.Began=0]="Began",e[e.Changed=1]="Changed",e[e.Ended=2]="Ended"}(E||(E={})),function(e){e[e.Creator=0]="Creator",e[e.Adopter=1]="Adopter",e[e.Viewer=2]="Viewer",e[e.Presenter=3]="Presenter"}(C||(C={}));var _=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 S{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=>x(o.setValue(e,t,r,n))))}getValue(e,t,r){return this.useInternalAPI((n=>x(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=x(e);r(t)}catch(e){n(e)}})))).delete()}))}}function x(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 k(e){return new Promise(((t,r)=>{e((e=>{try{const r=x(e);t(r)}catch(e){r(e)}}))}))}_([u],S.prototype,"setValue",null),_([s],S.prototype,"getValue",null);const T=(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 P,A,F,L,D,B=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 R=new WeakMap,O={assets:[],total:0,currentPage:0,nextPage:void 0};class M{constructor(e){P.add(this),A.set(this,void 0),Object.defineProperty(this,"onAssetSourceAdded",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=B(this,A,"f").subscribeToAssetSourceAdded(e);return()=>{B(this,A,"f").isDeleted()||x(B(this,A,"f").unsubscribe(t))}}}),Object.defineProperty(this,"onAssetSourceRemoved",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=B(this,A,"f").subscribeToAssetSourceRemoved(e);return()=>{B(this,A,"f").isDeleted()||x(B(this,A,"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,A,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;x(B(this,A,"f").addAssetSource(e.id,(async(t,r)=>{var n;try{const n=Object.assign(Object.assign({},t),{tags:T(t.tags),groups:T(t.groups),excludeGroups:T(t.excludeGroups)}),o=await e.findAssets(n);if(o){const t=Object.assign(Object.assign({},o),{assets:o.assets.map((t=>j(t,e.id)))});r.invoke(t)}else r.invoke(O)}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(B(this,P,"m",F).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(B(this,P,"m",F).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)),B(this,P,"m",L).call(this,e.id,e)}addLocalSource(e,t,r,n){x(B(this,A,"f").addLocalAssetSource(e,null!=t?t:[],r?async(e,t)=>{var n;try{const n=await r(B(this,P,"m",F).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(B(this,P,"m",F).call(this,e),t),r.invoke({})}catch(e){r.invoke(null!==(o=e.message)&&void 0!==o?o:"Unknown error in user-defined `applyAssetToBlock`")}}:null))}removeSource(e){x(B(this,A,"f").removeAssetSource(e)),B(this,P,"m",D).call(this,e)}findAllSources(){return T(B(this,A,"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:""};B(this,A,"f").findAssetSourceAssets(e,f,(e=>{try{const t=x(e),n=T(t.assets).map(B(this,P,"m",F));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 k((t=>B(this,A,"f").getAssetSourceGroups(e,t))).then((e=>T(e)))}getSupportedMimeTypes(e){return T(x(B(this,A,"f").getAssetSourceSupportedMimeTypes(e)))}getCredits(e){const t=x(B(this,A,"f").getAssetSourceCredits(e));if(t.name||t.url)return t.url?t:{name:t.name,url:void 0}}getLicense(e){const t=x(B(this,A,"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=R.get(B(this,A,"f")))||void 0===t?void 0:t.get(e))||void 0===r?void 0:r.canManageAssets)}addAssetToSource(e,t){x(B(this,A,"f").addAssetToSource(e,t))}removeAssetFromSource(e,t){x(B(this,A,"f").removeAssetFromSource(e,t))}async apply(e,t){return new Promise(((r,n)=>{B(this,A,"f").applyAssetSourceAsset(e,j(t,e),(e=>{try{const t=x(e);B(this,A,"f").isValid(t)?r(t):r(void 0)}catch(e){n(e)}}))}))}async applyToBlock(e,t,r){return k((n=>B(this,A,"f").applyAssetSourceAssetToBlock(e,j(t,e),r,n)))}async defaultApplyAsset(e){return new Promise(((t,r)=>{B(this,A,"f").defaultApplyAsset(j(e,""),(e=>{try{const r=x(e);B(this,A,"f").isValid(r)?t(r):t(void 0)}catch(e){r(e)}}))}))}async defaultApplyAssetToBlock(e,t){return k((r=>B(this,A,"f").defaultApplyAssetToBlock(j(e,""),t,r)))}dispose(){R.delete(B(this,A,"f"))}}function j(e,t){return"context"in e&&e.context.sourceId===t?e:Object.assign(Object.assign({},e),{context:{sourceId:t}})}A=new WeakMap,P=new WeakSet,F=function(e){var t,r,n,o,i,a,s,u;const l=Object.assign(Object.assign({},e),{groups:T(e.groups),meta:void 0,tags:T(e.tags)});return e.meta.size()>0&&(l.meta={},T(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},L=function(e,t){R.has(B(this,A,"f"))||R.set(B(this,A,"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/`),R.get(B(this,A,"f")).set(e,{canManageAssets:t.canManageAssets})},D=function(e){var t;null===(t=R.get(B(this,A,"f")))||void 0===t||t.delete(e)};class I 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 U(e){return"object"==typeof e&&null!=e}function q(e){return"string"==typeof e?JSON.stringify(e):""+e}function $(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: `"+q(n)+"`"}=e;return{value:n,type:a,refinement:s,key:o[o.length-1],path:o,branch:i,...e,message:u}}function*H(e,t,r,n){var o;U(o=e)&&"function"==typeof o[Symbol.iterator]||(e=[e]);for(const o of e){const e=$(o,t,r,n);e&&(yield e)}}function*N(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&&U(t.schema)&&U(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=N(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):U(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)=>H(n(e,t),t,this,e):()=>[],this.refiner=o?(e,t)=>H(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=N(e,t,r),o=function(e){const{done:t,value:r}=e.next();return t?void 0:r}(n);return o[0]?[new I(o[0],(function*(){for(const e of n)e[0]&&(yield e[0])})),void 0]:[void 0,o[1]]}function z(e,t){return new V({type:e,schema:null,validator:t})}function G(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: "+q(e)})}function Y(){return z("boolean",(e=>"boolean"==typeof e))}function X(){return z("integer",(e=>"number"==typeof e&&!isNaN(e)&&Number.isInteger(e)||"Expected an integer, but received: "+q(e)))}function K(){return z("number",(e=>"number"==typeof e&&!isNaN(e)||"Expected a number, but received: "+q(e)))}function Q(e){const t=e?Object.keys(e):[],r=z("never",(()=>!1));return new V({type:"object",schema:e||null,*entries(n){if(e&&U(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=>U(e)||"Expected an object, but received: "+q(e),coercer:e=>U(e)?{...e}:e})}function Z(){return z("string",(e=>"string"==typeof e||"Expected a string, but received: "+q(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=H(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 z("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 z("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(808).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,"onSelectionChanged",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=de(this,le,"f").subscribeToSelectionChange(e);return()=>{de(this,le,"f").isDeleted()||x(de(this,le,"f").unsubscribe(t))}}}),Object.defineProperty(this,"onClicked",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=de(this,le,"f").subscribeToBlockClicked(e);return()=>{de(this,le,"f").isDeleted()||x(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 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;de(this,le,"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;de(this,le,"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()),k((t=>de(this,le,"f").loadBlocksFromString(e,t))).then((e=>T(e)))}async saveToString(e){return ne("blocks",e,G(K())),k((t=>de(this,le,"f").saveBlocksToString(e,t)))}create(e){return ne("type",e,Z()),x(de(this,le,"f").create(e))}createFill(e){return ne("type",e,Z()),x(de(this,le,"f").createFill(e))}getType(e){return ne("id",e,X()),x(de(this,le,"f").getType(e))}getKind(e){return ne("id",e,X()),x(de(this,le,"f").getKind(e))}setKind(e,t){ne("id",e,X()),x(de(this,le,"f").setKind(e,t))}select(e){return ne("id",e,X()),x(de(this,le,"f").select(e))}setSelected(e,t){return ne("id",e,X()),ne("selected",t,Y()),x(de(this,le,"f").setSelected(e,t))}isSelected(e){return ne("id",e,X()),x(de(this,le,"f").isSelected(e))}findAllSelected(){return T(de(this,le,"f").findAllSelected())}isGroupable(e){return ne("ids",e,G(K())),x(de(this,le,"f").isGroupable(e))}group(e){return ne("ids",e,te(G(K()))),x(de(this,le,"f").group(e))}ungroup(e){return ne("id",e,K()),x(de(this,le,"f").ungroup(e))}enterGroup(e){return ne("id",e,K()),x(de(this,le,"f").enterGroup(e))}exitGroup(e){return ne("id",e,K()),x(de(this,le,"f").exitGroup(e))}setName(e,t){return ne("id",e,X()),ne("name",t,Z()),x(de(this,le,"f").setName(e,t))}getName(e){return ne("id",e,X()),x(de(this,le,"f").getName(e))}getUUID(e){return ne("id",e,X()),x(de(this,le,"f").getUUID(e))}findByName(e){ne("name",e,Z());const t=de(this,le,"f").findByName(e);return T(t)}findByType(e){ne("type",e,Z());const t=x(de(this,le,"f").findByType(e));return T(t)}findByKind(e){ne("kind",e,Z());const t=x(de(this,le,"f").findByKind(e));return T(t)}findAll(){return T(de(this,le,"f").findAll())}findAllPlaceholders(){return T(de(this,le,"f").findAllPlaceholders())}createShape(e){return ne("type",e,Z()),x(de(this,le,"f").createShape(e))}hasShape(e){return ne("id",e,X()),x(de(this,le,"f").hasShape(e))}getShape(e){return ne("id",e,X()),x(de(this,le,"f").getShape(e))}setShape(e,t){return ne("id",e,X()),ne("shape",t,X()),x(de(this,le,"f").setShape(e,t))}isVisible(e){return ne("id",e,X()),x(de(this,le,"f").isVisible(e))}setVisible(e,t){return ne("id",e,X()),ne("visible",t,Y()),x(de(this,le,"f").setVisible(e,t))}isClipped(e){return ne("id",e,X()),x(de(this,le,"f").isClipped(e))}setClipped(e,t){return ne("id",e,X()),ne("clipped",t,Y()),x(de(this,le,"f").setClipped(e,t))}getPositionX(e){return ne("id",e,X()),x(de(this,le,"f").getPositionX(e))}getPositionXMode(e){return ne("id",e,X()),x(de(this,le,"f").getPositionXMode(e))}getPositionY(e){return ne("id",e,X()),x(de(this,le,"f").getPositionY(e))}getPositionYMode(e){return ne("id",e,X()),x(de(this,le,"f").getPositionYMode(e))}setPositionX(e,t){return ne("id",e,X()),ne("value",t,K()),x(de(this,le,"f").setPositionX(e,t))}setPositionXMode(e,t){return ne("id",e,X()),x(de(this,le,"f").setPositionXMode(e,t))}setPositionY(e,t){return ne("id",e,X()),ne("value",t,K()),x(de(this,le,"f").setPositionY(e,t))}setPositionYMode(e,t){return ne("id",e,X()),x(de(this,le,"f").setPositionYMode(e,t))}setAlwaysOnTop(e,t){return ne("id",e,X()),ne("enabled",t,Y()),x(de(this,le,"f").setAlwaysOnTop(e,t))}setAlwaysOnBottom(e,t){return ne("id",e,X()),ne("enabled",t,Y()),x(de(this,le,"f").setAlwaysOnBottom(e,t))}isAlwaysOnTop(e){return ne("id",e,X()),x(de(this,le,"f").isAlwaysOnTop(e))}isAlwaysOnBottom(e){return ne("id",e,X()),x(de(this,le,"f").isAlwaysOnBottom(e))}bringToFront(e){return ne("id",e,K()),x(de(this,le,"f").bringToFront(e))}sendToBack(e){return ne("id",e,K()),x(de(this,le,"f").sendToBack(e))}bringForward(e){return ne("id",e,K()),x(de(this,le,"f").bringForward(e))}sendBackward(e){return ne("id",e,K()),x(de(this,le,"f").sendBackward(e))}getRotation(e){return ne("id",e,X()),x(de(this,le,"f").getRotation(e))}setRotation(e,t){return ne("id",e,X()),ne("radians",t,K()),x(de(this,le,"f").setRotation(e,t))}getFlipHorizontal(e){return ne("id",e,X()),x(de(this,le,"f").getFlip(e)).horizontal}getFlipVertical(e){return ne("id",e,X()),x(de(this,le,"f").getFlip(e)).vertical}setFlipHorizontal(e,t){return ne("id",e,X()),ne("flip",t,Y()),x(de(this,le,"f").setFlipHorizontal(e,t))}setFlipVertical(e,t){return ne("id",e,X()),ne("flip",t,Y()),x(de(this,le,"f").setFlipVertical(e,t))}hasContentFillMode(e){return ne("id",e,X()),x(de(this,le,"f").hasContentFillMode(e))}getWidth(e){return ne("id",e,X()),x(de(this,le,"f").getWidth(e))}getWidthMode(e){return ne("id",e,X()),x(de(this,le,"f").getWidthMode(e))}getHeight(e){return ne("id",e,X()),x(de(this,le,"f").getHeight(e))}getHeightMode(e){return ne("id",e,X()),x(de(this,le,"f").getHeightMode(e))}setWidth(e,t){return ne("id",e,X()),ne("value",t,K()),x(de(this,le,"f").setWidth(e,t))}setWidthMode(e,t){return ne("id",e,X()),x(de(this,le,"f").setWidthMode(e,t))}setHeight(e,t){return ne("id",e,X()),ne("value",t,K()),x(de(this,le,"f").setHeight(e,t))}setHeightMode(e,t){return ne("id",e,X()),x(de(this,le,"f").setHeightMode(e,t))}getFrameX(e){return ne("id",e,X()),x(de(this,le,"f").getLastFrameX(e))}getFrameY(e){return ne("id",e,X()),x(de(this,le,"f").getLastFrameY(e))}getFrameWidth(e){return ne("id",e,X()),x(de(this,le,"f").getLastFrameWidth(e))}getFrameHeight(e){return ne("id",e,X()),x(de(this,le,"f").getLastFrameHeight(e))}setContentFillMode(e,t){return ne("id",e,X()),x(de(this,le,"f").setContentFillMode(e,t))}getContentFillMode(e){return ne("id",e,X()),x(de(this,le,"f").getContentFillMode(e))}duplicate(e){return ne("id",e,X()),x(de(this,le,"f").duplicate(e))}destroy(e){return ne("id",e,X()),x(de(this,le,"f").destroy(e))}isValid(e){return ne("id",e,X()),de(this,le,"f").isValid(e)}getParent(e){return ne("id",e,X()),x(de(this,le,"f").hasParent(e))?x(de(this,le,"f").getParent(e)):null}getChildren(e){ne("id",e,X());const t=x(de(this,le,"f").getChildren(e));return T(t)}insertChild(e,t,r){return ne("parent",e,K()),ne("child",t,K()),ne("index",r,ee(K(),0)),x(de(this,le,"f").insertChild(e,t,r))}appendChild(e,t){return ne("parent",e,K()),ne("child",t,K()),x(de(this,le,"f").appendChild(e,t))}referencesAnyVariables(e){return ne("id",e,X()),x(de(this,le,"f").referencesAnyVariables(e))}getGlobalBoundingBoxX(e){return ne("id",e,X()),x(de(this,le,"f").getGlobalBoundingBoxX(e))}getGlobalBoundingBoxY(e){return ne("id",e,X()),x(de(this,le,"f").getGlobalBoundingBoxY(e))}getGlobalBoundingBoxWidth(e){return ne("id",e,X()),x(de(this,le,"f").getGlobalBoundingBoxWidth(e))}getGlobalBoundingBoxHeight(e){return ne("id",e,X()),x(de(this,le,"f").getGlobalBoundingBoxHeight(e))}getScreenSpaceBoundingBoxXYWH(e){return ne("ids",e,G(K())),x(de(this,le,"f").getScreenSpaceBoundingBoxXYWH(e))}alignHorizontally(e,t){return ne("ids",e,te(G(K()))),x(de(this,le,"f").alignHorizontally(e,t))}alignVertically(e,t){return ne("ids",e,te(G(K()))),x(de(this,le,"f").alignVertically(e,t))}isAlignable(e){return ne("ids",e,G(K())),x(de(this,le,"f").isAlignable(e))}distributeHorizontally(e){return ne("ids",e,te(G(K()))),x(de(this,le,"f").distributeHorizontally(e))}distributeVertically(e){return ne("ids",e,te(G(K()))),x(de(this,le,"f").distributeVertically(e))}isDistributable(e){return ne("ids",e,G(K())),x(de(this,le,"f").isDistributable(e))}fillParent(e){return ne("id",e,X()),x(de(this,le,"f").fillParent(e))}resizeContentAware(e,t,r){return ne("ids",e,G(K())),ne("width",t,K()),ne("height",r,K()),x(de(this,le,"f").resizeContentAware(e,t,r))}scale(e,t,r=0,n=0){return ne("id",e,X()),x(de(this,le,"f").scale(e,t,r,n))}findAllProperties(e){return ne("id",e,X()),T(x(de(this,le,"f").findAllProperties(e)))}isPropertyReadable(e){return ne("property",e,Z()),de(this,le,"f").isPropertyReadable(e)}isPropertyWritable(e){return ne("property",e,Z()),de(this,le,"f").isPropertyWritable(e)}getPropertyType(e){return ne("property",e,Z()),x(de(this,le,"f").getPropertyType(e))}getEnumValues(e){return ne("enumProperty",e,Z()),T(x(de(this,le,"f").getEnumValues(e)))}setBool(e,t,r){return ne("id",e,X()),ne("property",t,Z()),ne("value",r,Y()),x(de(this,le,"f").setBool(e,t,r))}getBool(e,t){return ne("id",e,X()),ne("property",t,Z()),x(de(this,le,"f").getBool(e,t))}setInt(e,t,r){return ne("id",e,X()),ne("property",t,Z()),ne("value",r,X()),x(de(this,le,"f").setInt(e,t,r))}getInt(e,t){return ne("id",e,X()),ne("property",t,Z()),x(de(this,le,"f").getInt(e,t))}setFloat(e,t,r){return ne("id",e,X()),ne("property",t,Z()),ne("value",r,K()),x(de(this,le,"f").setFloat(e,t,r))}getFloat(e,t){return ne("id",e,X()),ne("property",t,Z()),x(de(this,le,"f").getFloat(e,t))}setDouble(e,t,r){return ne("id",e,X()),ne("property",t,Z()),ne("value",r,K()),x(de(this,le,"f").setDouble(e,t,r))}getDouble(e,t){return ne("id",e,X()),ne("property",t,Z()),x(de(this,le,"f").getDouble(e,t))}setString(e,t,r){return ne("id",e,X()),ne("property",t,Z()),ne("value",r,Z()),x(de(this,le,"f").setString(e,t,r))}getString(e,t){return ne("id",e,X()),ne("property",t,Z()),x(de(this,le,"f").getString(e,t))}setColor(e,t,r){return ne("id",e,X()),ne("property",t,Z()),x(de(this,le,"f").setColor(e,t,c.fromColor(r)))}getColor(e,t){return ne("id",e,X()),ne("property",t,Z()),c.toColor(x(de(this,le,"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()),x(de(this,le,"f").setColorRGBA(e,t,r,n,o,i))}getColorRGBA(e,t){return ne("id",e,X()),ne("property",t,Z()),x(de(this,le,"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()),x(de(this,le,"f").setColorSpot(e,t,r,n))}getColorSpotName(e,t){return ne("id",e,X()),ne("property",t,Z()),x(de(this,le,"f").getColorSpotName(e,t))}getColorSpotTint(e,t){return ne("id",e,X()),ne("property",t,Z()),x(de(this,le,"f").getColorSpotTint(e,t))}setGradientColorStops(e,t,r){ne("id",e,X()),ne("property",t,Z());const n=r.map((e=>({color:c.fromColor(e.color),stop:e.stop})));return x(de(this,le,"f").setGradientColorStops(e,t,n))}getGradientColorStops(e,t){ne("id",e,X()),ne("property",t,Z());const r=x(de(this,le,"f").getGradientColorStops(e,t));return T(r).map((e=>({color:c.toColor(e.color),stop:e.stop})))}setEnum(e,t,r){return ne("id",e,X()),ne("property",t,Z()),ne("value",r,Z()),x(de(this,le,"f").setEnum(e,t,r))}getEnum(e,t){return ne("id",e,X()),ne("property",t,Z()),x(de(this,le,"f").getEnum(e,t))}hasCrop(e){return ne("id",e,X()),x(de(this,le,"f").hasCrop(e))}setCropScaleX(e,t){return ne("id",e,X()),ne("scaleX",t,K()),x(de(this,le,"f").setCropScaleX(e,t))}setCropScaleY(e,t){return ne("id",e,X()),ne("scaleY",t,K()),x(de(this,le,"f").setCropScaleY(e,t))}setCropRotation(e,t){return ne("id",e,X()),ne("rotation",t,K()),x(de(this,le,"f").setCropRotation(e,t))}setCropScaleRatio(e,t){return ne("id",e,X()),ne("scaleRatio",t,K()),x(de(this,le,"f").setCropScaleRatio(e,t))}setCropTranslationX(e,t){return ne("id",e,X()),ne("translationX",t,K()),x(de(this,le,"f").setCropTranslationX(e,t))}setCropTranslationY(e,t){return ne("id",e,X()),ne("translationY",t,K()),x(de(this,le,"f").setCropTranslationY(e,t))}resetCrop(e){return ne("id",e,X()),x(de(this,le,"f").resetCrop(e))}getCropScaleX(e){return ne("id",e,X()),x(de(this,le,"f").getCropScaleX(e))}getCropScaleY(e){return ne("id",e,X()),x(de(this,le,"f").getCropScaleY(e))}getCropRotation(e){return ne("id",e,X()),x(de(this,le,"f").getCropRotation(e))}getCropScaleRatio(e){return ne("id",e,X()),x(de(this,le,"f").getCropScaleRatio(e))}getCropTranslationX(e){return ne("id",e,X()),x(de(this,le,"f").getCropTranslationX(e))}getCropTranslationY(e){return ne("id",e,X()),x(de(this,le,"f").getCropTranslationY(e))}adjustCropToFillFrame(e,t){return ne("id",e,X()),ne("minScaleRatio",t,K()),x(de(this,le,"f").adjustCropToFillFrame(e,t))}flipCropHorizontal(e){return ne("id",e,X()),x(de(this,le,"f").flipCropHorizontal(e))}flipCropVertical(e){return ne("id",e,X()),x(de(this,le,"f").flipCropVertical(e))}hasOpacity(e){return ne("id",e,X()),x(de(this,le,"f").hasOpacity(e))}setOpacity(e,t){return ne("id",e,X()),ne("opacity",t,K()),x(de(this,le,"f").setOpacity(e,t))}getOpacity(e){return ne("id",e,X()),x(de(this,le,"f").getOpacity(e))}hasBlendMode(e){return ne("id",e,X()),x(de(this,le,"f").hasBlendMode(e))}setBlendMode(e,t){return ne("id",e,X()),ne("blendMode",t,Z()),x(de(this,le,"f").setBlendMode(e,t))}getBlendMode(e){return ne("id",e,X()),x(de(this,le,"f").getBlendMode(e))}hasFillColor(e){return ne("id",e,X()),x(de(this,le,"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()),x(de(this,le,"f").setFillColorRGBA(e,t,r,n,o))}getFillColorRGBA(e){return ne("id",e,X()),x(de(this,le,"f").getFillColorRGBA(e))}setFillColorEnabled(e,t){return ne("id",e,X()),ne("enabled",t,Y()),x(de(this,le,"f").setFillColorEnabled(e,t))}isFillColorEnabled(e){return ne("id",e,X()),x(de(this,le,"f").isFillColorEnabled(e))}createEffect(e){return ne("type",e,Z()),x(de(this,le,"f").createEffect(e))}hasEffects(e){return ne("id",e,X()),x(de(this,le,"f").hasEffects(e))}getEffects(e){ne("id",e,X());const t=x(de(this,le,"f").getEffects(e));return T(t)}insertEffect(e,t,r){ne("id",e,X()),ne("effectId",t,X()),ne("index",r,ee(X(),0)),x(de(this,le,"f").insertEffect(e,t,r))}appendEffect(e,t){ne("id",e,X()),ne("effectId",t,X()),x(de(this,le,"f").appendEffect(e,t))}removeEffect(e,t){ne("id",e,X()),ne("index",t,ee(X(),0)),x(de(this,le,"f").removeEffect(e,t))}hasEffectEnabled(e){return ne("effectId",e,X()),x(de(this,le,"f").hasEffectEnabled(e))}setEffectEnabled(e,t){ne("effectId",e,X()),ne("enabled",t,Y()),x(de(this,le,"f").setEffectEnabled(e,t))}isEffectEnabled(e){return ne("effectId",e,X()),x(de(this,le,"f").isEffectEnabled(e))}createBlur(e){return ne("type",e,Z()),x(de(this,le,"f").createBlur(e))}hasBlur(e){return ne("id",e,X()),x(de(this,le,"f").hasBlur(e))}setBlur(e,t){ne("id",e,X()),ne("blurId",t,X()),x(de(this,le,"f").setBlur(e,t))}getBlur(e){return ne("id",e,X()),x(de(this,le,"f").getBlur(e))}setBlurEnabled(e,t){ne("id",e,X()),ne("enabled",t,Y()),x(de(this,le,"f").setBlurEnabled(e,t))}isBlurEnabled(e){return ne("id",e,X()),x(de(this,le,"f").isBlurEnabled(e))}hasBackgroundColor(e){return ne("id",e,X()),x(de(this,le,"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()),x(de(this,le,"f").setBackgroundColorRGBA(e,t,r,n,o))}getBackgroundColorRGBA(e){return ne("id",e,X()),x(de(this,le,"f").getBackgroundColorRGBA(e))}setBackgroundColorEnabled(e,t){return ne("id",e,X()),ne("enabled",t,Y()),x(de(this,le,"f").setBackgroundColorEnabled(e,t))}isBackgroundColorEnabled(e){return ne("id",e,X()),x(de(this,le,"f").isBackgroundColorEnabled(e))}hasStroke(e){return ne("id",e,X()),x(de(this,le,"f").hasStroke(e))}setStrokeEnabled(e,t){return ne("id",e,X()),ne("enabled",t,Y()),x(de(this,le,"f").setStrokeEnabled(e,t))}isStrokeEnabled(e){return ne("id",e,X()),x(de(this,le,"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()),x(de(this,le,"f").setStrokeColorRGBA(e,t,r,n,o))}setStrokeColor(e,t){return ne("id",e,X()),x(de(this,le,"f").setStrokeColor(e,c.fromColor(t)))}getStrokeColorRGBA(e){return ne("id",e,X()),x(de(this,le,"f").getStrokeColorRGBA(e))}getStrokeColor(e){return ne("id",e,X()),c.toColor(x(de(this,le,"f").getStrokeColor(e)))}setStrokeWidth(e,t){return ne("id",e,X()),ne("width",t,K()),x(de(this,le,"f").setStrokeWidth(e,t))}getStrokeWidth(e){return ne("id",e,X()),x(de(this,le,"f").getStrokeWidth(e))}setStrokeStyle(e,t){return ne("id",e,X()),x(de(this,le,"f").setStrokeStyle(e,t))}getStrokeStyle(e){return ne("id",e,X()),x(de(this,le,"f").getStrokeStyle(e))}setStrokePosition(e,t){return ne("id",e,X()),x(de(this,le,"f").setStrokePosition(e,t))}getStrokePosition(e){return ne("id",e,X()),x(de(this,le,"f").getStrokePosition(e))}setStrokeCornerGeometry(e,t){return ne("id",e,X()),x(de(this,le,"f").setStrokeCornerGeometry(e,t))}getStrokeCornerGeometry(e){return ne("id",e,X()),x(de(this,le,"f").getStrokeCornerGeometry(e))}hasDropShadow(e){return ne("id",e,X()),x(de(this,le,"f").hasDropShadow(e))}setDropShadowEnabled(e,t){return ne("id",e,X()),ne("enabled",t,Y()),x(de(this,le,"f").setDropShadowEnabled(e,t))}isDropShadowEnabled(e){return ne("id",e,X()),x(de(this,le,"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()),x(de(this,le,"f").setDropShadowColorRGBA(e,t,r,n,o))}setDropShadowColor(e,t){return ne("id",e,X()),x(de(this,le,"f").setDropShadowColor(e,c.fromColor(t)))}getDropShadowColorRGBA(e){return ne("id",e,X()),x(de(this,le,"f").getDropShadowColorRGBA(e))}getDropShadowColor(e){return ne("id",e,X()),c.toColor(x(de(this,le,"f").getDropShadowColor(e)))}setDropShadowOffsetX(e,t){return ne("id",e,X()),ne("offsetX",t,K()),x(de(this,le,"f").setDropShadowOffsetX(e,t))}getDropShadowOffsetX(e){return ne("id",e,X()),x(de(this,le,"f").getDropShadowOffsetX(e))}setDropShadowOffsetY(e,t){return ne("id",e,X()),ne("offsetY",t,K()),x(de(this,le,"f").setDropShadowOffsetY(e,t))}getDropShadowOffsetY(e){return ne("id",e,X()),x(de(this,le,"f").getDropShadowOffsetY(e))}setDropShadowBlurRadiusX(e,t){return ne("id",e,X()),ne("blurRadiusX",t,K()),x(de(this,le,"f").setDropShadowBlurRadiusX(e,t))}getDropShadowBlurRadiusX(e){return ne("id",e,X()),x(de(this,le,"f").getDropShadowBlurRadiusX(e))}setDropShadowBlurRadiusY(e,t){return ne("id",e,X()),ne("blurRadiusY",t,K()),x(de(this,le,"f").setDropShadowBlurRadiusY(e,t))}getDropShadowBlurRadiusY(e){return ne("id",e,X()),x(de(this,le,"f").getDropShadowBlurRadiusY(e))}setDropShadowClip(e,t){return ne("id",e,X()),x(de(this,le,"f").setDropShadowClip(e,t))}getDropShadowClip(e){return ne("id",e,X()),x(de(this,le,"f").getDropShadowClip(e))}createCutoutFromBlocks(e,t=2,r=4){return ne("ids",e,G(X())),ne("vectorizeDistanceThreshold",t,K()),ne("maxSmoothingDistance",r,K()),x(de(this,le,"f").createCutoutFromBlocks(e,t,r))}createCutoutFromPath(e){return ne("path",e,Z()),x(de(this,le,"f").createCutoutFromPath(e))}createCutoutFromOperation(e,t){return ne("ids",e,G(X())),ne("op",t,function(){const e=["Difference","Intersection","Union","XOR"];return z("CutoutOperation",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}()),x(de(this,le,"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()),x(de(this,le,"f").replaceText(e,t,r,n))}removeText(e,t=-1,r=-1){ne("id",e,X()),ne("from",t,X()),ne("to",r,X()),x(de(this,le,"f").removeText(e,t,r))}setTextColor(e,t,r=-1,n=-1){ne("id",e,X()),ne("from",r,X()),ne("to",n,X()),x(de(this,le,"f").setTextColor(e,c.fromColor(t),r,n))}getTextColors(e,t=-1,r=-1){ne("id",e,X()),ne("from",t,X()),ne("to",r,X());const n=de(this,le,"f").getTextColors(e,t,r);return T(x(n)).map((e=>c.toColor(e)))}getTextFontWeights(e,t=-1,r=-1){return ne("id",e,X()),ne("from",t,X()),ne("to",r,X()),T(x(de(this,le,"f").getTextFontWeights(e,t,r)))}getTextFontStyles(e,t=-1,r=-1){return ne("id",e,X()),ne("from",t,X()),ne("to",r,X()),T(x(de(this,le,"f").getTextFontStyles(e,t,r)))}getTextCases(e,t=-1,r=-1){return ne("id",e,X()),ne("from",t,X()),ne("to",r,X()),T(x(de(this,le,"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()),x(de(this,le,"f").setTextCase(e,t,r,n))}getTextCursorRange(){return x(de(this,le,"f").getTextCursorRange())}hasFill(e){return ne("id",e,X()),x(de(this,le,"f").hasFill(e))}isFillEnabled(e){return ne("id",e,X()),x(de(this,le,"f").isFillEnabled(e))}setFillEnabled(e,t){return ne("id",e,X()),x(de(this,le,"f").setFillEnabled(e,t))}getFill(e){return ne("id",e,X()),x(de(this,le,"f").getFill(e))}setFill(e,t){return ne("id",e,X()),ne("fill",t,X()),x(de(this,le,"f").setFill(e,t))}setFillSolidColor(e,t,r,n,o=1){ne("id",e,X()),x(de(this,le,"f").setFillSolidColor(e,t,r,n,o))}getFillSolidColor(e){return ne("id",e,X()),x(de(this,le,"f").getFillSolidColor(e))}setPlaceholderEnabled(e,t){ne("id",e,X()),ne("enabled",t,Y()),x(de(this,le,"f").setPlaceholderEnabled(e,t))}isPlaceholderEnabled(e){return ne("id",e,X()),x(de(this,le,"f").isPlaceholderEnabled(e))}hasPlaceholderBehavior(e){return ne("id",e,X()),x(de(this,le,"f").hasPlaceholderBehavior(e))}setPlaceholderBehaviorEnabled(e,t){ne("id",e,X()),x(de(this,le,"f").setPlaceholderBehaviorEnabled(e,t))}isPlaceholderBehaviorEnabled(e){return ne("id",e,X()),x(de(this,le,"f").isPlaceholderBehaviorEnabled(e))}hasPlaceholderControls(e){return ne("id",e,X()),x(de(this,le,"f").hasPlaceholderControls(e))}setPlaceholderControlsOverlayEnabled(e,t){return ne("id",e,X()),ne("enabled",t,Y()),x(de(this,le,"f").setPlaceholderControlsOverlayEnabled(e,t))}isPlaceholderControlsOverlayEnabled(e){return ne("id",e,X()),x(de(this,le,"f").isPlaceholderControlsOverlayEnabled(e))}setPlaceholderControlsButtonEnabled(e,t){return ne("id",e,X()),ne("enabled",t,Y()),x(de(this,le,"f").setPlaceholderControlsButtonEnabled(e,t))}isPlaceholderControlsButtonEnabled(e){return ne("id",e,X()),x(de(this,le,"f").isPlaceholderControlsButtonEnabled(e))}setMetadata(e,t,r){ne("id",e,X()),ne("key",t,Z()),ne("value",r,Z()),x(de(this,le,"f").setMetadata(e,t,r))}getMetadata(e,t){return ne("id",e,X()),ne("key",t,Z()),x(de(this,le,"f").getMetadata(e,t))}hasMetadata(e,t){return ne("id",e,X()),ne("key",t,Z()),x(de(this,le,"f").hasMetadata(e,t))}findAllMetadata(e){return ne("id",e,X()),T(x(de(this,le,"f").findAllMetadata(e)))}removeMetadata(e,t){ne("id",e,X()),ne("key",t,Z()),x(de(this,le,"f").removeMetadata(e,t))}setScopeEnabled(e,t,r){ne("id",e,X()),ne("key",t,Z()),ne("enabled",r,Y()),x(de(this,le,"f").setScopeEnabled(e,t,r))}isScopeEnabled(e,t){return ne("id",e,X()),ne("key",t,Z()),x(de(this,le,"f").isScopeEnabled(e,t))}isAllowedByScope(e,t){return ne("id",e,X()),ne("key",t,Z()),x(de(this,le,"f").isAllowedByScope(e,t))}hasDuration(e){return ne("id",e,X()),x(de(this,le,"f").hasDuration(e))}setDuration(e,t){return ne("id",e,X()),ne("duration",t,K()),x(de(this,le,"f").setDuration(e,t))}getDuration(e){return ne("id",e,X()),x(de(this,le,"f").getDuration(e))}hasTimeOffset(e){return ne("id",e,X()),x(de(this,le,"f").hasTimeOffset(e))}setTimeOffset(e,t){return ne("id",e,X()),ne("offset",t,K()),x(de(this,le,"f").setTimeOffset(e,t))}getTimeOffset(e){return ne("id",e,X()),x(de(this,le,"f").getTimeOffset(e))}hasTrim(e){return ne("id",e,X()),x(de(this,le,"f").hasTrim(e))}setTrimOffset(e,t){return ne("id",e,X()),ne("offset",t,K()),x(de(this,le,"f").setTrimOffset(e,t))}getTrimOffset(e){return ne("id",e,X()),x(de(this,le,"f").getTrimOffset(e))}setTrimLength(e,t){return ne("id",e,X()),ne("length",t,K()),x(de(this,le,"f").setTrimLength(e,t))}getTrimLength(e){return ne("id",e,X()),x(de(this,le,"f").getTrimLength(e))}getTotalSceneDuration(e){return ne("scene",e,X()),x(de(this,le,"f").getTotalSceneDuration(e))}setPlaying(e,t){return ne("id",e,X()),ne("enabled",t,Y()),x(de(this,le,"f").setPlaying(e,t))}isPlaying(e){return ne("id",e,X()),x(de(this,le,"f").isPlaying(e))}hasPlaybackTime(e){return ne("id",e,X()),x(de(this,le,"f").hasPlaybackTime(e))}setPlaybackTime(e,t){return ne("id",e,X()),ne("time",t,K()),x(de(this,le,"f").setPlaybackTime(e,t))}getPlaybackTime(e){return ne("id",e,X()),x(de(this,le,"f").getPlaybackTime(e))}setSoloPlaybackEnabled(e,t){return ne("id",e,X()),ne("enabled",t,Y()),x(de(this,le,"f").setSoloPlaybackEnabled(e,t))}isSoloPlaybackEnabled(e){return ne("id",e,X()),x(de(this,le,"f").isSoloPlaybackEnabled(e))}hasPlaybackControl(e){return ne("id",e,X()),x(de(this,le,"f").hasPlaybackControl(e))}setLooping(e,t){ne("id",e,X()),ne("looping",t,Y()),x(de(this,le,"f").setLooping(e,t))}isLooping(e){return ne("id",e,X()),x(de(this,le,"f").isLooping(e))}setMuted(e,t){ne("id",e,X()),ne("muted",t,Y()),x(de(this,le,"f").setMuted(e,t))}isMuted(e){return ne("id",e,X()),x(de(this,le,"f").isMuted(e))}setVolume(e,t){ne("id",e,X()),ne("volume",t,K()),x(de(this,le,"f").setVolume(e,t))}getVolume(e){return ne("id",e,X()),x(de(this,le,"f").getVolume(e))}async forceLoadAVResource(e){return ne("id",e,X()),k((t=>de(this,le,"f").forceLoadAVResource(e,t)))}getAVResourceTotalDuration(e){return ne("id",e,X()),x(de(this,le,"f").getAVResourceTotalDuration(e))}getVideoWidth(e){return ne("id",e,X()),x(de(this,le,"f").getVideoWidth(e))}getVideoHeight(e){return ne("id",e,X()),x(de(this,le,"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()),de(this,le,"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))})),()=>{x(de(this,le,"f").cancelVideoThumbnailSequenceGeneration(e))}}async getVideoFillThumbnail(e,t){return ne("id",e,X()),ne("thumbnailHeight",t,X()),new Promise(((r,n)=>{de(this,le,"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)=>{de(this,le,"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)=>{de(this,le,"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),x(de(this,le,"f").setNativePixelBuffer(e,t))}}le=new WeakMap,ce([u],fe.prototype,"loadFromString",null),ce([u],fe.prototype,"create",null),ce([u],fe.prototype,"createFill",null),ce([s],fe.prototype,"getType",null),ce([u],fe.prototype,"select",null),ce([u],fe.prototype,"setSelected",null),ce([s],fe.prototype,"isSelected",null),ce([s],fe.prototype,"findAllSelected",null),ce([s],fe.prototype,"isGroupable",null),ce([u],fe.prototype,"group",null),ce([u],fe.prototype,"ungroup",null),ce([u],fe.prototype,"enterGroup",null),ce([u],fe.prototype,"exitGroup",null),ce([u],fe.prototype,"setName",null),ce([s],fe.prototype,"getName",null),ce([s],fe.prototype,"getUUID",null),ce([s],fe.prototype,"findByName",null),ce([s],fe.prototype,"findByType",null),ce([s],fe.prototype,"findAll",null),ce([s],fe.prototype,"findAllPlaceholders",null),ce([u],fe.prototype,"createShape",null),ce([s],fe.prototype,"hasShape",null),ce([s],fe.prototype,"getShape",null),ce([u],fe.prototype,"setShape",null),ce([s],fe.prototype,"isVisible",null),ce([u],fe.prototype,"setVisible",null),ce([s],fe.prototype,"isClipped",null),ce([u],fe.prototype,"setClipped",null),ce([s],fe.prototype,"getPositionX",null),ce([s],fe.prototype,"getPositionXMode",null),ce([s],fe.prototype,"getPositionY",null),ce([s],fe.prototype,"getPositionYMode",null),ce([u],fe.prototype,"setPositionX",null),ce([u],fe.prototype,"setPositionXMode",null),ce([u],fe.prototype,"setPositionY",null),ce([u],fe.prototype,"setPositionYMode",null),ce([u],fe.prototype,"setAlwaysOnTop",null),ce([u],fe.prototype,"setAlwaysOnBottom",null),ce([s],fe.prototype,"isAlwaysOnTop",null),ce([s],fe.prototype,"isAlwaysOnBottom",null),ce([u],fe.prototype,"bringToFront",null),ce([u],fe.prototype,"sendToBack",null),ce([u],fe.prototype,"bringForward",null),ce([u],fe.prototype,"sendBackward",null),ce([s],fe.prototype,"getRotation",null),ce([u],fe.prototype,"setRotation",null),ce([s],fe.prototype,"getFlipHorizontal",null),ce([s],fe.prototype,"getFlipVertical",null),ce([u],fe.prototype,"setFlipHorizontal",null),ce([u],fe.prototype,"setFlipVertical",null),ce([s],fe.prototype,"hasContentFillMode",null),ce([s],fe.prototype,"getWidth",null),ce([s],fe.prototype,"getWidthMode",null),ce([s],fe.prototype,"getHeight",null),ce([s],fe.prototype,"getHeightMode",null),ce([u],fe.prototype,"setWidth",null),ce([u],fe.prototype,"setWidthMode",null),ce([u],fe.prototype,"setHeight",null),ce([u],fe.prototype,"setHeightMode",null),ce([s],fe.prototype,"getFrameX",null),ce([s],fe.prototype,"getFrameY",null),ce([s],fe.prototype,"getFrameWidth",null),ce([s],fe.prototype,"getFrameHeight",null),ce([u],fe.prototype,"setContentFillMode",null),ce([s],fe.prototype,"getContentFillMode",null),ce([u],fe.prototype,"duplicate",null),ce([u],fe.prototype,"destroy",null),ce([s],fe.prototype,"isValid",null),ce([s],fe.prototype,"getParent",null),ce([s],fe.prototype,"getChildren",null),ce([u],fe.prototype,"insertChild",null),ce([u],fe.prototype,"appendChild",null),ce([s],fe.prototype,"referencesAnyVariables",null),ce([s],fe.prototype,"getGlobalBoundingBoxX",null),ce([s],fe.prototype,"getGlobalBoundingBoxY",null),ce([s],fe.prototype,"getGlobalBoundingBoxWidth",null),ce([s],fe.prototype,"getGlobalBoundingBoxHeight",null),ce([s],fe.prototype,"getScreenSpaceBoundingBoxXYWH",null),ce([u],fe.prototype,"alignHorizontally",null),ce([u],fe.prototype,"alignVertically",null),ce([s],fe.prototype,"isAlignable",null),ce([u],fe.prototype,"distributeHorizontally",null),ce([u],fe.prototype,"distributeVertically",null),ce([u],fe.prototype,"isDistributable",null),ce([u],fe.prototype,"fillParent",null),ce([u],fe.prototype,"resizeContentAware",null),ce([u],fe.prototype,"scale",null),ce([s],fe.prototype,"findAllProperties",null),ce([s],fe.prototype,"isPropertyReadable",null),ce([s],fe.prototype,"isPropertyWritable",null),ce([s],fe.prototype,"getPropertyType",null),ce([s],fe.prototype,"getEnumValues",null),ce([u],fe.prototype,"setBool",null),ce([s],fe.prototype,"getBool",null),ce([u],fe.prototype,"setInt",null),ce([s],fe.prototype,"getInt",null),ce([u],fe.prototype,"setFloat",null),ce([s],fe.prototype,"getFloat",null),ce([u],fe.prototype,"setDouble",null),ce([s],fe.prototype,"getDouble",null),ce([u],fe.prototype,"setString",null),ce([s],fe.prototype,"getString",null),ce([u],fe.prototype,"setColor",null),ce([s],fe.prototype,"getColor",null),ce([u],fe.prototype,"setColorRGBA",null),ce([s],fe.prototype,"getColorRGBA",null),ce([u],fe.prototype,"setColorSpot",null),ce([s],fe.prototype,"getColorSpotName",null),ce([s],fe.prototype,"getColorSpotTint",null),ce([u],fe.prototype,"setGradientColorStops",null),ce([s],fe.prototype,"getGradientColorStops",null),ce([u],fe.prototype,"setEnum",null),ce([s],fe.prototype,"getEnum",null),ce([s],fe.prototype,"hasCrop",null),ce([u],fe.prototype,"setCropScaleX",null),ce([u],fe.prototype,"setCropScaleY",null),ce([u],fe.prototype,"setCropRotation",null),ce([u],fe.prototype,"setCropScaleRatio",null),ce([u],fe.prototype,"setCropTranslationX",null),ce([u],fe.prototype,"setCropTranslationY",null),ce([u],fe.prototype,"resetCrop",null),ce([s],fe.prototype,"getCropScaleX",null),ce([s],fe.prototype,"getCropScaleY",null),ce([s],fe.prototype,"getCropRotation",null),ce([s],fe.prototype,"getCropScaleRatio",null),ce([s],fe.prototype,"getCropTranslationX",null),ce([s],fe.prototype,"getCropTranslationY",null),ce([u],fe.prototype,"adjustCropToFillFrame",null),ce([u],fe.prototype,"flipCropHorizontal",null),ce([u],fe.prototype,"flipCropVertical",null),ce([s],fe.prototype,"hasOpacity",null),ce([u],fe.prototype,"setOpacity",null),ce([s],fe.prototype,"getOpacity",null),ce([s],fe.prototype,"hasBlendMode",null),ce([u],fe.prototype,"setBlendMode",null),ce([s],fe.prototype,"getBlendMode",null),ce([s],fe.prototype,"hasFillColor",null),ce([u],fe.prototype,"setFillColorRGBA",null),ce([s],fe.prototype,"getFillColorRGBA",null),ce([u],fe.prototype,"setFillColorEnabled",null),ce([s],fe.prototype,"isFillColorEnabled",null),ce([u],fe.prototype,"createEffect",null),ce([s],fe.prototype,"hasEffects",null),ce([s],fe.prototype,"getEffects",null),ce([u],fe.prototype,"insertEffect",null),ce([u],fe.prototype,"appendEffect",null),ce([u],fe.prototype,"removeEffect",null),ce([s],fe.prototype,"hasEffectEnabled",null),ce([u],fe.prototype,"setEffectEnabled",null),ce([s],fe.prototype,"isEffectEnabled",null),ce([u],fe.prototype,"createBlur",null),ce([s],fe.prototype,"hasBlur",null),ce([u],fe.prototype,"setBlur",null),ce([s],fe.prototype,"getBlur",null),ce([u],fe.prototype,"setBlurEnabled",null),ce([s],fe.prototype,"isBlurEnabled",null),ce([s],fe.prototype,"hasBackgroundColor",null),ce([u],fe.prototype,"setBackgroundColorRGBA",null),ce([s],fe.prototype,"getBackgroundColorRGBA",null),ce([u],fe.prototype,"setBackgroundColorEnabled",null),ce([s],fe.prototype,"isBackgroundColorEnabled",null),ce([s],fe.prototype,"hasStroke",null),ce([u],fe.prototype,"setStrokeEnabled",null),ce([s],fe.prototype,"isStrokeEnabled",null),ce([u],fe.prototype,"setStrokeColorRGBA",null),ce([u],fe.prototype,"setStrokeColor",null),ce([s],fe.prototype,"getStrokeColorRGBA",null),ce([s],fe.prototype,"getStrokeColor",null),ce([u],fe.prototype,"setStrokeWidth",null),ce([s],fe.prototype,"getStrokeWidth",null),ce([u],fe.prototype,"setStrokeStyle",null),ce([s],fe.prototype,"getStrokeStyle",null),ce([u],fe.prototype,"setStrokePosition",null),ce([s],fe.prototype,"getStrokePosition",null),ce([u],fe.prototype,"setStrokeCornerGeometry",null),ce([s],fe.prototype,"getStrokeCornerGeometry",null),ce([s],fe.prototype,"hasDropShadow",null),ce([u],fe.prototype,"setDropShadowEnabled",null),ce([s],fe.prototype,"isDropShadowEnabled",null),ce([u],fe.prototype,"setDropShadowColorRGBA",null),ce([u],fe.prototype,"setDropShadowColor",null),ce([s],fe.prototype,"getDropShadowColorRGBA",null),ce([s],fe.prototype,"getDropShadowColor",null),ce([u],fe.prototype,"setDropShadowOffsetX",null),ce([s],fe.prototype,"getDropShadowOffsetX",null),ce([u],fe.prototype,"setDropShadowOffsetY",null),ce([s],fe.prototype,"getDropShadowOffsetY",null),ce([u],fe.prototype,"setDropShadowBlurRadiusX",null),ce([s],fe.prototype,"getDropShadowBlurRadiusX",null),ce([u],fe.prototype,"setDropShadowBlurRadiusY",null),ce([s],fe.prototype,"getDropShadowBlurRadiusY",null),ce([u],fe.prototype,"setDropShadowClip",null),ce([s],fe.prototype,"getDropShadowClip",null),ce([u],fe.prototype,"createCutoutFromBlocks",null),ce([u],fe.prototype,"createCutoutFromPath",null),ce([u],fe.prototype,"createCutoutFromOperation",null),ce([u],fe.prototype,"replaceText",null),ce([u],fe.prototype,"removeText",null),ce([u],fe.prototype,"setTextColor",null),ce([s],fe.prototype,"getTextColors",null),ce([s],fe.prototype,"getTextFontWeights",null),ce([s],fe.prototype,"getTextFontStyles",null),ce([s],fe.prototype,"getTextCases",null),ce([u],fe.prototype,"setTextCase",null),ce([s],fe.prototype,"getTextCursorRange",null),ce([s],fe.prototype,"hasFill",null),ce([s],fe.prototype,"isFillEnabled",null),ce([u],fe.prototype,"setFillEnabled",null),ce([s],fe.prototype,"getFill",null),ce([u],fe.prototype,"setFill",null),ce([u],fe.prototype,"setFillSolidColor",null),ce([s],fe.prototype,"getFillSolidColor",null),ce([u],fe.prototype,"setPlaceholderEnabled",null),ce([s],fe.prototype,"isPlaceholderEnabled",null),ce([s],fe.prototype,"hasPlaceholderBehavior",null),ce([u],fe.prototype,"setPlaceholderBehaviorEnabled",null),ce([s],fe.prototype,"isPlaceholderBehaviorEnabled",null),ce([s],fe.prototype,"hasPlaceholderControls",null),ce([u],fe.prototype,"setPlaceholderControlsOverlayEnabled",null),ce([s],fe.prototype,"isPlaceholderControlsOverlayEnabled",null),ce([u],fe.prototype,"setPlaceholderControlsButtonEnabled",null),ce([s],fe.prototype,"isPlaceholderControlsButtonEnabled",null),ce([u],fe.prototype,"setMetadata",null),ce([s],fe.prototype,"getMetadata",null),ce([s],fe.prototype,"hasMetadata",null),ce([s],fe.prototype,"findAllMetadata",null),ce([u],fe.prototype,"removeMetadata",null),ce([u],fe.prototype,"setScopeEnabled",null),ce([s],fe.prototype,"isScopeEnabled",null),ce([s],fe.prototype,"isAllowedByScope",null),ce([s],fe.prototype,"hasDuration",null),ce([u],fe.prototype,"setDuration",null),ce([s],fe.prototype,"getDuration",null),ce([s],fe.prototype,"hasTimeOffset",null),ce([u],fe.prototype,"setTimeOffset",null),ce([s],fe.prototype,"getTimeOffset",null),ce([s],fe.prototype,"hasTrim",null),ce([u],fe.prototype,"setTrimOffset",null),ce([s],fe.prototype,"getTrimOffset",null),ce([u],fe.prototype,"setTrimLength",null),ce([s],fe.prototype,"getTrimLength",null),ce([s],fe.prototype,"getTotalSceneDuration",null),ce([u],fe.prototype,"setPlaying",null),ce([s],fe.prototype,"isPlaying",null),ce([s],fe.prototype,"hasPlaybackTime",null),ce([u],fe.prototype,"setPlaybackTime",null),ce([s],fe.prototype,"getPlaybackTime",null),ce([u],fe.prototype,"setSoloPlaybackEnabled",null),ce([s],fe.prototype,"isSoloPlaybackEnabled",null),ce([s],fe.prototype,"hasPlaybackControl",null),ce([u],fe.prototype,"setLooping",null),ce([s],fe.prototype,"isLooping",null),ce([u],fe.prototype,"setMuted",null),ce([s],fe.prototype,"isMuted",null),ce([u],fe.prototype,"setVolume",null),ce([s],fe.prototype,"getVolume",null),ce([u],fe.prototype,"forceLoadAVResource",null),ce([s],fe.prototype,"getAVResourceTotalDuration",null),ce([s],fe.prototype,"getVideoWidth",null),ce([s],fe.prototype,"getVideoHeight",null),ce([s],fe.prototype,"getVideoFillThumbnail",null),ce([s],fe.prototype,"getVideoFillThumbnailAtlas",null),ce([s],fe.prototype,"getPageThumbnailAtlas",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,"onStateChanged",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=me(this,pe,"f").subscribeToEditorState(e);return()=>{me(this,pe,"f").isDeleted()||x(me(this,pe,"f").unsubscribe(t))}}}),Object.defineProperty(this,"onHistoryUpdated",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=me(this,pe,"f").subscribeToHistory(e);return()=>{me(this,pe,"f").isDeleted()||me(this,pe,"f").unsubscribe(t)}}}),Object.defineProperty(this,"onSettingsChanged",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=me(this,pe,"f").subscribeToSettings(e);return()=>{me(this,pe,"f").isDeleted()||x(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")}setEditMode(e){ne("keypath",e,Z()),me(this,pe,"f").setEditMode(e)}getEditMode(){return me(this,pe,"f").getEditMode()}getCursorType(){return me(this,pe,"f").getCursorType()}getCursorRotation(){return me(this,pe,"f").getCursorRotation()}getTextCursorPositionInScreenSpaceX(){return me(this,pe,"f").getTextCursorPositionInScreenSpaceX()}getTextCursorPositionInScreenSpaceY(){return me(this,pe,"f").getTextCursorPositionInScreenSpaceY()}createHistory(){return me(this,pe,"f").createHistory()}destroyHistory(e){x(me(this,pe,"f").destroyHistory(e))}setActiveHistory(e){x(me(this,pe,"f").setActiveHistory(e))}getActiveHistory(){return me(this,pe,"f").getActiveHistory()}addUndoStep(){x(me(this,pe,"f").addUndoStep())}undo(){x(me(this,pe,"f").undo())}redo(){x(me(this,pe,"f").redo())}canUndo(){return x(me(this,pe,"f").canUndo())}canRedo(){return x(me(this,pe,"f").canRedo())}setSettingBool(e,t){return ne("keypath",e,Z()),ne("value",t,Y()),x(me(this,pe,"f").setSettingBool(e,t))}getSettingBool(e){return ne("keypath",e,Z()),x(me(this,pe,"f").getSettingBool(e))}setSettingInt(e,t){return ne("keypath",e,Z()),ne("value",t,X()),x(me(this,pe,"f").setSettingInt(e,t))}getSettingInt(e){return ne("keypath",e,Z()),x(me(this,pe,"f").getSettingInt(e))}setSettingFloat(e,t){return ne("keypath",e,Z()),ne("value",t,K()),x(me(this,pe,"f").setSettingFloat(e,t))}getSettingFloat(e){return ne("keypath",e,Z()),x(me(this,pe,"f").getSettingFloat(e))}setSettingString(e,t){return ne("keypath",e,Z()),ne("value",t,Z()),x(me(this,pe,"f").setSettingString(e,t))}getSettingString(e){return ne("keypath",e,Z()),x(me(this,pe,"f").getSettingString(e))}setSettingColor(e,t){return ne("keypath",e,Z()),x(me(this,pe,"f").setSettingColor(e,c.fromColor(t)))}getSettingColor(e){return ne("keypath",e,Z()),c.toColor(x(me(this,pe,"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()),x(me(this,pe,"f").setSettingColorRGBA(e,t,r,n,o))}getSettingColorRGBA(e){return ne("keypath",e,Z()),x(me(this,pe,"f").getSettingColorRGBA(e))}setSettingEnum(e,t){return ne("keypath",e,Z()),ne("value",t,Z()),x(me(this,pe,"f").setSettingEnum(e,t))}getSettingEnum(e){return ne("keypath",e,Z()),x(me(this,pe,"f").getSettingEnum(e))}getSettingEnumOptions(e){return ne("keypath",e,Z()),T(x(me(this,pe,"f").getSettingEnumOptions(e)))}findAllSettings(){return T(me(this,pe,"f").findAllSettings())}getSettingType(e){return ne("keypath",e,Z()),x(me(this,pe,"f").getSettingType(e))}getAvailableMemory(){return x(me(this,pe,"f").getAvailableMemory())}getUsedMemory(){return x(me(this,pe,"f").getUsedMemory())}setURIResolver(e){return x(me(this,pe,"f").setURIResolver(e))}defaultURIResolver(e){return me(this,pe,"f").defaultURIResolver(e)}getAbsoluteURI(e){return x(me(this,pe,"f").getAbsoluteURI(e))}setGlobalScope(e,t){ne("key",e,Z()),ne("value",t,Z()),x(me(this,pe,"f").setGlobalScope(e,t))}getGlobalScope(e){return ne("key",e,Z()),x(me(this,pe,"f").getGlobalScope(e))}findAllSpotColors(){return T(me(this,pe,"f").findAllSpotColors())}getSpotColorRGBA(e){return ne("name",e,Z()),me(this,pe,"f").getSpotColorRGB(e)}getSpotColorCMYK(e){return ne("name",e,Z()),me(this,pe,"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()),me(this,pe,"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()),me(this,pe,"f").setSpotColorCMYK(e,t,r,n,o)}removeSpotColor(e){return ne("name",e,Z()),x(me(this,pe,"f").removeSpotColor(e))}setSpotColorForCutoutType(e,t){return ne("type",e,Z()),ne("color",t,Z()),x(me(this,pe,"f").setSpotColorForCutoutType(e,t))}getSpotColorForCutoutType(e){return ne("type",e,Z()),x(me(this,pe,"f").getSpotColorForCutoutType(e))}convertColorToColorSpace(e,t){return ne("colorSpace",t,Z()),c.toColor(x(me(this,pe,"f").convertColorToColorSpace(c.fromColor(e),t)))}}pe=new WeakMap,he([u],ge.prototype,"setEditMode",null),he([s],ge.prototype,"getEditMode",null),he([s],ge.prototype,"getCursorType",null),he([s],ge.prototype,"getCursorRotation",null),he([s],ge.prototype,"getTextCursorPositionInScreenSpaceX",null),he([s],ge.prototype,"getTextCursorPositionInScreenSpaceY",null),he([u],ge.prototype,"createHistory",null),he([u],ge.prototype,"destroyHistory",null),he([u],ge.prototype,"setActiveHistory",null),he([s],ge.prototype,"getActiveHistory",null),he([u],ge.prototype,"addUndoStep",null),he([u],ge.prototype,"undo",null),he([u],ge.prototype,"redo",null),he([s],ge.prototype,"canUndo",null),he([s],ge.prototype,"canRedo",null),he([u],ge.prototype,"setSettingBool",null),he([s],ge.prototype,"getSettingBool",null),he([u],ge.prototype,"setSettingInt",null),he([s],ge.prototype,"getSettingInt",null),he([u],ge.prototype,"setSettingFloat",null),he([s],ge.prototype,"getSettingFloat",null),he([u],ge.prototype,"setSettingString",null),he([s],ge.prototype,"getSettingString",null),he([u],ge.prototype,"setSettingColor",null),he([s],ge.prototype,"getSettingColor",null),he([u],ge.prototype,"setSettingColorRGBA",null),he([s],ge.prototype,"getSettingColorRGBA",null),he([u],ge.prototype,"setSettingEnum",null),he([s],ge.prototype,"getSettingEnum",null),he([s],ge.prototype,"getAvailableMemory",null),he([s],ge.prototype,"getUsedMemory",null),he([u],ge.prototype,"setURIResolver",null),he([s],ge.prototype,"defaultURIResolver",null),he([s],ge.prototype,"getAbsoluteURI",null),he([u],ge.prototype,"setGlobalScope",null),he([s],ge.prototype,"getGlobalScope",null),he([s],ge.prototype,"findAllSpotColors",null),he([s],ge.prototype,"getSpotColorRGBA",null),he([s],ge.prototype,"getSpotColorCMYK",null),he([u],ge.prototype,"setSpotColorRGB",null),he([u],ge.prototype,"setSpotColorCMYK",null),he([u],ge.prototype,"removeSpotColor",null),he([u],ge.prototype,"setSpotColorForCutoutType",null),he([u],ge.prototype,"getSpotColorForCutoutType",null);var ye,ve=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 be{constructor(e){ye.set(this,void 0),Object.defineProperty(this,"subscribe",{enumerable:!0,configurable:!0,writable:!0,value:(e,t)=>{ne("blocks",e,G());const r=ve(this,ye,"f").subscribe(e,(e=>{try{t(T(e,!0))}catch(e){console.error(e)}}));return()=>{ve(this,ye,"f").isDeleted()||x(ve(this,ye,"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,ye,e,"f")}}ye=new WeakMap;var we,Ee=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},Ce=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 _e{constructor(e){we.set(this,void 0),Object.defineProperty(this,"onZoomLevelChanged",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=Ce(this,we,"f").subscribeToZoomLevel(e);return()=>{Ce(this,we,"f").isDeleted()||x(Ce(this,we,"f").unsubscribe(t))}}}),Object.defineProperty(this,"onActiveChanged",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=Ce(this,we,"f").subscribeToActiveSceneChange(e);return()=>{Ce(this,we,"f").isDeleted()||x(Ce(this,we,"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,we,e,"f")}async loadFromString(e){return ne("sceneContent",e,Z()),k((t=>Ce(this,we,"f").loadSceneFromString(e,t)))}async loadFromURL(e){return ne("url",e,Z()),k((t=>Ce(this,we,"f").loadSceneFromURL(e,t)))}async saveToString(){const e=this.get();if(null==e)throw new Error("No scene available.");return k((t=>{Ce(this,we,"f").saveSceneToString(e,t)}))}async saveToArchive(){return new Promise(((e,t)=>{const r=this.get();null==r?t(new Error("No scene available.")):Ce(this,we,"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()),x(Ce(this,we,"f").createScene(e))}createVideo(){return x(Ce(this,we,"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()),k((a=>Ce(this,we,"f").createSceneFromImage(e,t,r,n,o,i,a)))}createFromVideo(e){return ne("url",e,Z()),k((t=>Ce(this,we,"f").createSceneFromVideo(e,t)))}get(){const e=x(Ce(this,we,"f").findByType("scene")),t=T(e);return t.length>0?t[0]:null}async applyTemplateFromString(e){return ne("content",e,Z()),k((t=>Ce(this,we,"f").applyTemplateFromString(e,t)))}async applyTemplateFromURL(e){return ne("url",e,Z()),k((t=>Ce(this,we,"f").applyTemplateFromURL(e,t)))}getMode(){const e=this.get();return x(Ce(this,we,"f").getSceneMode(e))}setDesignUnit(e){ne("designUnit",e,function(){const e=["Pixel","Millimeter","Inch"];return z("DesignUnit",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}());const t=this.get();x(Ce(this,we,"f").setDesignUnit(t,e))}getDesignUnit(){const e=this.get();return x(Ce(this,we,"f").getDesignUnit(e))}getPages(){return T(x(Ce(this,we,"f").getPages()))}getCurrentPage(){const e=this.get();if(null==e)return null;const t=x(Ce(this,we,"f").findNearestToViewPortCenterByKind(e,"page")),r=T(t);return r.length>0?r[0]:null}findNearestToViewPortCenterByType(e){ne("type",e,Z());const t=this.get();if(null==t)return[];const r=x(Ce(this,we,"f").findNearestToViewPortCenterByType(t,e));return T(r)}findNearestToViewPortCenterByKind(e){ne("kind",e,Z());const t=this.get();if(null==t)return[];const r=x(Ce(this,we,"f").findNearestToViewPortCenterByKind(t,e));return T(r)}setZoomLevel(e=1){const t=this.get();ne("zoomLevel",e,ee(K(),0)),Ce(this,we,"f").setZoomLevel(t,e)}getZoomLevel(){const e=this.get();return x(Ce(this,we,"f").getZoomLevel(e))}async zoomToBlock(e,t=0,r=0,n=0,o=0){return ne("id",e,X()),k((i=>Ce(this,we,"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 z("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()),x(Ce(this,we,"f").enableZoomAutoFit(e,t,r,0,n,0))):"Vertical"===t?(ne("paddingBefore",r,K()),ne("paddingAfter",n,K()),x(Ce(this,we,"f").enableZoomAutoFit(e,t,0,r,0,n))):(ne("paddingLeft",r,K()),ne("paddingTop",n,K()),ne("paddingRight",o,K()),ne("paddingBottom",i,K()),x(Ce(this,we,"f").enableZoomAutoFit(e,t,r,n,o,i)))}disableZoomAutoFit(e){return ne("blockOrScene",e,X()),x(Ce(this,we,"f").disableZoomAutoFit(e))}isZoomAutoFitEnabled(e){return ne("blockOrScene",e,X()),x(Ce(this,we,"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,G(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()),x(Ce(this,we,"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 x(Ce(this,we,"f").unstable_disableCameraPositionClamping(e))}unstable_isCameraPositionClampingEnabled(e=this.get()){if(null==e)throw new Error("No scene available.");return x(Ce(this,we,"f").unstable_isCameraPositionClampingEnabled(e))}unstable_enableCameraZoomClamping(e,t=-1,r=-1,n=0,o=0,i=0,a=0){return ne("ids",e,G(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()),x(Ce(this,we,"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 x(Ce(this,we,"f").unstable_disableCameraZoomClamping(e))}unstable_isCameraZoomClampingEnabled(e=this.get()){if(null==e)throw new Error("No scene available.");return x(Ce(this,we,"f").unstable_isCameraZoomClampingEnabled(e))}}function Se(e,t){const r=new Set;function n(n){return r.add(n),null==e||e(((e,...t)=>{n(e);for(const e of t)n(e)})),()=>{r.delete(n),null==t||t()}}return n.emit=function(e,...t){for(const n of r){n(e);for(const e of t)n(e)}},n.handlers=r,n}we=new WeakMap,Ee([u],_e.prototype,"loadFromString",null),Ee([u],_e.prototype,"loadFromURL",null),Ee([u],_e.prototype,"create",null),Ee([u],_e.prototype,"createVideo",null),Ee([u],_e.prototype,"createFromImage",null),Ee([u],_e.prototype,"createFromVideo",null),Ee([s],_e.prototype,"get",null),Ee([u],_e.prototype,"applyTemplateFromString",null),Ee([u],_e.prototype,"applyTemplateFromURL",null),Ee([s],_e.prototype,"getMode",null),Ee([u],_e.prototype,"setDesignUnit",null),Ee([s],_e.prototype,"getDesignUnit",null),Ee([s],_e.prototype,"getPages",null),Ee([s],_e.prototype,"getCurrentPage",null),Ee([s],_e.prototype,"findNearestToViewPortCenterByType",null),Ee([s],_e.prototype,"findNearestToViewPortCenterByKind",null),Ee([u],_e.prototype,"setZoomLevel",null),Ee([s],_e.prototype,"getZoomLevel",null),Ee([u],_e.prototype,"zoomToBlock",null),Ee([u],_e.prototype,"enableZoomAutoFit",null),Ee([u],_e.prototype,"disableZoomAutoFit",null),Ee([s],_e.prototype,"isZoomAutoFitEnabled",null);const xe=e=>t=>function(r){return t((function(t){r(e(t))}))};function ke(e){return t=>function(r){let n=!1;const o=t((function(e){n=!0,r(e)}));return n||r(e instanceof Function?e():e),o}}const Te=(e=((e,t)=>e===t))=>t=>function(r){let n;return t((function(t){e(t,n)||(n=t,r(t))}))},Pe=e=>{const t=new Set;let r=null;return function(n){return t.add(n),null===r&&(r=e((function(e){t.forEach((t=>t(e)))}))),function(){t.delete(n),0===t.size&&(null==r||r(),r=null)}}};function Ae(e,...t){return t.reduce(((e,t)=>t(e)),e)}const Fe=(...e)=>{const t=Array.from(e);return function(e){const r=t.map((function(t){return t(e)}));return function(){for(const e of r)e()}}};function Le(e){return function(t){let r=null;const n=e((function(e){null==r||r(),r=e?e(t):e}));return function(){n(),null==r||r(),r=null}}}function De(...e){const t=Array.from(e);return function(e){const r=new Array(t.length),n=t.map(((t,n)=>t((function(t){r[n]=t,e(r)}))));return function(){n.forEach((e=>e())),r.length=0}}}const Be=Symbol("NO_VALUE");function Re(e){let t=Be;const r=Se();return{subscribe:r,value:()=>(t===Be&&(t=e()),t),update(e){t=e,r.emit(t)}}}var Oe,Me,je,Ie,Ue,qe,$e,He,Ne=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},Ve=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){Oe.add(this),Me.set(this,void 0),je.set(this,null),Ie.set(this,void 0),Object.defineProperty(this,"singlePageMode",{enumerable:!0,configurable:!0,writable:!0,value:Ve(this,Oe,"m",qe).call(this,"features/singlePageModeEnabled")}),Object.defineProperty(this,"role",{enumerable:!0,configurable:!0,writable:!0,value:Ve(this,Oe,"m",$e).call(this,"role")}),Object.defineProperty(this,"pageTitleShow",{enumerable:!0,configurable:!0,writable:!0,value:Ve(this,Oe,"m",qe).call(this,"page/title/show")}),Object.defineProperty(this,"pageTitleFont",{enumerable:!0,configurable:!0,writable:!0,value:Ve(this,Oe,"m",He).call(this,"page/title/fontFileUri")}),Object.defineProperty(this,"dimOutOfPageAreas",{enumerable:!0,configurable:!0,writable:!0,value:Ve(this,Oe,"m",qe).call(this,"page/dimOutOfPageAreas")}),Object.defineProperty(this,"singlePointPanning",{enumerable:!0,configurable:!0,writable:!0,value:Ve(this,Oe,"m",qe).call(this,"touch/singlePointPanning")}),Object.defineProperty(this,"touchPinchAction",{enumerable:!0,configurable:!0,writable:!0,value:Ve(this,Oe,"m",$e).call(this,"touch/pinchAction")}),Object.defineProperty(this,"touchRotateAction",{enumerable:!0,configurable:!0,writable:!0,value:Ve(this,Oe,"m",$e).call(this,"touch/rotateAction")}),Object.defineProperty(this,"dragStartCanSelect",{enumerable:!0,configurable:!0,writable:!0,value:Ve(this,Oe,"m",qe).call(this,"touch/dragStartCanSelect")}),Object.defineProperty(this,"featureHspSelectiveAdjustmentsEnabled",{enumerable:!0,configurable:!0,writable:!0,value:Ve(this,Oe,"m",qe).call(this,"features/hspSelectiveAdjustmentsEnabled")}),Object.defineProperty(this,"featureLayerListEnabled",{enumerable:!0,configurable:!0,writable:!0,value:Ve(this,Oe,"m",qe).call(this,"features/layerListEnabled")}),Object.defineProperty(this,"unstable_workerFactory",{enumerable:!0,configurable:!0,writable:!0,value:Re((()=>null))}),Object.defineProperty(this,"unstable_videoExportInactivityTimeout",{enumerable:!0,configurable:!0,writable:!0,value:Re((()=>1e4))}),Ne(this,Me,e,"f");const t=Se((()=>{1===t.handlers.size&&Ve(this,Oe,"m",Ue).call(this)}),(()=>{var e;0===t.handlers.size&&(null===(e=Ve(this,je,"f"))||void 0===e||e.call(this))}));Ne(this,Ie,t,"f")}dispose(){var e;Ve(this,Ie,"f").handlers.clear(),null===(e=Ve(this,je,"f"))||void 0===e||e.call(this)}}Me=new WeakMap,je=new WeakMap,Ie=new WeakMap,Oe=new WeakSet,Ue=function(){if(Ve(this,je,"f"))throw new Error("Settings Changed Event callback is already registered.");const e=Ve(this,Me,"f").onSettingsChanged((()=>{Ve(this,Ie,"f").emit()}));Ne(this,je,(()=>{e(),Ne(this,je,null,"f")}),"f")},qe=function(e){const t=()=>Ve(this,Me,"f").getSettingBool(e);return{subscribe:Ae((e=>Ve(this,Ie,"f").call(this,e)),xe(t),Te(),Pe),update:t=>{Ve(this,Me,"f").setSettingBool(e,t),Ve(this,Ie,"f").emit()},value:t}},$e=function(e){const t=()=>Ve(this,Me,"f").getSettingEnum(e);return{subscribe:Ae((e=>Ve(this,Ie,"f").call(this,e)),xe(t),Te(),Pe),update:t=>{Ve(this,Me,"f").setSettingEnum(e,t),Ve(this,Ie,"f").emit()},value:t}},He=function(e){const t=()=>Ve(this,Me,"f").getSettingString(e);return{subscribe:Ae((e=>Ve(this,Ie,"f").call(this,e)),xe(t),Te(),Pe),update:t=>{Ve(this,Me,"f").setSettingString(e,t),Ve(this,Ie,"f").emit()},value:t}};var ze,Ge=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 Ye{constructor(e){ze.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,ze,e,"f")}findAll(){return T(Ge(this,ze,"f").findAllVariables())}setString(e,t){return ne("key",e,Z()),ne("value",t,Z()),x(Ge(this,ze,"f").setVariableString(e,t))}getString(e){return ne("key",e,Z()),x(Ge(this,ze,"f").getVariableString(e))}remove(e){return ne("key",e,Z()),x(Ge(this,ze,"f").removeVariable(e))}}ze=new WeakMap;const Xe={Info:"Info",Warning:"Warning",Error:"Error"};function Ke(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)}}const Qe={baseURL:"/extensions/",entries:["ly.img.cesdk.fonts"]};function Ze(e,t=("undefined"==typeof window?"":window.location.href)){return new URL(e,""===t?void 0:t).href}function Je(e){return"/"!==e[e.length-1]?`${e}/`:e}const et=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)};var tt,rt=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},nt=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)};function ot(e,t){let r;const n=new Set;function o(){const n=window.devicePixelRatio,{width:i,height:a}=e.getBoundingClientRect();t(i*n,a*n,n),r=matchMedia(`(resolution: ${n}dppx)`),r.addEventListener("change",o,{once:!0})}o();const i=new ResizeObserver((function([e]){const{width:r,height:o}=e.target.getBoundingClientRect();if(r<=0||o<=0)return;const i=window.devicePixelRatio,a=setTimeout((function(){n.delete(a),t(r*i,o*i,i)}),0);n.add(a)}));return i.observe(e),()=>{r.removeEventListener("change",o),i.disconnect();for(const e of n)clearTimeout(e);n.clear(),e=null,t=null}}!function(e){e.Scene="ubq/designblocks/SceneProps",e.Camera="ubq/designblocks/Camera",e.Common="ubq/designblocks/CommonDesignBlockProps",e.Page="ubq/designblocks/Page",e.Image="ubq/designblocks/Image",e.Video="ubq/designblocks/Video",e.Audio="ubq/designblocks/Audio",e.Sticker="ubq/designblocks/Sticker",e.Text="ubq/designblocks/Text",e.Crop="ubq/types/Crop",e.Scale="ubq/scene/Scale",e.Opacity="ubq/types/Opacity",e.FillColor="ubq/types/FillColor",e.Group="ubq/designblocks/Group",e.VectorPath="ubq/designblocks/VectorPath",e.PendingState="ubq/designblocks/PendingState",e.ErrorState="ubq/designblocks/ErrorState",e.DesignBlockFrame="ubq/designblocks/DesignBlockFrame",e.Size="ubq/layout/Size",e.Position="ubq/layout/Position",e.EulerRotation="ubq/scene/EulerRotation",e.Children="ubq/scene/Children"}(tt||(tt={}));const it=tt;var at=r(9510),st=r.n(at);function ut(e,t){const{block:r,event:n}=t;return Ae((t=>{const o=r.getType(e),i=st()(n.subscribe([e],(n=>{n.some((e=>"Destroyed"===e.type))&&!r.isValid(e)||r.getType(e)!==o?i():t(n)})));return i}),Pe)}const lt=function(e,t,r,n){const o=function(e,t){if(!t)return e;let r;return(...n)=>{const o=e(...n);return t(o,r)||(r=o),r}}(t,null==n?void 0:n.equals),i=Se();return{subscribe:Ae(Fe(e,i),xe(o),Te(),Pe),update:r,value:o,flush:()=>i.emit()}};var ct,dt=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 ft{constructor(e){Object.defineProperty(this,"settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"clampCamera",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"clampResult",{enumerable:!0,configurable:!0,writable:!0,value:Re((()=>({sceneSize:{x:0,y:0},scrollPercentage:{x:NaN,y:NaN}})))}),Object.defineProperty(this,"zoomLevel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),ct.set(this,void 0),Object.defineProperty(this,"viewportPadding",{enumerable:!0,configurable:!0,writable:!0,value:Re((()=>({x:40,y:48})))}),Object.defineProperty(this,"autoFit",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"scrollPercentage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sceneSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"scroll",{enumerable:!0,configurable:!0,writable:!0,value:void 0});const{block:t,scene:r,_ubq:n}=e,o=Ae(r.onActiveChanged,ke(),xe((()=>r.get()))),a=Ae(o,xe((r=>null!=r&&t.isValid(r)?Ae(ut(r,e),ke([]),xe((()=>t.getFloat(r,"scene/dpi")))):()=>()=>{})),Le),s=Ae(o,xe((()=>{const r=t.findByType("camera")[0];return null==r?()=>()=>{}:Ae(ut(r,e),ke([]),xe((()=>r)))})),Le);this.settings={subscribe:Ae(s,xe((e=>({width:t.getFloat(e,"camera/resolution/width"),height:t.getFloat(e,"camera/resolution/height"),pixelRatio:t.getFloat(e,"camera/pixelRatio")}))),Te(i()),Pe),update({width:e,height:r,pixelRatio:n}){const o=t.findByType("camera")[0];null!=o&&(t.setFloat(o,"camera/resolution/width",e),t.setFloat(o,"camera/resolution/height",r),t.setFloat(o,"camera/pixelRatio",n))},value(){const e=t.findByType("camera")[0];return null==e?{width:0,height:0,pixelRatio:1}:{width:t.getFloat(e,"camera/resolution/width"),height:t.getFloat(e,"camera/resolution/height"),pixelRatio:t.getFloat(e,"camera/pixelRatio")}}},this.zoomLevel=lt(Fe(r.onZoomLevelChanged,a),(()=>{const e=r.get();return null!=e&&t.isValid(e)?r.getZoomLevel():1}),(e=>{const n=r.get();null!=n&&t.isValid(n)&&r.setZoomLevel(e)})),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,ct,{subscribe:Ae(s,xe((e=>new S(n).getValue(e,it.Camera,"zoomLevel"))),Te()),value(){const e=t.findByType("camera")[0];return null==e?1:new S(n).getValue(e,it.Camera,"zoomLevel")}},"f"),this.autoFit=lt(r.onZoomLevelChanged,(()=>{const e=r.get();return null!=e&&r.isZoomAutoFitEnabled(e)})),this.scrollPercentage={subscribe:Ae(this.clampResult.subscribe,xe((e=>e.scrollPercentage)),Te(i())),value:()=>this.clampResult.value().scrollPercentage},this.sceneSize={subscribe:Ae(De(this.clampResult.subscribe,dt(this,ct,"f").subscribe,this.settings.subscribe),xe((([e,t,r])=>{var n,o,i,a,s;const u=null!==(o=null!==(n=null==e?void 0:e.sceneSize)&&void 0!==n?n:this.clampResult.value().sceneSize)&&void 0!==o?o:{x:0,y:0},l=null!==(i=null!=t?t:dt(this,ct,"f").value())&&void 0!==i?i:10,c=null!==(s=null!==(a=null==r?void 0:r.pixelRatio)&&void 0!==a?a:this.settings.value().pixelRatio)&&void 0!==s?s:1;return{x:u.x*l/c,y:u.y*l/c}})),Te(i())),value:()=>{var e,t,r;const n=null!==(e=this.clampResult.value().sceneSize)&&void 0!==e?e:{x:0,y:0},o=null!==(t=dt(this,ct,"f").value())&&void 0!==t?t:10,i=null!==(r=this.settings.value().pixelRatio)&&void 0!==r?r:1;return{x:n.x*o/i,y:n.y*o/i}}},this.scroll=e=>{const r=t.findByType("camera")[0];if(null==r)return;const n=dt(this,ct,"f").value(),o=this.settings.value().pixelRatio,i=e.x*o/n,a=e.y*o/n,s={x:t.getPositionX(r)+i,y:t.getPositionY(r)+a};t.setPositionX(r,s.x),t.setPositionY(r,s.y)}}zoom(e,t=1){const r=Math.exp(.01*e*t),n=this.zoomLevel.value();this.zoomLevel.update(n*r)}}function pt(e,t,r){const n=e=>{x(t.setContext("")),e.preventDefault()},o=e=>{x(t.setContext("!canvas")),r&&r(),e.preventDefault()};return e.addEventListener("webglcontextlost",n,!1),e.addEventListener("webglcontextrestored",o,!1),()=>{e.removeEventListener("webglcontextlost",n),e.removeEventListener("webglcontextrestored",o)}}ct=new WeakMap;var ht=r(789),mt=r.n(ht);const gt=r.p+"assets/core/cesdk-v1.18.1-rc.0-d92fadafda0b5129818d.data",yt=r.p+"assets/core/cesdk-v1.18.1-rc.0-1590a3bd4a5562ec284b.wasm",vt=mt(),bt=!("undefined"==typeof window||!window.document||!window.document.createElement)&&navigator&&navigator.userAgent||"",wt=-1!==bt.indexOf("Edge"),Et=!!bt.match(/msie|trident/i),Ct=/\b(iPad|iPhone|iPod)\b/.test(bt)&&/WebKit/.test(bt)&&!/Edge/.test(bt)&&("undefined"==typeof window||!("MSStream"in window)),_t=(e,t)=>null!=t?[t,e.split("/").pop()].join(""):new URL(e,window.location.origin);function St(){try{return new WebAssembly.Memory({initial:xt(Ct?512:32),maximum:xt(2048)})}catch(e){return new WebAssembly.Memory({initial:xt(32),maximum:xt(2048)})}}function xt(e){return 1024*e*1024/65536}async function kt(e,t){const{core:r}=t,n=t.logger,o=_t(yt,r.baseURL).toString(),i=_t(gt,r.baseURL).toString(),a=/electron/i.test(navigator.userAgent)?await fetch(i,{credentials:"same-origin"}).then((e=>e.arrayBuffer())).then((e=>function(t,r){if(t!==i)return null;if(r===e.byteLength)return e;throw new Error(`Attempt to get preloaded package of unknown name or size: ${t} ${r}`)})):void 0;return new Promise(((r,s)=>{const u={getPreloadedPackage:a,locateFile:(e,t)=>e.endsWith(".wasm")?o:e.endsWith(".data")?i:t+e,print:e=>{e&&"undefined"!==e&&n(e,"Info")},printErr:e=>{e&&"undefined"!==e&&n(e,"Error")},logReadFiles:!1,printWithColors:!0,wasmMemory:St()};vt(u).then((async n=>{var o;n.specialHTMLTargets["!canvas"]=e,n.emscripten_ubq_settings_forceWebGL1=!!(null==t?void 0:t.forceWebGL1);const i=x(n.createEngine("!canvas",null!==(o=t.audioOutput)&&void 0!==o?o:"auto"));!function(e,t){var r,n;const o=new S(e),i=new ge(e),a=new M(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 Ye(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"))}()}(i,t),r(i)})).catch(s)}))}async function Tt(e){throw new Error(`Plugins are not supported yet, we are actively working on it: ${e}`)}class Pt{constructor(e,t){Object.defineProperty(this,"_reactor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_updateHandler",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"debugName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dirty",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"readCalls",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),this.debugName=t,this._reactor=e}dispose(){this._updateHandler=null,this._reactor._unregisterReaction(this),this._reactor=null}track(e){return this._reactor._trackReaction(this,e)}subscribe(e){return this._reactor._registerReaction(this),this._updateHandler=e,()=>{this._updateHandler=null,this._reactor._unregisterReaction(this)}}update(){var e;null===(e=this._updateHandler)||void 0===e||e.call(this)}}const At=Symbol("NO_VALUE");class Ft{constructor(e,t){Object.defineProperty(this,"callId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_readCurrentValue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.callId=e,this._value=t(),this._readCurrentValue=t}updateValueAndCheckDirty(){try{const e=this._readCurrentValue();return i()(this._value,e)?(this._value=e,!1):(this._value=e,!0)}catch(e){return this._value=At,!0}}update(e){this._readCurrentValue=e}}var Lt,Dt,Bt=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)},Rt=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};class Ot{constructor(){Object.defineProperty(this,"readCalls",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"readCache",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"registeredReactions",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,"activeReactions",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,"updatingDirtyReactions",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"wrapUpdateReactor",{enumerable:!0,configurable:!0,writable:!0,value:function(e){var t,r,n;if(Bt(this,Lt,"f")>10)throw new Error("Too many nested engine updates");const o=(Rt(this,Lt,(r=Bt(this,Lt,"f"),t=r++,r),"f"),t);o>1&&console.warn("wrapUpdateReactor: nested update detected",o);try{e(),this._updateDirtyReactions()}finally{if(Rt(this,Lt,(n=Bt(this,Lt,"f"),--n),"f")!==o)throw new Error("Unexpected engine update nesting")}}.bind(this)}),Lt.set(this,0),Dt.set(this,new Set)}_getterCalled(e,t){if(this.activeReactions.size<=0)return;const r=this._readThroughCache.bind(this,e,t);this.readCalls.has(e)?this.readCalls.get(e).update(r):this.readCalls.set(e,new Ft(e,r));for(const t of this.activeReactions)t.readCalls.add(e)}_setterCalled(){this._clearReadCache()}_readThroughCache(e,t){if(this.updatingDirtyReactions&&this.readCache.has(e))return this.readCache.get(e);const r=t();return this.readCache.set(e,r),r}createReaction(e){return new Pt(this,e)}_registerReaction(e){this.registeredReactions.add(e)}_unregisterReaction(e){this.registeredReactions.delete(e)}_clearReadCache(){this.readCache.clear()}_cleanupReadCalls(){const e=new Set;for(const t of this.registeredReactions)for(const r of t.readCalls)e.add(r);for(const[t]of this.readCalls)e.has(t)||this.readCalls.delete(t)}_updateDirtyReactions(){try{this.updatingDirtyReactions++,this._clearReadCache();const e=new Set;for(const[t,r]of this.readCalls)r.updateValueAndCheckDirty()&&e.add(t);if(e.size>0)for(const t of this.registeredReactions)for(const r of t.readCalls)if(e.has(r)){t.dirty=!0;break}for(const e of this.registeredReactions)if(!Bt(this,Dt,"f").has(e)&&e.dirty){Bt(this,Dt,"f").add(e);try{e.update()}finally{Bt(this,Dt,"f").delete(e)}e.dirty=!1}this._cleanupReadCalls()}finally{this.updatingDirtyReactions--}}_trackReaction(e,t){try{return this.activeReactions.add(e),e.readCalls.clear(),t()}finally{e.dirty=!1,this.activeReactions.delete(e)}}decorateFunction(e,t){return function(e,t,r=t.name){var n;null!==(n=l[r])&&void 0!==n||(l[r]=0);const o=l[r]++;return function(...n){const i=this,a=`${r}${o}-${JSON.stringify(n,null,0)}`;function s(){return Reflect.apply(t,i,n)}return e._getterCalled(a,s),e._readThroughCache(a,s)}}(this,e,t)}decorateObject(e){return function(e,t){var r,n;const o=null!==(n=null===(r=t.constructor)||void 0===r?void 0:r.name)&&void 0!==n?n:crypto.randomUUID(),i=[];let s=!1;const u=Object.getOwnPropertyNames(t.constructor.prototype).concat(Object.getOwnPropertyNames(t));for(const c of u){const d=t[c];if("function"==typeof(l=d)&&a in l)if("getter"===d[a].type){function f(...t){if(s)throw new Error("Disposed @getter proxy called");const r=this,n=`${o}-${c.toString()}-${JSON.stringify(t,null,0)}`;function i(){return Reflect.apply(d,r,t)}return e._getterCalled(n,i),e._readThroughCache(n,i)}const p=Object.hasOwnProperty.call(t,"fnName")?()=>{t[c]=d}:()=>delete t[c];i.push(p),t[c]=f}else if("setter"===d[a].type){function h(...t){if(s)throw new Error("Disposed @setter proxy called");return e._setterCalled(),Reflect.apply(d,this,t)}const m=Object.hasOwnProperty.call(t,"fnName")?()=>{t[c]=d}:()=>delete t[c];i.push(m),t[c]=h}}var l;return function(){s=!0;for(const e of i)e();i.length=0}}(this,e)}dispose(){this.registeredReactions.forEach((e=>e.dispose())),this.registeredReactions.clear(),this.readCalls.clear(),this.activeReactions.clear(),this.readCache.clear()}}function Mt(e,t){let r;return t.onStateChanged((()=>{const n=function(e,t){switch(e){case"Arrow":return"default";case"Move":return"move";case"MoveNotPermitted":return"auto";case"Resize":{const e=180*t/Math.PI+45;if(!Et&&!wt)return`url("data:image/svg+xml,%3Csvg style='transform: rotate(${e}deg)' width ='22' height ='22' viewBox ='0 0 22 22' fill ='none' xmlns ='http://www.w3.org/2000/svg'%3E%3Cg filter ='url(%23filter0_d)'%3E%3Cpath d ='M13.7 11.1L9.7 15.2L12.5 18H4V9.5L6.9 12.3L10.9 8.3L12.3 6.9L9.5 4H18V12.5L15.2 9.7L13.7 11.1Z' fill ='white'/%3E%3C/g%3E%3Cpath d ='M12.7 10.7L8.3 15.2L10.1 17H5V11.9L6.9 13.8L11.3 9.3L13.8 6.9L11.9 5H17V10.1L15.2 8.3L12.7 10.7Z' fill ='black'/%3E%3Cdefs%3E%3Cfilter id ='filter0_d' x ='0' y ='0' width ='22' height ='22' filterUnits ='userSpaceOnUse' color-interpolation-filters ='sRGB'%3E%3CfeFlood flood-opacity ='0' result ='BackgroundImageFix'/%3E%3CfeColorMatrix in ='SourceAlpha' type ='matrix' values ='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0'/%3E%3CfeOffset/%3E%3CfeGaussianBlur stdDeviation ='2'/%3E%3CfeColorMatrix type ='matrix' values ='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0'/%3E%3CfeBlend mode ='normal' in2 ='BackgroundImageFix' result ='effect1_dropShadow'/%3E%3CfeBlend mode ='normal' in ='SourceGraphic' in2 ='effect1_dropShadow' result ='shape'/%3E%3C/filter%3E%3C/defs%3E%3C/svg%3E") 12 12, pointer`;switch(e){case 90:case 270:return"nwse-resize";case 135:case 315:return"ns-resize";case 180:case 360:return"nesw-resize";case 225:return"ew-resize";default:return"move"}}case"Rotate":return'url("data:image/svg+xml,%3Csvg width=%2722%27 height=%2725%27 viewBox=%270 0 22 25%27 fill=%27none%27 xmlns=%27http://www.w3.org/2000/svg%27%3E%3Cg filter=%27url(%23filter0_d)%27%3E%3Cpath d=%27M18 11.1071C18 14.5637 15.5566 17.4515 12.3314 18.0846V20L7.20308 17.0145L12.3314 14.0289V15.7825C14.3292 15.1951 15.7946 13.3221 15.7946 11.107C15.7946 8.42285 13.6437 6.23908 11 6.23908C8.35629 6.23908 6.20542 8.42285 6.20542 11.107C6.20542 11.8299 6.35745 12.5252 6.65738 13.1736L4.66118 14.1255C4.22245 13.1771 4 12.1616 4 11.1071C4.00007 7.18825 7.1403 4 11.0001 4C14.8599 4 18 7.18825 18 11.1071Z%27 fill=%27black%27/%3E%3Cpath d=%27M12.8314 15.0559V14.0289V13.1593L12.0799 13.5968L6.95152 16.5824L6.20927 17.0145L6.95152 17.4466L12.0799 20.4321L12.8314 20.8696V20V18.4841C16.0889 17.6521 18.5 14.6573 18.5 11.1071C18.5 6.9193 15.1431 3.5 11.0001 3.5C6.85702 3.5 3.50008 6.91929 3.5 11.1071V11.1071C3.5 12.2334 3.73793 13.3206 4.20739 14.3354L4.41978 14.7946L4.8764 14.5768L6.8726 13.6249L7.31866 13.4122L7.11118 12.9637C6.84206 12.3819 6.70542 11.7584 6.70542 11.107C6.70542 8.69181 8.63956 6.73908 11 6.73908C13.3604 6.73908 15.2946 8.69181 15.2946 11.107C15.2946 12.8513 14.2837 14.3564 12.8314 15.0559Z%27 stroke=%27white%27/%3E%3C/g%3E%3Cdefs%3E%3Cfilter id=%27filter0_d%27 x=%270.0599999%27 y=%270.0599999%27 width=%2721.88%27 height=%2724.6193%27 filterUnits=%27userSpaceOnUse%27 color-interpolation-filters=%27sRGB%27%3E%3CfeFlood flood-opacity=%270%27 result=%27BackgroundImageFix%27/%3E%3CfeColorMatrix in=%27SourceAlpha%27 type=%27matrix%27 values=%270 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0%27/%3E%3CfeOffset/%3E%3CfeGaussianBlur stdDeviation=%271.47%27/%3E%3CfeColorMatrix type=%27matrix%27 values=%270 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0%27/%3E%3CfeBlend mode=%27normal%27 in2=%27BackgroundImageFix%27 result=%27effect1_dropShadow%27/%3E%3CfeBlend mode=%27normal%27 in=%27SourceGraphic%27 in2=%27effect1_dropShadow%27 result=%27shape%27/%3E%3C/filter%3E%3C/defs%3E%3C/svg%3E") 12 12, pointer';case"Text":return"text";default:return"auto"}}(t.getCursorType(),t.getCursorRotation());if(n!==r){r=n;const t=new CustomEvent("cesdk-cursor",{composed:!0,bubbles:!0,cancelable:!0,detail:n});e.dispatchEvent(t)&&e.style.setProperty("cursor",n)}}))}Lt=new WeakMap,Dt=new WeakMap;const jt=function(e,t,r){let n,o=null;const i=r.onStateChanged((()=>{n=r.getEditMode(),"Text"!==n||o?"Text"!==n&&o&&(o(),o=null):o=function(){let n=function o(){let i=!1,a="";if(null==e.parentElement)return console.warn('Could not attach hidden text input to the DOM: Canvas has no parentElement. This can happen if edit mode is switched to "Text", while the canvas is removed from the DOM.'),()=>{};const s=function(){const e=document.createElement("textarea");return e.id="ubq_internal-inline_text_editing_html_representation",e.setAttribute("data-cy","inline-text-editing-input"),e.autocapitalize="none",e.spellcheck=!1,e.cols=4096,e.style.contain="strict",e.style.opacity="0",e.style.pointerEvents="none",e.style.zIndex="-1",e.style.position="fixed",e.style.width="1px",e.style.height="1px",e.style.padding="0",e.style.margin="-1px",e.style.overflow="hidden",e.style.clip="rect(0, 0, 0, 0)",e.style.border="0",e}();l();const u=function(){const t=e.getRootNode();s.addEventListener("input",v),s.addEventListener("keydown",w),s.addEventListener("copy",h),s.addEventListener("cut",g),s.addEventListener("compositionstart",E),s.addEventListener("compositionend",C),s.addEventListener("beforeinput",T),s.addEventListener("focusout",P),t.addEventListener("touchend",k),t.addEventListener("mousedown",k),t.addEventListener("mouseup",S);const n=r.onStateChanged((()=>{l()}));return()=>{s.removeEventListener("input",v),s.removeEventListener("keydown",w),s.removeEventListener("copy",h),s.removeEventListener("cut",g),s.removeEventListener("compositionstart",E),s.removeEventListener("compositionend",C),s.removeEventListener("beforeinput",T),s.removeEventListener("focusout",P),t.removeEventListener("mousedown",k),t.removeEventListener("mouseup",S),t.removeEventListener("touchend",k),n()}}();return e.parentElement.appendChild(s),c(),()=>{u(),s.blur(),s.remove()};function l(){const t=r.getTextCursorPositionInScreenSpaceX(),n=r.getTextCursorPositionInScreenSpaceY(),{left:o,top:i}=e.getBoundingClientRect();s.style.left=`${o+t/window.devicePixelRatio}px`,s.style.top=`${i+n/window.devicePixelRatio}px`}function c(){null!==s.parentElement&&(s.focus(),s.getRootNode().activeElement===s||setTimeout((()=>s.focus()),0))}function d(){i=!1,n(),n=o()}function f(e){return[...e].length}function p(e){var t,r;const n=null!==(r=null!==(t=e.selectionEnd)&&void 0!==t?t:e.selectionStart)&&void 0!==r?r:0;return f(e.value.substring(0,n))}function h(e){try{t.useInternalAPI((t=>{const r=x(t.getSelectedText());""!==r&&e.clipboardData&&(e.clipboardData.setData("text/plain",r),e.preventDefault())}))}catch(e){console.error(e)}}function g(e){try{t.useInternalAPI((r=>{const n=x(r.getSelectedText());if(""!==n&&e.clipboardData){e.clipboardData.setData("text/plain",n),e.preventDefault();const r={key:m.Delete,characters:"",shiftIsHeld:!1,commandIsHeld:!1,optionIsHeld:!1,timestamp:Date.now()};t.execute("ubq/inputs/keyboardkey",r)}}))}catch(e){console.error(e)}}async function y(){return!(!i||t.ubq.unstable_isTextCursorInCompositionRange()||(await C(),0))}function v(e){const r=e.target,{value:n}=r;if(i){const e=p(s);t.execute("ubq/text/compositionUpdate",{value:n,cursorPosition:e})}else n.length>0&&(r.value="")}function b(e){const r={key:m.Unknown,characters:e,shiftIsHeld:!1,commandIsHeld:!1,optionIsHeld:!1,timestamp:Date.now()};t.execute("ubq/inputs/keyboardkey",r)}async function w(e){if(y(),1===e.key.length&&(a=e.key),"a"===e.key&&(e.metaKey||e.ctrlKey))return i&&C(),void await t.execute("ubq/text/selectAllText");if("Escape"===e.key)return void async function(){r.setEditMode("Transform")}();if("Backspace"!==e.key&&"Delete"!==e.key&&"ArrowLeft"!==e.key&&"ArrowRight"!==e.key&&"ArrowUp"!==e.key&&"ArrowDown"!==e.key&&"Enter"!==e.key)return;const n=function(e){const t={key:m.Unknown,characters:e.key,shiftIsHeld:e.shiftKey,commandIsHeld:e.metaKey||e.ctrlKey,optionIsHeld:e.altKey,timestamp:Date.now()};switch(e.key.toUpperCase()){case"0":t.key=m.Key0;break;case"1":t.key=m.Key1;break;case"2":t.key=m.Key2;break;case"3":t.key=m.Key3;break;case"4":t.key=m.Key4;break;case"5":t.key=m.Key5;break;case"6":t.key=m.Key6;break;case"7":t.key=m.Key7;break;case"8":t.key=m.Key8;break;case"9":t.key=m.Key9;break;case"A":t.key=m.A;break;case"B":t.key=m.B;break;case"C":t.key=m.C;break;case"D":t.key=m.D;break;case"E":t.key=m.E;break;case"F":t.key=m.F;break;case"G":t.key=m.G;break;case"H":t.key=m.H;break;case"I":t.key=m.I;break;case"J":t.key=m.J;break;case"K":t.key=m.K;break;case"L":t.key=m.L;break;case"M":t.key=m.M;break;case"N":t.key=m.N;break;case"O":t.key=m.O;break;case"P":t.key=m.P;break;case"Q":t.key=m.Q;break;case"R":t.key=m.R;break;case"S":t.key=m.S;break;case"T":t.key=m.T;break;case"U":t.key=m.U;break;case"V":t.key=m.V;break;case"W":t.key=m.W;break;case"X":t.key=m.X;break;case"Y":t.key=m.Y;break;case"Z":t.key=m.Z;break;case" ":t.key=m.Space;break;case"ESCAPE":t.key=m.Escape,t.characters="";break;case"BACKSPACE":t.key=m.Backspace,t.characters="";break;case"DELETE":t.key=m.Delete,t.characters="";break;case"ENTER":t.key=m.Enter,t.characters=t.shiftIsHeld?"\u2028":"\n";break;case"CONTROL":t.key=m.Control,t.characters="";break;case"ALT":t.key=m.Option,t.characters="";break;case"SHIFT":t.key=m.Shift,t.characters="";break;case"ARROWLEFT":t.key=m.ArrowLeft,t.characters="";break;case"ARROWRIGHT":t.key=m.ArrowRight,t.characters="";break;case"ARROWUP":t.key=m.ArrowUp,t.characters="";break;case"ARROWDOWN":t.key=m.ArrowDown,t.characters="";break;case"DEAD":t.key=m.Unknown,t.characters=""}return t}(e);await t.execute("ubq/inputs/keyboardkey",n),e.currentTarget&&(s.value="")}async function E(){i=!0,await t.execute("ubq/text/compositionStart")}async function C(){i?(i=!1,s.value="",d(),t.execute("ubq/text/compositionEnd")):s.value=""}async function _(){if(!i)return;if(t.ubq.update(),await y())return;const e=t.ubq.unstable_getCursorPosition(),r=t.ubq.unstable_getCompositionRange(),n=e.end-r.start,o=p(s);e.start>=r.start&&e.start<=1+r.end&&n!==o&&C()}async function S(){_()}async function k(t){_(),t.target===e&&"Text"===r.getEditMode()&&(c(),t.preventDefault())}async function T(e){if(i&&!e.isComposing&&C(),null===e.data)return;const r=e.target,n=e.data;if(await y())b(a);else if(i){const e=f(n);t.execute("ubq/text/compositionUpdate",{value:n,cursorPosition:e})}else n.length>0&&("\n"!==n[0]&&b(n),r.value="")}function P(t){var r;null!=(r=t.relatedTarget)&&r instanceof HTMLElement&&(r instanceof HTMLTextAreaElement||r instanceof HTMLInputElement&&r.type.match("^(text|number|url|email|search|tel)$")||r.isContentEditable)&&function(t){const r=new CustomEvent("cesdk-blur",{composed:!0,bubbles:!0,cancelable:!0,detail:t});return e.dispatchEvent(r)}(t.relatedTarget)||function(t){const r=new CustomEvent("cesdk-refocus",{composed:!0,bubbles:!0,cancelable:!0,detail:t.relatedTarget}),n=e.dispatchEvent(r);n&&c()}(t)}}();return()=>{null==n||n()}}()}));return()=>{null==o||o(),i()}};function It(e,t){const r=[],n=t=>{var r,n;const o=e.getBoundingClientRect(),i=null!==(r=null==o?void 0:o.top)&&void 0!==r?r:0,a=null!==(n=null==o?void 0:o.left)&&void 0!==n?n:0;return{position:{x:(t.clientX-a)*window.devicePixelRatio,y:(t.clientY-i)*window.devicePixelRatio},isTouch:!1,timestamp:t.timeStamp}},o=e=>{if("touch"===e.pointerType)return;const r=n(e);t.execute("ubq/inputs/mousemove",r)},i=e=>{if("touch"===e.pointerType)return;const o=Object.assign(Object.assign({},n(e)),{button:Ut(e.button),state:h.Up,shiftIsHeld:!!e.shiftKey});r[e.button]=!1,e.currentTarget.releasePointerCapture(e.pointerId),t.execute("ubq/inputs/mousebutton",o),t.ubq.update()},a=e=>{if("touch"===e.pointerType)return;const o=Object.assign(Object.assign({},n(e)),{button:Ut(e.button),state:h.Down,shiftIsHeld:!!e.shiftKey});r[e.button]=!0,e.currentTarget.setPointerCapture(e.pointerId),t.execute("ubq/inputs/mousebutton",o)},s=e=>{if("touch"===e.pointerType)return;const o=Object.assign(Object.assign({},n(e)),{shiftIsHeld:!!e.shiftKey});r.forEach(((e,r)=>{if(e){const e=Object.assign(Object.assign({},o),{button:r,state:h.Up});t.execute("ubq/inputs/mousebutton",e)}})),r.length=0},u=e=>{e.cancelable&&e.preventDefault()};return e.addEventListener("pointerdown",a),e.addEventListener("pointerup",i),e.addEventListener("pointercancel",i),e.addEventListener("pointermove",o),e.addEventListener("lostpointercapture",s),e.addEventListener("touchmove",u,{passive:!1}),()=>{e.removeEventListener("pointerdown",a),e.removeEventListener("pointerup",i),e.removeEventListener("pointercancel",i),e.removeEventListener("pointermove",o),e.removeEventListener("lostpointercapture",s),e.removeEventListener("touchmove",u),e=null}}function Ut(e){switch(e){case 0:return p.Left;case 1:return p.Middle;case 2:return p.Right;default:return p.Unknown}}class qt{constructor(){Object.defineProperty(this,"active",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"enableDebug",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"timestamp",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"baseTouches",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"touches",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"currentTransform",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"touchstart",{enumerable:!0,configurable:!0,writable:!0,value:e=>{this.touchAddRemove(e),this.timestamp=e.timeStamp,this.process("touchstart")}}),Object.defineProperty(this,"touchend",{enumerable:!0,configurable:!0,writable:!0,value:e=>{this.touchAddRemove(e),this.timestamp=e.timeStamp,this.process("touchend")}}),Object.defineProperty(this,"touchcancel",{enumerable:!0,configurable:!0,writable:!0,value:e=>{this.touchAddRemove(e),this.timestamp=e.timeStamp,this.process("touchcancel")}}),Object.defineProperty(this,"touchmove",{enumerable:!0,configurable:!0,writable:!0,value:e=>{this.touchUpdate(e),this.timestamp=e.timeStamp,this.process("touchmove")}}),Object.defineProperty(this,"debugState",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"handlers",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),this.currentTransform=this.emptyTransform()}touchAddRemove(e){const t=new Array(e.touches.length);for(let r=0;r<e.touches.length;r++){const n=e.touches.item(r);t[r]=$t(n)}this.touches=t}touchUpdate(e){for(let t=0;t<e.touches.length;t++){const r=e.touches.item(t),n=this.touches.find((e=>e.identifier===r.identifier));if(!n)return;n.x=r.clientX,n.y=r.clientY}}listen(e){return e.addEventListener("touchstart",this.touchstart),e.addEventListener("touchend",this.touchend),e.addEventListener("touchcancel",this.touchcancel),e.addEventListener("touchmove",this.touchmove),()=>{e.removeEventListener("touchstart",this.touchstart),e.removeEventListener("touchend",this.touchend),e.removeEventListener("touchcancel",this.touchcancel),e.removeEventListener("touchmove",this.touchmove)}}debug(){var e,t,r,n,o,i,a,s;if(!this.enableDebug)return;const u=JSON.stringify(this.currentTransform);function l(e,[t,r,n],o){const i=document.createElement("div");return i.style.position="fixed",i.style.top="-25px",i.style.left="-25px",i.style.width="50px",i.style.height="50px",i.style.border=`3px ${o} rgb(${t},${r},${n})`,i.style.borderRadius="50%",i.style.borderStyle=o,i.style.backgroundColor=`rgba(${t},${r},${n}, 0.5)`,i.style.transformOrigin="center",i.style.textAlign="center",i.innerHTML=e,i.style.display="none",document.body.appendChild(i),i}this.debugState||(this.debugState={touches:[l("T1",[218,212,104],"solid"),l("T2",[218,212,104],"solid")],value:this.debugValueDiv(void 0,u,this.touches,[218,212,104]),baseTouches:[l("B1",[128,128,128],"solid"),l("B2",[128,128,128],"solid")]}),this.debugState.touches[0].style.display=this.touches[0]?"block":"none",this.debugState.touches[1].style.display=this.touches[1]?"block":"none",this.debugState.baseTouches[0].style.display=this.baseTouches[0]?"block":"none",this.debugState.baseTouches[1].style.display=this.baseTouches[1]?"block":"none",this.touches[0]&&(this.debugState.touches[0].style.transform=`translate(${null===(e=this.touches[0])||void 0===e?void 0:e.x}px, ${null===(t=this.touches[0])||void 0===t?void 0:t.y}px)`),this.touches[1]&&(this.debugState.touches[1].style.transform=`translate(${null===(r=this.touches[1])||void 0===r?void 0:r.x}px, ${null===(n=this.touches[1])||void 0===n?void 0:n.y}px)`),this.baseTouches[0]&&(this.debugState.baseTouches[0].style.transform=`translate(${null===(o=this.baseTouches[0])||void 0===o?void 0:o.x}px, ${null===(i=this.baseTouches[0])||void 0===i?void 0:i.y}px)`),this.baseTouches[1]&&(this.debugState.baseTouches[1].style.transform=`translate(${null===(a=this.baseTouches[1])||void 0===a?void 0:a.x}px, ${null===(s=this.baseTouches[1])||void 0===s?void 0:s.y}px)`),this.debugState.value=this.debugValueDiv(this.debugState.value,u,this.touches)}debugValueDiv(e,t,r,n){if(!e){const[t,r,o]=null!=n?n:[128,128,128];(e=document.createElement("div")).style.position="fixed",e.style.top="50px",e.style.left="50px",e.style.width="300px",e.style.height="100px",e.style.border=`3px solid rgb(${t},${r},${o})`,e.style.borderStyle="dashed",e.style.backgroundColor=`rgba(${t},${r},${o}, 0.5)`,e.style.transformOrigin="center",e.style.overflow="visible",e.style.textOverflow="visible",e.style.display="none",document.body.appendChild(e)}return this.active?e.style.borderStyle="solid":e.style.borderStyle="dashed",0===r.length?(e.style.display="none",e):(e.style.display="block",e.innerHTML=t,e)}resetBaseTouches(){this.baseTouches=this.touches.map($t)}process(e){if("touchcancel"===e)return this.resetBaseTouches(),this.reset(),this.debug(),void this.emit(E.Ended);"touchstart"!==e&&"touchend"!==e||(this.resetBaseTouches(),this.debug()),!this.active&&this.shouldStart()&&(this.active=!0,this.emit(E.Began)),"touchmove"===e&&(this.currentTransform=this.calculateTransform(),this.active&&this.emit(E.Changed)),this.debug(),this.active&&this.shouldStop()&&(this.active=!1,this.emit(E.Ended),this.reset())}shouldStart(){return 2===this.touches.length}shouldStop(){return 2!==this.touches.length}emit(e){const t={timestamp:this.timestamp,state:e,touchPoints:this.touches},r=this.makeEvent(t);for(const e of this.handlers)e(r)}addListener(e){return this.handlers.add(e),()=>{this.handlers.delete(e)}}reset(){this.active=!1,this.currentTransform=this.emptyTransform()}}function $t(e){if(null!=e)return e instanceof Touch?{identifier:e.identifier,x:e.clientX,y:e.clientY}:{identifier:e.identifier,x:e.x,y:e.y}}class Ht extends qt{makeEvent(e){const t=e.state===E.Began?{x:0,y:0}:this.currentTransform;return Object.assign(Object.assign({},e),{panDistance:t})}calculateTransform(){const e=Wt(this.touches),t=Wt(this.baseTouches);return{x:e.x-t.x,y:e.y-t.y}}emptyTransform(){return{x:0,y:0}}shouldStart(){return super.shouldStart()&&Vt(this.calculateTransform())>Ht.PAN_THRESHOLD}}Object.defineProperty(Ht,"PAN_THRESHOLD",{enumerable:!0,configurable:!0,writable:!0,value:10});const Nt=Ht;function Vt(e){return Math.sqrt(e.x**2+e.y**2)}function Wt(e){let t=0,r=0;for(let n=0;n<e.length;n++){const o=e[n];t+=o.x,r+=o.y}return t/=e.length,r/=e.length,{x:t,y:r}}class zt extends qt{makeEvent(e){return Object.assign(Object.assign({},e),{scale:this.currentTransform})}calculateTransform(){const e=this.baseTouches,t=this.touches;if(2!==e.length||2!==t.length)return 1;const r=Math.sqrt(Math.pow(e[0].x-e[1].x,2)+Math.pow(e[0].y-e[1].y,2));return Math.sqrt(Math.pow(t[0].x-t[1].x,2)+Math.pow(t[0].y-t[1].y,2))/r}emptyTransform(){return 1}shouldStart(){return super.shouldStart()&&Math.abs(this.calculateTransform()-1)>zt.PINCH_THRESHOLD}}Object.defineProperty(zt,"PINCH_THRESHOLD",{enumerable:!0,configurable:!0,writable:!0,value:.2});const Gt=zt;class Yt extends qt{constructor(){super(...arguments),Object.defineProperty(this,"lastPosition",{enumerable:!0,configurable:!0,writable:!0,value:{x:0,y:0}}),Object.defineProperty(this,"previousNumTouches",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"fingerDownTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"tapDetected",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"tapLocation",{enumerable:!0,configurable:!0,writable:!0,value:{x:0,y:0}})}makeEvent(e){const t=this.tapDetected?this.tapLocation:e.touchPoints[0];return e.state===E.Began?(this.lastPosition=t,{button:p.Left,state:h.Down,position:t,shiftIsHeld:!1,isTouch:!0,timestamp:e.timestamp}):e.state===E.Ended?{button:p.Left,state:h.Up,position:null!=t?t:this.lastPosition,shiftIsHeld:!1,isTouch:!0,timestamp:e.timestamp}:(this.lastPosition=t,{position:t,isTouch:!0,timestamp:e.timestamp})}process(e){if("touchstart"===e||"touchend"===e){this.tapDetected=!1;const e=1===this.touches.length&&0===this.previousNumTouches,t=0===this.touches.length&&1===this.previousNumTouches;e&&(this.fingerDownTimestamp=performance.now(),this.tapLocation=this.touches[0]),t&&performance.now()-this.fingerDownTimestamp<Yt.TAP_MAX_TIME&&(this.tapDetected=!0),this.previousNumTouches=this.touches.length}super.process(e)}calculateTransform(){if(0===this.touches.length||0===this.baseTouches.length)return{x:0,y:0};const e=this.touches[0],t=this.baseTouches[0];return{x:e.x-t.x,y:e.y-t.y}}emptyTransform(){return{x:0,y:0}}shouldStart(){return this.tapDetected||1===this.touches.length&&Vt(this.calculateTransform())>Yt.DISTANCE_THRESHOLD}shouldStop(){return 1!==this.touches.length}}Object.defineProperty(Yt,"DISTANCE_THRESHOLD",{enumerable:!0,configurable:!0,writable:!0,value:5}),Object.defineProperty(Yt,"TAP_MAX_TIME",{enumerable:!0,configurable:!0,writable:!0,value:250});const Xt=Yt;class Kt extends qt{makeEvent(e){return Object.assign(Object.assign({},e),{rotation:this.currentTransform})}calculateTransform(){const e=this.baseTouches,t=this.touches;if(e.length<2||t.length<2)return 0;const r=Math.atan2(e[1].y-e[0].y,e[1].x-e[0].x);return Math.atan2(t[1].y-t[0].y,t[1].x-t[0].x)-r}emptyTransform(){return 0}shouldStart(){return super.shouldStart()&&Math.abs(this.calculateTransform())>Kt.ROTATE_THRESHOLD}}Object.defineProperty(Kt,"ROTATE_THRESHOLD",{enumerable:!0,configurable:!0,writable:!0,value:.1});const Qt=Kt;function Zt(e,t){const r=[],n=new Xt;r.push(n.listen(e)),r.push(n.addListener((r=>{"button"in r?t.execute("ubq/inputs/mousebutton",Jt(e,r)):t.execute("ubq/inputs/mousemove",Jt(e,r))})));const o=new Nt;r.push(o.listen(e)),r.push(o.addListener((r=>{t.execute("ubq/inputs/touchpan",Jt(e,r))})));const i=new Gt;r.push(i.listen(e)),r.push(i.addListener((r=>{t.execute("ubq/inputs/touchpinch",Jt(e,r))})));const a=new Qt;return r.push(a.listen(e)),r.push(a.addListener((r=>{t.execute("ubq/inputs/touchrotate",Jt(e,r))}))),()=>{r.forEach((e=>e()))}}function Jt(e,t){var r;const n=null!==(r=window.devicePixelRatio)&&void 0!==r?r:1,{top:o,left:i}=e.getBoundingClientRect();if(1===n&&0===o&&0===i)return t;const a=e=>({x:(e.x-i)*n,y:(e.y-o)*n});if("position"in t)return Object.assign(Object.assign({},t),{position:a(t.position)});const s=t.touchPoints.map(a);return"panDistance"in t?Object.assign(Object.assign({},t),{touchPoints:s,panDistance:a(t.panDistance)}):Object.assign(Object.assign({},t),{touchPoints:s})}function er(e,t,r=Number.EPSILON){return Math.abs(e-t)<r}async function tr(e,t,r,n,o={},i){var a,s;let u,l,c=0,d=null;const f=null!==(a=null==i?void 0:i.visibility)&&void 0!==a?a:rr;globalThis.ubq_exportVideoTimeout=null==i?void 0:i.inactivityTimeout;const p=f.subscribe((()=>{null!==d&&(d=Date.now()),globalThis.ubq_browserTabHidden=!f.value()}));let h=null;function m(){clearTimeout(l),p(),null==h||h()}try{const a=new OffscreenCanvas(64,64),p=await kt(a,Object.assign(Object.assign({},e),{audioOutput:"none"})),g=new _e(p),y=new fe(p),v=new ge(p);h=()=>{p.delete()},function(e,t){for(const[r,n]of t)switch(e.getSettingType(r)){case"Bool":e.setSettingBool(r,n);break;case"Int":e.setSettingInt(r,n);break;case"Float":e.setSettingFloat(r,n);break;case"String":e.setSettingString(r,n);break;case"Color":e.setSettingColor(r,n);break;case"Enum":e.setSettingEnum(r,n)}}(v,t);const b=await Promise.all(r.map((e=>Tt(e)))),w={block:y,scene:g,editor:v};for(const e of b)null===(s=e.initialize)||void 0===s||s.call(e,w);const E=await g.loadFromString(n),C=y.getTotalSceneDuration(g.get());!function e(){if(!0===f.value()&&null!==d&&Date.now()-d>1e4)u(new Error("Video export timed out due to inactivity."));else{if(c<10){for(const e of b)e.update(w);p.update()}l=setTimeout(e,1)}}();const _=await new Promise(((t,r)=>{var n,a,s,l,f,h,m,g,y;u=r,null===(n=e.abortSignal)||void 0===n||n.addEventListener("abort",(()=>{r(new Error("AbortSignal received"))})),p.exportVideoToBuffer(null!==(a=o.block)&&void 0!==a?a:E,null!==(s=o.timeOffset)&&void 0!==s?s:0,null!==(l=o.duration)&&void 0!==l?l:C,se.Mp4,((e,t,r)=>{var n;c=e-t,d=Date.now(),null===(n=null==i?void 0:i.onProgress)||void 0===n||n.call(i,e,t,r)}),(e=>{"error"in e?r(e.error):t(e)}),{h264Profile:null!==(f=o.h264Profile)&&void 0!==f?f:77,h264Level:null!==(h=o.h264Level)&&void 0!==h?h:52,framerate:null!==(m=o.framerate)&&void 0!==m?m:30,useTargetSize:void 0!==o.width&&void 0!==o.height,targetWidth:null!==(g=o.width)&&void 0!==g?g:0,targetHeight:null!==(y=o.height)&&void 0!==y?y:0})}));return m(),_}catch(e){throw m(),e}}globalThis.ubq_browserTabHidden=!0;const rr={value:()=>"undefined"==typeof document||"visible"===document.visibilityState,subscribe(e){if("undefined"==typeof document)return()=>{};{const t=()=>{e("visible"===document.visibilityState)};return document.addEventListener("visibilitychange",t),()=>{document.removeEventListener("visibilitychange",t)}}}};var nr;!function(e){e.start=function(e){return Object.assign(Object.assign({},e),{msg:"exportVideo"})},e.abort=function(){return{msg:"exportVideoAbort"}},e.finished=function(e){return Object.assign(Object.assign({},e),{msg:"exportVideoFinished"})},e.error=function(e){return Object.assign(Object.assign({},e),{msg:"exportVideoError"})},e.progress=function(e){return Object.assign(Object.assign({},e),{msg:"exportVideoProgress"})},e.log=function(e){return Object.assign(Object.assign({},e),{msg:"exportLog"})}}(nr||(nr={}));class or{constructor(e,t){Object.defineProperty(this,"makeWorker",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"configuration",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.configuration=t,this.makeWorker=e}exportVideo(e,t,r,n,o){const{abortSignal:i,inactivityTimeout:a}=null!=o?o:{},s=this.makeWorker(),u=function(e){return{baseURL:e.baseURL,license:e.license,core:e.core,presets:e.presets,featureFlags:e.featureFlags,forceWebGL1:e.forceWebGL1,audioOutput:e.audioOutput,extensions:e.extensions}}(this.configuration),l=new Promise(((e,t)=>{if(s.onmessage=({data:r})=>{if("exportVideoFinished"===r.msg){const t=new Blob([r.data],{type:r.mimeType});e(t)}else"exportVideoError"===r.msg?t(r.error):"exportVideoProgress"===r.msg||("exportLog"===r.msg?this.configuration.logger(r.message,r.logLevel):console.error("Unknown message received ",r))},i){let e=!1;const t=()=>{e||(e=!0,s.postMessage(nr.abort()))};i.addEventListener("abort",t,{once:!0})}}));s.postMessage(nr.start({sceneString:e,engineSettings:t,pluginURLs:r,config:u,exportOptions:n,inactivityTimeout:a}));const c=()=>{s.postMessage({msg:"setVisibility",visible:"visible"===document.visibilityState})};return document.addEventListener("visibilitychange",c),l.finally((()=>{s.terminate(),document.removeEventListener("visibilitychange",c)})),l}}var ir,ar,sr,ur,lr,cr,dr,fr,pr,hr,mr,gr,yr,vr,br,wr,Er,Cr,_r,Sr,xr,kr,Tr,Pr,Ar=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},Fr=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 Lr{constructor(e,r,n){ir.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}),ar.set(this,void 0),Object.defineProperty(this,"reactor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),sr.set(this,void 0),ur.set(this,void 0),lr.set(this,void 0),cr.set(this,void 0),dr.set(this,[]),fr.set(this,[]),pr.set(this,void 0),hr.set(this,[]),yr.set(this,[]),br.set(this,void 0),_r.set(this,t()(function(){Fr(this,ir,"m",kr).call(this)}.bind(this),100,{leading:!0,trailing:!1})),Sr.set(this,void 0),Ar(this,pr,e,"f"),Ar(this,ur,new S(e),"f"),this.asset=new M(e),this.block=new fe(e),this.editor=new ge(e),this.event=new be(e),this.scene=new _e(e),this.variable=new Ye(e),Ar(this,ar,new We(this.editor),"f");const o=new Ot;this.reactor=o;const i=[this.reactor.decorateObject(Fr(this,ur,"f")),this.reactor.decorateObject(this.block),this.reactor.decorateObject(this.editor),this.reactor.decorateObject(this.scene)],a=this.wrapUpdate(o.wrapUpdateReactor);Fr(this,hr,"f").push((()=>{i.forEach((e=>e())),a(),this.reactor.dispose()})),this.block.exportVideo=function(e,t,r){return async(n,o,i,a)=>{const s=t.scene.get();if(null==s||!t.block.isValid(s))throw new Error("No valid scene available.");const u=await t.scene.saveToString(),l=function(e){const t=new Map,r=e.findAllSettings();for(const n of r)switch(e.getSettingType(n)){case"Bool":t.set(n,e.getSettingBool(n));break;case"Int":t.set(n,e.getSettingInt(n));break;case"Float":t.set(n,e.getSettingFloat(n));break;case"String":t.set(n,e.getSettingString(n));break;case"Color":t.set(n,e.getSettingColor(n));break;case"Enum":t.set(n,e.getSettingEnum(n))}return t}(t.editor),c=t.settings.unstable_workerFactory.value(),d=t.settings.unstable_videoExportInactivityTimeout.value();return c?new or(c,e).exportVideo(u,l,r,a,{abortSignal:a.abortSignal,inactivityTimeout:d}):tr(a.abortSignal?Object.assign(Object.assign({},e),{abortSignal:a.abortSignal}):e,l,r,u,Object.assign({block:n,width:a.targetWidth,height:a.targetHeight},a),{onProgress:i,inactivityTimeout:d}).then((e=>new Blob([e],{type:se.Mp4})))}}(n,{block:this.block,scene:this.scene,editor:this.editor,settings:Fr(this,ar,"f")},Fr(this,dr,"f")),"getInternalCanvas"in r?(Ar(this,lr,r.getInternalCanvas(),"f"),Ar(this,cr,r,"f")):Ar(this,lr,r,"f"),Ar(this,sr,new ft(this),"f"),Fr(this,ir,"m",wr).call(this),"undefined"!=typeof window&&window.Cypress&&(this.config=n,this.helper=Fr(this,ur,"f"))}async unstable_addPlugin(e){Fr(this,dr,"f").push(e);const t=await Tt(e),r={block:this.block,scene:this.scene,editor:this.editor};t.initialize&&t.initialize(r),Fr(this,fr,"f").push(t)}unstable_setWorkerFactory(e){Fr(this,ar,"f").unstable_workerFactory.update(e)}unstable_setVideoExportInactivityTimeout(e){Fr(this,ar,"f").unstable_videoExportInactivityTimeout.update(e)}wrapUpdate(e){return Fr(this,yr,"f").push(e),()=>{const t=Fr(this,yr,"f").indexOf(e);-1!==t&&Fr(this,yr,"f").splice(t,1)}}get element(){return Fr(this,cr,"f")}dispose(){var e;Fr(this,hr,"f").forEach((e=>e())),Fr(this,ir,"m",xr).call(this),this.asset.dispose(),Ar(this,lr,null,"f"),null===(e=Fr(this,cr,"f"))||void 0===e||e.dispose(),Ar(this,cr,void 0,"f"),Ar(this,ur,null,"f"),this.block=null,this.scene=null,this.variable=null,this.asset=null,this.editor=null,this.event=null,Fr(this,yr,"f").length=0,Fr(this,pr,"f").delete(),Ar(this,pr,null,"f")}static async init(e,t){let r=function(e,t){return r(null==t?void 0:t.canvas)?null==t?void 0:t.canvas:r(e)?(console.warn("Passing an existing HTMLCanvasElement as a second parameter to CreativeEngine.init() is deprecated. Use the element property on the CreativeEngine instance to access a fully managed canvas to append into the DOM instead. For more information, have a look into our documentation at https://img.ly/docs/cesdk/next/engine/quickstart/#initialization."),e):void 0;function r(e){return"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement}}(t,e);let n;var o,i;console.log("[CreativeEngine] Revision c769d097b1bf65316a9422b08e5c754789a29bfd"),r||(customElements.get("cesdk-canvas")||customElements.define("cesdk-canvas",(i=class extends HTMLElement{constructor(){super(),o.set(this,void 0),rt(this,o,document.createElement("canvas"),"f");const e=document.createElement("style");e.textContent=":host {display: block; width: 100%; height: 100%; contain: content;} canvas {position: absolute; inset: 0; width: 100%; height:100%; display: block; touch-action: none;}",this.attachShadow({mode:"closed"}).append(e,nt(this,o,"f"))}getInternalCanvas(){if(!nt(this,o,"f"))throw new Error("Internal canvas element is undefined");return nt(this,o,"f")}dispose(){var e;null===(e=nt(this,o,"f"))||void 0===e||e.remove(),rt(this,o,void 0,"f")}clear(){if(!nt(this,o,"f"))return;const e=nt(this,o,"f").width;nt(this,o,"f").width=1,nt(this,o,"f").width=e}},o=new WeakMap,i)),n=document.createElement("cesdk-canvas"),r=n.getInternalCanvas());const a=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),s=function(e={},t="https://cdn.img.ly/packages/imgly/cesdk-engine/1.18.1-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({},Qe),logger:null!==(a=e.logger)&&void 0!==a?a:Ke,presets:null!==(s=e.presets)&&void 0!==s?s:{}});return null!==(u=(c=f.extensions).baseURL)&&void 0!==u||(c.baseURL=Qe.baseURL),null!==(l=(d=f.extensions).entries)&&void 0!==l||(d.entries=Object.assign({},Qe.entries)),f.baseURL=Ze(f.baseURL),f.baseURL=Je(f.baseURL),f.core.baseURL=Ze(f.core.baseURL,f.baseURL),f.core.baseURL=Je(f.core.baseURL),f.extensions.baseURL=Je(f.extensions.baseURL),f.extensions.entries=f.extensions.entries.map((e=>Je(e))),f}(a);if(!function(e){return!0===(null==e?void 0:e._skipConfigWarnings)}(e))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))s.logger(t,"Warning");const u=new this(await kt(r,s),null!=n?n:r,s);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,u),u}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 et(o,t,n,e)}(this.asset,e,t)}async addDemoAssetSources({baseURL:e="https://cdn.img.ly/assets/demo/v1",excludeAssetSourceIds:t=[],sceneMode:r="Design",withUploadAssetSources:n=!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 et(d,a,i,e)}(this.asset,this.scene,t,r,n,void 0,e)}get _ubq(){return Fr(this,pr,"f")}get _camera(){return Fr(this,sr,"f")}get _helper(){return Fr(this,ur,"f")}}ar=new WeakMap,sr=new WeakMap,ur=new WeakMap,lr=new WeakMap,cr=new WeakMap,dr=new WeakMap,fr=new WeakMap,pr=new WeakMap,hr=new WeakMap,yr=new WeakMap,br=new WeakMap,_r=new WeakMap,Sr=new WeakMap,ir=new WeakSet,mr=function(){if(!Fr(this,cr,"f"))return;const e=Fr(this,cr,"f").getInternalCanvas(),t=e.getBoundingClientRect();if(0===t.width||0===t.height)return;const r="undefined"!=typeof window?window.devicePixelRatio:1,n=t.width*r,o=t.height*r;e.width!==n&&(e.width=n),e.height!==o&&(e.height=o)},gr=function(){const{width:e,height:t}=Fr(this,lr,"f"),r="undefined"!=typeof window?window.devicePixelRatio:1,{height:n,width:o,pixelRatio:i}=Fr(this,sr,"f").settings.value();er(o,e,1e-4)&&er(n,t,1e-4)&&er(i,r,1e-4)||Fr(this,sr,"f").settings.update({height:t,width:e,pixelRatio:window.devicePixelRatio})},vr=function(){return e=>{Fr(this,yr,"f").reduce(((e,t)=>function(){let r=!1;if(t((function(){r=!0,e()})),!r)throw new Error(`Wrapper did not call update: ${t.toString()}`)}),Fr(this,ir,"m",kr).bind(this,e))()}},wr=function(e=!0){Fr(this,ir,"m",Er).call(this,e),Fr(this,ir,"m",Cr).call(this)},Er=function(e=!0){let t=0;if(Fr(this,br,"f"))return;const r=()=>{const n=Fr(this,ir,"m",vr).call(this);Ar(this,br,requestAnimationFrame(r),"f");try{n(e),t=0}catch(e){throw t++,t>=10&&(console.error("Repeated exceptions in update loop. Stopping loop."),Fr(this,ir,"m",xr).call(this)),e}};Ar(this,br,requestAnimationFrame(r),"f")},Cr=function(){var e,t;if(t=Fr(this,lr,"f"),!("undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement))return;const r=null!==(e=Fr(this,cr,"f"))&&void 0!==e?e:Fr(this,lr,"f"),n=[It(r,Fr(this,ur,"f")),jt(r,Fr(this,ur,"f"),this.editor),Mt(r,this.editor),Zt(r,Fr(this,ur,"f")),pt(Fr(this,lr,"f"),Fr(this,pr,"f"),(()=>{Fr(this,lr,"f").width=Fr(this,lr,"f").width})),ot(r,Fr(this,_r,"f"))];Ar(this,Sr,(()=>{n.reverse().forEach((e=>e()))}),"f")},xr=function(){var e;null===(e=Fr(this,Sr,"f"))||void 0===e||e.call(this),Ar(this,Sr,void 0,"f"),Fr(this,br,"f")&&(cancelAnimationFrame(Fr(this,br,"f")),Ar(this,br,0,"f"))},kr=function(e=!0){for(const e of Fr(this,fr,"f"))e.update(this);e&&1===this.block.findByType("scene").length&&Fr(this,ir,"m",Tr).call(this),Fr(this,ir,"m",mr).call(this),Fr(this,ir,"m",gr).call(this),Fr(this,pr,"f").update()},Tr=function(){if(Fr(this,sr,"f").clampCamera){const e={sceneSize:{x:0,y:0},scrollPercentage:{x:NaN,y:NaN}};Fr(this,ur,"f").execute("cesdk/clampCameraAndRender",{horizontalPaddingInPixels:this._camera.viewportPadding.value().x,verticalPaddingInPixels:this._camera.viewportPadding.value().y}).then((e=>{i()(Fr(this,sr,"f").clampResult.value(),e)||Fr(this,sr,"f").clampResult.update(e)}),(()=>{i()(Fr(this,sr,"f").clampResult.value(),e)||Fr(this,sr,"f").clampResult.update(e)}))}else Fr(this,ur,"f").execute("ubq/render")},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"}(Pr||(Pr={}));const Dr=Pr,Br=function(){try{if("object"==typeof WebAssembly&&"function"==typeof WebAssembly.instantiate){const e=new WebAssembly.Module(Uint8Array.of(0,97,115,109,1,0,0,0));if(e instanceof WebAssembly.Module)return new WebAssembly.Instance(e)instanceof WebAssembly.Instance}}catch(e){return console.error(e),!1}return!1};async function Rr(){if("undefined"==typeof window)throw new Error("Window is undefined");if(!("VideoFrame"in window&&"VideoDecoder"in window&&"VideoEncoder"in window))throw new Error("Missing required web video APIs");const e={codec:"avc1.4D0034",width:1920,height:1080,avc:{format:"annexb"},framerate:30};if(!await VideoEncoder.isConfigSupported(e))throw new Error("Encoder config not supported");const t=new OffscreenCanvas(e.width,e.height),r=t.getContext("webgl2");if(!r)throw new Error("Could not create WebGL2 context");r.clearColor(1,0,1,1),r.clear(r.COLOR_BUFFER_BIT);const n=new Promise(((e,t)=>{setTimeout((()=>{t(new Error("Timed out during video export"))}),1e4)})),o=new Promise(((r,n)=>{const o=new VideoEncoder({output:()=>r(!0),error:e=>n(e)});o.configure(e);const i=new VideoFrame(t,{timestamp:0});o.encode(i,{keyFrame:!0}),i.close(),o.flush().then((()=>{"closed"!==o.state&&o.close()}))}));return Promise.race([o,n])}async function Or(){if("undefined"==typeof window)throw new Error("Window is undefined");if(!("AudioDecoder"in window)||!("AudioEncoder"in window))throw new Error("Missing required web audio APIs");const e={codec:"mp4a.40.02",sampleRate:48e3,numberOfChannels:2,bitrate:128e3};if(!await AudioEncoder.isConfigSupported(e))throw new Error("Encoder config not supported");const t=new Promise(((e,t)=>{setTimeout((()=>{t(new Error("Timed out during audio export"))}),1e4)})),r=new Promise(((t,r)=>{const n=new AudioEncoder({output:()=>t(!0),error:r});n.configure(e);const o=1024,i=new Float32Array(o*e.numberOfChannels);for(let e=0;e<o;++e){const t=e/o;i[2*e+0]=Math.sin(880*Math.PI*t),i[2*e+1]=Math.sin(888*Math.PI*t)}const a=new AudioData({format:"f32",sampleRate:e.sampleRate,numberOfFrames:o,numberOfChannels:e.numberOfChannels,timestamp:0,data:i});n.encode(a),a.close(),n.flush().then((()=>{"closed"!==n.state&&n.close()}))}));return Promise.race([r,t])}function Mr(){return"undefined"!=typeof window&&("VideoFrame"in window&&"VideoDecoder"in window&&"VideoEncoder"in window&&"AudioDecoder"in window&&"AudioEncoder"in window)}function jr(){return Promise.all([Rr(),Or()]).then((e=>e.every((e=>e))),(()=>!1))}const Ir=function(){var e;try{const t=!!(null===(e={testKey:"testValue"})||void 0===e?void 0:e.testKey),r=!0,n="globalThis"in window,o="BigInt"in window,i="allSettled"in Promise,a="matchAll"in String.prototype,s=CSS.supports("(display: flex) and (gap: 8px)"),u="MediaRecorder"in window&&"pause"in window.MediaRecorder.prototype,l=CSS.supports("selector(:not(a, .b))"),c=CSS.supports("selector(:is(a))");return Br()&&t&&r&&n&&o&&i&&a&&s&&u&&l&&c}catch(e){return!1}};if("undefined"!=typeof WorkerGlobalScope){const e=Re((()=>!0)),t=new AbortController;self.onmessage=async({data:r})=>{"setVisibility"===r.msg?e.update(r.visible):"exportVideo"===r.msg?tr(Object.assign(Object.assign({},r.config),{logger:(e,t)=>{self.postMessage(nr.log({logLevel:t,message:e}))},abortSignal:t.signal}),r.engineSettings,r.pluginURLs,r.sceneString,r.exportOptions,{onProgress:(e,t,r)=>{self.postMessage(nr.progress({renderedFrames:e,encodedFrames:t,totalFrames:r}))},visibility:e,inactivityTimeout:r.inactivityTimeout}).then((e=>{self.postMessage(nr.finished({data:e,mimeType:se.Mp4}))}),(e=>{self.postMessage(nr.error({error:e}))})):"exportVideoAbort"===r.msg&&t.abort()}}})();var o=n.Ju,i=n.in,a=n.HY,s=n.F4,u=n.ZP,l=n.aY,c=n.Qx,d=n.Gr,f=n.Pf;export{o as DesignBlockType,i as LogLevel,a as MimeType,s as WorkerClient,u as default,l as supportsBrowser,c as supportsVideo,d as supportsVideoExport,f as supportsWasm};
2
+ var e={789:(e,t,r)=>{var n,o=(n=(n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",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,x("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(5339).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 r.g&&"object"==typeof r.g.perf_hooks&&"object"==typeof r.g.perf_hooks.performance?s.performance=r.g.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(5339),{fileURLToPath:n}=r(3260),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(5339),C=r(9027);w=v?C.dirname(w)+"/":"//",d=(e,t)=>(e=ie(e)?new URL(e):C.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=ie(e)?new URL(e):C.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 _,S=s.print||console.log.bind(console),x=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&&(_=s.wasmBinary);var k,T,P=s.noExitRuntime||!0;"object"!=typeof WebAssembly&&ne("no native wasm support detected");var A,F,L,D,B,R,O,M,j,I,U,q=!1;function $(e,t){e||ne(t)}function H(){var e=k.buffer;s.HEAP8=F=new Int8Array(e),s.HEAP16=D=new Int16Array(e),s.HEAP32=R=new Int32Array(e),s.HEAPU8=L=new Uint8Array(e),s.HEAPU16=B=new Uint16Array(e),s.HEAPU32=O=new Uint32Array(e),s.HEAPF32=M=new Float32Array(e),s.HEAPF64=U=new Float64Array(e),s.HEAP64=j=new BigInt64Array(e),s.HEAPU64=I=new BigUint64Array(e)}var N,V=s.INITIAL_MEMORY||16777216;$(V>=65536,"INITIAL_MEMORY should be larger than STACK_SIZE, was "+V+"! (STACK_SIZE=65536)"),k=s.wasmMemory?s.wasmMemory:new WebAssembly.Memory({initial:V/65536,maximum:32768}),H(),V=k.buffer.byteLength;var W=[],z=[],G=[],Y=[];function X(){return P||!1}var K,Q,Z=0,J=null,ee=null;function te(e){Z++,s.monitorRunDependencies&&s.monitorRunDependencies(Z)}function re(e){if(Z--,s.monitorRunDependencies&&s.monitorRunDependencies(Z),0==Z&&(null!==J&&(clearInterval(J),J=null),ee)){var t=ee;ee=null,t()}}function ne(e){s.onAbort&&s.onAbort(e),x(e="Aborted("+e+")"),q=!0,A=1,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw o(t),t}function oe(e){return e.startsWith("data:application/octet-stream;base64,")}function ie(e){return e.startsWith("file://")}function ae(e){if(e==K&&_)return new Uint8Array(_);if(p)return p(e);throw"both async and sync fetching of the wasm failed"}function se(e,t,r){return function(e){return _||!y&&!v||"function"!=typeof fetch?Promise.resolve().then((()=>ae(e))):fetch(e,{credentials:"same-origin"}).then((t=>{if(!t.ok)throw"failed to load wasm binary file at '"+e+"'";return t.arrayBuffer()})).catch((()=>ae(e)))}(e).then((e=>WebAssembly.instantiate(e,t))).then((e=>e)).then(r,(e=>{x("failed to asynchronously prepare wasm: "+e),ne(e)}))}oe(K="cesdk.wasm")||(Q=K,K=s.locateFile?s.locateFile(Q,w):w+Q);var ue={2357112:(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),2359102:()=>{void 0!==window.miniaudio&&(window.miniaudio.referenceCount-=1,0===window.miniaudio.referenceCount&&delete window.miniaudio)},2359266:()=>void 0!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia,2359370:()=>{try{var e=new(window.AudioContext||window.webkitAudioContext),t=e.sampleRate;return e.close(),t}catch(e){return 0}},2359541:(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];Qn(f,c,d)}if(a==miniaudio.device_type.playback||a==miniaudio.device_type.duplex)for(Zn(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)},2362324:e=>miniaudio.get_device_by_index(e).webaudio.sampleRate,2362390: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},2362755:e=>{miniaudio.untrack_device_by_index(e)},2362798:e=>{var t=miniaudio.get_device_by_index(e);t.webaudio.resume(),t.state=miniaudio.device_state.started},2362923:e=>{var t=miniaudio.get_device_by_index(e);t.webaudio.suspend(),t.state=miniaudio.device_state.stopped},2363049:()=>!!globalThis.ubq_browserTabHidden,2363095:()=>F.length};function le(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var ce=e=>{for(;e.length>0;)e.shift()(s)},de=[],fe=0;function pe(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){O[this.ptr+4>>2]=e},this.get_type=function(){return O[this.ptr+4>>2]},this.set_destructor=function(e){O[this.ptr+8>>2]=e},this.get_destructor=function(){return O[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,F[this.ptr+12>>0]=e},this.get_caught=function(){return 0!=F[this.ptr+12>>0]},this.set_rethrown=function(e){e=e?1:0,F[this.ptr+13>>0]=e},this.get_rethrown=function(){return 0!=F[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){O[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return O[this.ptr+16>>2]},this.get_exception_ptr=function(){if(lo(this.get_type()))return O[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}var he=e=>{var t=fe;if(!t)return Jn(0),0;var r=new pe(t);r.set_adjusted_ptr(t);var n=r.get_type();if(!n)return Jn(0),t;for(var o in e){var i=e[o];if(0===i||i===n)break;var a=r.ptr+16;if(uo(i,n,a))return Jn(i),t}return Jn(n),t},me={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=me.isAbs(e),r="/"===e.substr(-1);return(e=me.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=me.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=me.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments);return me.normalize(e.join("/"))},join2:(e,t)=>me.normalize(e+"/"+t)},ge=e=>(ge=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>crypto.getRandomValues(e);if(b)try{var e=r(9758);if(e.randomFillSync)return t=>e.randomFillSync(t);var t=e.randomBytes;return e=>(e.set(t(e.byteLength)),e)}catch(e){}ne("initRandomDevice")})())(e),ye={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:Ae.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,t=me.isAbs(n)}return(t?"/":"")+(e=me.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=ye.resolve(e).substr(1),t=ye.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("/")}},ve="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,be=(e,t,r)=>{for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.buffer&&ve)return ve.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},we=[],Ee=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},Ce=(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:Ee(e)+1,o=new Array(n),i=Ce(e,o,0,o.length);return t&&(o.length=i),o}var Se={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){Se.ttys[e]={input:[],output:[],ops:t},Ae.registerDevice(e,Se.stream_ops)},stream_ops:{open:function(e){var t=Se.ttys[e.node.rdev];if(!t)throw new Ae.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 Ae.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 Ae.ErrnoError(29)}if(void 0===s&&0===i)throw new Ae.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 Ae.ErrnoError(60);try{for(var i=0;i<n;i++)e.tty.ops.put_char(e.tty,t[r+i])}catch(e){throw new Ae.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(e){return(()=>{if(!we.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;we=_e(e,!0)}return we.shift()})()},put_char:function(e,t){null===t||10===t?(S(be(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync:function(e){e.output&&e.output.length>0&&(S(be(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?(x(be(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync:function(e){e.output&&e.output.length>0&&(x(be(e.output,0)),e.output=[])}}},xe=e=>{e=((e,t)=>65536*Math.ceil(e/65536))(e);var t=to(65536,e);return t?((e,t)=>(L.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(Ae.isBlkdev(r)||Ae.isFIFO(r))throw new Ae.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:Ae.chrdev_stream_ops}});var o=Ae.createNode(e,t,r,n);return Ae.isDir(o.mode)?(o.node_ops=ke.ops_table.dir.node,o.stream_ops=ke.ops_table.dir.stream,o.contents={}):Ae.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):Ae.isLink(o.mode)?(o.node_ops=ke.ops_table.link.node,o.stream_ops=ke.ops_table.link.stream):Ae.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=Ae.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,Ae.isDir(e.mode)?t.size=4096:Ae.isFile(e.mode)?t.size=e.usedBytes:Ae.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 Ae.genericErrors[44]},mknod:(e,t,r,n)=>ke.createNode(e,t,r,n),rename(e,t,r){if(Ae.isDir(e.mode)){var n;try{n=Ae.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new Ae.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=Ae.lookupNode(e,t);for(var n in r.contents)throw new Ae.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(!Ae.isLink(e.mode))throw new Ae.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===F.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&&Ae.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new Ae.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(!Ae.isFile(e.node.mode))throw new Ae.ErrnoError(43);var i,a,s=e.node.contents;if(2&o||s.buffer!==F.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=xe(t)))throw new Ae.ErrnoError(48);F.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)}},Te=s.preloadPlugins||[];function Pe(e,t){var r=0;return e&&(r|=365),t&&(r|=146),r}var Ae={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=ye.resolve(e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new Ae.ErrnoError(32);for(var r=e.split("/").filter((e=>!!e)),n=Ae.root,o="/",i=0;i<r.length;i++){var a=i===r.length-1;if(a&&t.parent)break;if(n=Ae.lookupNode(n,r[i]),o=me.join2(o,r[i]),Ae.isMountpoint(n)&&(!a||a&&t.follow_mount)&&(n=n.mounted.root),!a||t.follow)for(var s=0;Ae.isLink(n.mode);){var u=Ae.readlink(o);if(o=ye.resolve(me.dirname(o),u),n=Ae.lookupPath(o,{recurse_count:t.recurse_count+1}).node,s++>40)throw new Ae.ErrnoError(32)}}return{path:o,node:n}},getPath:e=>{for(var t;;){if(Ae.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)%Ae.nameTable.length},hashAddNode:e=>{var t=Ae.hashName(e.parent.id,e.name);e.name_next=Ae.nameTable[t],Ae.nameTable[t]=e},hashRemoveNode:e=>{var t=Ae.hashName(e.parent.id,e.name);if(Ae.nameTable[t]===e)Ae.nameTable[t]=e.name_next;else for(var r=Ae.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode:(e,t)=>{var r=Ae.mayLookup(e);if(r)throw new Ae.ErrnoError(r,e);for(var n=Ae.hashName(e.id,t),o=Ae.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===t)return o}return Ae.lookup(e,t)},createNode:(e,t,r,n)=>{var o=new Ae.FSNode(e,t,r,n);return Ae.hashAddNode(o),o},destroyNode:e=>{Ae.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)=>Ae.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2,mayLookup:e=>Ae.nodePermissions(e,"x")||(e.node_ops.lookup?0:2),mayCreate:(e,t)=>{try{return Ae.lookupNode(e,t),20}catch(e){}return Ae.nodePermissions(e,"wx")},mayDelete:(e,t,r)=>{var n;try{n=Ae.lookupNode(e,t)}catch(e){return e.errno}var o=Ae.nodePermissions(e,"wx");if(o)return o;if(r){if(!Ae.isDir(n.mode))return 54;if(Ae.isRoot(n)||Ae.getPath(n)===Ae.cwd())return 10}else if(Ae.isDir(n.mode))return 31;return 0},mayOpen:(e,t)=>e?Ae.isLink(e.mode)?32:Ae.isDir(e.mode)&&("r"!==Ae.flagsToPermissionString(t)||512&t)?31:Ae.nodePermissions(e,Ae.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd:()=>{for(var e=0;e<=Ae.MAX_OPEN_FDS;e++)if(!Ae.streams[e])return e;throw new Ae.ErrnoError(33)},getStreamChecked:e=>{var t=Ae.getStream(e);if(!t)throw new Ae.ErrnoError(8);return t},getStream:e=>Ae.streams[e],createStream:(e,t=-1)=>(Ae.FSStream||(Ae.FSStream=function(){this.shared={}},Ae.FSStream.prototype={},Object.defineProperties(Ae.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 Ae.FSStream,e),-1==t&&(t=Ae.nextfd()),e.fd=t,Ae.streams[t]=e,e),closeStream:e=>{Ae.streams[e]=null},chrdev_stream_ops:{open:e=>{var t=Ae.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:()=>{throw new Ae.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice:(e,t)=>{Ae.devices[e]={stream_ops:t}},getDevice:e=>Ae.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),Ae.syncFSRequests++,Ae.syncFSRequests>1&&x(`warning: ${Ae.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var r=Ae.getMounts(Ae.root.mount),n=0;function o(e){return Ae.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&&Ae.root)throw new Ae.ErrnoError(10);if(!o&&!i){var a=Ae.lookupPath(r,{follow_mount:!1});if(r=a.path,n=a.node,Ae.isMountpoint(n))throw new Ae.ErrnoError(10);if(!Ae.isDir(n.mode))throw new Ae.ErrnoError(54)}var s={type:e,opts:t,mountpoint:r,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,o?Ae.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:e=>{var t=Ae.lookupPath(e,{follow_mount:!1});if(!Ae.isMountpoint(t.node))throw new Ae.ErrnoError(28);var r=t.node,n=r.mounted,o=Ae.getMounts(n);Object.keys(Ae.nameTable).forEach((e=>{for(var t=Ae.nameTable[e];t;){var r=t.name_next;o.includes(t.mount)&&Ae.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=Ae.lookupPath(e,{parent:!0}).node,o=me.basename(e);if(!o||"."===o||".."===o)throw new Ae.ErrnoError(28);var i=Ae.mayCreate(n,o);if(i)throw new Ae.ErrnoError(i);if(!n.node_ops.mknod)throw new Ae.ErrnoError(63);return n.node_ops.mknod(n,o,t,r)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,Ae.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,Ae.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{Ae.mkdir(n,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,r)=>(void 0===r&&(r=t,t=438),t|=8192,Ae.mknod(e,t,r)),symlink:(e,t)=>{if(!ye.resolve(e))throw new Ae.ErrnoError(44);var r=Ae.lookupPath(t,{parent:!0}).node;if(!r)throw new Ae.ErrnoError(44);var n=me.basename(t),o=Ae.mayCreate(r,n);if(o)throw new Ae.ErrnoError(o);if(!r.node_ops.symlink)throw new Ae.ErrnoError(63);return r.node_ops.symlink(r,n,e)},rename:(e,t)=>{var r,n,o=me.dirname(e),i=me.dirname(t),a=me.basename(e),s=me.basename(t);if(r=Ae.lookupPath(e,{parent:!0}).node,n=Ae.lookupPath(t,{parent:!0}).node,!r||!n)throw new Ae.ErrnoError(44);if(r.mount!==n.mount)throw new Ae.ErrnoError(75);var u,l=Ae.lookupNode(r,a),c=ye.relative(e,i);if("."!==c.charAt(0))throw new Ae.ErrnoError(28);if("."!==(c=ye.relative(t,o)).charAt(0))throw new Ae.ErrnoError(55);try{u=Ae.lookupNode(n,s)}catch(e){}if(l!==u){var d=Ae.isDir(l.mode),f=Ae.mayDelete(r,a,d);if(f)throw new Ae.ErrnoError(f);if(f=u?Ae.mayDelete(n,s,d):Ae.mayCreate(n,s))throw new Ae.ErrnoError(f);if(!r.node_ops.rename)throw new Ae.ErrnoError(63);if(Ae.isMountpoint(l)||u&&Ae.isMountpoint(u))throw new Ae.ErrnoError(10);if(n!==r&&(f=Ae.nodePermissions(r,"w")))throw new Ae.ErrnoError(f);Ae.hashRemoveNode(l);try{r.node_ops.rename(l,n,s)}catch(e){throw e}finally{Ae.hashAddNode(l)}}},rmdir:e=>{var t=Ae.lookupPath(e,{parent:!0}).node,r=me.basename(e),n=Ae.lookupNode(t,r),o=Ae.mayDelete(t,r,!0);if(o)throw new Ae.ErrnoError(o);if(!t.node_ops.rmdir)throw new Ae.ErrnoError(63);if(Ae.isMountpoint(n))throw new Ae.ErrnoError(10);t.node_ops.rmdir(t,r),Ae.destroyNode(n)},readdir:e=>{var t=Ae.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new Ae.ErrnoError(54);return t.node_ops.readdir(t)},unlink:e=>{var t=Ae.lookupPath(e,{parent:!0}).node;if(!t)throw new Ae.ErrnoError(44);var r=me.basename(e),n=Ae.lookupNode(t,r),o=Ae.mayDelete(t,r,!1);if(o)throw new Ae.ErrnoError(o);if(!t.node_ops.unlink)throw new Ae.ErrnoError(63);if(Ae.isMountpoint(n))throw new Ae.ErrnoError(10);t.node_ops.unlink(t,r),Ae.destroyNode(n)},readlink:e=>{var t=Ae.lookupPath(e).node;if(!t)throw new Ae.ErrnoError(44);if(!t.node_ops.readlink)throw new Ae.ErrnoError(28);return ye.resolve(Ae.getPath(t.parent),t.node_ops.readlink(t))},stat:(e,t)=>{var r=Ae.lookupPath(e,{follow:!t}).node;if(!r)throw new Ae.ErrnoError(44);if(!r.node_ops.getattr)throw new Ae.ErrnoError(63);return r.node_ops.getattr(r)},lstat:e=>Ae.stat(e,!0),chmod:(e,t,r)=>{var n;if(!(n="string"==typeof e?Ae.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new Ae.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod:(e,t)=>{Ae.chmod(e,t,!0)},fchmod:(e,t)=>{var r=Ae.getStreamChecked(e);Ae.chmod(r.node,t)},chown:(e,t,r,n)=>{var o;if(!(o="string"==typeof e?Ae.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new Ae.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(e,t,r)=>{Ae.chown(e,t,r,!0)},fchown:(e,t,r)=>{var n=Ae.getStreamChecked(e);Ae.chown(n.node,t,r)},truncate:(e,t)=>{if(t<0)throw new Ae.ErrnoError(28);var r;if(!(r="string"==typeof e?Ae.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new Ae.ErrnoError(63);if(Ae.isDir(r.mode))throw new Ae.ErrnoError(31);if(!Ae.isFile(r.mode))throw new Ae.ErrnoError(28);var n=Ae.nodePermissions(r,"w");if(n)throw new Ae.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate:(e,t)=>{var r=Ae.getStreamChecked(e);if(0==(2097155&r.flags))throw new Ae.ErrnoError(28);Ae.truncate(r.node,t)},utime:(e,t,r)=>{var n=Ae.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open:(e,t,r)=>{if(""===e)throw new Ae.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=me.normalize(e);try{n=Ae.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var o=!1;if(64&t)if(n){if(128&t)throw new Ae.ErrnoError(20)}else n=Ae.mknod(e,r,0),o=!0;if(!n)throw new Ae.ErrnoError(44);if(Ae.isChrdev(n.mode)&&(t&=-513),65536&t&&!Ae.isDir(n.mode))throw new Ae.ErrnoError(54);if(!o){var i=Ae.mayOpen(n,t);if(i)throw new Ae.ErrnoError(i)}512&t&&!o&&Ae.truncate(n,0),t&=-131713;var a=Ae.createStream({node:n,path:Ae.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||(Ae.readFiles||(Ae.readFiles={}),e in Ae.readFiles||(Ae.readFiles[e]=1)),a},close:e=>{if(Ae.isClosed(e))throw new Ae.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{Ae.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek:(e,t,r)=>{if(Ae.isClosed(e))throw new Ae.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new Ae.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new Ae.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 Ae.ErrnoError(28);if(Ae.isClosed(e))throw new Ae.ErrnoError(8);if(1==(2097155&e.flags))throw new Ae.ErrnoError(8);if(Ae.isDir(e.node.mode))throw new Ae.ErrnoError(31);if(!e.stream_ops.read)throw new Ae.ErrnoError(28);var i=void 0!==o;if(i){if(!e.seekable)throw new Ae.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 Ae.ErrnoError(28);if(Ae.isClosed(e))throw new Ae.ErrnoError(8);if(0==(2097155&e.flags))throw new Ae.ErrnoError(8);if(Ae.isDir(e.node.mode))throw new Ae.ErrnoError(31);if(!e.stream_ops.write)throw new Ae.ErrnoError(28);e.seekable&&1024&e.flags&&Ae.llseek(e,0,2);var a=void 0!==o;if(a){if(!e.seekable)throw new Ae.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(Ae.isClosed(e))throw new Ae.ErrnoError(8);if(t<0||r<=0)throw new Ae.ErrnoError(28);if(0==(2097155&e.flags))throw new Ae.ErrnoError(8);if(!Ae.isFile(e.node.mode)&&!Ae.isDir(e.node.mode))throw new Ae.ErrnoError(43);if(!e.stream_ops.allocate)throw new Ae.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 Ae.ErrnoError(2);if(1==(2097155&e.flags))throw new Ae.ErrnoError(2);if(!e.stream_ops.mmap)throw new Ae.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 Ae.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=Ae.open(e,t.flags),o=Ae.stat(e).size,i=new Uint8Array(o);return Ae.read(n,i,0,o,0),"utf8"===t.encoding?r=be(i,0):"binary"===t.encoding&&(r=i),Ae.close(n),r},writeFile:(e,t,r={})=>{r.flags=r.flags||577;var n=Ae.open(e,r.flags,r.mode);if("string"==typeof t){var o=new Uint8Array(Ee(t)+1),i=Ce(t,o,0,o.length);Ae.write(n,o,0,i,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");Ae.write(n,t,0,t.byteLength,void 0,r.canOwn)}Ae.close(n)},cwd:()=>Ae.currentPath,chdir:e=>{var t=Ae.lookupPath(e,{follow:!0});if(null===t.node)throw new Ae.ErrnoError(44);if(!Ae.isDir(t.node.mode))throw new Ae.ErrnoError(54);var r=Ae.nodePermissions(t.node,"x");if(r)throw new Ae.ErrnoError(r);Ae.currentPath=t.path},createDefaultDirectories:()=>{Ae.mkdir("/tmp"),Ae.mkdir("/home"),Ae.mkdir("/home/web_user")},createDefaultDevices:()=>{Ae.mkdir("/dev"),Ae.registerDevice(Ae.makedev(1,3),{read:()=>0,write:(e,t,r,n,o)=>n}),Ae.mkdev("/dev/null",Ae.makedev(1,3)),Se.register(Ae.makedev(5,0),Se.default_tty_ops),Se.register(Ae.makedev(6,0),Se.default_tty1_ops),Ae.mkdev("/dev/tty",Ae.makedev(5,0)),Ae.mkdev("/dev/tty1",Ae.makedev(6,0));var e=new Uint8Array(1024),t=0,r=()=>(0===t&&(t=ge(e).byteLength),e[--t]);Ae.createDevice("/dev","random",r),Ae.createDevice("/dev","urandom",r),Ae.mkdir("/dev/shm"),Ae.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{Ae.mkdir("/proc");var e=Ae.mkdir("/proc/self");Ae.mkdir("/proc/self/fd"),Ae.mount({mount:()=>{var t=Ae.createNode(e,"fd",16895,73);return t.node_ops={lookup:(e,t)=>{var r=+t,n=Ae.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?Ae.createDevice("/dev","stdin",s.stdin):Ae.symlink("/dev/tty","/dev/stdin"),s.stdout?Ae.createDevice("/dev","stdout",null,s.stdout):Ae.symlink("/dev/tty","/dev/stdout"),s.stderr?Ae.createDevice("/dev","stderr",null,s.stderr):Ae.symlink("/dev/tty1","/dev/stderr"),Ae.open("/dev/stdin",0),Ae.open("/dev/stdout",1),Ae.open("/dev/stderr",1)},ensureErrnoError:()=>{Ae.ErrnoError||(Ae.ErrnoError=function(e,t){this.name="ErrnoError",this.node=t,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},Ae.ErrnoError.prototype=new Error,Ae.ErrnoError.prototype.constructor=Ae.ErrnoError,[44].forEach((e=>{Ae.genericErrors[e]=new Ae.ErrnoError(e),Ae.genericErrors[e].stack="<generic error, no stack>"})))},staticInit:()=>{Ae.ensureErrnoError(),Ae.nameTable=new Array(4096),Ae.mount(ke,{},"/"),Ae.createDefaultDirectories(),Ae.createDefaultDevices(),Ae.createSpecialDirectories(),Ae.filesystems={MEMFS:ke}},init:(e,t,r)=>{Ae.init.initialized=!0,Ae.ensureErrnoError(),s.stdin=e||s.stdin,s.stdout=t||s.stdout,s.stderr=r||s.stderr,Ae.createStandardStreams()},quit:()=>{Ae.init.initialized=!1;for(var e=0;e<Ae.streams.length;e++){var t=Ae.streams[e];t&&Ae.close(t)}},findObject:(e,t)=>{var r=Ae.analyzePath(e,t);return r.exists?r.object:null},analyzePath:(e,t)=>{try{e=(n=Ae.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=Ae.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=me.basename(e),n=Ae.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:Ae.getPath(e);for(var o=t.split("/").reverse();o.length;){var i=o.pop();if(i){var a=me.join2(e,i);try{Ae.mkdir(a)}catch(e){}e=a}}return a},createFile:(e,t,r,n,o)=>{var i=me.join2("string"==typeof e?e:Ae.getPath(e),t),a=Pe(n,o);return Ae.create(i,a)},createDataFile:(e,t,r,n,o,i)=>{var a=t;e&&(e="string"==typeof e?e:Ae.getPath(e),a=t?me.join2(e,t):e);var s=Pe(n,o),u=Ae.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}Ae.chmod(u,146|s);var f=Ae.open(u,577);Ae.write(f,r,0,r.length,0,i),Ae.close(f),Ae.chmod(u,s)}return u},createDevice:(e,t,r,n)=>{var o=me.join2("string"==typeof e?e:Ae.getPath(e),t),i=Pe(!!r,!!n);Ae.createDevice.major||(Ae.createDevice.major=64);var a=Ae.makedev(Ae.createDevice.major++,0);return Ae.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 Ae.ErrnoError(29)}if(void 0===u&&0===a)throw new Ae.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 Ae.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),a}}),Ae.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 Ae.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=Ae.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 Ae.forceLoadFile(u),t.apply(null,arguments)}})),l.read=(e,t,r,n,o)=>(Ae.forceLoadFile(u),c(e,t,r,n,o)),l.mmap=(e,t,r,n,o)=>{Ae.forceLoadFile(u);var i=xe(t);if(!i)throw new Ae.ErrnoError(48);return c(e,F,i,t,r),{ptr:i,allocated:!0}},u.stream_ops=l,u}},Fe=(e,t)=>e?be(L,e,t):"",Le={DEFAULT_POLLMASK:5,calculateAt:function(e,t,r){if(me.isAbs(t))return t;var n;if(n=-100===e?Ae.cwd():Le.getStreamFromFD(e).path,0==t.length){if(!r)throw new Ae.ErrnoError(44);return n}return me.join2(n,t)},doStat:function(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&me.normalize(t)!==me.normalize(Ae.getPath(e.node)))return-54;throw e}R[r>>2]=n.dev,R[r+4>>2]=n.mode,O[r+8>>2]=n.nlink,R[r+12>>2]=n.uid,R[r+16>>2]=n.gid,R[r+20>>2]=n.rdev,j[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 j[r+40>>3]=BigInt(Math.floor(o/1e3)),O[r+48>>2]=o%1e3*1e3,j[r+56>>3]=BigInt(Math.floor(i/1e3)),O[r+64>>2]=i%1e3*1e3,j[r+72>>3]=BigInt(Math.floor(a/1e3)),O[r+80>>2]=a%1e3*1e3,j[r+88>>3]=BigInt(n.ino),0},doMsync:function(e,t,r,n,o){if(!Ae.isFile(t.node.mode))throw new Ae.ErrnoError(43);if(2&n)return 0;var i=L.slice(e,e+r);Ae.msync(t,i,o,r,n)},varargs:void 0,get:()=>(Le.varargs+=4,R[Le.varargs-4>>2]),getStr:e=>Fe(e),getStreamFromFD:function(e){return Ae.getStreamChecked(e)}},De={};function Be(e){for(;e.length;){var t=e.pop();e.pop()(t)}}function Re(e){return this.fromWireType(R[e>>2])}var Oe={},Me={},je={},Ie=void 0;function Ue(e){throw new Ie(e)}function qe(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){je[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),Oe.hasOwnProperty(e)||(Oe[e]=[]),Oe[e].push((()=>{o[t]=Me[e],++a===i.length&&n(o)})))})),0===i.length&&n(o)}var $e={};function He(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 Ve(e){for(var t="",r=e;L[r];)t+=Ne[L[r++]];return t}var We=void 0;function ze(e){throw new We(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||ze(`type "${n}" must have a positive integer typeid pointer`),Me.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;ze(`Cannot register type '${n}' twice`)}if(Me[e]=t,delete je[e],Oe.hasOwnProperty(e)){var o=Oe[e];delete Oe[e],o.forEach((e=>e()))}}(e,t,r)}function Ye(e,t,r){switch(t){case 0:return r?function(e){return F[e]}:function(e){return L[e]};case 1:return r?function(e){return D[e>>1]}:function(e){return B[e>>1]};case 2:return r?function(e){return R[e>>2]}:function(e){return O[e>>2]};case 3:return r?function(e){return j[e>>3]}:function(e){return I[e>>3]};default:throw new TypeError("Unknown integer type: "+e)}}function Xe(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 Ke(e){ze(e.$$.ptrType.registeredClass.name+" instance already deleted")}var Qe=!1;function Ze(e){}function Je(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 et(e,t,r){if(t===r)return e;if(void 0===r.baseClass)return null;var n=et(e,t,r.baseClass);return null===n?null:r.downcast(n)}var tt={};var rt=[];function nt(){for(;rt.length;){var e=rt.pop();e.$$.deleteScheduled=!1,e.delete()}}var ot=void 0;var it={};function at(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},st(Object.create(e,{$$:{value:t}}))}var st=function(e){return"undefined"==typeof FinalizationRegistry?(st=e=>e,e):(Qe=new FinalizationRegistry((e=>{Je(e.$$)})),st=e=>{var t=e.$$;if(t.smartPtr){var r={$$:t};Qe.register(e,r,e)}return e},Ze=e=>Qe.unregister(e),st(e))};function ut(){}function lt(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 ct(e,t){return{[e=lt(e)]:function(){return t.apply(this,arguments)}}[e]}function dt(e,t,r){if(void 0===e[t].overloadTable){var n=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||ze(`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 ft(e,t,r){s.hasOwnProperty(e)?((void 0===r||void 0!==s[e].overloadTable&&void 0!==s[e].overloadTable[r])&&ze(`Cannot register public name '${e}' twice`),dt(s,e,e),s.hasOwnProperty(r)&&ze(`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 pt(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 ht(e,t,r){for(;t!==r;)t.upcast||ze(`Expected null or instance of ${r.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e}function mt(e,t){if(null===t)return this.isReference&&ze(`null is not a valid ${this.name}`),0;t.$$||ze(`Cannot pass "${He(t)}" as a ${this.name}`),t.$$.ptr||ze(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=t.$$.ptrType.registeredClass;return ht(t.$$.ptr,r,this.registeredClass)}function gt(e,t){var r;if(null===t)return this.isReference&&ze(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,r),r):0;t.$$||ze(`Cannot pass "${He(t)}" as a ${this.name}`),t.$$.ptr||ze(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&ze(`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=ht(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&ze("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:ze(`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:ze("Unsupporting sharing policy")}return r}function yt(e,t){if(null===t)return this.isReference&&ze(`null is not a valid ${this.name}`),0;t.$$||ze(`Cannot pass "${He(t)}" as a ${this.name}`),t.$$.ptr||ze(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&ze(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass;return ht(t.$$.ptr,r,this.registeredClass)}function vt(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=gt:n?(this.toWireType=mt,this.destructorFunction=null):(this.toWireType=yt,this.destructorFunction=null)}function bt(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 wt=[],Et=e=>{var t=wt[e];return t||(e>=wt.length&&(wt.length=e+1),wt[e]=t=N.get(e)),t};function Ct(e,t){e=Ve(e);var r=Et(t);return"function"!=typeof r&&ze(`unknown function pointer with signature ${e}: ${t}`),r}var _t=void 0;function St(e){var t=eo(e),r=Ve(t);return Xn(t),r}function xt(e,t){var r=[],n={};throw t.forEach((function e(t){n[t]||Me[t]||(je[t]?je[t].forEach(e):(r.push(t),n[t]=!0))})),new _t(`${e}: `+r.map(St).join([", "]))}function kt(e,t){for(var r=[],n=0;n<e;n++)r.push(O[t+4*n>>2]);return r}function Tt(e,t){if(!(e instanceof Function))throw new TypeError(`new_ called with constructor type ${typeof e} which is not a function`);var r=ct(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&&ze("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 ${lt(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=[ze,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),Tt(Function,m).apply(null,g)}function At(){this.allocated=[void 0],this.freelist=[]}var Ft=new At;function Lt(e){e>=Ft.reserved&&0==--Ft.get(e).refcount&&Ft.free(e)}var Dt={toValue:e=>(e||ze("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?F:L;return this.fromWireType(t[e])};case 1:return function(e){var t=r?D:B;return this.fromWireType(t[e>>1])};case 2:return function(e){var t=r?R:O;return this.fromWireType(t[e>>2])};default:throw new TypeError("Unknown integer type: "+e)}}function Rt(e,t){var r=Me[e];return void 0===r&&ze(t+" has unknown type "+St(e)),r}function Ot(e,t){switch(t){case 2:return function(e){return this.fromWireType(M[e>>2])};case 3:return function(e){return this.fromWireType(U[e>>3])};default:throw new TypeError("Unknown float type: "+e)}}var Mt=(e,t,r)=>Ce(e,L,t,r),jt="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)&&B[n];)++n;if((r=n<<1)-e>32&&jt)return jt.decode(L.subarray(e,r));for(var i="",a=0;!(a>=t/2);++a){var s=D[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);D[t>>1]=a,t+=2}return D[t>>1]=0,t-n},qt=e=>2*e.length,$t=(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},Ht=(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 Vt(e,t){for(var r=new Array(e),n=0;n<e;++n)r[n]=Rt(O[t+4*n>>2],"parameter "+n);return r}var Wt={};function zt(e){var t=Wt[e];return void 0===t?Ve(e):t}var Gt=[];function Yt(){return"object"==typeof globalThis?globalThis:Function("return this")()}var Xt=[],Kt={};function Qt(e){return e<-9007199254740992||e>9007199254740992?NaN:Number(e)}var Zt,Jt=e=>e%4==0&&(e%100!=0||e%400==0),er=[0,31,60,91,121,152,182,213,244,274,305,335],tr=[0,31,59,90,120,151,181,212,243,273,304,334],rr=e=>(Jt(e.getFullYear())?er:tr)[e.getMonth()]+e.getDate()-1,nr=e=>{var t=Ee(e)+1,r=Yn(t);return r&&Mt(e,r,t),r};function or(e,t){if(lr.mainLoop.timingMode=e,lr.mainLoop.timingValue=t,!lr.mainLoop.func)return 1;if(lr.mainLoop.running||(lr.mainLoop.running=!0),0==e)lr.mainLoop.scheduler=function(){var e=0|Math.max(0,lr.mainLoop.tickStartTime+t-Zt());setTimeout(lr.mainLoop.runner,e)},lr.mainLoop.method="timeout";else if(1==e)lr.mainLoop.scheduler=function(){lr.requestAnimationFrame(lr.mainLoop.runner)},lr.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,"*")}}lr.mainLoop.scheduler=function(){setImmediate(lr.mainLoop.runner)},lr.mainLoop.method="immediate"}return 0}Zt=()=>performance.now();var ir=e=>{if(e instanceof le||"unwind"==e)return A;g(1,e)},ar=(e,t)=>{var r;A=e,A=r=e,X()||(s.onExit&&s.onExit(r),q=!0),g(r,new le(r))},sr=e=>{if(!q)try{e(),(()=>{if(!X())try{ar(A)}catch(e){ir(e)}})()}catch(e){ir(e)}},ur=(e,t)=>setTimeout((()=>{sr(e)}),t),lr={mainLoop:{running:!1,scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function(){lr.mainLoop.scheduler=null,lr.mainLoop.currentlyRunningMainloop++},resume:function(){lr.mainLoop.currentlyRunningMainloop++;var e=lr.mainLoop.timingMode,t=lr.mainLoop.timingValue,r=lr.mainLoop.func;lr.mainLoop.func=null,function(e,t,r,n,o){$(!lr.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."),lr.mainLoop.func=e,lr.mainLoop.arg=n;var i=lr.mainLoop.currentlyRunningMainloop;function a(){return!(i<lr.mainLoop.currentlyRunningMainloop)}lr.mainLoop.running=!1,lr.mainLoop.runner=function(){if(!q)if(lr.mainLoop.queue.length>0){var t=Date.now(),r=lr.mainLoop.queue.shift();if(r.func(r.arg),lr.mainLoop.remainingBlockers){var n=lr.mainLoop.remainingBlockers,o=n%1==0?n-1:Math.floor(n);r.counted?lr.mainLoop.remainingBlockers=o:(o+=.5,lr.mainLoop.remainingBlockers=(8*n+o)/9)}if(S('main loop blocker "'+r.name+'" took '+(Date.now()-t)+" ms"),lr.mainLoop.updateStatus(),!a())return;setTimeout(lr.mainLoop.runner,0)}else a()&&(lr.mainLoop.currentFrameNumber=lr.mainLoop.currentFrameNumber+1|0,1==lr.mainLoop.timingMode&&lr.mainLoop.timingValue>1&&lr.mainLoop.currentFrameNumber%lr.mainLoop.timingValue!=0?lr.mainLoop.scheduler():(0==lr.mainLoop.timingMode&&(lr.mainLoop.tickStartTime=Zt()),lr.mainLoop.runIter(e),a()&&("object"==typeof SDL&&SDL.audio&&SDL.audio.queueNewAudioData&&SDL.audio.queueNewAudioData(),lr.mainLoop.scheduler())))}}(r,0,0,lr.mainLoop.arg),or(e,t),lr.mainLoop.scheduler()},updateStatus:function(){if(s.setStatus){var e=s.statusMessage||"Please wait...",t=lr.mainLoop.remainingBlockers,r=lr.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;sr(e),s.postMainLoop&&s.postMainLoop()}}},isFullscreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init:function(){if(!lr.initted){lr.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:lr.getMimetype(t)});o.size!==e.length&&(o=new Blob([new Uint8Array(e).buffer],{type:lr.getMimetype(t)}));var i=URL.createObjectURL(o),a=new Image;a.onload=()=>{$(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),$n[t]=n,URL.revokeObjectURL(i),r&&r(e)},a.onerror=e=>{S("Image "+i+" could not be decoded"),n&&n()},a.src=i}};Te.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,Hn[t]=n,r&&r(e))}var a=new Blob([e],{type:lr.getMimetype(t)}),s=URL.createObjectURL(a),u=new Audio;u.addEventListener("canplaythrough",(()=>i(u)),!1),u.onerror=function(r){o||(x("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,ur((()=>{i(u)}),1e4)}};Te.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=>{!lr.pointerLock&&s.canvas.requestPointerLock&&(s.canvas.requestPointerLock(),e.preventDefault())}),!1))}function n(){lr.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!==yr&&(i=yr.createContext(e,a))&&(o=yr.getContext(i).GLctx)}else o=e.getContext("2d");return o?(r&&(t||$(void 0===qn,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),s.ctx=o,t&&yr.makeContextCurrent(i),s.useWebGL=t,lr.moduleContextCreatedCallbacks.forEach((e=>e())),lr.init()),o):null},destroyContext:function(e,t,r){},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen:function(e,t){lr.lockPointer=e,lr.resizeCanvas=t,void 0===lr.lockPointer&&(lr.lockPointer=!0),void 0===lr.resizeCanvas&&(lr.resizeCanvas=!1);var r=s.canvas;function n(){lr.isFullscreen=!1;var e=r.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e?(r.exitFullscreen=lr.exitFullscreen,lr.lockPointer&&r.requestPointerLock(),lr.isFullscreen=!0,lr.resizeCanvas?lr.setFullscreenCanvasSize():lr.updateCanvasDimensions(r)):(e.parentNode.insertBefore(r,e),e.parentNode.removeChild(e),lr.resizeCanvas?lr.setWindowedCanvasSize():lr.updateCanvasDimensions(r)),s.onFullScreen&&s.onFullScreen(lr.isFullscreen),s.onFullscreen&&s.onFullscreen(lr.isFullscreen)}lr.fullscreenHandlersInstalled||(lr.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!!lr.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===lr.nextRAF)lr.nextRAF=t+1e3/60;else for(;t+2>=lr.nextRAF;)lr.nextRAF+=1e3/60;var r=Math.max(lr.nextRAF-t,0);setTimeout(e,r)},requestAnimationFrame:function(e){"function"!=typeof requestAnimationFrame?(0,lr.fakeRequestAnimationFrame)(e):requestAnimationFrame(e)},safeSetTimeout:function(e,t){return ur(e,t)},safeRequestAnimationFrame:function(e){return lr.requestAnimationFrame((()=>{sr(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(lr.pointerLock)"mousemove"!=e.type&&"mozMovementX"in e?lr.mouseMovementX=lr.mouseMovementY=0:(lr.mouseMovementX=lr.getMovementX(e),lr.mouseMovementY=lr.getMovementY(e)),"undefined"!=typeof SDL?(lr.mouseX=SDL.mouseX+lr.mouseMovementX,lr.mouseY=SDL.mouseY+lr.mouseMovementY):(lr.mouseX+=lr.mouseMovementX,lr.mouseY+=lr.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)lr.lastTouches[a.identifier]=c,lr.touches[a.identifier]=c;else if("touchend"===e.type||"touchmove"===e.type){var d=lr.touches[a.identifier];d||(d=c),lr.lastTouches[a.identifier]=d,lr.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,lr.mouseMovementX=f-lr.mouseX,lr.mouseMovementY=p-lr.mouseY,lr.mouseX=f,lr.mouseY=p}},resizeListeners:[],updateResizeListeners:function(){var e=s.canvas;lr.resizeListeners.forEach((t=>t(e.width,e.height)))},setCanvasSize:function(e,t,r){var n=s.canvas;lr.updateCanvasDimensions(n,e,t),r||lr.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize:function(){if("undefined"!=typeof SDL){var e=O[SDL.screen>>2];e|=8388608,R[SDL.screen>>2]=e}lr.updateCanvasDimensions(s.canvas),lr.updateResizeListeners()},setWindowedCanvasSize:function(){if("undefined"!=typeof SDL){var e=O[SDL.screen>>2];e&=-8388609,R[SDL.screen>>2]=e}lr.updateCanvasDimensions(s.canvas),lr.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)}lr.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"))))}},cr={errorCode:12288,defaultDisplayInitialized:!1,currentContext:0,currentReadSurface:0,currentDrawSurface:0,contextAttributes:{alpha:!1,depth:!1,stencil:!1,antialias:!1},stringCache:{},setErrorCode:function(e){cr.errorCode=e},chooseConfig:function(e,t,r,n,o){if(62e3!=e)return cr.setErrorCode(12296),0;if(t)for(;;){var i=R[t>>2];if(12321==i){var a=R[t+4>>2];cr.contextAttributes.alpha=a>0}else if(12325==i){var s=R[t+4>>2];cr.contextAttributes.depth=s>0}else if(12326==i){var u=R[t+4>>2];cr.contextAttributes.stencil=u>0}else if(12337==i){var l=R[t+4>>2];cr.contextAttributes.antialias=l>0}else if(12338==i)l=R[t+4>>2],cr.contextAttributes.antialias=1==l;else if(12544==i){var c=R[t+4>>2];cr.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),cr.setErrorCode(12288),1):(cr.setErrorCode(12300),0)}};function dr(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 fr(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 pr(e){var t=e.getExtension("WEBGL_draw_buffers");if(t)return e.drawBuffers=function(e,r){t.drawBuffersWEBGL(e,r)},1}function hr(e){return!!(e.dibvbi=e.getExtension("WEBGL_draw_instanced_base_vertex_base_instance"))}function mr(e){return!!(e.mdibvbi=e.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance"))}function gr(e){return!!(e.multiDrawWebgl=e.getExtension("WEBGL_multi_draw"))}var yr={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:[],offscreenCanvases:{},queries:[],samplers:[],transformFeedbacks:[],syncs:[],stringCache:{},stringiCache:{},unpackAlignment:4,recordError:function(e){yr.lastError||(yr.lastError=e)},getNewId:function(e){for(var t=yr.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?yr.registerContext(r,t):0},registerContext:function(e,t){var r=yr.getNewId(yr.contexts),n={handle:r,attributes:t,version:t.majorVersion,GLctx:e};return e.canvas&&(e.canvas.GLctxObject=n),yr.contexts[r]=n,(void 0===t.enableExtensionsByDefault||t.enableExtensionsByDefault)&&yr.initExtensions(n),r},makeContextCurrent:function(e){return yr.currentContext=yr.contexts[e],s.ctx=qn=yr.currentContext&&yr.currentContext.GLctx,!(e&&!qn)},getContext:function(e){return yr.contexts[e]},deleteContext:function(e){yr.currentContext===yr.contexts[e]&&(yr.currentContext=null),"object"==typeof Pn&&Pn.removeAllHandlersOnTarget(yr.contexts[e].GLctx.canvas),yr.contexts[e]&&yr.contexts[e].GLctx.canvas&&(yr.contexts[e].GLctx.canvas.GLctxObject=void 0),yr.contexts[e]=null},initExtensions:function(e){if(e||(e=yr.currentContext),!e.initExtensionsDone){e.initExtensionsDone=!0;var t=e.GLctx;dr(t),fr(t),pr(t),hr(t),mr(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")),gr(t),(t.getSupportedExtensions()||[]).forEach((function(e){e.includes("lose_context")||e.includes("debug")||t.getExtension(e)}))}}},vr=[];function br(e){qn.bindVertexArray(yr.vaos[e])}var wr=br,Er=br;function Cr(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2];qn.deleteVertexArray(yr.vaos[n]),yr.vaos[n]=null}}var _r=Cr,Sr=Cr;function xr(e,t,r,n){qn.drawArraysInstanced(e,t,r,n)}var kr=xr,Tr=xr,Pr=xr,Ar=xr,Fr=xr,Lr=[];function Dr(e,t){for(var r=Lr[e],n=0;n<e;n++)r[n]=R[t+4*n>>2];qn.drawBuffers(r)}var Br=Dr,Rr=Dr,Or=Dr;function Mr(e,t,r,n){qn.drawElements(e,t,r,n)}var jr=Mr;function Ir(e,t,r,n,o){qn.drawElementsInstanced(e,t,r,n,o)}var Ur=Ir,qr=Ir,$r=Ir,Hr=Ir,Nr=Ir;function Vr(e,t,r,n){for(var o=0;o<e;o++){var i=qn[r](),a=i&&yr.getNewId(n);i?(i.name=a,n[a]=i):yr.recordError(1282),R[t+4*o>>2]=a}}function Wr(e,t){Vr(e,t,"createVertexArray",yr.vaos)}var zr=Wr,Gr=Wr;function Yr(e,t,r,n,o,i,a,s){t=yr.programs[t];var u=qn[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 Xr(e,t){O[e>>2]=t,O[e+4>>2]=(t-O[e>>2])/4294967296}function Kr(e,t,r){if(t){var n=void 0;switch(e){case 36346:n=1;break;case 36344:return void(0!=r&&1!=r&&yr.recordError(1280));case 34814:case 36345:n=0;break;case 34466:var o=qn.getParameter(34467);n=o?o.length:0;break;case 33309:if(yr.currentContext.version<2)return void yr.recordError(1282);n=2*(qn.getSupportedExtensions()||[]).length;break;case 33307:case 33308:if(yr.currentContext.version<2)return void yr.recordError(1280);n=33307==e?3:0}if(void 0===n){var i=qn.getParameter(e);switch(typeof i){case"number":n=i;break;case"boolean":n=i?1:0;break;case"string":return void yr.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 yr.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:M[t+4*a>>2]=i[a];break;case 4:F[t+a>>0]=i[a]?1:0}return}try{n=0|i.name}catch(t){return yr.recordError(1280),void x("GL_INVALID_ENUM in glGet"+r+"v: Unknown object returned from WebGL getParameter("+e+")! (error: "+t+")")}}break;default:return yr.recordError(1280),void x("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:Xr(t,n);break;case 0:R[t>>2]=n;break;case 2:M[t>>2]=n;break;case 4:F[t>>0]=n?1:0}}else yr.recordError(1281)}function Qr(e,t,r,n){if(r){var o,i=qn.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 yr.recordError(1280)}else{if(!(i instanceof WebGLBuffer))return void yr.recordError(1280);o=0|i.name}break;default:return void yr.recordError(1280)}switch(n){case 1:Xr(r,o);break;case 0:R[r>>2]=o;break;case 2:M[r>>2]=o;break;case 4:F[r>>0]=o?1:0;break;default:throw"internal emscriptenWebGLGetIndexed() error, bad type: "+n}}else yr.recordError(1281)}function Zr(e,t,r){if(r){var n,o=yr.queries[e];Xr(r,"boolean"==typeof(n=yr.currentContext.version<2?qn.disjointTimerQueryExt.getQueryObjectEXT(o,t):qn.getQueryParameter(o,t))?n?1:0:n)}else yr.recordError(1281)}var Jr=Zr;function en(e,t,r){if(r){var n,o=yr.queries[e],i=qn.disjointTimerQueryExt.getQueryObjectEXT(o,t);n="boolean"==typeof i?i?1:0:i,R[r>>2]=n}else yr.recordError(1281)}var tn=en,rn=Zr,nn=en;function on(e){return"]"==e.slice(-1)&&e.lastIndexOf("[")}function an(e){var t,r,n=e.uniformLocsById,o=e.uniformSizeAndIdsByName;if(!n)for(e.uniformLocsById=n={},e.uniformArrayNamesById={},t=0;t<qn.getProgramParameter(e,35718);++t){var i=qn.getActiveUniform(e,t),a=i.name,s=i.size,u=on(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 sn(e){var t=qn.currentProgram;if(t){var r=t.uniformLocsById[e];return"number"==typeof r&&(t.uniformLocsById[e]=r=qn.getUniformLocation(t,t.uniformArrayNamesById[e]+(r>0?"["+r+"]":""))),r}yr.recordError(1282)}function un(e,t,r,n){if(r){an(e=yr.programs[e]);var o=qn.getUniform(e,sn(t));if("number"==typeof o||"boolean"==typeof o)switch(n){case 0:R[r>>2]=o;break;case 2:M[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:M[r+4*i>>2]=o[i]}}else yr.recordError(1281)}function ln(e,t,r,n){if(r){var o=qn.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:M[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:M[r+4*i>>2]=o[i];break;case 5:R[r+4*i>>2]=Math.fround(o[i])}}else yr.recordError(1281)}function cn(e,t,r){ln(e,t,r,0)}var dn=cn,fn=cn;function pn(e){var t=yr.vaos[e];return t?qn.isVertexArray(t):0}var hn=pn,mn=pn;function gn(e){return 0==(e-=5120)?F:1==e?L:2==e?D:4==e?R:6==e?M:5==e||28922==e||28520==e||30779==e||30782==e?O:B}function yn(e){return 31-Math.clz32(e.BYTES_PER_ELEMENT)}function vn(e,t,r,n,o,i){var a=gn(e),s=yn(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,yr.unpackAlignment);return a.subarray(o>>s,o+c>>s)}var bn=[],wn=[];function En(e,t){qn.vertexAttribDivisor(e,t)}var Cn=En,_n=En,Sn=En,xn=En,kn=En,Tn=e=>{var t=e-k.buffer.byteLength+65535>>>16;try{return k.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}},An=["default","low-power","high-performance"],Fn=[0,"undefined"!=typeof document?document:0,"undefined"!=typeof window?window:0];var Ln,Dn,Bn={},Rn=()=>{if(!Rn.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]}`);Rn.strings=r}return Rn.strings},On=(e,t,r,n)=>{for(var o=0,i=0;i<r;i++){var a=O[t>>2],s=O[t+4>>2];t+=8;var u=Ae.read(e,F,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],jn=[31,28,31,30,31,30,31,31,30,31,30,31],In=(e,t)=>{F.set(e,t)},Un=function(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=Ae.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 Ae.isDir(this.mode)}},isDevice:{get:function(){return Ae.isChrdev(this.mode)}}}),Ae.FSNode=Un,Ae.createPreloadedFile=function(e,t,r,n,o,i,a,s,u,l){var c=t?ye.resolve(me.join2(e,t)):e;function d(r){function d(r){l&&l(),s||Ae.createDataFile(e,t,r,n,o,u),i&&i(),re()}(function(e,t,r,n){void 0!==lr&&lr.init();var o=!1;return Te.forEach((function(i){o||i.canHandle(t)&&(i.handle(e,t,r,n),o=!0)})),o})(r,c,d,(()=>{a&&a(),re()}))||d(r)}te(),"string"==typeof r?((e,t,r,n)=>{var o=`al ${e}`;f(e,(t=>{$(t,`Loading data file "${e}" failed (no arrayBuffer).`),d(new Uint8Array(t)),o&&re()}),(t=>{if(!r)throw`Loading data file "${e}" failed.`;r()})),o&&te()})(r,0,a):d(r)},Ae.staticInit(),s.FS_createPath=Ae.createPath,s.FS_createDataFile=Ae.createDataFile,s.FS_createPreloadedFile=Ae.createPreloadedFile,s.FS_unlink=Ae.unlink,s.FS_createLazyFile=Ae.createLazyFile,s.FS_createDevice=Ae.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}(),We=s.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},ut.prototype.isAliasOf=function(e){if(!(this instanceof ut))return!1;if(!(e instanceof ut))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},ut.prototype.clone=function(){if(this.$$.ptr||Ke(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,t=st(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},ut.prototype.delete=function(){this.$$.ptr||Ke(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ze("Object already scheduled for deletion"),Ze(this),Je(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},ut.prototype.isDeleted=function(){return!this.$$.ptr},ut.prototype.deleteLater=function(){return this.$$.ptr||Ke(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ze("Object already scheduled for deletion"),rt.push(this),1===rt.length&&ot&&ot(nt),this.$$.deleteScheduled=!0,this},s.getInheritedInstanceCount=function(){return Object.keys(it).length},s.getLiveInheritedInstances=function(){var e=[];for(var t in it)it.hasOwnProperty(t)&&e.push(it[t]);return e},s.flushPendingDeletes=nt,s.setDelayFunction=function(e){ot=e,rt.length&&ot&&ot(nt)},vt.prototype.getPointee=function(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},vt.prototype.destructor=function(e){this.rawDestructor&&this.rawDestructor(e)},vt.prototype.argPackAdvance=8,vt.prototype.readValueFromPointer=Re,vt.prototype.deleteObject=function(e){null!==e&&e.delete()},vt.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&&ze("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t}(e,t),it[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?at(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):at(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var i,a=this.registeredClass.getActualType(t),s=tt[a];if(!s)return o.call(this);i=this.isConst?s.constPointerType:s.pointerType;var u=et(t,this.registeredClass,i.registeredClass);return null===u?o.call(this):this.isSmartPointer?at(i.registeredClass.instancePrototype,{ptrType:i,ptr:u,smartPtrType:this,smartPtr:e}):at(i.registeredClass.instancePrototype,{ptrType:i,ptr:u})},_t=s.UnboundTypeError=(Ln=Error,(Dn=ct("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(Ln.prototype),Dn.prototype.constructor=Dn,Dn.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},Dn),Object.assign(At.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){lr.requestFullscreen(e,t)},s.requestAnimationFrame=function(e){lr.requestAnimationFrame(e)},s.setCanvasSize=function(e,t,r){lr.setCanvasSize(e,t,r)},s.pauseMainLoop=function(){lr.mainLoop.pause()},s.resumeMainLoop=function(){lr.mainLoop.resume()},s.getUserMedia=function(){lr.getUserMedia()},s.createContext=function(e,t,r,n){return lr.createContext(e,t,r,n)};for(var qn,$n={},Hn={},Nn=0;Nn<32;++Nn)Lr.push(new Array(Nn));var Vn=new Float32Array(288);for(Nn=0;Nn<288;++Nn)bn[Nn]=Vn.subarray(0,Nn+1);var Wn=new Int32Array(288);for(Nn=0;Nn<288;++Nn)wn[Nn]=Wn.subarray(0,Nn+1);var zn,Gn={Ha:function(e){var t=new pe(e);return t.get_caught()||t.set_caught(!0),t.set_rethrown(!1),de.push(t),so(t.excPtr),t.get_exception_ptr()},Ga:function(){ro(0,0);var e=de.pop();ao(e.excPtr),fe=0},n:()=>he([]),_:e=>he([e]),i:function(e,t,r){throw new pe(e).init(t,r),fe=e},L:function(e){throw fe||(fe=e),fe},ca:function(e,t,r){Le.varargs=r;try{var n=Le.getStreamFromFD(e);switch(t){case 0:return(o=Le.get())<0?-28:Ae.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=Le.get();return n.flags|=o,0;case 5:return o=Le.get(),D[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return 28,R[Kn()>>2]=28,-1}}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},zb:function(e,t){try{var r=Le.getStreamFromFD(e);return Le.doStat(Ae.stat,r.path,t)}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},Db:function(e,t,r){Le.varargs=r;try{var n=Le.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=Le.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++)F[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=Le.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(F[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=Le.get(),R[i>>2]=0,0):-59;case 21520:return n.tty?-28:-59;case 21531:return i=Le.get(),Ae.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=Le.get(),D[i>>1]=f[0],D[i+2>>1]=f[1]}return 0;default:return-28}}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},vb:function(e,t){try{return e=Le.getStr(e),Le.doStat(Ae.lstat,e,t)}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},wb:function(e,t,r,n){try{t=Le.getStr(t);var o=256&n,i=4096&n;return n&=-6401,t=Le.calculateAt(e,t,i),Le.doStat(o?Ae.lstat:Ae.stat,t,r)}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},pa:function(e,t,r,n){Le.varargs=n;try{t=Le.getStr(t),t=Le.calculateAt(e,t);var o=n?Le.get():0;return Ae.open(t,r,o).fd}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},xb:function(e,t){try{return e=Le.getStr(e),Le.doStat(Ae.stat,e,t)}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},ta: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;qe([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:Re,destructorFunction:a}]}))},y:function(e){var t=$e[e];delete $e[e];var r=t.rawConstructor,n=t.rawDestructor,o=t.fields;qe([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:Re,destructorFunction:n}]}))},xa:function(e,t,r,n,o){t=Ve(t);var i=Xe(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 "${He(r)}" to ${this.name}`);if(r<n||r>o)throw new TypeError(`Passing a number "${He(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:Ye(t,i,!a),destructorFunction:null})},je:function(e,t,r,n,o){var i=Xe(r);Ge(e,{name:t=Ve(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=F;else if(2===r)n=D;else{if(4!==r)throw new TypeError("Unknown boolean type size: "+t);n=R}return this.fromWireType(n[e>>i])},destructorFunction:null})},u:function(e,t,r,n,o,i,a,s,u,l,c,d,f){c=Ve(c),i=Ct(o,i),s&&(s=Ct(a,s)),l&&(l=Ct(u,l)),f=Ct(d,f);var p=lt(c);ft(p,(function(){xt(`Cannot construct ${c} due to unbound types`,[n])})),qe([e,t,r],n?[n]:[],(function(t){var r,o;t=t[0],o=n?(r=t.registeredClass).instancePrototype:ut.prototype;var a=ct(p,(function(){if(Object.getPrototypeOf(this)!==u)throw new We("Use 'new' to construct "+c);if(void 0===d.constructor_body)throw new We(c+" has no accessible constructor");var e=d.constructor_body[arguments.length];if(void 0===e)throw new We(`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 pt(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 vt(c,d,!0,!1,!1),m=new vt(c+"*",d,!1,!1,!1),g=new vt(c+" const*",d,!1,!0,!1);return tt[e]={pointerType:m,constPointerType:g},bt(p,a),[h,m,g]}))},w:function(e,t,r,n,o,i){var a=kt(t,r);o=Ct(n,o),qe([],[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 We(`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]=()=>{xt(`Cannot construct ${e.name} due to unbound types`,a)},qe([],a,(function(n){return n.splice(1,0,null),e.registeredClass.constructor_body[t-1]=Pt(r,n,null,o,i),[]})),[]}))},d:function(e,t,r,n,o,i,a,s,u){var l=kt(r,n);t=Ve(t),i=Ct(o,i),qe([],[e],(function(e){var n=`${(e=e[0]).name}.${t}`;function o(){xt(`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):(dt(c,t,n),c[t].overloadTable[r-2]=o),qe([],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,[]})),[]}))},ie:function(e,t){Ge(e,{name:t=Ve(t),fromWireType:function(e){var t=Dt.toValue(e);return Lt(e),t},toWireType:function(e,t){return Dt.toHandle(t)},argPackAdvance:8,readValueFromPointer:Re,destructorFunction:null})},U:function(e,t,r,n){var o=Xe(r);function i(){}t=Ve(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}),ft(t,i)},A:function(e,t,r){var n=Rt(e,"enum");t=Ve(t);var o=n.constructor,i=Object.create(n.constructor.prototype,{value:{value:r},constructor:{value:ct(`${n.name}_${t}`,(function(){}))}});o.values[r]=i,o[t]=i},wa:function(e,t,r){var n=Xe(r);Ge(e,{name:t=Ve(t),fromWireType:function(e){return e},toWireType:function(e,t){return t},argPackAdvance:8,readValueFromPointer:Ot(t,n),destructorFunction:null})},K:function(e,t,r,n,o,i,a){var s=kt(t,r);e=Ve(e),o=Ct(n,o),ft(e,(function(){xt(`Cannot call ${e} due to unbound types`,s)}),t-1),qe([],s,(function(r){var n=[r[0],null].concat(r.slice(1));return bt(e,Pt(e,n,null,o,i,a),t-1),[]}))},Q:function(e,t,r,n,o){t=Ve(t),-1===o&&(o=4294967295);var i=Xe(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:Ye(t,i,0!==n),destructorFunction:null})},C:function(e,t,r){var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][t];function o(e){var t=O,r=t[e>>=2],o=t[e+1];return new n(t.buffer,o,r)}Ge(e,{name:r=Ve(r),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},Fe:function(e,t,r,n,o,i,a,s,u,l,c,d){r=Ve(r),i=Ct(o,i),s=Ct(a,s),l=Ct(u,l),d=Ct(c,d),qe([e],[t],(function(e){return e=e[0],[new vt(r,e.registeredClass,!1,!1,!0,e,n,i,s,l,d)]}))},va:function(e,t){var r="std::string"===(t=Ve(t));Ge(e,{name:t,fromWireType:function(e){var t,n=O[e>>2],o=e+4;if(r)for(var i=o,a=0;a<=n;++a){var s=o+a;if(a==n||0==L[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(L[o+a]);t=l.join("")}return Xn(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||ze("Cannot pass non-string to std::string"),n=r&&o?Ee(t):t.length;var i=Yn(4+n+1),a=i+4;if(O[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&&(Xn(a),ze("String has UTF-16 code units that do not fit in 8 bits")),L[a+s]=u}else for(s=0;s<n;++s)L[a+s]=t[s];return null!==e&&e.push(Xn,i),i},argPackAdvance:8,readValueFromPointer:Re,destructorFunction:function(e){Xn(e)}})},ea:function(e,t,r){var n,o,i,a,s;r=Ve(r),2===t?(n=It,o=Ut,a=qt,i=()=>B,s=1):4===t&&(n=$t,o=Ht,a=Nt,i=()=>O,s=2),Ge(e,{name:r,fromWireType:function(e){for(var r,o=O[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 Xn(e),r},toWireType:function(e,n){"string"!=typeof n&&ze(`Cannot pass non-string to C++ string type ${r}`);var i=a(n),u=Yn(4+i+t);return O[u>>2]=i>>s,o(n,u+4,i+t),null!==e&&e.push(Xn,u),u},argPackAdvance:8,readValueFromPointer:Re,destructorFunction:function(e){Xn(e)}})},ua:function(e,t,r,n,o,i){De[e]={name:Ve(t),rawConstructor:Ct(r,n),rawDestructor:Ct(o,i),elements:[]}},P:function(e,t,r,n,o,i,a,s,u){De[e].elements.push({getterReturnType:t,getter:Ct(r,n),getterContext:o,setterArgumentType:i,setter:Ct(a,s),setterContext:u})},z:function(e,t,r,n,o,i){$e[e]={name:Ve(t),rawConstructor:Ct(r,n),rawDestructor:Ct(o,i),fields:[]}},j:function(e,t,r,n,o,i,a,s,u,l){$e[e].fields.push({fieldName:Ve(t),getterReturnType:r,getter:Ct(n,o),getterContext:i,setterArgumentType:a,setter:Ct(s,u),setterContext:l})},ke:function(e,t){Ge(e,{isVoid:!0,name:t=Ve(t),argPackAdvance:0,fromWireType:function(){},toWireType:function(e,t){}})},Bb:()=>!0,hb:()=>{throw 1/0},m:function(e,t,r){e=Dt.toValue(e),t=Rt(t,"emval::as");var n=[],o=Dt.toHandle(n);return O[r>>2]=o,t.toWireType(n,e)},t:function(e,t,r,n){e=Dt.toValue(e);for(var o=Vt(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)},V:function(e,t,r,n,o){return(e=Gt[e])(t=Dt.toValue(t),r=zt(r),function(e){var t=[];return O[e>>2]=Dt.toHandle(t),t}(n),o)},X:function(e,t,r,n){(e=Gt[e])(t=Dt.toValue(t),r=zt(r),null,n)},c:Lt,ce:function(e,t){return(e=Dt.toValue(e))==Dt.toValue(t)},E:function(e){return 0===e?Dt.toHandle(Yt()):(e=zt(e),Dt.toHandle(Yt()[e]))},J:function(e,t){var r=Vt(e,t),n=r[0],o=n.name+"_$"+r.slice(1).map((function(e){return e.name})).join("_")+"$",i=Xt[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 "+lt("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=Tt(Function,a).apply(null,s),d=Gt.length,Gt.push(c),i=d,Xt[o]=i,i},h:function(e,t){return e=Dt.toValue(e),t=Dt.toValue(t),Dt.toHandle(e[t])},e:function(e){e>4&&(Ft.get(e).refcount+=1)},Ba:function(e,t){return(e=Dt.toValue(e))instanceof Dt.toValue(t)},da:function(e){return"number"==typeof(e=Dt.toValue(e))},M:function(e){return"string"==typeof(e=Dt.toValue(e))},ye:function(e,t,r,n){e=Dt.toValue(e);var o=Kt[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)(Rt,s,Dt.toHandle,(()=>O))}(t),Kt[t]=o),o(e,r,n)},O:function(){return Dt.toHandle([])},g:function(e){return Dt.toHandle(zt(e))},I:function(){return Dt.toHandle({})},k:function(e){Be(Dt.toValue(e)),Lt(e)},v:function(e,t,r){e=Dt.toValue(e),t=Dt.toValue(t),r=Dt.toValue(r),e[t]=r},f:function(e,t){var r=(e=Rt(e,"_emval_take_value")).readValueFromPointer(t);return Dt.toHandle(r)},re:function(e){throw Dt.toValue(e)},Nc:function(e){return e=Dt.toValue(e),Dt.toHandle(typeof e)},pb:function(e,t){e=Qt(e),t=Qt(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},qb:function(e,t){e=Qt(e),t=Qt(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|rr(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},rb:function(e){e=Qt(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|rr(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)},mb:function(e,t,r,n,o,i,a){e=Qt(e),o=Qt(o),i=Qt(i),a=Qt(a);try{if(isNaN(o))return 61;var s=Le.getStreamFromFD(n),u=Ae.mmap(s,e,o,t,r),l=u.ptr;return R[i>>2]=u.allocated,O[a>>2]=l,0}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},ob:function(e,t,r,n,o,i){e=Qt(e),t=Qt(t),i=Qt(i);try{if(isNaN(i))return 61;var a=Le.getStreamFromFD(o);2&r&&Le.doMsync(e,a,t,n,i),Ae.munmap(a)}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},ib:(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"}O[e>>2]=60*u,R[t>>2]=Number(a!=s);var c=l(o),d=l(i),f=nr(c),p=nr(d);s<a?(O[r>>2]=f,O[r+4>>2]=p):(O[r>>2]=p,O[r+4>>2]=f)},b:()=>{ne("")},na:function(e,t,r,n,o){return cr.chooseConfig(e,t,r,n,o)},oa:function(e,t,r,n){if(62e3!=e)return cr.setErrorCode(12296),0;for(var o=1;;){var i=R[n>>2];if(12440!=i){if(12344==i)break;return cr.setErrorCode(12292),0}o=R[n+4>>2],n+=8}return o<2||o>3?(cr.setErrorCode(12293),0):(cr.contextAttributes.majorVersion=o-1,cr.contextAttributes.minorVersion=0,cr.context=yr.createContext(s.canvas,cr.contextAttributes),0!=cr.context?(cr.setErrorCode(12288),yr.makeContextCurrent(cr.context),s.useWebGL=!0,lr.moduleContextCreatedCallbacks.forEach((function(e){e()})),yr.makeContextCurrent(null),62004):(cr.setErrorCode(12297),0))},$a:function(e,t,r,n){return 62e3!=e?(cr.setErrorCode(12296),0):62002!=t?(cr.setErrorCode(12293),0):(cr.setErrorCode(12288),62006)},hc:function(e,t){return 62e3!=e?(cr.setErrorCode(12296),0):62004!=t?(cr.setErrorCode(12294),0):(yr.deleteContext(cr.context),cr.setErrorCode(12288),cr.currentContext==t&&(cr.currentContext=0),1)},Yb:function(e,t){return 62e3!=e?(cr.setErrorCode(12296),0):62006!=t?(cr.setErrorCode(12301),1):(cr.currentReadSurface==t&&(cr.currentReadSurface=0),cr.currentDrawSurface==t&&(cr.currentDrawSurface=0),cr.setErrorCode(12288),1)},S:function(e,t,r,n){if(62e3!=e)return cr.setErrorCode(12296),0;if(62002!=t)return cr.setErrorCode(12293),0;if(!n)return cr.setErrorCode(12300),0;switch(cr.setErrorCode(12288),r){case 12320:return R[n>>2]=cr.contextAttributes.alpha?32:24,1;case 12321:return R[n>>2]=cr.contextAttributes.alpha?8:0,1;case 12322:case 12323:case 12324:return R[n>>2]=8,1;case 12325:return R[n>>2]=cr.contextAttributes.depth?24:0,1;case 12326:return R[n>>2]=cr.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]=cr.contextAttributes.antialias?4:0,1;case 12338:return R[n>>2]=cr.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 cr.setErrorCode(12292),0}},nb:function(e){return cr.setErrorCode(12288),62e3},sa:function(){return cr.errorCode},eb:function(e,t,r){return 62e3!=e?(cr.setErrorCode(12296),0):(t&&(R[t>>2]=1),r&&(R[r>>2]=4),cr.defaultDisplayInitialized=!0,cr.setErrorCode(12288),1)},yb:function(e,t,r,n){return 62e3!=e?(cr.setErrorCode(12296),0):0!=n&&62004!=n?(cr.setErrorCode(12294),0):0!=r&&62006!=r||0!=t&&62006!=t?(cr.setErrorCode(12301),0):(yr.makeContextCurrent(n?cr.context:null),cr.currentContext=n,cr.currentDrawSurface=t,cr.currentReadSurface=r,cr.setErrorCode(12288),1)},sc:function(e,t){if(cr.defaultDisplayInitialized)if(s.ctx){if(!s.ctx.isContextLost())return cr.setErrorCode(12288),1;cr.setErrorCode(12302)}else cr.setErrorCode(12290);else cr.setErrorCode(12289);return 0},Nb:function(e){return 62e3!=e?(cr.setErrorCode(12296),0):(cr.currentContext=0,cr.currentReadSurface=0,cr.currentDrawSurface=0,cr.defaultDisplayInitialized=!1,cr.setErrorCode(12288),1)},H:(e,t,r)=>((e,t,r)=>{var n=((e,t)=>{var r;for(vr.length=0,t>>=2;r=L[e++];)t+=105!=r&t,vr.push(105==r?R[t]:(106==r?j:U)[t++>>1]),++t;return vr})(t,r);return ue[e].apply(null,n)})(e,t,r),ve:e=>{console.error(Fe(e))},we:e=>{console.log(Fe(e))},ga:e=>{console.warn(Fe(e))},aa:function(){return Date.now()},le:function(){},jb:()=>2147483648,Ab:Zt,Vf:function(e){qn.activeTexture(e)},Wf:function(e,t){qn.attachShader(yr.programs[e],yr.shaders[t])},Yc:function(e,t){qn.beginQuery(e,yr.queries[t])},ee:function(e,t){qn.disjointTimerQueryExt.beginQueryEXT(e,yr.queries[t])},Kc:function(e){qn.beginTransformFeedback(e)},Xf:function(e,t,r){qn.bindAttribLocation(yr.programs[e],t,Fe(r))},Yf:function(e,t){35051==e?qn.currentPixelPackBufferBinding=t:35052==e&&(qn.currentPixelUnpackBufferBinding=t),qn.bindBuffer(e,yr.buffers[t])},Hc:function(e,t,r){qn.bindBufferBase(e,t,yr.buffers[r])},Ic:function(e,t,r,n,o){qn.bindBufferRange(e,t,yr.buffers[r],n,o)},Xe:function(e,t){qn.bindFramebuffer(e,yr.framebuffers[t])},Ye:function(e,t){qn.bindRenderbuffer(e,yr.renderbuffers[t])},He:function(e,t){qn.bindSampler(e,yr.samplers[t])},Zf:function(e,t){qn.bindTexture(e,yr.textures[t])},Vb:function(e,t){qn.bindTransformFeedback(e,yr.transformFeedbacks[t])},rf:wr,uf:Er,_f:function(e,t,r,n){qn.blendColor(e,t,r,n)},$f:function(e){qn.blendEquation(e)},Sd:function(e,t){qn.blendEquationSeparate(e,t)},ag:function(e,t){qn.blendFunc(e,t)},Rd:function(e,t,r,n){qn.blendFuncSeparate(e,t,r,n)},Re:function(e,t,r,n,o,i,a,s,u,l){qn.blitFramebuffer(e,t,r,n,o,i,a,s,u,l)},bg:function(e,t,r,n){yr.currentContext.version>=2?r&&t?qn.bufferData(e,L,n,r,t):qn.bufferData(e,t,n):qn.bufferData(e,r?L.subarray(r,r+t):t,n)},cg:function(e,t,r,n){yr.currentContext.version>=2?r&&qn.bufferSubData(e,t,L,n,r):qn.bufferSubData(e,t,L.subarray(n,n+r))},Ze:function(e){return qn.checkFramebufferStatus(e)},dg:function(e){qn.clear(e)},kc:function(e,t,r,n){qn.clearBufferfi(e,t,r,n)},lc:function(e,t,r){qn.clearBufferfv(e,t,M,r>>2)},nc:function(e,t,r){qn.clearBufferiv(e,t,R,r>>2)},mc:function(e,t,r){qn.clearBufferuiv(e,t,O,r>>2)},eg:function(e,t,r,n){qn.clearColor(e,t,r,n)},Qd:function(e){qn.clearDepth(e)},fg:function(e){qn.clearStencil(e)},Da:function(e,t,r){return r=Number(r),qn.clientWaitSync(yr.syncs[e],t,r)},gg:function(e,t,r,n){qn.colorMask(!!e,!!t,!!r,!!n)},hg:function(e){qn.compileShader(yr.shaders[e])},ig:function(e,t,r,n,o,i,a,s){yr.currentContext.version>=2?qn.currentPixelUnpackBufferBinding||!a?qn.compressedTexImage2D(e,t,r,n,o,i,a,s):qn.compressedTexImage2D(e,t,r,n,o,i,L,s,a):qn.compressedTexImage2D(e,t,r,n,o,i,s?L.subarray(s,s+a):null)},bd:function(e,t,r,n,o,i,a,s,u){qn.currentPixelUnpackBufferBinding?qn.compressedTexImage3D(e,t,r,n,o,i,a,s,u):qn.compressedTexImage3D(e,t,r,n,o,i,a,L,u,s)},jg:function(e,t,r,n,o,i,a,s,u){yr.currentContext.version>=2?qn.currentPixelUnpackBufferBinding||!s?qn.compressedTexSubImage2D(e,t,r,n,o,i,a,s,u):qn.compressedTexSubImage2D(e,t,r,n,o,i,a,L,u,s):qn.compressedTexSubImage2D(e,t,r,n,o,i,a,u?L.subarray(u,u+s):null)},ad:function(e,t,r,n,o,i,a,s,u,l,c){qn.currentPixelUnpackBufferBinding?qn.compressedTexSubImage3D(e,t,r,n,o,i,a,s,u,l,c):qn.compressedTexSubImage3D(e,t,r,n,o,i,a,s,u,L,c,l)},Pe:function(e,t,r,n,o){qn.copyBufferSubData(e,t,r,n,o)},Pd:function(e,t,r,n,o,i,a,s){qn.copyTexImage2D(e,t,r,n,o,i,a,s)},kg:function(e,t,r,n,o,i,a,s){qn.copyTexSubImage2D(e,t,r,n,o,i,a,s)},cd:function(e,t,r,n,o,i,a,s,u){qn.copyTexSubImage3D(e,t,r,n,o,i,a,s,u)},lg:function(){var e=yr.getNewId(yr.programs),t=qn.createProgram();return t.name=e,t.maxUniformLength=t.maxAttributeLength=t.maxUniformBlockNameLength=0,t.uniformIdCounter=1,yr.programs[e]=t,e},mg:function(e){var t=yr.getNewId(yr.shaders);return yr.shaders[t]=qn.createShader(e),t},ng:function(e){qn.cullFace(e)},og:function(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2],o=yr.buffers[n];o&&(qn.deleteBuffer(o),o.name=0,yr.buffers[n]=null,n==qn.currentPixelPackBufferBinding&&(qn.currentPixelPackBufferBinding=0),n==qn.currentPixelUnpackBufferBinding&&(qn.currentPixelUnpackBufferBinding=0))}},_e:function(e,t){for(var r=0;r<e;++r){var n=R[t+4*r>>2],o=yr.framebuffers[n];o&&(qn.deleteFramebuffer(o),o.name=0,yr.framebuffers[n]=null)}},pg:function(e){if(e){var t=yr.programs[e];t?(qn.deleteProgram(t),t.name=0,yr.programs[e]=null):yr.recordError(1281)}},_c:function(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2],o=yr.queries[n];o&&(qn.deleteQuery(o),yr.queries[n]=null)}},ge:function(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2],o=yr.queries[n];o&&(qn.disjointTimerQueryExt.deleteQueryEXT(o),yr.queries[n]=null)}},$e:function(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2],o=yr.renderbuffers[n];o&&(qn.deleteRenderbuffer(o),o.name=0,yr.renderbuffers[n]=null)}},Ie:function(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2],o=yr.samplers[n];o&&(qn.deleteSampler(o),o.name=0,yr.samplers[n]=null)}},qg:function(e){if(e){var t=yr.shaders[e];t?(qn.deleteShader(t),yr.shaders[e]=null):yr.recordError(1281)}},Qe:function(e){if(e){var t=yr.syncs[e];t?(qn.deleteSync(t),t.name=0,yr.syncs[e]=null):yr.recordError(1281)}},rg:function(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2],o=yr.textures[n];o&&(qn.deleteTexture(o),o.name=0,yr.textures[n]=null)}},Ub:function(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2],o=yr.transformFeedbacks[n];o&&(qn.deleteTransformFeedback(o),o.name=0,yr.transformFeedbacks[n]=null)}},sf:_r,vf:Sr,Od:function(e){qn.depthFunc(e)},sg:function(e){qn.depthMask(!!e)},Nd:function(e,t){qn.depthRange(e,t)},Md:function(e,t){qn.detachShader(yr.programs[e],yr.shaders[t])},tg:function(e){qn.disable(e)},ug:function(e){qn.disableVertexAttribArray(e)},vg:function(e,t,r){qn.drawArrays(e,t,r)},pf:kr,Vd:Tr,Gb:Pr,nf:function(e,t,r,n,o){qn.dibvbi.drawArraysInstancedBaseInstanceWEBGL(e,t,r,n,o)},hd:Ar,Hb:Fr,lf:Br,fd:Rr,Wd:Or,wg:jr,qf:Ur,Ud:qr,Eb:$r,of:function(e,t,r,n,o,i,a){qn.dibvbi.drawElementsInstancedBaseVertexBaseInstanceWEBGL(e,t,r,n,o,i,a)},Fb:Hr,gd:Nr,ef:function(e,t,r,n,o,i){Mr(e,n,o,i)},xg:function(e){qn.enable(e)},yg:function(e){qn.enableVertexAttribArray(e)},Xc:function(e){qn.endQuery(e)},de:function(e){qn.disjointTimerQueryExt.endQueryEXT(e)},Jc:function(){qn.endTransformFeedback()},Ne:function(e,t){var r=qn.fenceSync(e,t);if(r){var n=yr.getNewId(yr.syncs);return r.name=n,yr.syncs[n]=r,n}return 0},zg:function(){qn.finish()},Ag:function(){qn.flush()},af:function(e,t,r,n){qn.framebufferRenderbuffer(e,t,r,yr.renderbuffers[n])},bf:function(e,t,r,n,o){qn.framebufferTexture2D(e,t,r,yr.textures[n],o)},Oc:function(e,t,r,n,o){qn.framebufferTextureLayer(e,t,yr.textures[r],n,o)},Bg:function(e){qn.frontFace(e)},Cg:function(e,t){Vr(e,t,"createBuffer",yr.buffers)},cf:function(e,t){Vr(e,t,"createFramebuffer",yr.framebuffers)},$c:function(e,t){Vr(e,t,"createQuery",yr.queries)},he:function(e,t){for(var r=0;r<e;r++){var n=qn.disjointTimerQueryExt.createQueryEXT();if(!n){for(yr.recordError(1282);r<e;)R[t+4*r++>>2]=0;return}var o=yr.getNewId(yr.queries);n.name=o,yr.queries[o]=n,R[t+4*r>>2]=o}},df:function(e,t){Vr(e,t,"createRenderbuffer",yr.renderbuffers)},Je:function(e,t){Vr(e,t,"createSampler",yr.samplers)},Dg:function(e,t){Vr(e,t,"createTexture",yr.textures)},Tb:function(e,t){Vr(e,t,"createTransformFeedback",yr.transformFeedbacks)},tf:zr,wf:Gr,Te:function(e){qn.generateMipmap(e)},Ld:function(e,t,r,n,o,i,a){Yr("getActiveAttrib",e,t,r,n,o,i,a)},Kd:function(e,t,r,n,o,i,a){Yr("getActiveUniform",e,t,r,n,o,i,a)},ec:function(e,t,r,n,o){e=yr.programs[e];var i=qn.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)},fc:function(e,t,r,n){if(n)if(e=yr.programs[e],35393!=r){var o=qn.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=qn.getActiveUniformBlockName(e,t);R[n>>2]=a.length+1}else yr.recordError(1281)},ic:function(e,t,r,n,o){if(o)if(t>0&&0==r)yr.recordError(1281);else{e=yr.programs[e];for(var i=[],a=0;a<t;a++)i.push(R[r+4*a>>2]);var s=qn.getActiveUniforms(e,i,n);if(s){var u=s.length;for(a=0;a<u;a++)R[o+4*a>>2]=s[a]}}else yr.recordError(1281)},Jd:function(e,t,r,n){var o=qn.getAttachedShaders(yr.programs[e]),i=o.length;i>t&&(i=t),R[r>>2]=i;for(var a=0;a<i;++a){var s=yr.shaders.indexOf(o[a]);R[n+4*a>>2]=s}},Id:function(e,t){return qn.getAttribLocation(yr.programs[e],Fe(t))},Hd:function(e,t){Kr(e,t,4)},$b:function(e,t,r){r?Xr(r,qn.getBufferParameter(e,t)):yr.recordError(1281)},Eg:function(e,t,r){r?R[r>>2]=qn.getBufferParameter(e,t):yr.recordError(1281)},Fg:function(){var e=qn.getError()||yr.lastError;return yr.lastError=0,e},Gg:function(e,t){Kr(e,t,2)},xc:function(e,t){return qn.getFragDataLocation(yr.programs[e],Fe(t))},Ue:function(e,t,r,n){var o=qn.getFramebufferAttachmentParameter(e,t,r);(o instanceof WebGLRenderbuffer||o instanceof WebGLTexture)&&(o=0|o.name),R[n>>2]=o},ac:function(e,t,r){Qr(e,t,r,1)},cc:function(e,t){Kr(e,t,1)},Lc:function(e,t,r){Qr(e,t,r,0)},fh:function(e,t){Kr(e,t,0)},Kb:function(e,t,r,n,o){if(n<0)yr.recordError(1281);else if(o){var i=qn.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 yr.recordError(1281)},Pb:function(e,t,r,n,o){yr.recordError(1282)},Hg:function(e,t,r,n){var o=qn.getProgramInfoLog(yr.programs[e]);null===o&&(o="(unknown error)");var i=t>0&&n?Mt(o,n,t):0;r&&(R[r>>2]=i)},Ig:function(e,t,r){if(r)if(e>=yr.counter)yr.recordError(1281);else if(e=yr.programs[e],35716==t){var n=qn.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<qn.getProgramParameter(e,35718);++o)e.maxUniformLength=Math.max(e.maxUniformLength,qn.getActiveUniform(e,o).name.length+1);R[r>>2]=e.maxUniformLength}else if(35722==t){if(!e.maxAttributeLength)for(o=0;o<qn.getProgramParameter(e,35721);++o)e.maxAttributeLength=Math.max(e.maxAttributeLength,qn.getActiveAttrib(e,o).name.length+1);R[r>>2]=e.maxAttributeLength}else if(35381==t){if(!e.maxUniformBlockNameLength)for(o=0;o<qn.getProgramParameter(e,35382);++o)e.maxUniformBlockNameLength=Math.max(e.maxUniformBlockNameLength,qn.getActiveUniformBlockName(e,o).length+1);R[r>>2]=e.maxUniformBlockNameLength}else R[r>>2]=qn.getProgramParameter(e,t);else yr.recordError(1281)},Zd:Jr,$d:tn,Yd:rn,Vc:function(e,t,r){if(r){var n,o=yr.queries[e],i=qn.getQueryParameter(o,t);n="boolean"==typeof i?i?1:0:i,R[r>>2]=n}else yr.recordError(1281)},_d:nn,Wc:function(e,t,r){r?R[r>>2]=qn.getQuery(e,t):yr.recordError(1281)},ae:function(e,t,r){r?R[r>>2]=qn.disjointTimerQueryExt.getQueryEXT(e,t):yr.recordError(1281)},Ve:function(e,t,r){r?R[r>>2]=qn.getRenderbufferParameter(e,t):yr.recordError(1281)},Wb:function(e,t,r){r?M[r>>2]=qn.getSamplerParameter(yr.samplers[e],t):yr.recordError(1281)},Xb:function(e,t,r){r?R[r>>2]=qn.getSamplerParameter(yr.samplers[e],t):yr.recordError(1281)},Jg:function(e,t,r,n){var o=qn.getShaderInfoLog(yr.shaders[e]);null===o&&(o="(unknown error)");var i=t>0&&n?Mt(o,n,t):0;r&&(R[r>>2]=i)},De:function(e,t,r,n){var o=qn.getShaderPrecisionFormat(e,t);R[r>>2]=o.rangeMin,R[r+4>>2]=o.rangeMax,R[n>>2]=o.precision},Gd:function(e,t,r,n){var o=qn.getShaderSource(yr.shaders[e]);if(o){var i=t>0&&n?Mt(o,n,t):0;r&&(R[r>>2]=i)}},Kg:function(e,t,r){if(r)if(35716==t){var n=qn.getShaderInfoLog(yr.shaders[e]);null===n&&(n="(unknown error)");var o=n?n.length+1:0;R[r>>2]=o}else if(35720==t){var i=qn.getShaderSource(yr.shaders[e]),a=i?i.length+1:0;R[r>>2]=a}else R[r>>2]=qn.getShaderParameter(yr.shaders[e],t);else yr.recordError(1281)},Ca:function(e){var t=yr.stringCache[e];if(!t){switch(e){case 7939:var r=qn.getSupportedExtensions()||[];r=r.concat(r.map((function(e){return"GL_"+e}))),t=nr(r.join(" "));break;case 7936:case 7937:case 37445:case 37446:var n=qn.getParameter(e);n||yr.recordError(1280),t=n&&nr(n);break;case 7938:var o=qn.getParameter(7938);o=yr.currentContext.version>=2?"OpenGL ES 3.0 ("+o+")":"OpenGL ES 2.0 ("+o+")",t=nr(o);break;case 35724:var i=qn.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=nr(i);break;default:yr.recordError(1280)}yr.stringCache[e]=t}return t},gh:function(e,t){if(yr.currentContext.version<2)return yr.recordError(1282),0;var r=yr.stringiCache[e];if(r)return t<0||t>=r.length?(yr.recordError(1281),0):r[t];if(7939===e){var n=qn.getSupportedExtensions()||[];return n=(n=n.concat(n.map((function(e){return"GL_"+e})))).map((function(e){return nr(e)})),r=yr.stringiCache[e]=n,t<0||t>=r.length?(yr.recordError(1281),0):r[t]}return yr.recordError(1280),0},bc:function(e,t,r,n,o){if(r<0)yr.recordError(1281);else if(o){var i=qn.getSyncParameter(yr.syncs[e],t);null!==i&&(R[o>>2]=i,n&&(R[n>>2]=1))}else yr.recordError(1281)},Fd:function(e,t,r){r?M[r>>2]=qn.getTexParameter(e,t):yr.recordError(1281)},Ed:function(e,t,r){r?R[r>>2]=qn.getTexParameter(e,t):yr.recordError(1281)},Fc:function(e,t,r,n,o,i,a){e=yr.programs[e];var s=qn.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)}},gc:function(e,t){return qn.getUniformBlockIndex(yr.programs[e],Fe(t))},jc:function(e,t,r,n){if(n)if(t>0&&(0==r||0==n))yr.recordError(1281);else{e=yr.programs[e];for(var o=[],i=0;i<t;i++)o.push(Fe(R[r+4*i>>2]));var a=qn.getUniformIndices(e,o);if(a){var s=a.length;for(i=0;i<s;i++)R[n+4*i>>2]=a[i]}}else yr.recordError(1281)},Lg:function(e,t){if(t=Fe(t),e=yr.programs[e]){an(e);var r=e.uniformLocsById,n=0,o=t,i=on(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]||qn.getUniformLocation(e,t)))return n}else yr.recordError(1281);var s;return-1},Dd:function(e,t,r){un(e,t,r,2)},Cd:function(e,t,r){un(e,t,r,0)},yc:function(e,t,r){un(e,t,r,0)},Ec:dn,Dc:fn,zd:function(e,t,r){r?R[r>>2]=qn.getVertexAttribOffset(e,t):yr.recordError(1281)},Bd:function(e,t,r){ln(e,t,r,2)},Ad:function(e,t,r){ln(e,t,r,5)},yd:function(e,t){qn.hint(e,t)},Ee:function(e,t,r){for(var n=Lr[t],o=0;o<t;o++)n[o]=R[r+4*o>>2];qn.invalidateFramebuffer(e,n)},Ge:function(e,t,r,n,o,i,a){for(var s=Lr[t],u=0;u<t;u++)s[u]=R[r+4*u>>2];qn.invalidateSubFramebuffer(e,s,n,o,i,a)},xd:function(e){var t=yr.buffers[e];return t?qn.isBuffer(t):0},wd:function(e){return qn.isEnabled(e)},vd:function(e){var t=yr.framebuffers[e];return t?qn.isFramebuffer(t):0},ud:function(e){return(e=yr.programs[e])?qn.isProgram(e):0},Zc:function(e){var t=yr.queries[e];return t?qn.isQuery(t):0},fe:function(e){var t=yr.queries[e];return t?qn.disjointTimerQueryExt.isQueryEXT(t):0},td:function(e){var t=yr.renderbuffers[e];return t?qn.isRenderbuffer(t):0},_b:function(e){var t=yr.samplers[e];return t?qn.isSampler(t):0},sd:function(e){var t=yr.shaders[e];return t?qn.isShader(t):0},Oe:function(e){return qn.isSync(yr.syncs[e])},Mg:function(e){var t=yr.textures[e];return t?qn.isTexture(t):0},Sb:function(e){return qn.isTransformFeedback(yr.transformFeedbacks[e])},Mc:hn,Xd:mn,Ng:function(e){qn.lineWidth(e)},Og:function(e){e=yr.programs[e],qn.linkProgram(e),e.uniformLocsById=0,e.uniformSizeAndIdsByName={}},jf:function(e,t,r,n,o,i){qn.mdibvbi.multiDrawArraysInstancedBaseInstanceWEBGL(e,R,t>>2,R,r>>2,R,n>>2,O,o>>2,i)},kf:function(e,t,r,n,o,i,a,s){qn.mdibvbi.multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL(e,R,t>>2,r,R,n>>2,R,o>>2,R,i>>2,O,a>>2,s)},Rb:function(){qn.pauseTransformFeedback()},Pg:function(e,t){3317==e&&(yr.unpackAlignment=t),qn.pixelStorei(e,t)},rd:function(e,t){qn.polygonOffset(e,t)},Ob:function(e,t,r,n){yr.recordError(1280)},Mb:function(e,t,r){yr.recordError(1280)},be:function(e,t){qn.disjointTimerQueryExt.queryCounterEXT(yr.queries[e],t)},mf:function(e){qn.readBuffer(e)},Qg:function(e,t,r,n,o,i,a){if(yr.currentContext.version>=2)if(qn.currentPixelPackBufferBinding)qn.readPixels(e,t,r,n,o,i,a);else{var s=gn(i);qn.readPixels(e,t,r,n,o,i,s,a>>yn(s))}else{var u=vn(i,o,r,n,a);u?qn.readPixels(e,t,r,n,o,i,u):yr.recordError(1280)}},qd:function(){},We:function(e,t,r,n){qn.renderbufferStorage(e,t,r,n)},Se:function(e,t,r,n,o){qn.renderbufferStorageMultisample(e,t,r,n,o)},Qb:function(){qn.resumeTransformFeedback()},pd:function(e,t){qn.sampleCoverage(e,!!t)},Ke:function(e,t,r){qn.samplerParameterf(yr.samplers[e],t,r)},Zb:function(e,t,r){var n=M[r>>2];qn.samplerParameterf(yr.samplers[e],t,n)},Le:function(e,t,r){qn.samplerParameteri(yr.samplers[e],t,r)},Me:function(e,t,r){var n=R[r>>2];qn.samplerParameteri(yr.samplers[e],t,n)},Rg:function(e,t,r,n){qn.scissor(e,t,r,n)},od:function(e,t,r,n,o){yr.recordError(1280)},Sg:function(e,t,r,n){var o=yr.getSource(e,t,r,n);if(yr.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)}qn.shaderSource(yr.shaders[e],o)},Tg:function(e,t,r){qn.stencilFunc(e,t,r)},Ug:function(e,t,r,n){qn.stencilFuncSeparate(e,t,r,n)},Vg:function(e){qn.stencilMask(e)},Wg:function(e,t){qn.stencilMaskSeparate(e,t)},Xg:function(e,t,r){qn.stencilOp(e,t,r)},Yg:function(e,t,r,n){qn.stencilOpSeparate(e,t,r,n)},Zg:function(e,t,r,n,o,i,a,s,u){if(yr.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)),yr.currentContext.version>=2)if(qn.currentPixelUnpackBufferBinding)qn.texImage2D(e,t,r,n,o,i,a,s,u);else if(u){var l=gn(s);qn.texImage2D(e,t,r,n,o,i,a,s,l,u>>yn(l))}else qn.texImage2D(e,t,r,n,o,i,a,s,null);else qn.texImage2D(e,t,r,n,o,i,a,s,u?vn(s,a,n,o,u):null)},ed:function(e,t,r,n,o,i,a,s,u,l){if(qn.currentPixelUnpackBufferBinding)qn.texImage3D(e,t,r,n,o,i,a,s,u,l);else if(l){var c=gn(u);qn.texImage3D(e,t,r,n,o,i,a,s,u,c,l>>yn(c))}else qn.texImage3D(e,t,r,n,o,i,a,s,u,null)},_g:function(e,t,r){qn.texParameterf(e,t,r)},$g:function(e,t,r){var n=M[r>>2];qn.texParameterf(e,t,n)},ah:function(e,t,r){qn.texParameteri(e,t,r)},bh:function(e,t,r){var n=R[r>>2];qn.texParameteri(e,t,n)},ff:function(e,t,r,n,o){qn.texStorage2D(e,t,r,n,o)},Lb:function(e,t,r,n,o,i){qn.texStorage3D(e,t,r,n,o,i)},ch:function(e,t,r,n,o,i,a,s,u){if(yr.currentContext.version>=2&&36193==s&&(s=5131),yr.currentContext.version>=2)if(qn.currentPixelUnpackBufferBinding)qn.texSubImage2D(e,t,r,n,o,i,a,s,u);else if(u){var l=gn(s);qn.texSubImage2D(e,t,r,n,o,i,a,s,l,u>>yn(l))}else qn.texSubImage2D(e,t,r,n,o,i,a,s,null);else{var c=null;u&&(c=vn(s,a,o,i,u)),qn.texSubImage2D(e,t,r,n,o,i,a,s,c)}},dd:function(e,t,r,n,o,i,a,s,u,l,c){if(qn.currentPixelUnpackBufferBinding)qn.texSubImage3D(e,t,r,n,o,i,a,s,u,l,c);else if(c){var d=gn(l);qn.texSubImage3D(e,t,r,n,o,i,a,s,u,l,d,c>>yn(d))}else qn.texSubImage3D(e,t,r,n,o,i,a,s,u,l,null)},Gc:function(e,t,r,n){e=yr.programs[e];for(var o=[],i=0;i<t;i++)o.push(Fe(R[r+4*i>>2]));qn.transformFeedbackVaryings(e,o,n)},dh:function(e,t){qn.uniform1f(sn(e),t)},eh:function(e,t,r){if(yr.currentContext.version>=2)t&&qn.uniform1fv(sn(e),M,r>>2,t);else{if(t<=288)for(var n=bn[t-1],o=0;o<t;++o)n[o]=M[r+4*o>>2];else n=M.subarray(r>>2,r+4*t>>2);qn.uniform1fv(sn(e),n)}},Rf:function(e,t){qn.uniform1i(sn(e),t)},Sf:function(e,t,r){if(yr.currentContext.version>=2)t&&qn.uniform1iv(sn(e),R,r>>2,t);else{if(t<=288)for(var n=wn[t-1],o=0;o<t;++o)n[o]=R[r+4*o>>2];else n=R.subarray(r>>2,r+4*t>>2);qn.uniform1iv(sn(e),n)}},wc:function(e,t){qn.uniform1ui(sn(e),t)},rc:function(e,t,r){t&&qn.uniform1uiv(sn(e),O,r>>2,t)},Tf:function(e,t,r){qn.uniform2f(sn(e),t,r)},Uf:function(e,t,r){if(yr.currentContext.version>=2)t&&qn.uniform2fv(sn(e),M,r>>2,2*t);else{if(t<=144)for(var n=bn[2*t-1],o=0;o<2*t;o+=2)n[o]=M[r+4*o>>2],n[o+1]=M[r+(4*o+4)>>2];else n=M.subarray(r>>2,r+8*t>>2);qn.uniform2fv(sn(e),n)}},Qf:function(e,t,r){qn.uniform2i(sn(e),t,r)},Pf:function(e,t,r){if(yr.currentContext.version>=2)t&&qn.uniform2iv(sn(e),R,r>>2,2*t);else{if(t<=144)for(var n=wn[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);qn.uniform2iv(sn(e),n)}},vc:function(e,t,r){qn.uniform2ui(sn(e),t,r)},qc:function(e,t,r){t&&qn.uniform2uiv(sn(e),O,r>>2,2*t)},Of:function(e,t,r,n){qn.uniform3f(sn(e),t,r,n)},Nf:function(e,t,r){if(yr.currentContext.version>=2)t&&qn.uniform3fv(sn(e),M,r>>2,3*t);else{if(t<=96)for(var n=bn[3*t-1],o=0;o<3*t;o+=3)n[o]=M[r+4*o>>2],n[o+1]=M[r+(4*o+4)>>2],n[o+2]=M[r+(4*o+8)>>2];else n=M.subarray(r>>2,r+12*t>>2);qn.uniform3fv(sn(e),n)}},Mf:function(e,t,r,n){qn.uniform3i(sn(e),t,r,n)},Lf:function(e,t,r){if(yr.currentContext.version>=2)t&&qn.uniform3iv(sn(e),R,r>>2,3*t);else{if(t<=96)for(var n=wn[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);qn.uniform3iv(sn(e),n)}},uc:function(e,t,r,n){qn.uniform3ui(sn(e),t,r,n)},pc:function(e,t,r){t&&qn.uniform3uiv(sn(e),O,r>>2,3*t)},Kf:function(e,t,r,n,o){qn.uniform4f(sn(e),t,r,n,o)},Jf:function(e,t,r){if(yr.currentContext.version>=2)t&&qn.uniform4fv(sn(e),M,r>>2,4*t);else{if(t<=72){var n=bn[4*t-1],o=M;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=M.subarray(r>>2,r+16*t>>2);qn.uniform4fv(sn(e),n)}},xf:function(e,t,r,n,o){qn.uniform4i(sn(e),t,r,n,o)},yf:function(e,t,r){if(yr.currentContext.version>=2)t&&qn.uniform4iv(sn(e),R,r>>2,4*t);else{if(t<=72)for(var n=wn[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);qn.uniform4iv(sn(e),n)}},tc:function(e,t,r,n,o){qn.uniform4ui(sn(e),t,r,n,o)},oc:function(e,t,r){t&&qn.uniform4uiv(sn(e),O,r>>2,4*t)},dc:function(e,t,r){e=yr.programs[e],qn.uniformBlockBinding(e,t,r)},zf:function(e,t,r,n){if(yr.currentContext.version>=2)t&&qn.uniformMatrix2fv(sn(e),!!r,M,n>>2,4*t);else{if(t<=72)for(var o=bn[4*t-1],i=0;i<4*t;i+=4)o[i]=M[n+4*i>>2],o[i+1]=M[n+(4*i+4)>>2],o[i+2]=M[n+(4*i+8)>>2],o[i+3]=M[n+(4*i+12)>>2];else o=M.subarray(n>>2,n+16*t>>2);qn.uniformMatrix2fv(sn(e),!!r,o)}},Uc:function(e,t,r,n){t&&qn.uniformMatrix2x3fv(sn(e),!!r,M,n>>2,6*t)},Sc:function(e,t,r,n){t&&qn.uniformMatrix2x4fv(sn(e),!!r,M,n>>2,8*t)},Af:function(e,t,r,n){if(yr.currentContext.version>=2)t&&qn.uniformMatrix3fv(sn(e),!!r,M,n>>2,9*t);else{if(t<=32)for(var o=bn[9*t-1],i=0;i<9*t;i+=9)o[i]=M[n+4*i>>2],o[i+1]=M[n+(4*i+4)>>2],o[i+2]=M[n+(4*i+8)>>2],o[i+3]=M[n+(4*i+12)>>2],o[i+4]=M[n+(4*i+16)>>2],o[i+5]=M[n+(4*i+20)>>2],o[i+6]=M[n+(4*i+24)>>2],o[i+7]=M[n+(4*i+28)>>2],o[i+8]=M[n+(4*i+32)>>2];else o=M.subarray(n>>2,n+36*t>>2);qn.uniformMatrix3fv(sn(e),!!r,o)}},Tc:function(e,t,r,n){t&&qn.uniformMatrix3x2fv(sn(e),!!r,M,n>>2,6*t)},Qc:function(e,t,r,n){t&&qn.uniformMatrix3x4fv(sn(e),!!r,M,n>>2,12*t)},Bf:function(e,t,r,n){if(yr.currentContext.version>=2)t&&qn.uniformMatrix4fv(sn(e),!!r,M,n>>2,16*t);else{if(t<=18){var o=bn[16*t-1],i=M;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=M.subarray(n>>2,n+64*t>>2);qn.uniformMatrix4fv(sn(e),!!r,o)}},Rc:function(e,t,r,n){t&&qn.uniformMatrix4x2fv(sn(e),!!r,M,n>>2,8*t)},Pc:function(e,t,r,n){t&&qn.uniformMatrix4x3fv(sn(e),!!r,M,n>>2,12*t)},Cf:function(e){e=yr.programs[e],qn.useProgram(e),qn.currentProgram=e},nd:function(e){qn.validateProgram(yr.programs[e])},Df:function(e,t){qn.vertexAttrib1f(e,t)},md:function(e,t){qn.vertexAttrib1f(e,M[t>>2])},ld:function(e,t,r){qn.vertexAttrib2f(e,t,r)},Ef:function(e,t){qn.vertexAttrib2f(e,M[t>>2],M[t+4>>2])},kd:function(e,t,r,n){qn.vertexAttrib3f(e,t,r,n)},Ff:function(e,t){qn.vertexAttrib3f(e,M[t>>2],M[t+4>>2],M[t+8>>2])},jd:function(e,t,r,n,o){qn.vertexAttrib4f(e,t,r,n,o)},Gf:function(e,t){qn.vertexAttrib4f(e,M[t>>2],M[t+4>>2],M[t+8>>2],M[t+12>>2])},gf:Cn,Td:_n,Ib:Sn,id:xn,Jb:kn,Cc:function(e,t,r,n,o){qn.vertexAttribI4i(e,t,r,n,o)},Ac:function(e,t){qn.vertexAttribI4i(e,R[t>>2],R[t+4>>2],R[t+8>>2],R[t+12>>2])},Bc:function(e,t,r,n,o){qn.vertexAttribI4ui(e,t,r,n,o)},zc:function(e,t){qn.vertexAttribI4ui(e,O[t>>2],O[t+4>>2],O[t+8>>2],O[t+12>>2])},hf:function(e,t,r,n,o){qn.vertexAttribIPointer(e,t,r,n,o)},Hf:function(e,t,r,n,o,i){qn.vertexAttribPointer(e,t,r,!!n,o,i)},If:function(e,t,r,n){qn.viewport(e,t,r,n)},Ea:function(e,t,r){r=Number(r),qn.waitSync(yr.syncs[e],t,r)},Cb:(e,t,r)=>L.copyWithin(e,t,t+r),kb:e=>{var t=L.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(Tn(a))return!0}return!1},Va: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})},Ma: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})},_a: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})},Qa: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})},Ra: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})},Ia: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})},Ua: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)}},La: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)},Ya: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)}},Pa: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)},Ka: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()},Oa: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++},Ja:async function(e,t){const r=s.emscripten_ubq_codec_audioEncoders.get(e);await r.audioEncoder.flush(),s.emscripten_ubq_codec_onFinalizedAudioEncoding(e,t)},Na:async function(e,t){const r=s.emscripten_ubq_codec_videoEncoders.get(e);await r.videoEncoder.flush(),s.emscripten_ubq_codec_onFinalizedVideoEncoding(e,t)},Ta: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},Y: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},ja:function(e){return s.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder.decodeQueueSize},ka:function(e){return s.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder.decodedFrames},$:function(e){return s.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder.writtenFrames},Sa:function(e){return s.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder.flushing},Xa:function(e){return s.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder.flushing},Z:function(){return"undefined"!=typeof VideoFrame&&"undefined"!=typeof VideoDecoder&&"undefined"!=typeof VideoEncoder&&"undefined"!=typeof AudioDecoder&&"undefined"!=typeof AudioEncoder},Wa:function(e,t){s.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder.requestedFrame=t},Za: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]=yr.textures[o[e]]},pe:function(e){const t=s.emscripten_ubq_asyncFetchManager.getProcess(e);return!!(null==t?void 0:t.allocate())},fa:function(e,t,r,n){return s.emscripten_ubq_asyncFetchManager.createHeader(e,t,r,n)},te:function(e){s.emscripten_ubq_asyncFetchManager.deleteHeader(e)},ue: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},me:function(e){return s.emscripten_ubq_asyncFetchManager.deleteProcess(e)},se: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},oe:function(e){const t=s.emscripten_ubq_asyncFetchManager.getProcess(e);return(null==t?void 0:t.isAllocated())?t.resultAddress:-1},ne:function(e){const t=s.emscripten_ubq_asyncFetchManager.getProcess(e);return(null==t?void 0:t.isAllocated())?t.resultLength:-1},ya: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},qe: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},bb:function(){return!!s.emscripten_ubq_settings_forceWebGL1},ma: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:An[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:yr.createContext(i,o):0},la:function(e){yr.currentContext==e&&(yr.currentContext=0),yr.deleteContext(e)},cb:function(e,t){var r=yr.getContext(e),n=Fe(t);return n.startsWith("GL_")&&(n=n.substr(3)),"ANGLE_instanced_arrays"==n&&dr(qn),"OES_vertex_array_object"==n&&fr(qn),"WEBGL_draw_buffers"==n&&pr(qn),"WEBGL_draw_instanced_base_vertex_base_instance"==n&&hr(qn),"WEBGL_multi_draw_instanced_base_vertex_base_instance"==n&&mr(qn),"WEBGL_multi_draw"==n&&gr(qn),!!r.GLctx.getExtension(n)},ab: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},db:function(e){return yr.makeContextCurrent(e)?0:-5},tb:(e,t)=>{var r=0;return Rn().forEach((function(n,o){var i=t+r;O[e+4*o>>2]=i,((e,t)=>{for(var r=0;r<e.length;++r)F[t++>>0]=e.charCodeAt(r);F[t>>0]=0})(n,i),r+=n.length+1})),0},ub:(e,t)=>{var r=Rn();O[e>>2]=r.length;var n=0;return r.forEach((function(e){n+=e.length+1})),O[t>>2]=n,0},xe:ar,ba:function(e){try{var t=Le.getStreamFromFD(e);return Ae.close(t),0}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return e.errno}},lb:function(e,t,r,n,o){t=Qt(t),r=Qt(r),n=Qt(n),o=Qt(o);try{if(isNaN(n))return 61;var i=Le.getStreamFromFD(e),a=On(i,t,r,n);return O[o>>2]=a,0}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return e.errno}},ra:function(e,t,r,n){try{var o=Le.getStreamFromFD(e),i=On(o,t,r);return O[n>>2]=i,0}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return e.errno}},sb:function(e,t,r,n){t=Qt(t),n=Qt(n);try{if(isNaN(t))return 61;var o=Le.getStreamFromFD(e);return Ae.llseek(o,t,r),j[n>>3]=BigInt(o.position),o.getdents&&0===t&&0===r&&(o.getdents=null),0}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return e.errno}},qa:function(e,t,r,n){try{var o=((e,t,r,n)=>{for(var o=0,i=0;i<r;i++){var a=O[t>>2],s=O[t+4>>2];t+=8;var u=Ae.write(e,F,a,s,n);if(u<0)return-1;o+=u,void 0!==n&&(n+=u)}return o})(Le.getStreamFromFD(e),t,r);return O[n>>2]=o,0}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return e.errno}},fb:(e,t)=>(ge(L.subarray(e,e+t)),0),x:function(e,t,r){var n=no();try{return Et(e)(t,r)}catch(e){if(oo(n),e!==e+0)throw e;ro(1,0)}},N:function(e,t){var r=no();try{return Et(e)(t)}catch(e){if(oo(r),e!==e+0)throw e;ro(1,0)}},G:function(e,t,r){var n=no();try{return Et(e)(t,r)}catch(e){if(oo(n),e!==e+0)throw e;ro(1,0)}},l:function(e,t,r,n){var o=no();try{return Et(e)(t,r,n)}catch(e){if(oo(o),e!==e+0)throw e;ro(1,0)}},Fa:function(e){var t=no();try{return Et(e)()}catch(e){if(oo(t),e!==e+0)throw e;ro(1,0)}},ha:function(e,t,r){var n=no();try{return Et(e)(t,r)}catch(e){if(oo(n),e!==e+0)throw e;ro(1,0)}},q:function(e,t){var r=no();try{return Et(e)(t)}catch(e){if(oo(r),e!==e+0)throw e;ro(1,0)}},W:function(e,t,r,n,o,i,a,s,u,l,c,d,f,p,h,m){var g=no();try{return Et(e)(t,r,n,o,i,a,s,u,l,c,d,f,p,h,m)}catch(e){if(oo(g),e!==e+0)throw e;ro(1,0)}},p:function(e,t,r){var n=no();try{return Et(e)(t,r)}catch(e){if(oo(n),e!==e+0)throw e;ro(1,0)}},r:function(e,t,r,n){var o=no();try{return Et(e)(t,r,n)}catch(e){if(oo(o),e!==e+0)throw e;ro(1,0)}},T:function(e,t,r,n,o){var i=no();try{return Et(e)(t,r,n,o)}catch(e){if(oo(i),e!==e+0)throw e;ro(1,0)}},Ce:function(e,t,r,n,o,i){var a=no();try{return Et(e)(t,r,n,o,i)}catch(e){if(oo(a),e!==e+0)throw e;ro(1,0)}},Aa:function(e,t,r,n,o,i,a){var s=no();try{return Et(e)(t,r,n,o,i,a)}catch(e){if(oo(s),e!==e+0)throw e;ro(1,0)}},za:function(e,t,r,n,o,i,a,s,u,l){var c=no();try{return Et(e)(t,r,n,o,i,a,s,u,l)}catch(e){if(oo(c),e!==e+0)throw e;ro(1,0)}},R:function(e){var t=no();try{Et(e)()}catch(e){if(oo(t),e!==e+0)throw e;ro(1,0)}},s:function(e,t){var r=no();try{Et(e)(t)}catch(e){if(oo(r),e!==e+0)throw e;ro(1,0)}},B:function(e,t,r,n){var o=no();try{Et(e)(t,r,n)}catch(e){if(oo(o),e!==e+0)throw e;ro(1,0)}},F:function(e,t,r){var n=no();try{Et(e)(t,r)}catch(e){if(oo(n),e!==e+0)throw e;ro(1,0)}},o:function(e,t,r,n){var o=no();try{Et(e)(t,r,n)}catch(e){if(oo(o),e!==e+0)throw e;ro(1,0)}},D:function(e,t,r,n,o){var i=no();try{Et(e)(t,r,n,o)}catch(e){if(oo(i),e!==e+0)throw e;ro(1,0)}},Be:function(e,t,r,n,o,i){var a=no();try{Et(e)(t,r,n,o,i)}catch(e){if(oo(a),e!==e+0)throw e;ro(1,0)}},ze:function(e,t,r,n,o,i,a){var s=no();try{Et(e)(t,r,n,o,i,a)}catch(e){if(oo(s),e!==e+0)throw e;ro(1,0)}},hh:function(e,t,r,n,o,i,a,s){var u=no();try{Et(e)(t,r,n,o,i,a,s)}catch(e){if(oo(u),e!==e+0)throw e;ro(1,0)}},Ae:function(e,t,r,n,o,i,a,s,u,l){var c=no();try{Et(e)(t,r,n,o,i,a,s,u,l)}catch(e){if(oo(c),e!==e+0)throw e;ro(1,0)}},ia:function(e,t){const r=Dt.toValue(t),n=s.ctx;n.bindTexture(n.TEXTURE_2D,yr.textures[e]),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,r)},a:k,gb:(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=Jt(r.getFullYear()),o=r.getMonth(),i=(n?Mn:jn)[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})(Jt(e.tm_year+1900)?Mn:jn,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&&Jt(e.tm_year)||(t=1)}}else{t=52;var n=(e.tm_wday+7-e.tm_yday-1)%7;(4==n||5==n&&Jt(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)},Yn=(function(){var e,t,r,n,i={a:Gn};function a(e,t){var r,n=e.exports;return N=(T=n).kh,r=T.ih,z.unshift(r),re(),n}if(te(),s.instantiateWasm)try{return s.instantiateWasm(i,a)}catch(e){x("Module.instantiateWasm callback failed with error: "+e),o(e)}(e=_,t=K,r=i,n=function(e){a(e.instance)},e||"function"!=typeof WebAssembly.instantiateStreaming||oe(t)||b||"function"!=typeof fetch?se(t,r,n):fetch(t,{credentials:"same-origin"}).then((e=>WebAssembly.instantiateStreaming(e,r).then(n,(function(e){return x("wasm streaming compile failed: "+e),x("falling back to ArrayBuffer instantiation"),se(t,r,n)}))))).catch(o)}(),s._malloc=e=>(Yn=s._malloc=T.jh)(e)),Xn=s._free=e=>(Xn=s._free=T.lh)(e),Kn=()=>(Kn=T.mh)(),Qn=(s._ma_malloc_emscripten=(e,t)=>(s._ma_malloc_emscripten=T.nh)(e,t),s._ma_free_emscripten=(e,t)=>(s._ma_free_emscripten=T.oh)(e,t),s._ma_device_process_pcm_frames_capture__webaudio=(e,t,r)=>(Qn=s._ma_device_process_pcm_frames_capture__webaudio=T.ph)(e,t,r)),Zn=s._ma_device_process_pcm_frames_playback__webaudio=(e,t,r)=>(Zn=s._ma_device_process_pcm_frames_playback__webaudio=T.qh)(e,t,r),Jn=e=>(Jn=T.rh)(e),eo=e=>(eo=T.sh)(e),to=(s.__embind_initialize_bindings=()=>(s.__embind_initialize_bindings=T.th)(),(e,t)=>(to=T.uh)(e,t)),ro=(e,t)=>(ro=T.vh)(e,t),no=()=>(no=T.wh)(),oo=e=>(oo=T.xh)(e),io=e=>(io=T.yh)(e),ao=e=>(ao=T.zh)(e),so=e=>(so=T.Ah)(e),uo=(e,t,r)=>(uo=T.Bh)(e,t,r),lo=e=>(lo=T.Ch)(e);function co(){function e(){zn||(zn=!0,s.calledRun=!0,q||(s.noFSInit||Ae.init.initialized||Ae.init(),Ae.ignorePermissions=!1,Se.init(),ce(z),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(),Y.unshift(e);var e;ce(Y)}()))}Z>0||(function(){if(s.preRun)for("function"==typeof s.preRun&&(s.preRun=[s.preRun]);s.preRun.length;)e=s.preRun.shift(),W.unshift(e);var e;ce(W)}(),Z>0||(s.setStatus?(s.setStatus("Running..."),setTimeout((function(){setTimeout((function(){s.setStatus("")}),1),e()}),1)):e()))}if(s.___start_em_js=2363115,s.___stop_em_js=2363366,s.addRunDependency=te,s.removeRunDependency=re,s.FS_createPath=Ae.createPath,s.FS_createDataFile=Ae.createDataFile,s.FS_createLazyFile=Ae.createLazyFile,s.FS_createDevice=Ae.createDevice,s.FS_unlink=Ae.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=Ee(e)+1,r=io(t);return Mt(e,r,t),r})(e)),t},array:e=>{var t=io(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=no()),u[c]=d(n[c])):u[c]=n[c]}var f=a.apply(null,u);return function(e){return 0!==l&&oo(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 F[e>>0];case"i16":return D[e>>1];case"i32":return R[e>>2];case"i64":return j[e>>3];case"float":return M[e>>2];case"double":return U[e>>3];case"*":return O[e>>2];default:ne(`invalid type for getValue: ${t}`)}},s.UTF8ToString=Fe,s.specialHTMLTargets=Fn,s.FS_createPreloadedFile=Ae.createPreloadedFile,ee=function e(){zn||co(),zn||(ee=e)},s.preInit)for("function"==typeof s.preInit&&(s.preInit=[s.preInit]);s.preInit.length>0;)s.preInit.pop()();return co(),e.ready});e.exports=o},2021:(e,t)=>{t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,i=u(e),a=i[0],s=i[1],l=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,s)),c=0,d=s>0?a-4:a;for(r=0;r<d;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],l[c++]=t>>16&255,l[c++]=t>>8&255,l[c++]=255&t;return 2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,l[c++]=255&t),1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,l[c++]=t>>8&255,l[c++]=255&t),l},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=16383,s=0,u=n-o;s<u;s+=a)i.push(l(e,s,s+a>u?u:s+a));return 1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=i.length;a<s;++a)r[a]=i[a],n[i.charCodeAt(a)]=a;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e,t,n){for(var o,i,a=[],s=t;s<n;s+=3)o=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},808:(e,t,r)=>{var n=r(2021),o=r(7410),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.h2=50;var a=2147483647;function s(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|m(e,t),n=s(r),o=n.write(e,t);return o!==r&&(n=n.slice(0,o)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if($(e,Uint8Array)){var t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if($(e,ArrayBuffer)||e&&$(e.buffer,ArrayBuffer))return p(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&($(e,SharedArrayBuffer)||e&&$(e.buffer,SharedArrayBuffer)))return p(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);var o=function(e){if(u.isBuffer(e)){var t=0|h(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||H(e.length)?s(0):f(e):"Buffer"===e.type&&Array.isArray(e.data)?f(e.data):void 0}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return c(e),s(e<0?0:0|h(e))}function f(e){for(var t=e.length<0?0:0|h(e.length),r=s(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function p(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,u.prototype),n}function h(e){if(e>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function m(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||$(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var o=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return I(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return U(e).length;default:if(o)return n?-1:I(e).length;t=(""+t).toLowerCase(),o=!0}}function g(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return F(this,t,r);case"utf8":case"utf-8":return k(this,t,r);case"ascii":return P(this,t,r);case"latin1":case"binary":return A(this,t,r);case"base64":return x(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function y(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function v(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),H(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,n,o){var i,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var c=-1;for(i=r;i<s;i++)if(l(e,i)===l(t,-1===c?0:i-c)){if(-1===c&&(c=i),i-c+1===u)return c*a}else-1!==c&&(i-=i-c),c=-1}else for(r+u>s&&(r=s-u),i=r;i>=0;i--){for(var d=!0,f=0;f<u;f++)if(l(e,i+f)!==l(t,f)){d=!1;break}if(d)return i}return-1}function w(e,t,r,n){r=Number(r)||0;var o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=t.length;n>i/2&&(n=i/2);for(var a=0;a<n;++a){var s=parseInt(t.substr(2*a,2),16);if(H(s))return a;e[r+a]=s}return a}function E(e,t,r,n){return q(I(t,e.length-r),e,r,n)}function C(e,t,r,n){return q(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function _(e,t,r,n){return q(U(t),e,r,n)}function S(e,t,r,n){return q(function(e,t){for(var r,n,o,i=[],a=0;a<e.length&&!((t-=2)<0);++a)n=(r=e.charCodeAt(a))>>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function x(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function k(e,t,r){r=Math.min(e.length,r);for(var n=[],o=t;o<r;){var i,a,s,u,l=e[o],c=null,d=l>239?4:l>223?3:l>191?2:1;if(o+d<=r)switch(d){case 1:l<128&&(c=l);break;case 2:128==(192&(i=e[o+1]))&&(u=(31&l)<<6|63&i)>127&&(c=u);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(u=(15&l)<<12|(63&i)<<6|63&a)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:i=e[o+1],a=e[o+2],s=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(u=(15&l)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,d=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),o+=d}return function(e){var t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=T));return r}(n)}u.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return function(e,t,r){return c(e),e<=0?s(e):void 0!==t?"string"==typeof r?s(e).fill(t,r):s(e).fill(t):s(e)}(e,t,r)},u.allocUnsafe=function(e){return d(e)},u.allocUnsafeSlow=function(e){return d(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if($(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),$(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=u.allocUnsafe(t),o=0;for(r=0;r<e.length;++r){var i=e[r];if($(i,Uint8Array))o+i.length>n.length?u.from(i).copy(n,o):Uint8Array.prototype.set.call(n,i,o);else{if(!u.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o)}o+=i.length}return n},u.byteLength=m,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)y(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},u.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?k(this,0,e):g.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",r=t.h2;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},i&&(u.prototype[i]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,o){if($(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(i,a),l=this.slice(n,o),c=e.slice(t,r),d=0;d<s;++d)if(l[d]!==c[d]){i=l[d],a=c[d];break}return i<a?-1:a<i?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return v(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return v(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return E(this,e,t,r);case"ascii":case"latin1":case"binary":return C(this,e,t,r);case"base64":return _(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var T=4096;function P(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function A(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function F(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=t;i<r;++i)o+=N[e[i]];return o}function L(e,t,r){for(var n=e.slice(t,r),o="",i=0;i<n.length-1;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function D(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function B(e,t,r,n,o,i){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function R(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function O(e,t,r,n,i){return t=+t,r>>>=0,i||R(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function M(e,t,r,n,i){return t=+t,r>>>=0,i||R(e,0,r,8),o.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);for(var n=this[e],o=1,i=0;++i<t&&(o*=256);)n+=this[e+i]*o;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);for(var n=this[e+--t],o=1;t>0&&(o*=256);)n+=this[e+--t]*o;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||D(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||D(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);for(var n=this[e],o=1,i=0;++i<t&&(o*=256);)n+=this[e+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);for(var n=t,o=1,i=this[e+--n];n>0&&(o*=256);)i+=this[e+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||D(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||D(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||D(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||D(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return e>>>=0,t||D(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||D(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||D(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||D(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||B(this,e,t,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||B(this,e,t,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var o=Math.pow(2,8*r-1);B(this,e,t,r,o-1,-o)}var i=0,a=1,s=0;for(this[t]=255&e;++i<r&&(a*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var o=Math.pow(2,8*r-1);B(this,e,t,r,o-1,-o)}var i=r-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeFloatLE=function(e,t,r){return O(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return O(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return M(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return M(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var o=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),o},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var o=e.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(e=o)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{var a=u.isBuffer(e)?e:u.from(e,n),s=a.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=a[i%s]}return this};var j=/[^+/0-9A-Za-z-_]/g;function I(e,t){var r;t=t||1/0;for(var n=e.length,o=null,i=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function U(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(j,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function q(e,t,r,n){for(var o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function $(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function H(e){return e!=e}var N=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=16*r,o=0;o<16;++o)t[n+o]=e[r]+e[o];return t}()},7410:(e,t)=>{t.read=function(e,t,r,n,o){var i,a,s=8*o-n-1,u=(1<<s)-1,l=u>>1,c=-7,d=r?o-1:0,f=r?-1:1,p=e[t+d];for(d+=f,i=p&(1<<-c)-1,p>>=-c,c+=s;c>0;i=256*i+e[t+d],d+=f,c-=8);for(a=i&(1<<-c)-1,i>>=-c,c+=n;c>0;a=256*a+e[t+d],d+=f,c-=8);if(0===i)i=1-l;else{if(i===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),i-=l}return(p?-1:1)*a*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var a,s,u,l=8*i-o-1,c=(1<<l)-1,d=c>>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,h=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+d>=1?f/u:f*Math.pow(2,1-d))*u>=2&&(a++,u/=2),a+d>=c?(s=0,a=c):a+d>=1?(s=(t*u-1)*Math.pow(2,o),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,o),a=0));o>=8;e[r+p]=255&s,p+=h,s/=256,o-=8);for(a=a<<o|s,l+=o;l>0;e[r+p]=255&a,p+=h,a/=256,l-=8);e[r+p-h]|=128*m}},8634:(e,t,r)=>{var n=r(7451)(r(6491),"DataView");e.exports=n},3871:(e,t,r)=>{var n=r(770),o=r(1464),i=r(1265),a=r(4008),s=r(8409);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=s,e.exports=u},602:(e,t,r)=>{var n=r(8924),o=r(3775),i=r(2891),a=r(4670),s=r(3985);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=s,e.exports=u},9446:(e,t,r)=>{var n=r(7451)(r(6491),"Map");e.exports=n},1341:(e,t,r)=>{var n=r(5089),o=r(2523),i=r(3950),a=r(2369),s=r(6174);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=s,e.exports=u},7418:(e,t,r)=>{var n=r(7451)(r(6491),"Promise");e.exports=n},2408:(e,t,r)=>{var n=r(7451)(r(6491),"Set");e.exports=n},6092:(e,t,r)=>{var n=r(1341),o=r(3322),i=r(4103);function a(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}a.prototype.add=a.prototype.push=o,a.prototype.has=i,e.exports=a},3192:(e,t,r)=>{var n=r(602),o=r(8562),i=r(1723),a=r(8574),s=r(5235),u=r(4298);function l(e){var t=this.__data__=new n(e);this.size=t.size}l.prototype.clear=o,l.prototype.delete=i,l.prototype.get=a,l.prototype.has=s,l.prototype.set=u,e.exports=l},7322:(e,t,r)=>{var n=r(6491).Symbol;e.exports=n},6218:(e,t,r)=>{var n=r(6491).Uint8Array;e.exports=n},3335:(e,t,r)=>{var n=r(7451)(r(6491),"WeakMap");e.exports=n},8040:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,o=0,i=[];++r<n;){var a=e[r];t(a,r,e)&&(i[o++]=a)}return i}},6221:(e,t,r)=>{var n=r(7679),o=r(5137),i=r(6848),a=r(5990),s=r(6045),u=r(7196),l=Object.prototype.hasOwnProperty;e.exports=function(e,t){var r=i(e),c=!r&&o(e),d=!r&&!c&&a(e),f=!r&&!c&&!d&&u(e),p=r||c||d||f,h=p?n(e.length,String):[],m=h.length;for(var g in e)!t&&!l.call(e,g)||p&&("length"==g||d&&("offset"==g||"parent"==g)||f&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||s(g,m))||h.push(g);return h}},1458:e=>{e.exports=function(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}},5737:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}},2622:(e,t,r)=>{var n=r(7470);e.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}},2678:(e,t,r)=>{var n=r(1458),o=r(6848);e.exports=function(e,t,r){var i=t(e);return o(e)?i:n(i,r(e))}},1407:(e,t,r)=>{var n=r(7322),o=r(7637),i=r(7573),a=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?o(e):i(e)}},8199:(e,t,r)=>{var n=r(1407),o=r(2981);e.exports=function(e){return o(e)&&"[object Arguments]"==n(e)}},9145:(e,t,r)=>{var n=r(7229),o=r(2981);e.exports=function e(t,r,i,a,s){return t===r||(null==t||null==r||!o(t)&&!o(r)?t!=t&&r!=r:n(t,r,i,a,e,s))}},7229:(e,t,r)=>{var n=r(3192),o=r(7632),i=r(1441),a=r(2340),s=r(4522),u=r(6848),l=r(5990),c=r(7196),d="[object Arguments]",f="[object Array]",p="[object Object]",h=Object.prototype.hasOwnProperty;e.exports=function(e,t,r,m,g,y){var v=u(e),b=u(t),w=v?f:s(e),E=b?f:s(t),C=(w=w==d?p:w)==p,_=(E=E==d?p:E)==p,S=w==E;if(S&&l(e)){if(!l(t))return!1;v=!0,C=!1}if(S&&!C)return y||(y=new n),v||c(e)?o(e,t,r,m,g,y):i(e,t,w,r,m,g,y);if(!(1&r)){var x=C&&h.call(e,"__wrapped__"),k=_&&h.call(t,"__wrapped__");if(x||k){var T=x?e.value():e,P=k?t.value():t;return y||(y=new n),g(T,P,r,m,y)}}return!!S&&(y||(y=new n),a(e,t,r,m,g,y))}},2791:(e,t,r)=>{var n=r(6998),o=r(193),i=r(4377),a=r(3443),s=/^\[object .+?Constructor\]$/,u=Function.prototype,l=Object.prototype,c=u.toString,d=l.hasOwnProperty,f=RegExp("^"+c.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||o(e))&&(n(e)?f:s).test(a(e))}},6516:(e,t,r)=>{var n=r(1407),o=r(7875),i=r(2981),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return i(e)&&o(e.length)&&!!a[n(e)]}},3623:(e,t,r)=>{var n=r(598),o=r(5030),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return o(e);var t=[];for(var r in Object(e))i.call(e,r)&&"constructor"!=r&&t.push(r);return t}},7679:e=>{e.exports=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}},2724:(e,t,r)=>{var n=r(377),o=/^\s+/;e.exports=function(e){return e?e.slice(0,n(e)+1).replace(o,""):e}},3629:e=>{e.exports=function(e){return function(t){return e(t)}}},4706:e=>{e.exports=function(e,t){return e.has(t)}},8015:(e,t,r)=>{var n=r(6491)["__core-js_shared__"];e.exports=n},7632:(e,t,r)=>{var n=r(6092),o=r(5737),i=r(4706);e.exports=function(e,t,r,a,s,u){var l=1&r,c=e.length,d=t.length;if(c!=d&&!(l&&d>c))return!1;var f=u.get(e),p=u.get(t);if(f&&p)return f==t&&p==e;var h=-1,m=!0,g=2&r?new n:void 0;for(u.set(e,t),u.set(t,e);++h<c;){var y=e[h],v=t[h];if(a)var b=l?a(v,y,h,t,e,u):a(y,v,h,e,t,u);if(void 0!==b){if(b)continue;m=!1;break}if(g){if(!o(t,(function(e,t){if(!i(g,t)&&(y===e||s(y,e,r,a,u)))return g.push(t)}))){m=!1;break}}else if(y!==v&&!s(y,v,r,a,u)){m=!1;break}}return u.delete(e),u.delete(t),m}},1441:(e,t,r)=>{var n=r(7322),o=r(6218),i=r(7470),a=r(7632),s=r(1264),u=r(9142),l=n?n.prototype:void 0,c=l?l.valueOf:void 0;e.exports=function(e,t,r,n,l,d,f){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!d(new o(e),new o(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return i(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var p=s;case"[object Set]":var h=1&n;if(p||(p=u),e.size!=t.size&&!h)return!1;var m=f.get(e);if(m)return m==t;n|=2,f.set(e,t);var g=a(p(e),p(t),n,l,d,f);return f.delete(e),g;case"[object Symbol]":if(c)return c.call(e)==c.call(t)}return!1}},2340:(e,t,r)=>{var n=r(1221),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,r,i,a,s){var u=1&r,l=n(e),c=l.length;if(c!=n(t).length&&!u)return!1;for(var d=c;d--;){var f=l[d];if(!(u?f in t:o.call(t,f)))return!1}var p=s.get(e),h=s.get(t);if(p&&h)return p==t&&h==e;var m=!0;s.set(e,t),s.set(t,e);for(var g=u;++d<c;){var y=e[f=l[d]],v=t[f];if(i)var b=u?i(v,y,f,t,e,s):i(y,v,f,e,t,s);if(!(void 0===b?y===v||a(y,v,r,i,s):b)){m=!1;break}g||(g="constructor"==f)}if(m&&!g){var w=e.constructor,E=t.constructor;w==E||!("constructor"in e)||!("constructor"in t)||"function"==typeof w&&w instanceof w&&"function"==typeof E&&E instanceof E||(m=!1)}return s.delete(e),s.delete(t),m}},3442:(e,t,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},1221:(e,t,r)=>{var n=r(2678),o=r(6165),i=r(5533);e.exports=function(e){return n(e,i,o)}},3661:(e,t,r)=>{var n=r(9360);e.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}},7451:(e,t,r)=>{var n=r(2791),o=r(9764);e.exports=function(e,t){var r=o(e,t);return n(r)?r:void 0}},7637:(e,t,r)=>{var n=r(7322),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,s=n?n.toStringTag:void 0;e.exports=function(e){var t=i.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var o=a.call(e);return n&&(t?e[s]=r:delete e[s]),o}},6165:(e,t,r)=>{var n=r(8040),o=r(470),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),n(a(e),(function(t){return i.call(e,t)})))}:o;e.exports=s},4522:(e,t,r)=>{var n=r(8634),o=r(9446),i=r(7418),a=r(2408),s=r(3335),u=r(1407),l=r(3443),c="[object Map]",d="[object Promise]",f="[object Set]",p="[object WeakMap]",h="[object DataView]",m=l(n),g=l(o),y=l(i),v=l(a),b=l(s),w=u;(n&&w(new n(new ArrayBuffer(1)))!=h||o&&w(new o)!=c||i&&w(i.resolve())!=d||a&&w(new a)!=f||s&&w(new s)!=p)&&(w=function(e){var t=u(e),r="[object Object]"==t?e.constructor:void 0,n=r?l(r):"";if(n)switch(n){case m:return h;case g:return c;case y:return d;case v:return f;case b:return p}return t}),e.exports=w},9764:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},770:(e,t,r)=>{var n=r(2919);e.exports=function(){this.__data__=n?n(null):{},this.size=0}},1464:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},1265:(e,t,r)=>{var n=r(2919),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(n){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return o.call(t,e)?t[e]:void 0}},4008:(e,t,r)=>{var n=r(2919),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:o.call(t,e)}},8409:(e,t,r)=>{var n=r(2919);e.exports=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}},6045:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,r){var n=typeof e;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&t.test(e))&&e>-1&&e%1==0&&e<r}},9360:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},193:(e,t,r)=>{var n,o=r(8015),i=(n=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!i&&i in e}},598:e=>{var t=Object.prototype;e.exports=function(e){var r=e&&e.constructor;return e===("function"==typeof r&&r.prototype||t)}},8924:e=>{e.exports=function(){this.__data__=[],this.size=0}},3775:(e,t,r)=>{var n=r(2622),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0||(r==t.length-1?t.pop():o.call(t,r,1),--this.size,0))}},2891:(e,t,r)=>{var n=r(2622);e.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},4670:(e,t,r)=>{var n=r(2622);e.exports=function(e){return n(this.__data__,e)>-1}},3985:(e,t,r)=>{var n=r(2622);e.exports=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}},5089:(e,t,r)=>{var n=r(3871),o=r(602),i=r(9446);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(i||o),string:new n}}},2523:(e,t,r)=>{var n=r(3661);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},3950:(e,t,r)=>{var n=r(3661);e.exports=function(e){return n(this,e).get(e)}},2369:(e,t,r)=>{var n=r(3661);e.exports=function(e){return n(this,e).has(e)}},6174:(e,t,r)=>{var n=r(3661);e.exports=function(e,t){var r=n(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}},1264:e=>{e.exports=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}},2919:(e,t,r)=>{var n=r(7451)(Object,"create");e.exports=n},5030:(e,t,r)=>{var n=r(2080)(Object.keys,Object);e.exports=n},2747:(e,t,r)=>{e=r.nmd(e);var n=r(3442),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,a=i&&i.exports===o&&n.process,s=function(){try{return i&&i.require&&i.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s},7573:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},2080:e=>{e.exports=function(e,t){return function(r){return e(t(r))}}},6491:(e,t,r)=>{var n=r(3442),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();e.exports=i},3322:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},4103:e=>{e.exports=function(e){return this.__data__.has(e)}},9142:e=>{e.exports=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}},8562:(e,t,r)=>{var n=r(602);e.exports=function(){this.__data__=new n,this.size=0}},1723:e=>{e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},8574:e=>{e.exports=function(e){return this.__data__.get(e)}},5235:e=>{e.exports=function(e){return this.__data__.has(e)}},4298:(e,t,r)=>{var n=r(602),o=r(9446),i=r(1341);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var a=r.__data__;if(!o||a.length<199)return a.push([e,t]),this.size=++r.size,this;r=this.__data__=new i(a)}return r.set(e,t),this.size=r.size,this}},3443:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},377:e=>{var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},9273:(e,t,r)=>{var n=r(2697);e.exports=function(e,t){var r;if("function"!=typeof t)throw new TypeError("Expected a function");return e=n(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}}},1945:(e,t,r)=>{var n=r(4377),o=r(6642),i=r(366),a=Math.max,s=Math.min;e.exports=function(e,t,r){var u,l,c,d,f,p,h=0,m=!1,g=!1,y=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function v(t){var r=u,n=l;return u=l=void 0,h=t,d=e.apply(n,r)}function b(e){return h=e,f=setTimeout(E,t),m?v(e):d}function w(e){var r=e-p;return void 0===p||r>=t||r<0||g&&e-h>=c}function E(){var e=o();if(w(e))return C(e);f=setTimeout(E,function(e){var r=t-(e-p);return g?s(r,c-(e-h)):r}(e))}function C(e){return f=void 0,y&&u?v(e):(u=l=void 0,d)}function _(){var e=o(),r=w(e);if(u=arguments,l=this,p=e,r){if(void 0===f)return b(p);if(g)return clearTimeout(f),f=setTimeout(E,t),v(p)}return void 0===f&&(f=setTimeout(E,t)),d}return t=i(t)||0,n(r)&&(m=!!r.leading,c=(g="maxWait"in r)?a(i(r.maxWait)||0,t):c,y="trailing"in r?!!r.trailing:y),_.cancel=function(){void 0!==f&&clearTimeout(f),h=0,u=p=l=f=void 0},_.flush=function(){return void 0===f?d:C(o())},_}},7470:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},5137:(e,t,r)=>{var n=r(8199),o=r(2981),i=Object.prototype,a=i.hasOwnProperty,s=i.propertyIsEnumerable,u=n(function(){return arguments}())?n:function(e){return o(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=u},6848:e=>{var t=Array.isArray;e.exports=t},4106:(e,t,r)=>{var n=r(6998),o=r(7875);e.exports=function(e){return null!=e&&o(e.length)&&!n(e)}},5990:(e,t,r)=>{e=r.nmd(e);var n=r(6491),o=r(2871),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,s=a&&a.exports===i?n.Buffer:void 0,u=(s?s.isBuffer:void 0)||o;e.exports=u},1710:(e,t,r)=>{var n=r(9145);e.exports=function(e,t){return n(e,t)}},6998:(e,t,r)=>{var n=r(1407),o=r(4377);e.exports=function(e){if(!o(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},7875:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},4377:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},2981:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},3551:(e,t,r)=>{var n=r(1407),o=r(2981);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==n(e)}},7196:(e,t,r)=>{var n=r(6516),o=r(3629),i=r(2747),a=i&&i.isTypedArray,s=a?o(a):n;e.exports=s},5533:(e,t,r)=>{var n=r(6221),o=r(3623),i=r(4106);e.exports=function(e){return i(e)?n(e):o(e)}},6642:(e,t,r)=>{var n=r(6491);e.exports=function(){return n.Date.now()}},9510:(e,t,r)=>{var n=r(9273);e.exports=function(e){return n(2,e)}},470:e=>{e.exports=function(){return[]}},2871:e=>{e.exports=function(){return!1}},1141:(e,t,r)=>{var n=r(366);e.exports=function(e){return e?Infinity===(e=n(e))||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},2697:(e,t,r)=>{var n=r(1141);e.exports=function(e){var t=n(e),r=t%1;return t==t?r?t-r:t:0}},366:(e,t,r)=>{var n=r(2724),o=r(4377),i=r(3551),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,l=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return NaN;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=n(e);var r=s.test(e);return r||u.test(e)?l(e.slice(2),r?2:8):a.test(e)?NaN:+e}},9758:()=>{},5339:()=>{},9027:()=>{},3260:()=>{}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n](i,i.exports,r),i.loaded=!0,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.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r.p="";var n={};(()=>{r.d(n,{Ju:()=>f,in:()=>Qe,HY:()=>le,F4:()=>ar,ZP:()=>Dr,aY:()=>Ur,Qx:()=>jr,Gr:()=>Ir,Pf:()=>Br});var e=r(1945),t=r.n(e),o=r(1710),i=r.n(o);const a=Symbol("PROXY");function s(e,t){Object.defineProperty(e[t],a,{value:{type:"getter"},writable:!1})}function u(e,t){Object.defineProperty(e[t],a,{value:{type:"setter"},writable:!1})}Symbol("RESTORE");const l={};var c,d;!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!")}}(c||(c={})),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"}(d||(d={}));const f=d;var p,h,m,g,y,v,b,w,E,C,_,S;!function(e){e[e.Pending=0]="Pending",e[e.Ready=1]="Ready",e[e.Error=2]="Error"}(p||(p={})),function(e){e.Added="DesignBlockAddedEvent",e.Updated="DesignBlockUpdatedEvent",e.Removed="DesignBlockRemovedEvent"}(h||(h={})),function(e){e[e.Left=0]="Left",e[e.Right=1]="Right",e[e.Middle=2]="Middle",e[e.Unknown=255]="Unknown"}(m||(m={})),function(e){e[e.Up=0]="Up",e[e.Down=1]="Down"}(g||(g={})),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"}(y||(y={})),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"}(v||(v={})),function(e){e[e.Normal=0]="Normal",e[e.Italic=1]="Italic"}(b||(b={})),function(e){e.Bold="bold",e.Italic="italic"}(w||(w={})),function(e){e[e.Undefined=0]="Undefined",e[e.DesignUnit=1]="DesignUnit",e[e.Percent=2]="Percent",e[e.Auto=3]="Auto"}(E||(E={})),function(e){e[e.Free=0]="Free",e[e.VerticalStack=1]="VerticalStack",e[e.HorizontalStack=2]="HorizontalStack",e[e.DepthStack=3]="DepthStack"}(C||(C={})),function(e){e[e.Began=0]="Began",e[e.Changed=1]="Changed",e[e.Ended=2]="Ended"}(_||(_={})),function(e){e[e.Creator=0]="Creator",e[e.Adopter=1]="Adopter",e[e.Viewer=2]="Viewer",e[e.Presenter=3]="Presenter"}(S||(S={}));var x=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 k{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=>T(o.setValue(e,t,r,n))))}getValue(e,t,r){return this.useInternalAPI((n=>T(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=T(e);r(t)}catch(e){n(e)}})))).delete()}))}}function T(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 P(e){return new Promise(((t,r)=>{e((e=>{try{const r=T(e);t(r)}catch(e){r(e)}}))}))}x([u],k.prototype,"setValue",null),x([s],k.prototype,"getValue",null);const A=(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 F,L,D,B,R,O=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 M=new WeakMap,j={assets:[],total:0,currentPage:0,nextPage:void 0};class I{constructor(e){F.add(this),L.set(this,void 0),Object.defineProperty(this,"onAssetSourceAdded",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=O(this,L,"f").subscribeToAssetSourceAdded(e);return()=>{O(this,L,"f").isDeleted()||T(O(this,L,"f").unsubscribe(t))}}}),Object.defineProperty(this,"onAssetSourceRemoved",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=O(this,L,"f").subscribeToAssetSourceRemoved(e);return()=>{O(this,L,"f").isDeleted()||T(O(this,L,"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,L,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;T(O(this,L,"f").addAssetSource(e.id,(async(t,r)=>{var n;try{const n=Object.assign(Object.assign({},t),{tags:A(t.tags),groups:A(t.groups),excludeGroups:A(t.excludeGroups)}),o=await e.findAssets(n);if(o){const t=Object.assign(Object.assign({},o),{assets:o.assets.map((t=>U(t,e.id)))});r.invoke(t)}else r.invoke(j)}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(O(this,F,"m",D).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(O(this,F,"m",D).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)),O(this,F,"m",B).call(this,e.id,e)}addLocalSource(e,t,r,n){T(O(this,L,"f").addLocalAssetSource(e,null!=t?t:[],r?async(e,t)=>{var n;try{const n=await r(O(this,F,"m",D).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(O(this,F,"m",D).call(this,e),t),r.invoke({})}catch(e){r.invoke(null!==(o=e.message)&&void 0!==o?o:"Unknown error in user-defined `applyAssetToBlock`")}}:null))}removeSource(e){T(O(this,L,"f").removeAssetSource(e)),O(this,F,"m",R).call(this,e)}findAllSources(){return A(O(this,L,"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:""};O(this,L,"f").findAssetSourceAssets(e,f,(e=>{try{const t=T(e),n=A(t.assets).map(O(this,F,"m",D));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 P((t=>O(this,L,"f").getAssetSourceGroups(e,t))).then((e=>A(e)))}getSupportedMimeTypes(e){return A(T(O(this,L,"f").getAssetSourceSupportedMimeTypes(e)))}getCredits(e){const t=T(O(this,L,"f").getAssetSourceCredits(e));if(t.name||t.url)return t.url?t:{name:t.name,url:void 0}}getLicense(e){const t=T(O(this,L,"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=M.get(O(this,L,"f")))||void 0===t?void 0:t.get(e))||void 0===r?void 0:r.canManageAssets)}addAssetToSource(e,t){T(O(this,L,"f").addAssetToSource(e,t))}removeAssetFromSource(e,t){T(O(this,L,"f").removeAssetFromSource(e,t))}async apply(e,t){return new Promise(((r,n)=>{O(this,L,"f").applyAssetSourceAsset(e,U(t,e),(e=>{try{const t=T(e);O(this,L,"f").isValid(t)?r(t):r(void 0)}catch(e){n(e)}}))}))}async applyToBlock(e,t,r){return P((n=>O(this,L,"f").applyAssetSourceAssetToBlock(e,U(t,e),r,n)))}async defaultApplyAsset(e){return new Promise(((t,r)=>{O(this,L,"f").defaultApplyAsset(U(e,""),(e=>{try{const r=T(e);O(this,L,"f").isValid(r)?t(r):t(void 0)}catch(e){r(e)}}))}))}async defaultApplyAssetToBlock(e,t){return P((r=>O(this,L,"f").defaultApplyAssetToBlock(U(e,""),t,r)))}dispose(){M.delete(O(this,L,"f"))}}function U(e,t){return"context"in e&&e.context.sourceId===t?e:Object.assign(Object.assign({},e),{context:{sourceId:t}})}L=new WeakMap,F=new WeakSet,D=function(e){var t,r,n,o,i,a,s,u;const l=Object.assign(Object.assign({},e),{groups:A(e.groups),meta:void 0,tags:A(e.tags)});return e.meta.size()>0&&(l.meta={},A(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},B=function(e,t){M.has(O(this,L,"f"))||M.set(O(this,L,"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/`),M.get(O(this,L,"f")).set(e,{canManageAssets:t.canManageAssets})},R=function(e){var t;null===(t=M.get(O(this,L,"f")))||void 0===t||t.delete(e)};class q 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 H(e){return"string"==typeof e?JSON.stringify(e):""+e}function N(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: `"+H(n)+"`"}=e;return{value:n,type:a,refinement:s,key:o[o.length-1],path:o,branch:i,...e,message:u}}function*V(e,t,r,n){var o;$(o=e)&&"function"==typeof o[Symbol.iterator]||(e=[e]);for(const o of e){const e=N(o,t,r,n);e&&(yield e)}}function*W(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=W(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 z{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)=>V(n(e,t),t,this,e):()=>[],this.refiner=o?(e,t)=>V(o(e,t),t,this,e):()=>[]}assert(e){return function(e,t){const r=G(e,t);if(r[0])throw r[0]}(e,this)}create(e){return function(e,t){const r=G(e,t,{coerce:!0});if(r[0])throw r[0];return r[1]}(e,this)}is(e){return function(e,t){return!G(e,t)[0]}(e,this)}mask(e){return function(e,t){const r=G(e,t,{coerce:!0,mask:!0});if(r[0])throw r[0];return r[1]}(e,this)}validate(e,t={}){return G(e,this,t)}}function G(e,t,r={}){const n=W(e,t,r),o=function(e){const{done:t,value:r}=e.next();return t?void 0:r}(n);return o[0]?[new q(o[0],(function*(){for(const e of n)e[0]&&(yield e[0])})),void 0]:[void 0,o[1]]}function Y(e,t){return new z({type:e,schema:null,validator:t})}function X(e){return new z({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: "+H(e)})}function K(){return Y("boolean",(e=>"boolean"==typeof e))}function Q(){return Y("integer",(e=>"number"==typeof e&&!isNaN(e)&&Number.isInteger(e)||"Expected an integer, but received: "+H(e)))}function Z(){return Y("number",(e=>"number"==typeof e&&!isNaN(e)||"Expected a number, but received: "+H(e)))}function J(e){const t=e?Object.keys(e):[],r=Y("never",(()=>!1));return new z({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: "+H(e),coercer:e=>$(e)?{...e}:e})}function ee(){return Y("string",(e=>"string"==typeof e||"Expected a string, but received: "+H(e)))}function te(e,t,r={}){const{exclusive:n}=r;return oe(e,"max",(r=>n?r<t:r<=t||"Expected a "+e.type+" less than "+(n?"":"or equal to ")+t+" but received `"+r+"`"))}function re(e,t,r={}){const{exclusive:n}=r;return oe(e,"min",(r=>n?r>t:r>=t||"Expected a "+e.type+" greater than "+(n?"":"or equal to ")+t+" but received `"+r+"`"))}function ne(e){return oe(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 oe(e,t,r){return new z({...e,*refiner(n,o){yield*e.refiner(n,o);const i=V(r(n,o),o,e,n);for(const e of i)yield{...e,refinement:t}}})}function ie(e,t,r){const[n]=G(t,r);if(n)throw n.message=`Error in argument '${e}': ${n.message}`,n}function ae(){const e=/image\/(png|jpeg|webp|x-tga)|video\/(mp4|quicktime)|application\/octet-stream|application\/pdf/;return Y("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 se(){const e=["Free","VerticalStack","HorizontalStack","DepthStack"];return Y("SceneLayout",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}var ue;!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"}(ue||(ue={}));const le=ue,ce="undefined"!=typeof Blob?Blob:(()=>{try{return r(808).Blob}catch(e){return function(){throw new Error("Could not find Blob constructor and failed to require('buffer').Blob")}}})();var de,fe=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},pe=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 he{constructor(e){de.set(this,void 0),Object.defineProperty(this,"onSelectionChanged",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=pe(this,de,"f").subscribeToSelectionChange(e);return()=>{pe(this,de,"f").isDeleted()||T(pe(this,de,"f").unsubscribe(t))}}}),Object.defineProperty(this,"onClicked",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=pe(this,de,"f").subscribeToBlockClicked(e);return()=>{pe(this,de,"f").isDeleted()||T(pe(this,de,"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,de,e,"f")}async export(e,t=le.Png,r={}){var n,o,i;ie("handle",e,Z()),ie("mimeType",t,ae()),ie("options",r,J());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 ie("jpegQuality",s,re(te(Z(),1),0,{exclusive:!0})),ie("webpQuality",u,re(te(Z(),1),0,{exclusive:!0})),ie("pngCompressionLevel",l,re(te(Q(),9),0)),null==r.targetWidth&&null==r.targetHeight||(ie("targetWidth",r.targetWidth,Z()),ie("targetHeight",r.targetHeight,Z())),new Promise(((n,o)=>{var i,c,d;pe(this,de,"f").exportToBuffer(e,t,(e=>{"error"in e?o(e.error):n(new ce([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=le.Png,r,n,o,i={}){var a,s,u;ie("handle",e,Z()),ie("mimeType",t,ae()),ie("options",i,J());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 ie("jpegQuality",c,re(te(Z(),1),0,{exclusive:!0})),ie("webpQuality",d,re(te(Z(),1),0,{exclusive:!0})),ie("pngCompressionLevel",f,re(te(Q(),9),0)),null==i.targetWidth&&null==i.targetHeight||(ie("targetWidth",i.targetWidth,Z()),ie("targetHeight",i.targetHeight,Z())),new Promise(((a,s)=>{var u,p,h;pe(this,de,"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 ce([e],{type:t}),o=new ce([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=le.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 ie("content",e,ee()),P((t=>pe(this,de,"f").loadBlocksFromString(e,t))).then((e=>A(e)))}async saveToString(e){return ie("blocks",e,X(Z())),P((t=>pe(this,de,"f").saveBlocksToString(e,t)))}create(e){return ie("type",e,ee()),T(pe(this,de,"f").create(e))}createFill(e){return ie("type",e,ee()),T(pe(this,de,"f").createFill(e))}getType(e){return ie("id",e,Q()),T(pe(this,de,"f").getType(e))}getKind(e){return ie("id",e,Q()),T(pe(this,de,"f").getKind(e))}setKind(e,t){ie("id",e,Q()),T(pe(this,de,"f").setKind(e,t))}select(e){return ie("id",e,Q()),T(pe(this,de,"f").select(e))}setSelected(e,t){return ie("id",e,Q()),ie("selected",t,K()),T(pe(this,de,"f").setSelected(e,t))}isSelected(e){return ie("id",e,Q()),T(pe(this,de,"f").isSelected(e))}findAllSelected(){return A(pe(this,de,"f").findAllSelected())}isGroupable(e){return ie("ids",e,X(Z())),T(pe(this,de,"f").isGroupable(e))}group(e){return ie("ids",e,ne(X(Z()))),T(pe(this,de,"f").group(e))}ungroup(e){return ie("id",e,Z()),T(pe(this,de,"f").ungroup(e))}enterGroup(e){return ie("id",e,Z()),T(pe(this,de,"f").enterGroup(e))}exitGroup(e){return ie("id",e,Z()),T(pe(this,de,"f").exitGroup(e))}setName(e,t){return ie("id",e,Q()),ie("name",t,ee()),T(pe(this,de,"f").setName(e,t))}getName(e){return ie("id",e,Q()),T(pe(this,de,"f").getName(e))}getUUID(e){return ie("id",e,Q()),T(pe(this,de,"f").getUUID(e))}findByName(e){ie("name",e,ee());const t=pe(this,de,"f").findByName(e);return A(t)}findByType(e){ie("type",e,ee());const t=T(pe(this,de,"f").findByType(e));return A(t)}findByKind(e){ie("kind",e,ee());const t=T(pe(this,de,"f").findByKind(e));return A(t)}findAll(){return A(pe(this,de,"f").findAll())}findAllPlaceholders(){return A(pe(this,de,"f").findAllPlaceholders())}createShape(e){return ie("type",e,ee()),T(pe(this,de,"f").createShape(e))}hasShape(e){return ie("id",e,Q()),T(pe(this,de,"f").hasShape(e))}getShape(e){return ie("id",e,Q()),T(pe(this,de,"f").getShape(e))}setShape(e,t){return ie("id",e,Q()),ie("shape",t,Q()),T(pe(this,de,"f").setShape(e,t))}isVisible(e){return ie("id",e,Q()),T(pe(this,de,"f").isVisible(e))}setVisible(e,t){return ie("id",e,Q()),ie("visible",t,K()),T(pe(this,de,"f").setVisible(e,t))}isClipped(e){return ie("id",e,Q()),T(pe(this,de,"f").isClipped(e))}setClipped(e,t){return ie("id",e,Q()),ie("clipped",t,K()),T(pe(this,de,"f").setClipped(e,t))}getPositionX(e){return ie("id",e,Q()),T(pe(this,de,"f").getPositionX(e))}getPositionXMode(e){return ie("id",e,Q()),T(pe(this,de,"f").getPositionXMode(e))}getPositionY(e){return ie("id",e,Q()),T(pe(this,de,"f").getPositionY(e))}getPositionYMode(e){return ie("id",e,Q()),T(pe(this,de,"f").getPositionYMode(e))}setPositionX(e,t){return ie("id",e,Q()),ie("value",t,Z()),T(pe(this,de,"f").setPositionX(e,t))}setPositionXMode(e,t){return ie("id",e,Q()),T(pe(this,de,"f").setPositionXMode(e,t))}setPositionY(e,t){return ie("id",e,Q()),ie("value",t,Z()),T(pe(this,de,"f").setPositionY(e,t))}setPositionYMode(e,t){return ie("id",e,Q()),T(pe(this,de,"f").setPositionYMode(e,t))}setAlwaysOnTop(e,t){return ie("id",e,Q()),ie("enabled",t,K()),T(pe(this,de,"f").setAlwaysOnTop(e,t))}setAlwaysOnBottom(e,t){return ie("id",e,Q()),ie("enabled",t,K()),T(pe(this,de,"f").setAlwaysOnBottom(e,t))}isAlwaysOnTop(e){return ie("id",e,Q()),T(pe(this,de,"f").isAlwaysOnTop(e))}isAlwaysOnBottom(e){return ie("id",e,Q()),T(pe(this,de,"f").isAlwaysOnBottom(e))}bringToFront(e){return ie("id",e,Z()),T(pe(this,de,"f").bringToFront(e))}sendToBack(e){return ie("id",e,Z()),T(pe(this,de,"f").sendToBack(e))}bringForward(e){return ie("id",e,Z()),T(pe(this,de,"f").bringForward(e))}sendBackward(e){return ie("id",e,Z()),T(pe(this,de,"f").sendBackward(e))}getRotation(e){return ie("id",e,Q()),T(pe(this,de,"f").getRotation(e))}setRotation(e,t){return ie("id",e,Q()),ie("radians",t,Z()),T(pe(this,de,"f").setRotation(e,t))}getFlipHorizontal(e){return ie("id",e,Q()),T(pe(this,de,"f").getFlip(e)).horizontal}getFlipVertical(e){return ie("id",e,Q()),T(pe(this,de,"f").getFlip(e)).vertical}setFlipHorizontal(e,t){return ie("id",e,Q()),ie("flip",t,K()),T(pe(this,de,"f").setFlipHorizontal(e,t))}setFlipVertical(e,t){return ie("id",e,Q()),ie("flip",t,K()),T(pe(this,de,"f").setFlipVertical(e,t))}hasContentFillMode(e){return ie("id",e,Q()),T(pe(this,de,"f").hasContentFillMode(e))}getWidth(e){return ie("id",e,Q()),T(pe(this,de,"f").getWidth(e))}getWidthMode(e){return ie("id",e,Q()),T(pe(this,de,"f").getWidthMode(e))}getHeight(e){return ie("id",e,Q()),T(pe(this,de,"f").getHeight(e))}getHeightMode(e){return ie("id",e,Q()),T(pe(this,de,"f").getHeightMode(e))}setWidth(e,t){return ie("id",e,Q()),ie("value",t,Z()),T(pe(this,de,"f").setWidth(e,t))}setWidthMode(e,t){return ie("id",e,Q()),T(pe(this,de,"f").setWidthMode(e,t))}setHeight(e,t){return ie("id",e,Q()),ie("value",t,Z()),T(pe(this,de,"f").setHeight(e,t))}setHeightMode(e,t){return ie("id",e,Q()),T(pe(this,de,"f").setHeightMode(e,t))}getFrameX(e){return ie("id",e,Q()),T(pe(this,de,"f").getLastFrameX(e))}getFrameY(e){return ie("id",e,Q()),T(pe(this,de,"f").getLastFrameY(e))}getFrameWidth(e){return ie("id",e,Q()),T(pe(this,de,"f").getLastFrameWidth(e))}getFrameHeight(e){return ie("id",e,Q()),T(pe(this,de,"f").getLastFrameHeight(e))}setContentFillMode(e,t){return ie("id",e,Q()),T(pe(this,de,"f").setContentFillMode(e,t))}getContentFillMode(e){return ie("id",e,Q()),T(pe(this,de,"f").getContentFillMode(e))}duplicate(e){return ie("id",e,Q()),T(pe(this,de,"f").duplicate(e))}destroy(e){return ie("id",e,Q()),T(pe(this,de,"f").destroy(e))}isValid(e){return ie("id",e,Q()),pe(this,de,"f").isValid(e)}getParent(e){return ie("id",e,Q()),T(pe(this,de,"f").hasParent(e))?T(pe(this,de,"f").getParent(e)):null}getChildren(e){ie("id",e,Q());const t=T(pe(this,de,"f").getChildren(e));return A(t)}insertChild(e,t,r){return ie("parent",e,Z()),ie("child",t,Z()),ie("index",r,re(Z(),0)),T(pe(this,de,"f").insertChild(e,t,r))}appendChild(e,t){return ie("parent",e,Z()),ie("child",t,Z()),T(pe(this,de,"f").appendChild(e,t))}referencesAnyVariables(e){return ie("id",e,Q()),T(pe(this,de,"f").referencesAnyVariables(e))}getGlobalBoundingBoxX(e){return ie("id",e,Q()),T(pe(this,de,"f").getGlobalBoundingBoxX(e))}getGlobalBoundingBoxY(e){return ie("id",e,Q()),T(pe(this,de,"f").getGlobalBoundingBoxY(e))}getGlobalBoundingBoxWidth(e){return ie("id",e,Q()),T(pe(this,de,"f").getGlobalBoundingBoxWidth(e))}getGlobalBoundingBoxHeight(e){return ie("id",e,Q()),T(pe(this,de,"f").getGlobalBoundingBoxHeight(e))}getScreenSpaceBoundingBoxXYWH(e){return ie("ids",e,X(Z())),T(pe(this,de,"f").getScreenSpaceBoundingBoxXYWH(e))}alignHorizontally(e,t){return ie("ids",e,ne(X(Z()))),T(pe(this,de,"f").alignHorizontally(e,t))}alignVertically(e,t){return ie("ids",e,ne(X(Z()))),T(pe(this,de,"f").alignVertically(e,t))}isAlignable(e){return ie("ids",e,X(Z())),T(pe(this,de,"f").isAlignable(e))}distributeHorizontally(e){return ie("ids",e,ne(X(Z()))),T(pe(this,de,"f").distributeHorizontally(e))}distributeVertically(e){return ie("ids",e,ne(X(Z()))),T(pe(this,de,"f").distributeVertically(e))}isDistributable(e){return ie("ids",e,X(Z())),T(pe(this,de,"f").isDistributable(e))}fillParent(e){return ie("id",e,Q()),T(pe(this,de,"f").fillParent(e))}resizeContentAware(e,t,r){return ie("ids",e,X(Z())),ie("width",t,Z()),ie("height",r,Z()),T(pe(this,de,"f").resizeContentAware(e,t,r))}scale(e,t,r=0,n=0){return ie("id",e,Q()),T(pe(this,de,"f").scale(e,t,r,n))}findAllProperties(e){return ie("id",e,Q()),A(T(pe(this,de,"f").findAllProperties(e)))}isPropertyReadable(e){return ie("property",e,ee()),pe(this,de,"f").isPropertyReadable(e)}isPropertyWritable(e){return ie("property",e,ee()),pe(this,de,"f").isPropertyWritable(e)}getPropertyType(e){return ie("property",e,ee()),T(pe(this,de,"f").getPropertyType(e))}getEnumValues(e){return ie("enumProperty",e,ee()),A(T(pe(this,de,"f").getEnumValues(e)))}setBool(e,t,r){return ie("id",e,Q()),ie("property",t,ee()),ie("value",r,K()),T(pe(this,de,"f").setBool(e,t,r))}getBool(e,t){return ie("id",e,Q()),ie("property",t,ee()),T(pe(this,de,"f").getBool(e,t))}setInt(e,t,r){return ie("id",e,Q()),ie("property",t,ee()),ie("value",r,Q()),T(pe(this,de,"f").setInt(e,t,r))}getInt(e,t){return ie("id",e,Q()),ie("property",t,ee()),T(pe(this,de,"f").getInt(e,t))}setFloat(e,t,r){return ie("id",e,Q()),ie("property",t,ee()),ie("value",r,Z()),T(pe(this,de,"f").setFloat(e,t,r))}getFloat(e,t){return ie("id",e,Q()),ie("property",t,ee()),T(pe(this,de,"f").getFloat(e,t))}setDouble(e,t,r){return ie("id",e,Q()),ie("property",t,ee()),ie("value",r,Z()),T(pe(this,de,"f").setDouble(e,t,r))}getDouble(e,t){return ie("id",e,Q()),ie("property",t,ee()),T(pe(this,de,"f").getDouble(e,t))}setString(e,t,r){return ie("id",e,Q()),ie("property",t,ee()),ie("value",r,ee()),T(pe(this,de,"f").setString(e,t,r))}getString(e,t){return ie("id",e,Q()),ie("property",t,ee()),T(pe(this,de,"f").getString(e,t))}setColor(e,t,r){return ie("id",e,Q()),ie("property",t,ee()),T(pe(this,de,"f").setColor(e,t,c.fromColor(r)))}getColor(e,t){return ie("id",e,Q()),ie("property",t,ee()),c.toColor(T(pe(this,de,"f").getColor(e,t)))}setColorRGBA(e,t,r,n,o,i=1){return ie("id",e,Q()),ie("property",t,ee()),ie("r",r,Z()),ie("g",n,Z()),ie("b",o,Z()),ie("a",i,Z()),T(pe(this,de,"f").setColorRGBA(e,t,r,n,o,i))}getColorRGBA(e,t){return ie("id",e,Q()),ie("property",t,ee()),T(pe(this,de,"f").getColorRGBA(e,t))}setColorSpot(e,t,r,n=1){return ie("id",e,Q()),ie("property",t,ee()),ie("name",r,ee()),ie("tint",n,Z()),T(pe(this,de,"f").setColorSpot(e,t,r,n))}getColorSpotName(e,t){return ie("id",e,Q()),ie("property",t,ee()),T(pe(this,de,"f").getColorSpotName(e,t))}getColorSpotTint(e,t){return ie("id",e,Q()),ie("property",t,ee()),T(pe(this,de,"f").getColorSpotTint(e,t))}setGradientColorStops(e,t,r){ie("id",e,Q()),ie("property",t,ee());const n=r.map((e=>({color:c.fromColor(e.color),stop:e.stop})));return T(pe(this,de,"f").setGradientColorStops(e,t,n))}getGradientColorStops(e,t){ie("id",e,Q()),ie("property",t,ee());const r=T(pe(this,de,"f").getGradientColorStops(e,t));return A(r).map((e=>({color:c.toColor(e.color),stop:e.stop})))}setEnum(e,t,r){return ie("id",e,Q()),ie("property",t,ee()),ie("value",r,ee()),T(pe(this,de,"f").setEnum(e,t,r))}getEnum(e,t){return ie("id",e,Q()),ie("property",t,ee()),T(pe(this,de,"f").getEnum(e,t))}hasCrop(e){return ie("id",e,Q()),T(pe(this,de,"f").hasCrop(e))}setCropScaleX(e,t){return ie("id",e,Q()),ie("scaleX",t,Z()),T(pe(this,de,"f").setCropScaleX(e,t))}setCropScaleY(e,t){return ie("id",e,Q()),ie("scaleY",t,Z()),T(pe(this,de,"f").setCropScaleY(e,t))}setCropRotation(e,t){return ie("id",e,Q()),ie("rotation",t,Z()),T(pe(this,de,"f").setCropRotation(e,t))}setCropScaleRatio(e,t){return ie("id",e,Q()),ie("scaleRatio",t,Z()),T(pe(this,de,"f").setCropScaleRatio(e,t))}setCropTranslationX(e,t){return ie("id",e,Q()),ie("translationX",t,Z()),T(pe(this,de,"f").setCropTranslationX(e,t))}setCropTranslationY(e,t){return ie("id",e,Q()),ie("translationY",t,Z()),T(pe(this,de,"f").setCropTranslationY(e,t))}resetCrop(e){return ie("id",e,Q()),T(pe(this,de,"f").resetCrop(e))}getCropScaleX(e){return ie("id",e,Q()),T(pe(this,de,"f").getCropScaleX(e))}getCropScaleY(e){return ie("id",e,Q()),T(pe(this,de,"f").getCropScaleY(e))}getCropRotation(e){return ie("id",e,Q()),T(pe(this,de,"f").getCropRotation(e))}getCropScaleRatio(e){return ie("id",e,Q()),T(pe(this,de,"f").getCropScaleRatio(e))}getCropTranslationX(e){return ie("id",e,Q()),T(pe(this,de,"f").getCropTranslationX(e))}getCropTranslationY(e){return ie("id",e,Q()),T(pe(this,de,"f").getCropTranslationY(e))}adjustCropToFillFrame(e,t){return ie("id",e,Q()),ie("minScaleRatio",t,Z()),T(pe(this,de,"f").adjustCropToFillFrame(e,t))}flipCropHorizontal(e){return ie("id",e,Q()),T(pe(this,de,"f").flipCropHorizontal(e))}flipCropVertical(e){return ie("id",e,Q()),T(pe(this,de,"f").flipCropVertical(e))}hasOpacity(e){return ie("id",e,Q()),T(pe(this,de,"f").hasOpacity(e))}setOpacity(e,t){return ie("id",e,Q()),ie("opacity",t,Z()),T(pe(this,de,"f").setOpacity(e,t))}getOpacity(e){return ie("id",e,Q()),T(pe(this,de,"f").getOpacity(e))}hasBlendMode(e){return ie("id",e,Q()),T(pe(this,de,"f").hasBlendMode(e))}setBlendMode(e,t){return ie("id",e,Q()),ie("blendMode",t,ee()),T(pe(this,de,"f").setBlendMode(e,t))}getBlendMode(e){return ie("id",e,Q()),T(pe(this,de,"f").getBlendMode(e))}hasFillColor(e){return ie("id",e,Q()),T(pe(this,de,"f").hasFillColor(e))}setFillColorRGBA(e,t,r,n,o=1){return ie("id",e,Q()),ie("r",t,Z()),ie("g",r,Z()),ie("b",n,Z()),ie("a",o,Z()),T(pe(this,de,"f").setFillColorRGBA(e,t,r,n,o))}getFillColorRGBA(e){return ie("id",e,Q()),T(pe(this,de,"f").getFillColorRGBA(e))}setFillColorEnabled(e,t){return ie("id",e,Q()),ie("enabled",t,K()),T(pe(this,de,"f").setFillColorEnabled(e,t))}isFillColorEnabled(e){return ie("id",e,Q()),T(pe(this,de,"f").isFillColorEnabled(e))}createEffect(e){return ie("type",e,ee()),T(pe(this,de,"f").createEffect(e))}hasEffects(e){return ie("id",e,Q()),T(pe(this,de,"f").hasEffects(e))}getEffects(e){ie("id",e,Q());const t=T(pe(this,de,"f").getEffects(e));return A(t)}insertEffect(e,t,r){ie("id",e,Q()),ie("effectId",t,Q()),ie("index",r,re(Q(),0)),T(pe(this,de,"f").insertEffect(e,t,r))}appendEffect(e,t){ie("id",e,Q()),ie("effectId",t,Q()),T(pe(this,de,"f").appendEffect(e,t))}removeEffect(e,t){ie("id",e,Q()),ie("index",t,re(Q(),0)),T(pe(this,de,"f").removeEffect(e,t))}hasEffectEnabled(e){return ie("effectId",e,Q()),T(pe(this,de,"f").hasEffectEnabled(e))}setEffectEnabled(e,t){ie("effectId",e,Q()),ie("enabled",t,K()),T(pe(this,de,"f").setEffectEnabled(e,t))}isEffectEnabled(e){return ie("effectId",e,Q()),T(pe(this,de,"f").isEffectEnabled(e))}createBlur(e){return ie("type",e,ee()),T(pe(this,de,"f").createBlur(e))}hasBlur(e){return ie("id",e,Q()),T(pe(this,de,"f").hasBlur(e))}setBlur(e,t){ie("id",e,Q()),ie("blurId",t,Q()),T(pe(this,de,"f").setBlur(e,t))}getBlur(e){return ie("id",e,Q()),T(pe(this,de,"f").getBlur(e))}setBlurEnabled(e,t){ie("id",e,Q()),ie("enabled",t,K()),T(pe(this,de,"f").setBlurEnabled(e,t))}isBlurEnabled(e){return ie("id",e,Q()),T(pe(this,de,"f").isBlurEnabled(e))}hasBackgroundColor(e){return ie("id",e,Q()),T(pe(this,de,"f").hasBackgroundColor(e))}setBackgroundColorRGBA(e,t,r,n,o=1){return ie("id",e,Q()),ie("r",t,Z()),ie("g",r,Z()),ie("b",n,Z()),ie("a",o,Z()),T(pe(this,de,"f").setBackgroundColorRGBA(e,t,r,n,o))}getBackgroundColorRGBA(e){return ie("id",e,Q()),T(pe(this,de,"f").getBackgroundColorRGBA(e))}setBackgroundColorEnabled(e,t){return ie("id",e,Q()),ie("enabled",t,K()),T(pe(this,de,"f").setBackgroundColorEnabled(e,t))}isBackgroundColorEnabled(e){return ie("id",e,Q()),T(pe(this,de,"f").isBackgroundColorEnabled(e))}hasStroke(e){return ie("id",e,Q()),T(pe(this,de,"f").hasStroke(e))}setStrokeEnabled(e,t){return ie("id",e,Q()),ie("enabled",t,K()),T(pe(this,de,"f").setStrokeEnabled(e,t))}isStrokeEnabled(e){return ie("id",e,Q()),T(pe(this,de,"f").isStrokeEnabled(e))}setStrokeColorRGBA(e,t,r,n,o=1){return ie("id",e,Q()),ie("r",t,Z()),ie("g",r,Z()),ie("b",n,Z()),ie("a",o,Z()),T(pe(this,de,"f").setStrokeColorRGBA(e,t,r,n,o))}setStrokeColor(e,t){return ie("id",e,Q()),T(pe(this,de,"f").setStrokeColor(e,c.fromColor(t)))}getStrokeColorRGBA(e){return ie("id",e,Q()),T(pe(this,de,"f").getStrokeColorRGBA(e))}getStrokeColor(e){return ie("id",e,Q()),c.toColor(T(pe(this,de,"f").getStrokeColor(e)))}setStrokeWidth(e,t){return ie("id",e,Q()),ie("width",t,Z()),T(pe(this,de,"f").setStrokeWidth(e,t))}getStrokeWidth(e){return ie("id",e,Q()),T(pe(this,de,"f").getStrokeWidth(e))}setStrokeStyle(e,t){return ie("id",e,Q()),T(pe(this,de,"f").setStrokeStyle(e,t))}getStrokeStyle(e){return ie("id",e,Q()),T(pe(this,de,"f").getStrokeStyle(e))}setStrokePosition(e,t){return ie("id",e,Q()),T(pe(this,de,"f").setStrokePosition(e,t))}getStrokePosition(e){return ie("id",e,Q()),T(pe(this,de,"f").getStrokePosition(e))}setStrokeCornerGeometry(e,t){return ie("id",e,Q()),T(pe(this,de,"f").setStrokeCornerGeometry(e,t))}getStrokeCornerGeometry(e){return ie("id",e,Q()),T(pe(this,de,"f").getStrokeCornerGeometry(e))}hasDropShadow(e){return ie("id",e,Q()),T(pe(this,de,"f").hasDropShadow(e))}setDropShadowEnabled(e,t){return ie("id",e,Q()),ie("enabled",t,K()),T(pe(this,de,"f").setDropShadowEnabled(e,t))}isDropShadowEnabled(e){return ie("id",e,Q()),T(pe(this,de,"f").isDropShadowEnabled(e))}setDropShadowColorRGBA(e,t,r,n,o=1){return ie("id",e,Q()),ie("r",t,Z()),ie("g",r,Z()),ie("b",n,Z()),ie("a",o,Z()),T(pe(this,de,"f").setDropShadowColorRGBA(e,t,r,n,o))}setDropShadowColor(e,t){return ie("id",e,Q()),T(pe(this,de,"f").setDropShadowColor(e,c.fromColor(t)))}getDropShadowColorRGBA(e){return ie("id",e,Q()),T(pe(this,de,"f").getDropShadowColorRGBA(e))}getDropShadowColor(e){return ie("id",e,Q()),c.toColor(T(pe(this,de,"f").getDropShadowColor(e)))}setDropShadowOffsetX(e,t){return ie("id",e,Q()),ie("offsetX",t,Z()),T(pe(this,de,"f").setDropShadowOffsetX(e,t))}getDropShadowOffsetX(e){return ie("id",e,Q()),T(pe(this,de,"f").getDropShadowOffsetX(e))}setDropShadowOffsetY(e,t){return ie("id",e,Q()),ie("offsetY",t,Z()),T(pe(this,de,"f").setDropShadowOffsetY(e,t))}getDropShadowOffsetY(e){return ie("id",e,Q()),T(pe(this,de,"f").getDropShadowOffsetY(e))}setDropShadowBlurRadiusX(e,t){return ie("id",e,Q()),ie("blurRadiusX",t,Z()),T(pe(this,de,"f").setDropShadowBlurRadiusX(e,t))}getDropShadowBlurRadiusX(e){return ie("id",e,Q()),T(pe(this,de,"f").getDropShadowBlurRadiusX(e))}setDropShadowBlurRadiusY(e,t){return ie("id",e,Q()),ie("blurRadiusY",t,Z()),T(pe(this,de,"f").setDropShadowBlurRadiusY(e,t))}getDropShadowBlurRadiusY(e){return ie("id",e,Q()),T(pe(this,de,"f").getDropShadowBlurRadiusY(e))}setDropShadowClip(e,t){return ie("id",e,Q()),T(pe(this,de,"f").setDropShadowClip(e,t))}getDropShadowClip(e){return ie("id",e,Q()),T(pe(this,de,"f").getDropShadowClip(e))}createCutoutFromBlocks(e,t=2,r=4){return ie("ids",e,X(Q())),ie("vectorizeDistanceThreshold",t,Z()),ie("maxSmoothingDistance",r,Z()),T(pe(this,de,"f").createCutoutFromBlocks(e,t,r))}createCutoutFromPath(e){return ie("path",e,ee()),T(pe(this,de,"f").createCutoutFromPath(e))}createCutoutFromOperation(e,t){return ie("ids",e,X(Q())),ie("op",t,function(){const e=["Difference","Intersection","Union","XOR"];return Y("CutoutOperation",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}()),T(pe(this,de,"f").createCutoutFromOperation(e,t))}replaceText(e,t,r=-1,n=-1){ie("id",e,Q()),ie("text",t,ee()),ie("from",r,Q()),ie("to",n,Q()),T(pe(this,de,"f").replaceText(e,t,r,n))}removeText(e,t=-1,r=-1){ie("id",e,Q()),ie("from",t,Q()),ie("to",r,Q()),T(pe(this,de,"f").removeText(e,t,r))}setTextColor(e,t,r=-1,n=-1){ie("id",e,Q()),ie("from",r,Q()),ie("to",n,Q()),T(pe(this,de,"f").setTextColor(e,c.fromColor(t),r,n))}getTextColors(e,t=-1,r=-1){ie("id",e,Q()),ie("from",t,Q()),ie("to",r,Q());const n=pe(this,de,"f").getTextColors(e,t,r);return A(T(n)).map((e=>c.toColor(e)))}getTextFontWeights(e,t=-1,r=-1){return ie("id",e,Q()),ie("from",t,Q()),ie("to",r,Q()),A(T(pe(this,de,"f").getTextFontWeights(e,t,r)))}getTextFontStyles(e,t=-1,r=-1){return ie("id",e,Q()),ie("from",t,Q()),ie("to",r,Q()),A(T(pe(this,de,"f").getTextFontStyles(e,t,r)))}getTextCases(e,t=-1,r=-1){return ie("id",e,Q()),ie("from",t,Q()),ie("to",r,Q()),A(T(pe(this,de,"f").getTextCases(e,t,r)))}setTextCase(e,t,r=-1,n=-1){ie("id",e,Q()),ie("textCase",t,ee()),ie("from",r,Q()),ie("to",n,Q()),T(pe(this,de,"f").setTextCase(e,t,r,n))}getTextCursorRange(){return T(pe(this,de,"f").getTextCursorRange())}hasFill(e){return ie("id",e,Q()),T(pe(this,de,"f").hasFill(e))}isFillEnabled(e){return ie("id",e,Q()),T(pe(this,de,"f").isFillEnabled(e))}setFillEnabled(e,t){return ie("id",e,Q()),T(pe(this,de,"f").setFillEnabled(e,t))}getFill(e){return ie("id",e,Q()),T(pe(this,de,"f").getFill(e))}setFill(e,t){return ie("id",e,Q()),ie("fill",t,Q()),T(pe(this,de,"f").setFill(e,t))}setFillSolidColor(e,t,r,n,o=1){ie("id",e,Q()),T(pe(this,de,"f").setFillSolidColor(e,t,r,n,o))}getFillSolidColor(e){return ie("id",e,Q()),T(pe(this,de,"f").getFillSolidColor(e))}setPlaceholderEnabled(e,t){ie("id",e,Q()),ie("enabled",t,K()),T(pe(this,de,"f").setPlaceholderEnabled(e,t))}isPlaceholderEnabled(e){return ie("id",e,Q()),T(pe(this,de,"f").isPlaceholderEnabled(e))}hasPlaceholderBehavior(e){return ie("id",e,Q()),T(pe(this,de,"f").hasPlaceholderBehavior(e))}setPlaceholderBehaviorEnabled(e,t){ie("id",e,Q()),T(pe(this,de,"f").setPlaceholderBehaviorEnabled(e,t))}isPlaceholderBehaviorEnabled(e){return ie("id",e,Q()),T(pe(this,de,"f").isPlaceholderBehaviorEnabled(e))}hasPlaceholderControls(e){return ie("id",e,Q()),T(pe(this,de,"f").hasPlaceholderControls(e))}setPlaceholderControlsOverlayEnabled(e,t){return ie("id",e,Q()),ie("enabled",t,K()),T(pe(this,de,"f").setPlaceholderControlsOverlayEnabled(e,t))}isPlaceholderControlsOverlayEnabled(e){return ie("id",e,Q()),T(pe(this,de,"f").isPlaceholderControlsOverlayEnabled(e))}setPlaceholderControlsButtonEnabled(e,t){return ie("id",e,Q()),ie("enabled",t,K()),T(pe(this,de,"f").setPlaceholderControlsButtonEnabled(e,t))}isPlaceholderControlsButtonEnabled(e){return ie("id",e,Q()),T(pe(this,de,"f").isPlaceholderControlsButtonEnabled(e))}setMetadata(e,t,r){ie("id",e,Q()),ie("key",t,ee()),ie("value",r,ee()),T(pe(this,de,"f").setMetadata(e,t,r))}getMetadata(e,t){return ie("id",e,Q()),ie("key",t,ee()),T(pe(this,de,"f").getMetadata(e,t))}hasMetadata(e,t){return ie("id",e,Q()),ie("key",t,ee()),T(pe(this,de,"f").hasMetadata(e,t))}findAllMetadata(e){return ie("id",e,Q()),A(T(pe(this,de,"f").findAllMetadata(e)))}removeMetadata(e,t){ie("id",e,Q()),ie("key",t,ee()),T(pe(this,de,"f").removeMetadata(e,t))}setScopeEnabled(e,t,r){ie("id",e,Q()),ie("key",t,ee()),ie("enabled",r,K()),T(pe(this,de,"f").setScopeEnabled(e,t,r))}isScopeEnabled(e,t){return ie("id",e,Q()),ie("key",t,ee()),T(pe(this,de,"f").isScopeEnabled(e,t))}isAllowedByScope(e,t){return ie("id",e,Q()),ie("key",t,ee()),T(pe(this,de,"f").isAllowedByScope(e,t))}hasDuration(e){return ie("id",e,Q()),T(pe(this,de,"f").hasDuration(e))}setDuration(e,t){return ie("id",e,Q()),ie("duration",t,Z()),T(pe(this,de,"f").setDuration(e,t))}getDuration(e){return ie("id",e,Q()),T(pe(this,de,"f").getDuration(e))}hasTimeOffset(e){return ie("id",e,Q()),T(pe(this,de,"f").hasTimeOffset(e))}setTimeOffset(e,t){return ie("id",e,Q()),ie("offset",t,Z()),T(pe(this,de,"f").setTimeOffset(e,t))}getTimeOffset(e){return ie("id",e,Q()),T(pe(this,de,"f").getTimeOffset(e))}hasTrim(e){return ie("id",e,Q()),T(pe(this,de,"f").hasTrim(e))}setTrimOffset(e,t){return ie("id",e,Q()),ie("offset",t,Z()),T(pe(this,de,"f").setTrimOffset(e,t))}getTrimOffset(e){return ie("id",e,Q()),T(pe(this,de,"f").getTrimOffset(e))}setTrimLength(e,t){return ie("id",e,Q()),ie("length",t,Z()),T(pe(this,de,"f").setTrimLength(e,t))}getTrimLength(e){return ie("id",e,Q()),T(pe(this,de,"f").getTrimLength(e))}getTotalSceneDuration(e){return ie("scene",e,Q()),T(pe(this,de,"f").getTotalSceneDuration(e))}setPlaying(e,t){return ie("id",e,Q()),ie("enabled",t,K()),T(pe(this,de,"f").setPlaying(e,t))}isPlaying(e){return ie("id",e,Q()),T(pe(this,de,"f").isPlaying(e))}hasPlaybackTime(e){return ie("id",e,Q()),T(pe(this,de,"f").hasPlaybackTime(e))}setPlaybackTime(e,t){return ie("id",e,Q()),ie("time",t,Z()),T(pe(this,de,"f").setPlaybackTime(e,t))}getPlaybackTime(e){return ie("id",e,Q()),T(pe(this,de,"f").getPlaybackTime(e))}setSoloPlaybackEnabled(e,t){return ie("id",e,Q()),ie("enabled",t,K()),T(pe(this,de,"f").setSoloPlaybackEnabled(e,t))}isSoloPlaybackEnabled(e){return ie("id",e,Q()),T(pe(this,de,"f").isSoloPlaybackEnabled(e))}hasPlaybackControl(e){return ie("id",e,Q()),T(pe(this,de,"f").hasPlaybackControl(e))}setLooping(e,t){ie("id",e,Q()),ie("looping",t,K()),T(pe(this,de,"f").setLooping(e,t))}isLooping(e){return ie("id",e,Q()),T(pe(this,de,"f").isLooping(e))}setMuted(e,t){ie("id",e,Q()),ie("muted",t,K()),T(pe(this,de,"f").setMuted(e,t))}isMuted(e){return ie("id",e,Q()),T(pe(this,de,"f").isMuted(e))}setVolume(e,t){ie("id",e,Q()),ie("volume",t,Z()),T(pe(this,de,"f").setVolume(e,t))}getVolume(e){return ie("id",e,Q()),T(pe(this,de,"f").getVolume(e))}async forceLoadAVResource(e){return ie("id",e,Q()),P((t=>pe(this,de,"f").forceLoadAVResource(e,t)))}getAVResourceTotalDuration(e){return ie("id",e,Q()),T(pe(this,de,"f").getAVResourceTotalDuration(e))}getVideoWidth(e){return ie("id",e,Q()),T(pe(this,de,"f").getVideoWidth(e))}getVideoHeight(e){return ie("id",e,Q()),T(pe(this,de,"f").getVideoHeight(e))}generateVideoThumbnailSequence(e,t,r,n,o,i){return ie("id",e,Q()),ie("thumbnailHeight",t,Q()),ie("timeBegin",r,Z()),ie("timeEnd",n,Z()),ie("numberOfFrames",o,Q()),pe(this,de,"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))})),()=>{T(pe(this,de,"f").cancelVideoThumbnailSequenceGeneration(e))}}async getVideoFillThumbnail(e,t){return ie("id",e,Q()),ie("thumbnailHeight",t,Q()),new Promise(((r,n)=>{pe(this,de,"f").getVideoFillThumbnail(e,t,(e=>{"error"in e?n(e.error):r(new ce([e],{type:"image/jpeg"}))}))}))}async getVideoFillThumbnailAtlas(e,t,r,n){return ie("id",e,Q()),ie("numberOfColumns",t,Q()),ie("numberOfRows",r,Q()),ie("thumbnailHeight",n,Q()),new Promise(((o,i)=>{pe(this,de,"f").getVideoFillThumbnailAtlas(e,t,r,n,(e=>{"error"in e?i(e.error):o(new ce([e],{type:"image/jpeg"}))}))}))}async getPageThumbnailAtlas(e,t,r,n){return ie("id",e,Q()),ie("numberOfColumns",t,Q()),ie("numberOfRows",r,Q()),new Promise(((o,i)=>{pe(this,de,"f").getPageThumbnailAtlas(e,t,r,n,(e=>{"error"in e?i(e.error):o(new ce([e],{type:"image/jpeg"}))}))}))}setNativePixelBuffer(e,t){t instanceof HTMLVideoElement&&(t.width=t.videoWidth,t.height=t.videoHeight),T(pe(this,de,"f").setNativePixelBuffer(e,t))}}de=new WeakMap,fe([u],he.prototype,"loadFromString",null),fe([u],he.prototype,"create",null),fe([u],he.prototype,"createFill",null),fe([s],he.prototype,"getType",null),fe([u],he.prototype,"select",null),fe([u],he.prototype,"setSelected",null),fe([s],he.prototype,"isSelected",null),fe([s],he.prototype,"findAllSelected",null),fe([s],he.prototype,"isGroupable",null),fe([u],he.prototype,"group",null),fe([u],he.prototype,"ungroup",null),fe([u],he.prototype,"enterGroup",null),fe([u],he.prototype,"exitGroup",null),fe([u],he.prototype,"setName",null),fe([s],he.prototype,"getName",null),fe([s],he.prototype,"getUUID",null),fe([s],he.prototype,"findByName",null),fe([s],he.prototype,"findByType",null),fe([s],he.prototype,"findAll",null),fe([s],he.prototype,"findAllPlaceholders",null),fe([u],he.prototype,"createShape",null),fe([s],he.prototype,"hasShape",null),fe([s],he.prototype,"getShape",null),fe([u],he.prototype,"setShape",null),fe([s],he.prototype,"isVisible",null),fe([u],he.prototype,"setVisible",null),fe([s],he.prototype,"isClipped",null),fe([u],he.prototype,"setClipped",null),fe([s],he.prototype,"getPositionX",null),fe([s],he.prototype,"getPositionXMode",null),fe([s],he.prototype,"getPositionY",null),fe([s],he.prototype,"getPositionYMode",null),fe([u],he.prototype,"setPositionX",null),fe([u],he.prototype,"setPositionXMode",null),fe([u],he.prototype,"setPositionY",null),fe([u],he.prototype,"setPositionYMode",null),fe([u],he.prototype,"setAlwaysOnTop",null),fe([u],he.prototype,"setAlwaysOnBottom",null),fe([s],he.prototype,"isAlwaysOnTop",null),fe([s],he.prototype,"isAlwaysOnBottom",null),fe([u],he.prototype,"bringToFront",null),fe([u],he.prototype,"sendToBack",null),fe([u],he.prototype,"bringForward",null),fe([u],he.prototype,"sendBackward",null),fe([s],he.prototype,"getRotation",null),fe([u],he.prototype,"setRotation",null),fe([s],he.prototype,"getFlipHorizontal",null),fe([s],he.prototype,"getFlipVertical",null),fe([u],he.prototype,"setFlipHorizontal",null),fe([u],he.prototype,"setFlipVertical",null),fe([s],he.prototype,"hasContentFillMode",null),fe([s],he.prototype,"getWidth",null),fe([s],he.prototype,"getWidthMode",null),fe([s],he.prototype,"getHeight",null),fe([s],he.prototype,"getHeightMode",null),fe([u],he.prototype,"setWidth",null),fe([u],he.prototype,"setWidthMode",null),fe([u],he.prototype,"setHeight",null),fe([u],he.prototype,"setHeightMode",null),fe([s],he.prototype,"getFrameX",null),fe([s],he.prototype,"getFrameY",null),fe([s],he.prototype,"getFrameWidth",null),fe([s],he.prototype,"getFrameHeight",null),fe([u],he.prototype,"setContentFillMode",null),fe([s],he.prototype,"getContentFillMode",null),fe([u],he.prototype,"duplicate",null),fe([u],he.prototype,"destroy",null),fe([s],he.prototype,"isValid",null),fe([s],he.prototype,"getParent",null),fe([s],he.prototype,"getChildren",null),fe([u],he.prototype,"insertChild",null),fe([u],he.prototype,"appendChild",null),fe([s],he.prototype,"referencesAnyVariables",null),fe([s],he.prototype,"getGlobalBoundingBoxX",null),fe([s],he.prototype,"getGlobalBoundingBoxY",null),fe([s],he.prototype,"getGlobalBoundingBoxWidth",null),fe([s],he.prototype,"getGlobalBoundingBoxHeight",null),fe([s],he.prototype,"getScreenSpaceBoundingBoxXYWH",null),fe([u],he.prototype,"alignHorizontally",null),fe([u],he.prototype,"alignVertically",null),fe([s],he.prototype,"isAlignable",null),fe([u],he.prototype,"distributeHorizontally",null),fe([u],he.prototype,"distributeVertically",null),fe([u],he.prototype,"isDistributable",null),fe([u],he.prototype,"fillParent",null),fe([u],he.prototype,"resizeContentAware",null),fe([u],he.prototype,"scale",null),fe([s],he.prototype,"findAllProperties",null),fe([s],he.prototype,"isPropertyReadable",null),fe([s],he.prototype,"isPropertyWritable",null),fe([s],he.prototype,"getPropertyType",null),fe([s],he.prototype,"getEnumValues",null),fe([u],he.prototype,"setBool",null),fe([s],he.prototype,"getBool",null),fe([u],he.prototype,"setInt",null),fe([s],he.prototype,"getInt",null),fe([u],he.prototype,"setFloat",null),fe([s],he.prototype,"getFloat",null),fe([u],he.prototype,"setDouble",null),fe([s],he.prototype,"getDouble",null),fe([u],he.prototype,"setString",null),fe([s],he.prototype,"getString",null),fe([u],he.prototype,"setColor",null),fe([s],he.prototype,"getColor",null),fe([u],he.prototype,"setColorRGBA",null),fe([s],he.prototype,"getColorRGBA",null),fe([u],he.prototype,"setColorSpot",null),fe([s],he.prototype,"getColorSpotName",null),fe([s],he.prototype,"getColorSpotTint",null),fe([u],he.prototype,"setGradientColorStops",null),fe([s],he.prototype,"getGradientColorStops",null),fe([u],he.prototype,"setEnum",null),fe([s],he.prototype,"getEnum",null),fe([s],he.prototype,"hasCrop",null),fe([u],he.prototype,"setCropScaleX",null),fe([u],he.prototype,"setCropScaleY",null),fe([u],he.prototype,"setCropRotation",null),fe([u],he.prototype,"setCropScaleRatio",null),fe([u],he.prototype,"setCropTranslationX",null),fe([u],he.prototype,"setCropTranslationY",null),fe([u],he.prototype,"resetCrop",null),fe([s],he.prototype,"getCropScaleX",null),fe([s],he.prototype,"getCropScaleY",null),fe([s],he.prototype,"getCropRotation",null),fe([s],he.prototype,"getCropScaleRatio",null),fe([s],he.prototype,"getCropTranslationX",null),fe([s],he.prototype,"getCropTranslationY",null),fe([u],he.prototype,"adjustCropToFillFrame",null),fe([u],he.prototype,"flipCropHorizontal",null),fe([u],he.prototype,"flipCropVertical",null),fe([s],he.prototype,"hasOpacity",null),fe([u],he.prototype,"setOpacity",null),fe([s],he.prototype,"getOpacity",null),fe([s],he.prototype,"hasBlendMode",null),fe([u],he.prototype,"setBlendMode",null),fe([s],he.prototype,"getBlendMode",null),fe([s],he.prototype,"hasFillColor",null),fe([u],he.prototype,"setFillColorRGBA",null),fe([s],he.prototype,"getFillColorRGBA",null),fe([u],he.prototype,"setFillColorEnabled",null),fe([s],he.prototype,"isFillColorEnabled",null),fe([u],he.prototype,"createEffect",null),fe([s],he.prototype,"hasEffects",null),fe([s],he.prototype,"getEffects",null),fe([u],he.prototype,"insertEffect",null),fe([u],he.prototype,"appendEffect",null),fe([u],he.prototype,"removeEffect",null),fe([s],he.prototype,"hasEffectEnabled",null),fe([u],he.prototype,"setEffectEnabled",null),fe([s],he.prototype,"isEffectEnabled",null),fe([u],he.prototype,"createBlur",null),fe([s],he.prototype,"hasBlur",null),fe([u],he.prototype,"setBlur",null),fe([s],he.prototype,"getBlur",null),fe([u],he.prototype,"setBlurEnabled",null),fe([s],he.prototype,"isBlurEnabled",null),fe([s],he.prototype,"hasBackgroundColor",null),fe([u],he.prototype,"setBackgroundColorRGBA",null),fe([s],he.prototype,"getBackgroundColorRGBA",null),fe([u],he.prototype,"setBackgroundColorEnabled",null),fe([s],he.prototype,"isBackgroundColorEnabled",null),fe([s],he.prototype,"hasStroke",null),fe([u],he.prototype,"setStrokeEnabled",null),fe([s],he.prototype,"isStrokeEnabled",null),fe([u],he.prototype,"setStrokeColorRGBA",null),fe([u],he.prototype,"setStrokeColor",null),fe([s],he.prototype,"getStrokeColorRGBA",null),fe([s],he.prototype,"getStrokeColor",null),fe([u],he.prototype,"setStrokeWidth",null),fe([s],he.prototype,"getStrokeWidth",null),fe([u],he.prototype,"setStrokeStyle",null),fe([s],he.prototype,"getStrokeStyle",null),fe([u],he.prototype,"setStrokePosition",null),fe([s],he.prototype,"getStrokePosition",null),fe([u],he.prototype,"setStrokeCornerGeometry",null),fe([s],he.prototype,"getStrokeCornerGeometry",null),fe([s],he.prototype,"hasDropShadow",null),fe([u],he.prototype,"setDropShadowEnabled",null),fe([s],he.prototype,"isDropShadowEnabled",null),fe([u],he.prototype,"setDropShadowColorRGBA",null),fe([u],he.prototype,"setDropShadowColor",null),fe([s],he.prototype,"getDropShadowColorRGBA",null),fe([s],he.prototype,"getDropShadowColor",null),fe([u],he.prototype,"setDropShadowOffsetX",null),fe([s],he.prototype,"getDropShadowOffsetX",null),fe([u],he.prototype,"setDropShadowOffsetY",null),fe([s],he.prototype,"getDropShadowOffsetY",null),fe([u],he.prototype,"setDropShadowBlurRadiusX",null),fe([s],he.prototype,"getDropShadowBlurRadiusX",null),fe([u],he.prototype,"setDropShadowBlurRadiusY",null),fe([s],he.prototype,"getDropShadowBlurRadiusY",null),fe([u],he.prototype,"setDropShadowClip",null),fe([s],he.prototype,"getDropShadowClip",null),fe([u],he.prototype,"createCutoutFromBlocks",null),fe([u],he.prototype,"createCutoutFromPath",null),fe([u],he.prototype,"createCutoutFromOperation",null),fe([u],he.prototype,"replaceText",null),fe([u],he.prototype,"removeText",null),fe([u],he.prototype,"setTextColor",null),fe([s],he.prototype,"getTextColors",null),fe([s],he.prototype,"getTextFontWeights",null),fe([s],he.prototype,"getTextFontStyles",null),fe([s],he.prototype,"getTextCases",null),fe([u],he.prototype,"setTextCase",null),fe([s],he.prototype,"getTextCursorRange",null),fe([s],he.prototype,"hasFill",null),fe([s],he.prototype,"isFillEnabled",null),fe([u],he.prototype,"setFillEnabled",null),fe([s],he.prototype,"getFill",null),fe([u],he.prototype,"setFill",null),fe([u],he.prototype,"setFillSolidColor",null),fe([s],he.prototype,"getFillSolidColor",null),fe([u],he.prototype,"setPlaceholderEnabled",null),fe([s],he.prototype,"isPlaceholderEnabled",null),fe([s],he.prototype,"hasPlaceholderBehavior",null),fe([u],he.prototype,"setPlaceholderBehaviorEnabled",null),fe([s],he.prototype,"isPlaceholderBehaviorEnabled",null),fe([s],he.prototype,"hasPlaceholderControls",null),fe([u],he.prototype,"setPlaceholderControlsOverlayEnabled",null),fe([s],he.prototype,"isPlaceholderControlsOverlayEnabled",null),fe([u],he.prototype,"setPlaceholderControlsButtonEnabled",null),fe([s],he.prototype,"isPlaceholderControlsButtonEnabled",null),fe([u],he.prototype,"setMetadata",null),fe([s],he.prototype,"getMetadata",null),fe([s],he.prototype,"hasMetadata",null),fe([s],he.prototype,"findAllMetadata",null),fe([u],he.prototype,"removeMetadata",null),fe([u],he.prototype,"setScopeEnabled",null),fe([s],he.prototype,"isScopeEnabled",null),fe([s],he.prototype,"isAllowedByScope",null),fe([s],he.prototype,"hasDuration",null),fe([u],he.prototype,"setDuration",null),fe([s],he.prototype,"getDuration",null),fe([s],he.prototype,"hasTimeOffset",null),fe([u],he.prototype,"setTimeOffset",null),fe([s],he.prototype,"getTimeOffset",null),fe([s],he.prototype,"hasTrim",null),fe([u],he.prototype,"setTrimOffset",null),fe([s],he.prototype,"getTrimOffset",null),fe([u],he.prototype,"setTrimLength",null),fe([s],he.prototype,"getTrimLength",null),fe([s],he.prototype,"getTotalSceneDuration",null),fe([u],he.prototype,"setPlaying",null),fe([s],he.prototype,"isPlaying",null),fe([s],he.prototype,"hasPlaybackTime",null),fe([u],he.prototype,"setPlaybackTime",null),fe([s],he.prototype,"getPlaybackTime",null),fe([u],he.prototype,"setSoloPlaybackEnabled",null),fe([s],he.prototype,"isSoloPlaybackEnabled",null),fe([s],he.prototype,"hasPlaybackControl",null),fe([u],he.prototype,"setLooping",null),fe([s],he.prototype,"isLooping",null),fe([u],he.prototype,"setMuted",null),fe([s],he.prototype,"isMuted",null),fe([u],he.prototype,"setVolume",null),fe([s],he.prototype,"getVolume",null),fe([u],he.prototype,"forceLoadAVResource",null),fe([s],he.prototype,"getAVResourceTotalDuration",null),fe([s],he.prototype,"getVideoWidth",null),fe([s],he.prototype,"getVideoHeight",null),fe([s],he.prototype,"getVideoFillThumbnail",null),fe([s],he.prototype,"getVideoFillThumbnailAtlas",null),fe([s],he.prototype,"getPageThumbnailAtlas",null);var me,ge=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},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 ve{constructor(e){me.set(this,void 0),Object.defineProperty(this,"onStateChanged",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=ye(this,me,"f").subscribeToEditorState(e);return()=>{ye(this,me,"f").isDeleted()||T(ye(this,me,"f").unsubscribe(t))}}}),Object.defineProperty(this,"onHistoryUpdated",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=ye(this,me,"f").subscribeToHistory(e);return()=>{ye(this,me,"f").isDeleted()||ye(this,me,"f").unsubscribe(t)}}}),Object.defineProperty(this,"onSettingsChanged",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=ye(this,me,"f").subscribeToSettings(e);return()=>{ye(this,me,"f").isDeleted()||T(ye(this,me,"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,me,e,"f")}setEditMode(e){ie("keypath",e,ee()),ye(this,me,"f").setEditMode(e)}getEditMode(){return ye(this,me,"f").getEditMode()}getCursorType(){return ye(this,me,"f").getCursorType()}getCursorRotation(){return ye(this,me,"f").getCursorRotation()}getTextCursorPositionInScreenSpaceX(){return ye(this,me,"f").getTextCursorPositionInScreenSpaceX()}getTextCursorPositionInScreenSpaceY(){return ye(this,me,"f").getTextCursorPositionInScreenSpaceY()}createHistory(){return ye(this,me,"f").createHistory()}destroyHistory(e){T(ye(this,me,"f").destroyHistory(e))}setActiveHistory(e){T(ye(this,me,"f").setActiveHistory(e))}getActiveHistory(){return ye(this,me,"f").getActiveHistory()}addUndoStep(){T(ye(this,me,"f").addUndoStep())}undo(){T(ye(this,me,"f").undo())}redo(){T(ye(this,me,"f").redo())}canUndo(){return T(ye(this,me,"f").canUndo())}canRedo(){return T(ye(this,me,"f").canRedo())}setSettingBool(e,t){return ie("keypath",e,ee()),ie("value",t,K()),T(ye(this,me,"f").setSettingBool(e,t))}getSettingBool(e){return ie("keypath",e,ee()),T(ye(this,me,"f").getSettingBool(e))}setSettingInt(e,t){return ie("keypath",e,ee()),ie("value",t,Q()),T(ye(this,me,"f").setSettingInt(e,t))}getSettingInt(e){return ie("keypath",e,ee()),T(ye(this,me,"f").getSettingInt(e))}setSettingFloat(e,t){return ie("keypath",e,ee()),ie("value",t,Z()),T(ye(this,me,"f").setSettingFloat(e,t))}getSettingFloat(e){return ie("keypath",e,ee()),T(ye(this,me,"f").getSettingFloat(e))}setSettingString(e,t){return ie("keypath",e,ee()),ie("value",t,ee()),T(ye(this,me,"f").setSettingString(e,t))}getSettingString(e){return ie("keypath",e,ee()),T(ye(this,me,"f").getSettingString(e))}setSettingColor(e,t){return ie("keypath",e,ee()),T(ye(this,me,"f").setSettingColor(e,c.fromColor(t)))}getSettingColor(e){return ie("keypath",e,ee()),c.toColor(T(ye(this,me,"f").getSettingColor(e)))}setSettingColorRGBA(e,t,r,n,o=1){return ie("keypath",e,ee()),ie("r",t,Z()),ie("g",r,Z()),ie("b",n,Z()),ie("a",o,Z()),T(ye(this,me,"f").setSettingColorRGBA(e,t,r,n,o))}getSettingColorRGBA(e){return ie("keypath",e,ee()),T(ye(this,me,"f").getSettingColorRGBA(e))}setSettingEnum(e,t){return ie("keypath",e,ee()),ie("value",t,ee()),T(ye(this,me,"f").setSettingEnum(e,t))}getSettingEnum(e){return ie("keypath",e,ee()),T(ye(this,me,"f").getSettingEnum(e))}getSettingEnumOptions(e){return ie("keypath",e,ee()),A(T(ye(this,me,"f").getSettingEnumOptions(e)))}findAllSettings(){return A(ye(this,me,"f").findAllSettings())}getSettingType(e){return ie("keypath",e,ee()),T(ye(this,me,"f").getSettingType(e))}getAvailableMemory(){return T(ye(this,me,"f").getAvailableMemory())}getUsedMemory(){return T(ye(this,me,"f").getUsedMemory())}setURIResolver(e){return T(ye(this,me,"f").setURIResolver(e))}defaultURIResolver(e){return ye(this,me,"f").defaultURIResolver(e)}getAbsoluteURI(e){return T(ye(this,me,"f").getAbsoluteURI(e))}setGlobalScope(e,t){ie("key",e,ee()),ie("value",t,ee()),T(ye(this,me,"f").setGlobalScope(e,t))}getGlobalScope(e){return ie("key",e,ee()),T(ye(this,me,"f").getGlobalScope(e))}findAllSpotColors(){return A(ye(this,me,"f").findAllSpotColors())}getSpotColorRGBA(e){return ie("name",e,ee()),ye(this,me,"f").getSpotColorRGB(e)}getSpotColorCMYK(e){return ie("name",e,ee()),ye(this,me,"f").getSpotColorCMYK(e)}setSpotColorRGB(e,t,r,n){return ie("name",e,ee()),ie("r",t,Z()),ie("g",r,Z()),ie("b",n,Z()),ye(this,me,"f").setSpotColorRGB(e,t,r,n)}setSpotColorCMYK(e,t,r,n,o){return ie("name",e,ee()),ie("c",t,Z()),ie("m",r,Z()),ie("y",n,Z()),ie("k",o,Z()),ye(this,me,"f").setSpotColorCMYK(e,t,r,n,o)}removeSpotColor(e){return ie("name",e,ee()),T(ye(this,me,"f").removeSpotColor(e))}setSpotColorForCutoutType(e,t){return ie("type",e,ee()),ie("color",t,ee()),T(ye(this,me,"f").setSpotColorForCutoutType(e,t))}getSpotColorForCutoutType(e){return ie("type",e,ee()),T(ye(this,me,"f").getSpotColorForCutoutType(e))}convertColorToColorSpace(e,t){return ie("colorSpace",t,ee()),c.toColor(T(ye(this,me,"f").convertColorToColorSpace(c.fromColor(e),t)))}}me=new WeakMap,ge([u],ve.prototype,"setEditMode",null),ge([s],ve.prototype,"getEditMode",null),ge([s],ve.prototype,"getCursorType",null),ge([s],ve.prototype,"getCursorRotation",null),ge([s],ve.prototype,"getTextCursorPositionInScreenSpaceX",null),ge([s],ve.prototype,"getTextCursorPositionInScreenSpaceY",null),ge([u],ve.prototype,"createHistory",null),ge([u],ve.prototype,"destroyHistory",null),ge([u],ve.prototype,"setActiveHistory",null),ge([s],ve.prototype,"getActiveHistory",null),ge([u],ve.prototype,"addUndoStep",null),ge([u],ve.prototype,"undo",null),ge([u],ve.prototype,"redo",null),ge([s],ve.prototype,"canUndo",null),ge([s],ve.prototype,"canRedo",null),ge([u],ve.prototype,"setSettingBool",null),ge([s],ve.prototype,"getSettingBool",null),ge([u],ve.prototype,"setSettingInt",null),ge([s],ve.prototype,"getSettingInt",null),ge([u],ve.prototype,"setSettingFloat",null),ge([s],ve.prototype,"getSettingFloat",null),ge([u],ve.prototype,"setSettingString",null),ge([s],ve.prototype,"getSettingString",null),ge([u],ve.prototype,"setSettingColor",null),ge([s],ve.prototype,"getSettingColor",null),ge([u],ve.prototype,"setSettingColorRGBA",null),ge([s],ve.prototype,"getSettingColorRGBA",null),ge([u],ve.prototype,"setSettingEnum",null),ge([s],ve.prototype,"getSettingEnum",null),ge([s],ve.prototype,"getAvailableMemory",null),ge([s],ve.prototype,"getUsedMemory",null),ge([u],ve.prototype,"setURIResolver",null),ge([s],ve.prototype,"defaultURIResolver",null),ge([s],ve.prototype,"getAbsoluteURI",null),ge([u],ve.prototype,"setGlobalScope",null),ge([s],ve.prototype,"getGlobalScope",null),ge([s],ve.prototype,"findAllSpotColors",null),ge([s],ve.prototype,"getSpotColorRGBA",null),ge([s],ve.prototype,"getSpotColorCMYK",null),ge([u],ve.prototype,"setSpotColorRGB",null),ge([u],ve.prototype,"setSpotColorCMYK",null),ge([u],ve.prototype,"removeSpotColor",null),ge([u],ve.prototype,"setSpotColorForCutoutType",null),ge([u],ve.prototype,"getSpotColorForCutoutType",null);var be,we=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 Ee{constructor(e){be.set(this,void 0),Object.defineProperty(this,"subscribe",{enumerable:!0,configurable:!0,writable:!0,value:(e,t)=>{ie("blocks",e,X());const r=we(this,be,"f").subscribe(e,(e=>{try{t(A(e,!0))}catch(e){console.error(e)}}));return()=>{we(this,be,"f").isDeleted()||T(we(this,be,"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,be,e,"f")}}be=new WeakMap;var Ce,_e=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},Se=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){Ce.set(this,void 0),Object.defineProperty(this,"onZoomLevelChanged",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=Se(this,Ce,"f").subscribeToZoomLevel(e);return()=>{Se(this,Ce,"f").isDeleted()||T(Se(this,Ce,"f").unsubscribe(t))}}}),Object.defineProperty(this,"onActiveChanged",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=Se(this,Ce,"f").subscribeToActiveSceneChange(e);return()=>{Se(this,Ce,"f").isDeleted()||T(Se(this,Ce,"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,Ce,e,"f")}async loadFromString(e){return ie("sceneContent",e,ee()),P((t=>Se(this,Ce,"f").loadSceneFromString(e,t)))}async loadFromURL(e){return ie("url",e,ee()),P((t=>Se(this,Ce,"f").loadSceneFromURL(e,t)))}async saveToString(){const e=this.get();if(null==e)throw new Error("No scene available.");return P((t=>{Se(this,Ce,"f").saveSceneToString(e,t)}))}async saveToArchive(){return new Promise(((e,t)=>{const r=this.get();null==r?t(new Error("No scene available.")):Se(this,Ce,"f").saveSceneToArchive(r,(r=>{"error"in r?t(r.error):e(new ce([r],{type:le.Zip}))}))}))}create(e="Free"){return ie("sceneLayout",e,se()),T(Se(this,Ce,"f").createScene(e))}createVideo(){return T(Se(this,Ce,"f").createVideoScene())}createFromImage(e,t=300,r=1,n="Free",o=0,i=!1){return ie("url",e,ee()),ie("dpi",t,re(Z(),0)),ie("pixelScaleFactor",r,re(Z(),0)),ie("sceneLayout",n,se()),P((a=>Se(this,Ce,"f").createSceneFromImage(e,t,r,n,o,i,a)))}createFromVideo(e){return ie("url",e,ee()),P((t=>Se(this,Ce,"f").createSceneFromVideo(e,t)))}get(){const e=T(Se(this,Ce,"f").findByType(f.Scene)),t=A(e);return t.length>0?t[0]:null}async applyTemplateFromString(e){return ie("content",e,ee()),P((t=>Se(this,Ce,"f").applyTemplateFromString(e,t)))}async applyTemplateFromURL(e){return ie("url",e,ee()),P((t=>Se(this,Ce,"f").applyTemplateFromURL(e,t)))}getMode(){const e=this.get();return T(Se(this,Ce,"f").getSceneMode(e))}setDesignUnit(e){ie("designUnit",e,function(){const e=["Pixel","Millimeter","Inch"];return Y("DesignUnit",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}());const t=this.get();T(Se(this,Ce,"f").setDesignUnit(t,e))}getDesignUnit(){const e=this.get();return T(Se(this,Ce,"f").getDesignUnit(e))}getPages(){return A(T(Se(this,Ce,"f").getPages()))}getCurrentPage(){const e=this.get();if(null==e)return null;const t=T(Se(this,Ce,"f").findNearestToViewPortCenterByKind(e,"page")),r=A(t);return r.length>0?r[0]:null}findNearestToViewPortCenterByType(e){ie("type",e,ee());const t=this.get();if(null==t)return[];const r=T(Se(this,Ce,"f").findNearestToViewPortCenterByType(t,e));return A(r)}findNearestToViewPortCenterByKind(e){ie("kind",e,ee());const t=this.get();if(null==t)return[];const r=T(Se(this,Ce,"f").findNearestToViewPortCenterByKind(t,e));return A(r)}setZoomLevel(e=1){const t=this.get();ie("zoomLevel",e,re(Z(),0)),Se(this,Ce,"f").setZoomLevel(t,e)}getZoomLevel(){const e=this.get();return T(Se(this,Ce,"f").getZoomLevel(e))}async zoomToBlock(e,t=0,r=0,n=0,o=0){return ie("id",e,Q()),P((i=>Se(this,Ce,"f").zoomToBlock(e,t,r,n,o,i)))}enableZoomAutoFit(e,t,r=0,n=0,o=0,i=0){return ie("id",e,Q()),ie("axis",t,function(){const e=["Horizontal","Vertical","Both"];return Y("ZoomAutoFitAxis",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}()),"Horizontal"===t?(ie("paddingBefore",r,Z()),ie("paddingAfter",n,Z()),T(Se(this,Ce,"f").enableZoomAutoFit(e,t,r,0,n,0))):"Vertical"===t?(ie("paddingBefore",r,Z()),ie("paddingAfter",n,Z()),T(Se(this,Ce,"f").enableZoomAutoFit(e,t,0,r,0,n))):(ie("paddingLeft",r,Z()),ie("paddingTop",n,Z()),ie("paddingRight",o,Z()),ie("paddingBottom",i,Z()),T(Se(this,Ce,"f").enableZoomAutoFit(e,t,r,n,o,i)))}disableZoomAutoFit(e){return ie("blockOrScene",e,Q()),T(Se(this,Ce,"f").disableZoomAutoFit(e))}isZoomAutoFitEnabled(e){return ie("blockOrScene",e,Q()),T(Se(this,Ce,"f").isZoomAutoFitEnabled(e))}unstable_enableCameraPositionClamping(e,t=0,r=0,n=0,o=0,i=0,a=0,s=0,u=0){return ie("ids",e,X(Z())),ie("paddingLeft",t,Z()),ie("paddingTop",r,Z()),ie("paddingRight",n,Z()),ie("paddingBottom",o,Z()),ie("scaledPaddingLeft",t,Z()),ie("scaledPaddingTop",r,Z()),ie("scaledPaddingRight",n,Z()),ie("scaledPaddingBottom",o,Z()),T(Se(this,Ce,"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 T(Se(this,Ce,"f").unstable_disableCameraPositionClamping(e))}unstable_isCameraPositionClampingEnabled(e=this.get()){if(null==e)throw new Error("No scene available.");return T(Se(this,Ce,"f").unstable_isCameraPositionClampingEnabled(e))}unstable_enableCameraZoomClamping(e,t=-1,r=-1,n=0,o=0,i=0,a=0){return ie("ids",e,X(Z())),ie("minZoomLimit",t,Z()),ie("maxZoomLimit",r,Z()),ie("paddingLeft",n,Z()),ie("paddingTop",o,Z()),ie("paddingRight",i,Z()),ie("paddingBottom",a,Z()),T(Se(this,Ce,"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 T(Se(this,Ce,"f").unstable_disableCameraZoomClamping(e))}unstable_isCameraZoomClampingEnabled(e=this.get()){if(null==e)throw new Error("No scene available.");return T(Se(this,Ce,"f").unstable_isCameraZoomClampingEnabled(e))}}function ke(e,t){const r=new Set;function n(n){return r.add(n),null==e||e(((e,...t)=>{n(e);for(const e of t)n(e)})),()=>{r.delete(n),null==t||t()}}return n.emit=function(e,...t){for(const n of r){n(e);for(const e of t)n(e)}},n.handlers=r,n}Ce=new WeakMap,_e([u],xe.prototype,"loadFromString",null),_e([u],xe.prototype,"loadFromURL",null),_e([u],xe.prototype,"create",null),_e([u],xe.prototype,"createVideo",null),_e([u],xe.prototype,"createFromImage",null),_e([u],xe.prototype,"createFromVideo",null),_e([s],xe.prototype,"get",null),_e([u],xe.prototype,"applyTemplateFromString",null),_e([u],xe.prototype,"applyTemplateFromURL",null),_e([s],xe.prototype,"getMode",null),_e([u],xe.prototype,"setDesignUnit",null),_e([s],xe.prototype,"getDesignUnit",null),_e([s],xe.prototype,"getPages",null),_e([s],xe.prototype,"getCurrentPage",null),_e([s],xe.prototype,"findNearestToViewPortCenterByType",null),_e([s],xe.prototype,"findNearestToViewPortCenterByKind",null),_e([u],xe.prototype,"setZoomLevel",null),_e([s],xe.prototype,"getZoomLevel",null),_e([u],xe.prototype,"zoomToBlock",null),_e([u],xe.prototype,"enableZoomAutoFit",null),_e([u],xe.prototype,"disableZoomAutoFit",null),_e([s],xe.prototype,"isZoomAutoFitEnabled",null);const Te=e=>t=>function(r){return t((function(t){r(e(t))}))};function Pe(e){return t=>function(r){let n=!1;const o=t((function(e){n=!0,r(e)}));return n||r(e instanceof Function?e():e),o}}const Ae=(e=((e,t)=>e===t))=>t=>function(r){let n;return t((function(t){e(t,n)||(n=t,r(t))}))},Fe=e=>{const t=new Set;let r=null;return function(n){return t.add(n),null===r&&(r=e((function(e){t.forEach((t=>t(e)))}))),function(){t.delete(n),0===t.size&&(null==r||r(),r=null)}}};function Le(e,...t){return t.reduce(((e,t)=>t(e)),e)}const De=(...e)=>{const t=Array.from(e);return function(e){const r=t.map((function(t){return t(e)}));return function(){for(const e of r)e()}}};function Be(e){return function(t){let r=null;const n=e((function(e){null==r||r(),r=e?e(t):e}));return function(){n(),null==r||r(),r=null}}}function Re(...e){const t=Array.from(e);return function(e){const r=new Array(t.length),n=t.map(((t,n)=>t((function(t){r[n]=t,e(r)}))));return function(){n.forEach((e=>e())),r.length=0}}}const Oe=Symbol("NO_VALUE");function Me(e){let t=Oe;const r=ke();return{subscribe:r,value:()=>(t===Oe&&(t=e()),t),update(e){t=e,r.emit(t)}}}var je,Ie,Ue,qe,$e,He,Ne,Ve,We=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},ze=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){je.add(this),Ie.set(this,void 0),Ue.set(this,null),qe.set(this,void 0),Object.defineProperty(this,"singlePageMode",{enumerable:!0,configurable:!0,writable:!0,value:ze(this,je,"m",He).call(this,"features/singlePageModeEnabled")}),Object.defineProperty(this,"role",{enumerable:!0,configurable:!0,writable:!0,value:ze(this,je,"m",Ne).call(this,"role")}),Object.defineProperty(this,"pageTitleShow",{enumerable:!0,configurable:!0,writable:!0,value:ze(this,je,"m",He).call(this,"page/title/show")}),Object.defineProperty(this,"pageTitleFont",{enumerable:!0,configurable:!0,writable:!0,value:ze(this,je,"m",Ve).call(this,"page/title/fontFileUri")}),Object.defineProperty(this,"dimOutOfPageAreas",{enumerable:!0,configurable:!0,writable:!0,value:ze(this,je,"m",He).call(this,"page/dimOutOfPageAreas")}),Object.defineProperty(this,"singlePointPanning",{enumerable:!0,configurable:!0,writable:!0,value:ze(this,je,"m",He).call(this,"touch/singlePointPanning")}),Object.defineProperty(this,"touchPinchAction",{enumerable:!0,configurable:!0,writable:!0,value:ze(this,je,"m",Ne).call(this,"touch/pinchAction")}),Object.defineProperty(this,"touchRotateAction",{enumerable:!0,configurable:!0,writable:!0,value:ze(this,je,"m",Ne).call(this,"touch/rotateAction")}),Object.defineProperty(this,"dragStartCanSelect",{enumerable:!0,configurable:!0,writable:!0,value:ze(this,je,"m",He).call(this,"touch/dragStartCanSelect")}),Object.defineProperty(this,"featureHspSelectiveAdjustmentsEnabled",{enumerable:!0,configurable:!0,writable:!0,value:ze(this,je,"m",He).call(this,"features/hspSelectiveAdjustmentsEnabled")}),Object.defineProperty(this,"featureLayerListEnabled",{enumerable:!0,configurable:!0,writable:!0,value:ze(this,je,"m",He).call(this,"features/layerListEnabled")}),Object.defineProperty(this,"unstable_workerFactory",{enumerable:!0,configurable:!0,writable:!0,value:Me((()=>null))}),Object.defineProperty(this,"unstable_videoExportInactivityTimeout",{enumerable:!0,configurable:!0,writable:!0,value:Me((()=>1e4))}),We(this,Ie,e,"f");const t=ke((()=>{1===t.handlers.size&&ze(this,je,"m",$e).call(this)}),(()=>{var e;0===t.handlers.size&&(null===(e=ze(this,Ue,"f"))||void 0===e||e.call(this))}));We(this,qe,t,"f")}dispose(){var e;ze(this,qe,"f").handlers.clear(),null===(e=ze(this,Ue,"f"))||void 0===e||e.call(this)}}Ie=new WeakMap,Ue=new WeakMap,qe=new WeakMap,je=new WeakSet,$e=function(){if(ze(this,Ue,"f"))throw new Error("Settings Changed Event callback is already registered.");const e=ze(this,Ie,"f").onSettingsChanged((()=>{ze(this,qe,"f").emit()}));We(this,Ue,(()=>{e(),We(this,Ue,null,"f")}),"f")},He=function(e){const t=()=>ze(this,Ie,"f").getSettingBool(e);return{subscribe:Le((e=>ze(this,qe,"f").call(this,e)),Te(t),Ae(),Fe),update:t=>{ze(this,Ie,"f").setSettingBool(e,t),ze(this,qe,"f").emit()},value:t}},Ne=function(e){const t=()=>ze(this,Ie,"f").getSettingEnum(e);return{subscribe:Le((e=>ze(this,qe,"f").call(this,e)),Te(t),Ae(),Fe),update:t=>{ze(this,Ie,"f").setSettingEnum(e,t),ze(this,qe,"f").emit()},value:t}},Ve=function(e){const t=()=>ze(this,Ie,"f").getSettingString(e);return{subscribe:Le((e=>ze(this,qe,"f").call(this,e)),Te(t),Ae(),Fe),update:t=>{ze(this,Ie,"f").setSettingString(e,t),ze(this,qe,"f").emit()},value:t}};var Ye,Xe=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 Ke{constructor(e){Ye.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,Ye,e,"f")}findAll(){return A(Xe(this,Ye,"f").findAllVariables())}setString(e,t){return ie("key",e,ee()),ie("value",t,ee()),T(Xe(this,Ye,"f").setVariableString(e,t))}getString(e){return ie("key",e,ee()),T(Xe(this,Ye,"f").getVariableString(e))}remove(e){return ie("key",e,ee()),T(Xe(this,Ye,"f").removeVariable(e))}}Ye=new WeakMap;const Qe={Info:"Info",Warning:"Warning",Error:"Error"};function Ze(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)}}const Je={baseURL:"/extensions/",entries:["ly.img.cesdk.fonts"]};function et(e,t=("undefined"==typeof window?"":window.location.href)){return new URL(e,""===t?void 0:t).href}function tt(e){return"/"!==e[e.length-1]?`${e}/`:e}const rt=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)};var nt,ot=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},it=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)};function at(e,t){let r;const n=new Set;function o(){const n=window.devicePixelRatio,{width:i,height:a}=e.getBoundingClientRect();t(i*n,a*n,n),r=matchMedia(`(resolution: ${n}dppx)`),r.addEventListener("change",o,{once:!0})}o();const i=new ResizeObserver((function([e]){const{width:r,height:o}=e.target.getBoundingClientRect();if(r<=0||o<=0)return;const i=window.devicePixelRatio,a=setTimeout((function(){n.delete(a),t(r*i,o*i,i)}),0);n.add(a)}));return i.observe(e),()=>{r.removeEventListener("change",o),i.disconnect();for(const e of n)clearTimeout(e);n.clear(),e=null,t=null}}!function(e){e.Scene="ubq/designblocks/SceneProps",e.Camera="ubq/designblocks/Camera",e.Common="ubq/designblocks/CommonDesignBlockProps",e.Page="ubq/designblocks/Page",e.Image="ubq/designblocks/Image",e.Video="ubq/designblocks/Video",e.Audio="ubq/designblocks/Audio",e.Sticker="ubq/designblocks/Sticker",e.Text="ubq/designblocks/Text",e.Crop="ubq/types/Crop",e.Scale="ubq/scene/Scale",e.Opacity="ubq/types/Opacity",e.FillColor="ubq/types/FillColor",e.Group="ubq/designblocks/Group",e.VectorPath="ubq/designblocks/VectorPath",e.PendingState="ubq/designblocks/PendingState",e.ErrorState="ubq/designblocks/ErrorState",e.DesignBlockFrame="ubq/designblocks/DesignBlockFrame",e.Size="ubq/layout/Size",e.Position="ubq/layout/Position",e.EulerRotation="ubq/scene/EulerRotation",e.Children="ubq/scene/Children"}(nt||(nt={}));const st=nt;var ut=r(9510),lt=r.n(ut);function ct(e,t){const{block:r,event:n}=t;return Le((t=>{const o=r.getType(e),i=lt()(n.subscribe([e],(n=>{n.some((e=>"Destroyed"===e.type))&&!r.isValid(e)||r.getType(e)!==o?i():t(n)})));return i}),Fe)}const dt=function(e,t,r,n){const o=function(e,t){if(!t)return e;let r;return(...n)=>{const o=e(...n);return t(o,r)||(r=o),r}}(t,null==n?void 0:n.equals),i=ke();return{subscribe:Le(De(e,i),Te(o),Ae(),Fe),update:r,value:o,flush:()=>i.emit()}};var ft,pt=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 ht{constructor(e){Object.defineProperty(this,"settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"clampCamera",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"clampResult",{enumerable:!0,configurable:!0,writable:!0,value:Me((()=>({sceneSize:{x:0,y:0},scrollPercentage:{x:NaN,y:NaN}})))}),Object.defineProperty(this,"zoomLevel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),ft.set(this,void 0),Object.defineProperty(this,"viewportPadding",{enumerable:!0,configurable:!0,writable:!0,value:Me((()=>({x:40,y:48})))}),Object.defineProperty(this,"autoFit",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"scrollPercentage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sceneSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"scroll",{enumerable:!0,configurable:!0,writable:!0,value:void 0});const{block:t,scene:r,_ubq:n}=e,o=Le(r.onActiveChanged,Pe(),Te((()=>r.get()))),a=Le(o,Te((r=>null!=r&&t.isValid(r)?Le(ct(r,e),Pe([]),Te((()=>t.getFloat(r,"scene/dpi")))):()=>()=>{})),Be),s=Le(o,Te((()=>{const r=t.findByType(f.Camera)[0];return null==r?()=>()=>{}:Le(ct(r,e),Pe([]),Te((()=>r)))})),Be);this.settings={subscribe:Le(s,Te((e=>({width:t.getFloat(e,"camera/resolution/width"),height:t.getFloat(e,"camera/resolution/height"),pixelRatio:t.getFloat(e,"camera/pixelRatio")}))),Ae(i()),Fe),update({width:e,height:r,pixelRatio:n}){const o=t.findByType(f.Camera)[0];null!=o&&(t.setFloat(o,"camera/resolution/width",e),t.setFloat(o,"camera/resolution/height",r),t.setFloat(o,"camera/pixelRatio",n))},value(){const e=t.findByType(f.Camera)[0];return null==e?{width:0,height:0,pixelRatio:1}:{width:t.getFloat(e,"camera/resolution/width"),height:t.getFloat(e,"camera/resolution/height"),pixelRatio:t.getFloat(e,"camera/pixelRatio")}}},this.zoomLevel=dt(De(r.onZoomLevelChanged,a),(()=>{const e=r.get();return null!=e&&t.isValid(e)?r.getZoomLevel():1}),(e=>{const n=r.get();null!=n&&t.isValid(n)&&r.setZoomLevel(e)})),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,ft,{subscribe:Le(s,Te((e=>new k(n).getValue(e,st.Camera,"zoomLevel"))),Ae()),value(){const e=t.findByType(f.Camera)[0];return null==e?1:new k(n).getValue(e,st.Camera,"zoomLevel")}},"f"),this.autoFit=dt(r.onZoomLevelChanged,(()=>{const e=r.get();return null!=e&&r.isZoomAutoFitEnabled(e)})),this.scrollPercentage={subscribe:Le(this.clampResult.subscribe,Te((e=>e.scrollPercentage)),Ae(i())),value:()=>this.clampResult.value().scrollPercentage},this.sceneSize={subscribe:Le(Re(this.clampResult.subscribe,pt(this,ft,"f").subscribe,this.settings.subscribe),Te((([e,t,r])=>{var n,o,i,a,s;const u=null!==(o=null!==(n=null==e?void 0:e.sceneSize)&&void 0!==n?n:this.clampResult.value().sceneSize)&&void 0!==o?o:{x:0,y:0},l=null!==(i=null!=t?t:pt(this,ft,"f").value())&&void 0!==i?i:10,c=null!==(s=null!==(a=null==r?void 0:r.pixelRatio)&&void 0!==a?a:this.settings.value().pixelRatio)&&void 0!==s?s:1;return{x:u.x*l/c,y:u.y*l/c}})),Ae(i())),value:()=>{var e,t,r;const n=null!==(e=this.clampResult.value().sceneSize)&&void 0!==e?e:{x:0,y:0},o=null!==(t=pt(this,ft,"f").value())&&void 0!==t?t:10,i=null!==(r=this.settings.value().pixelRatio)&&void 0!==r?r:1;return{x:n.x*o/i,y:n.y*o/i}}},this.scroll=e=>{const r=t.findByType(f.Camera)[0];if(null==r)return;const n=pt(this,ft,"f").value(),o=this.settings.value().pixelRatio,i=e.x*o/n,a=e.y*o/n,s={x:t.getPositionX(r)+i,y:t.getPositionY(r)+a};t.setPositionX(r,s.x),t.setPositionY(r,s.y)}}zoom(e,t=1){const r=Math.exp(.01*e*t),n=this.zoomLevel.value();this.zoomLevel.update(n*r)}}function mt(e,t,r){const n=e=>{T(t.setContext("")),e.preventDefault()},o=e=>{T(t.setContext("!canvas")),r&&r(),e.preventDefault()};return e.addEventListener("webglcontextlost",n,!1),e.addEventListener("webglcontextrestored",o,!1),()=>{e.removeEventListener("webglcontextlost",n),e.removeEventListener("webglcontextrestored",o)}}ft=new WeakMap;var gt=r(789),yt=r.n(gt);const vt=r.p+"assets/core/cesdk-v1.18.1-d92fadafda0b5129818d.data",bt=r.p+"assets/core/cesdk-v1.18.1-d3e0acb895f4d9e31459.wasm",wt=yt(),Et=!("undefined"==typeof window||!window.document||!window.document.createElement)&&navigator&&navigator.userAgent||"",Ct=-1!==Et.indexOf("Edge"),_t=!!Et.match(/msie|trident/i),St=/\b(iPad|iPhone|iPod)\b/.test(Et)&&/WebKit/.test(Et)&&!/Edge/.test(Et)&&("undefined"==typeof window||!("MSStream"in window)),xt=(e,t)=>null!=t?[t,e.split("/").pop()].join(""):new URL(e,window.location.origin);function kt(){try{return new WebAssembly.Memory({initial:Tt(St?512:32),maximum:Tt(2048)})}catch(e){return new WebAssembly.Memory({initial:Tt(32),maximum:Tt(2048)})}}function Tt(e){return 1024*e*1024/65536}async function Pt(e,t){const{core:r}=t,n=t.logger,o=xt(bt,r.baseURL).toString(),i=xt(vt,r.baseURL).toString(),a=/electron/i.test(navigator.userAgent)?await fetch(i,{credentials:"same-origin"}).then((e=>e.arrayBuffer())).then((e=>function(t,r){if(t!==i)return null;if(r===e.byteLength)return e;throw new Error(`Attempt to get preloaded package of unknown name or size: ${t} ${r}`)})):void 0;return new Promise(((r,s)=>{const u={getPreloadedPackage:a,locateFile:(e,t)=>e.endsWith(".wasm")?o:e.endsWith(".data")?i:t+e,print:e=>{e&&"undefined"!==e&&n(e,"Info")},printErr:e=>{e&&"undefined"!==e&&n(e,"Error")},logReadFiles:!1,printWithColors:!0,wasmMemory:kt()};wt(u).then((async n=>{var o;n.specialHTMLTargets["!canvas"]=e,n.emscripten_ubq_settings_forceWebGL1=!!(null==t?void 0:t.forceWebGL1);const i=T(n.createEngine("!canvas",null!==(o=t.audioOutput)&&void 0!==o?o:"auto"));!function(e,t){var r,n;const o=new k(e),i=new ve(e),a=new I(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 Ke(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"))}()}(i,t),r(i)})).catch(s)}))}async function At(e){throw new Error(`Plugins are not supported yet, we are actively working on it: ${e}`)}class Ft{constructor(e,t){Object.defineProperty(this,"_reactor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_updateHandler",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"debugName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dirty",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"readCalls",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),this.debugName=t,this._reactor=e}dispose(){this._updateHandler=null,this._reactor._unregisterReaction(this),this._reactor=null}track(e){return this._reactor._trackReaction(this,e)}subscribe(e){return this._reactor._registerReaction(this),this._updateHandler=e,()=>{this._updateHandler=null,this._reactor._unregisterReaction(this)}}update(){var e;null===(e=this._updateHandler)||void 0===e||e.call(this)}}const Lt=Symbol("NO_VALUE");class Dt{constructor(e,t){Object.defineProperty(this,"callId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_readCurrentValue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.callId=e,this._value=t(),this._readCurrentValue=t}updateValueAndCheckDirty(){try{const e=this._readCurrentValue();return i()(this._value,e)?(this._value=e,!1):(this._value=e,!0)}catch(e){return this._value=Lt,!0}}update(e){this._readCurrentValue=e}}var Bt,Rt,Ot=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)},Mt=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};class jt{constructor(){Object.defineProperty(this,"readCalls",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"readCache",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"registeredReactions",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,"activeReactions",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,"updatingDirtyReactions",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"wrapUpdateReactor",{enumerable:!0,configurable:!0,writable:!0,value:function(e){var t,r,n;if(Ot(this,Bt,"f")>10)throw new Error("Too many nested engine updates");const o=(Mt(this,Bt,(r=Ot(this,Bt,"f"),t=r++,r),"f"),t);o>1&&console.warn("wrapUpdateReactor: nested update detected",o);try{e(),this._updateDirtyReactions()}finally{if(Mt(this,Bt,(n=Ot(this,Bt,"f"),--n),"f")!==o)throw new Error("Unexpected engine update nesting")}}.bind(this)}),Bt.set(this,0),Rt.set(this,new Set)}_getterCalled(e,t){if(this.activeReactions.size<=0)return;const r=this._readThroughCache.bind(this,e,t);this.readCalls.has(e)?this.readCalls.get(e).update(r):this.readCalls.set(e,new Dt(e,r));for(const t of this.activeReactions)t.readCalls.add(e)}_setterCalled(){this._clearReadCache()}_readThroughCache(e,t){if(this.updatingDirtyReactions&&this.readCache.has(e))return this.readCache.get(e);const r=t();return this.readCache.set(e,r),r}createReaction(e){return new Ft(this,e)}_registerReaction(e){this.registeredReactions.add(e)}_unregisterReaction(e){this.registeredReactions.delete(e)}_clearReadCache(){this.readCache.clear()}_cleanupReadCalls(){const e=new Set;for(const t of this.registeredReactions)for(const r of t.readCalls)e.add(r);for(const[t]of this.readCalls)e.has(t)||this.readCalls.delete(t)}_updateDirtyReactions(){try{this.updatingDirtyReactions++,this._clearReadCache();const e=new Set;for(const[t,r]of this.readCalls)r.updateValueAndCheckDirty()&&e.add(t);if(e.size>0)for(const t of this.registeredReactions)for(const r of t.readCalls)if(e.has(r)){t.dirty=!0;break}for(const e of this.registeredReactions)if(!Ot(this,Rt,"f").has(e)&&e.dirty){Ot(this,Rt,"f").add(e);try{e.update()}finally{Ot(this,Rt,"f").delete(e)}e.dirty=!1}this._cleanupReadCalls()}finally{this.updatingDirtyReactions--}}_trackReaction(e,t){try{return this.activeReactions.add(e),e.readCalls.clear(),t()}finally{e.dirty=!1,this.activeReactions.delete(e)}}decorateFunction(e,t){return function(e,t,r=t.name){var n;null!==(n=l[r])&&void 0!==n||(l[r]=0);const o=l[r]++;return function(...n){const i=this,a=`${r}${o}-${JSON.stringify(n,null,0)}`;function s(){return Reflect.apply(t,i,n)}return e._getterCalled(a,s),e._readThroughCache(a,s)}}(this,e,t)}decorateObject(e){return function(e,t){var r,n;const o=null!==(n=null===(r=t.constructor)||void 0===r?void 0:r.name)&&void 0!==n?n:crypto.randomUUID(),i=[];let s=!1;const u=Object.getOwnPropertyNames(t.constructor.prototype).concat(Object.getOwnPropertyNames(t));for(const c of u){const d=t[c];if("function"==typeof(l=d)&&a in l)if("getter"===d[a].type){function f(...t){if(s)throw new Error("Disposed @getter proxy called");const r=this,n=`${o}-${c.toString()}-${JSON.stringify(t,null,0)}`;function i(){return Reflect.apply(d,r,t)}return e._getterCalled(n,i),e._readThroughCache(n,i)}const p=Object.hasOwnProperty.call(t,"fnName")?()=>{t[c]=d}:()=>delete t[c];i.push(p),t[c]=f}else if("setter"===d[a].type){function h(...t){if(s)throw new Error("Disposed @setter proxy called");return e._setterCalled(),Reflect.apply(d,this,t)}const m=Object.hasOwnProperty.call(t,"fnName")?()=>{t[c]=d}:()=>delete t[c];i.push(m),t[c]=h}}var l;return function(){s=!0;for(const e of i)e();i.length=0}}(this,e)}dispose(){this.registeredReactions.forEach((e=>e.dispose())),this.registeredReactions.clear(),this.readCalls.clear(),this.activeReactions.clear(),this.readCache.clear()}}function It(e,t){let r;return t.onStateChanged((()=>{const n=function(e,t){switch(e){case"Arrow":return"default";case"Move":return"move";case"MoveNotPermitted":return"auto";case"Resize":{const e=180*t/Math.PI+45;if(!_t&&!Ct)return`url("data:image/svg+xml,%3Csvg style='transform: rotate(${e}deg)' width ='22' height ='22' viewBox ='0 0 22 22' fill ='none' xmlns ='http://www.w3.org/2000/svg'%3E%3Cg filter ='url(%23filter0_d)'%3E%3Cpath d ='M13.7 11.1L9.7 15.2L12.5 18H4V9.5L6.9 12.3L10.9 8.3L12.3 6.9L9.5 4H18V12.5L15.2 9.7L13.7 11.1Z' fill ='white'/%3E%3C/g%3E%3Cpath d ='M12.7 10.7L8.3 15.2L10.1 17H5V11.9L6.9 13.8L11.3 9.3L13.8 6.9L11.9 5H17V10.1L15.2 8.3L12.7 10.7Z' fill ='black'/%3E%3Cdefs%3E%3Cfilter id ='filter0_d' x ='0' y ='0' width ='22' height ='22' filterUnits ='userSpaceOnUse' color-interpolation-filters ='sRGB'%3E%3CfeFlood flood-opacity ='0' result ='BackgroundImageFix'/%3E%3CfeColorMatrix in ='SourceAlpha' type ='matrix' values ='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0'/%3E%3CfeOffset/%3E%3CfeGaussianBlur stdDeviation ='2'/%3E%3CfeColorMatrix type ='matrix' values ='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0'/%3E%3CfeBlend mode ='normal' in2 ='BackgroundImageFix' result ='effect1_dropShadow'/%3E%3CfeBlend mode ='normal' in ='SourceGraphic' in2 ='effect1_dropShadow' result ='shape'/%3E%3C/filter%3E%3C/defs%3E%3C/svg%3E") 12 12, pointer`;switch(e){case 90:case 270:return"nwse-resize";case 135:case 315:return"ns-resize";case 180:case 360:return"nesw-resize";case 225:return"ew-resize";default:return"move"}}case"Rotate":return'url("data:image/svg+xml,%3Csvg width=%2722%27 height=%2725%27 viewBox=%270 0 22 25%27 fill=%27none%27 xmlns=%27http://www.w3.org/2000/svg%27%3E%3Cg filter=%27url(%23filter0_d)%27%3E%3Cpath d=%27M18 11.1071C18 14.5637 15.5566 17.4515 12.3314 18.0846V20L7.20308 17.0145L12.3314 14.0289V15.7825C14.3292 15.1951 15.7946 13.3221 15.7946 11.107C15.7946 8.42285 13.6437 6.23908 11 6.23908C8.35629 6.23908 6.20542 8.42285 6.20542 11.107C6.20542 11.8299 6.35745 12.5252 6.65738 13.1736L4.66118 14.1255C4.22245 13.1771 4 12.1616 4 11.1071C4.00007 7.18825 7.1403 4 11.0001 4C14.8599 4 18 7.18825 18 11.1071Z%27 fill=%27black%27/%3E%3Cpath d=%27M12.8314 15.0559V14.0289V13.1593L12.0799 13.5968L6.95152 16.5824L6.20927 17.0145L6.95152 17.4466L12.0799 20.4321L12.8314 20.8696V20V18.4841C16.0889 17.6521 18.5 14.6573 18.5 11.1071C18.5 6.9193 15.1431 3.5 11.0001 3.5C6.85702 3.5 3.50008 6.91929 3.5 11.1071V11.1071C3.5 12.2334 3.73793 13.3206 4.20739 14.3354L4.41978 14.7946L4.8764 14.5768L6.8726 13.6249L7.31866 13.4122L7.11118 12.9637C6.84206 12.3819 6.70542 11.7584 6.70542 11.107C6.70542 8.69181 8.63956 6.73908 11 6.73908C13.3604 6.73908 15.2946 8.69181 15.2946 11.107C15.2946 12.8513 14.2837 14.3564 12.8314 15.0559Z%27 stroke=%27white%27/%3E%3C/g%3E%3Cdefs%3E%3Cfilter id=%27filter0_d%27 x=%270.0599999%27 y=%270.0599999%27 width=%2721.88%27 height=%2724.6193%27 filterUnits=%27userSpaceOnUse%27 color-interpolation-filters=%27sRGB%27%3E%3CfeFlood flood-opacity=%270%27 result=%27BackgroundImageFix%27/%3E%3CfeColorMatrix in=%27SourceAlpha%27 type=%27matrix%27 values=%270 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0%27/%3E%3CfeOffset/%3E%3CfeGaussianBlur stdDeviation=%271.47%27/%3E%3CfeColorMatrix type=%27matrix%27 values=%270 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0%27/%3E%3CfeBlend mode=%27normal%27 in2=%27BackgroundImageFix%27 result=%27effect1_dropShadow%27/%3E%3CfeBlend mode=%27normal%27 in=%27SourceGraphic%27 in2=%27effect1_dropShadow%27 result=%27shape%27/%3E%3C/filter%3E%3C/defs%3E%3C/svg%3E") 12 12, pointer';case"Text":return"text";default:return"auto"}}(t.getCursorType(),t.getCursorRotation());if(n!==r){r=n;const t=new CustomEvent("cesdk-cursor",{composed:!0,bubbles:!0,cancelable:!0,detail:n});e.dispatchEvent(t)&&e.style.setProperty("cursor",n)}}))}Bt=new WeakMap,Rt=new WeakMap;const Ut=function(e,t,r){let n,o=null;const i=r.onStateChanged((()=>{n=r.getEditMode(),"Text"!==n||o?"Text"!==n&&o&&(o(),o=null):o=function(){let n=function o(){let i=!1,a="";if(null==e.parentElement)return console.warn('Could not attach hidden text input to the DOM: Canvas has no parentElement. This can happen if edit mode is switched to "Text", while the canvas is removed from the DOM.'),()=>{};const s=function(){const e=document.createElement("textarea");return e.id="ubq_internal-inline_text_editing_html_representation",e.setAttribute("data-cy","inline-text-editing-input"),e.autocapitalize="none",e.spellcheck=!1,e.cols=4096,e.style.contain="strict",e.style.opacity="0",e.style.pointerEvents="none",e.style.zIndex="-1",e.style.position="fixed",e.style.width="1px",e.style.height="1px",e.style.padding="0",e.style.margin="-1px",e.style.overflow="hidden",e.style.clip="rect(0, 0, 0, 0)",e.style.border="0",e}();l();const u=function(){const t=e.getRootNode();s.addEventListener("input",v),s.addEventListener("keydown",w),s.addEventListener("copy",h),s.addEventListener("cut",m),s.addEventListener("compositionstart",E),s.addEventListener("compositionend",C),s.addEventListener("beforeinput",k),s.addEventListener("focusout",P),t.addEventListener("touchend",x),t.addEventListener("mousedown",x),t.addEventListener("mouseup",S);const n=r.onStateChanged((()=>{l()}));return()=>{s.removeEventListener("input",v),s.removeEventListener("keydown",w),s.removeEventListener("copy",h),s.removeEventListener("cut",m),s.removeEventListener("compositionstart",E),s.removeEventListener("compositionend",C),s.removeEventListener("beforeinput",k),s.removeEventListener("focusout",P),t.removeEventListener("mousedown",x),t.removeEventListener("mouseup",S),t.removeEventListener("touchend",x),n()}}();return e.parentElement.appendChild(s),c(),()=>{u(),s.blur(),s.remove()};function l(){const t=r.getTextCursorPositionInScreenSpaceX(),n=r.getTextCursorPositionInScreenSpaceY(),{left:o,top:i}=e.getBoundingClientRect();s.style.left=`${o+t/window.devicePixelRatio}px`,s.style.top=`${i+n/window.devicePixelRatio}px`}function c(){null!==s.parentElement&&(s.focus(),s.getRootNode().activeElement===s||setTimeout((()=>s.focus()),0))}function d(){i=!1,n(),n=o()}function f(e){return[...e].length}function p(e){var t,r;const n=null!==(r=null!==(t=e.selectionEnd)&&void 0!==t?t:e.selectionStart)&&void 0!==r?r:0;return f(e.value.substring(0,n))}function h(e){try{t.useInternalAPI((t=>{const r=T(t.getSelectedText());""!==r&&e.clipboardData&&(e.clipboardData.setData("text/plain",r),e.preventDefault())}))}catch(e){console.error(e)}}function m(e){try{t.useInternalAPI((r=>{const n=T(r.getSelectedText());if(""!==n&&e.clipboardData){e.clipboardData.setData("text/plain",n),e.preventDefault();const r={key:y.Delete,characters:"",shiftIsHeld:!1,commandIsHeld:!1,optionIsHeld:!1,timestamp:Date.now()};t.execute("ubq/inputs/keyboardkey",r)}}))}catch(e){console.error(e)}}async function g(){return!(!i||t.ubq.unstable_isTextCursorInCompositionRange()||(await C(),0))}function v(e){const r=e.target,{value:n}=r;if(i){const e=p(s);t.execute("ubq/text/compositionUpdate",{value:n,cursorPosition:e})}else n.length>0&&(r.value="")}function b(e){const r={key:y.Unknown,characters:e,shiftIsHeld:!1,commandIsHeld:!1,optionIsHeld:!1,timestamp:Date.now()};t.execute("ubq/inputs/keyboardkey",r)}async function w(e){if(g(),1===e.key.length&&(a=e.key),"a"===e.key&&(e.metaKey||e.ctrlKey))return i&&C(),void await t.execute("ubq/text/selectAllText");if("Escape"===e.key)return void async function(){r.setEditMode("Transform")}();if("Backspace"!==e.key&&"Delete"!==e.key&&"ArrowLeft"!==e.key&&"ArrowRight"!==e.key&&"ArrowUp"!==e.key&&"ArrowDown"!==e.key&&"Enter"!==e.key)return;const n=function(e){const t={key:y.Unknown,characters:e.key,shiftIsHeld:e.shiftKey,commandIsHeld:e.metaKey||e.ctrlKey,optionIsHeld:e.altKey,timestamp:Date.now()};switch(e.key.toUpperCase()){case"0":t.key=y.Key0;break;case"1":t.key=y.Key1;break;case"2":t.key=y.Key2;break;case"3":t.key=y.Key3;break;case"4":t.key=y.Key4;break;case"5":t.key=y.Key5;break;case"6":t.key=y.Key6;break;case"7":t.key=y.Key7;break;case"8":t.key=y.Key8;break;case"9":t.key=y.Key9;break;case"A":t.key=y.A;break;case"B":t.key=y.B;break;case"C":t.key=y.C;break;case"D":t.key=y.D;break;case"E":t.key=y.E;break;case"F":t.key=y.F;break;case"G":t.key=y.G;break;case"H":t.key=y.H;break;case"I":t.key=y.I;break;case"J":t.key=y.J;break;case"K":t.key=y.K;break;case"L":t.key=y.L;break;case"M":t.key=y.M;break;case"N":t.key=y.N;break;case"O":t.key=y.O;break;case"P":t.key=y.P;break;case"Q":t.key=y.Q;break;case"R":t.key=y.R;break;case"S":t.key=y.S;break;case"T":t.key=y.T;break;case"U":t.key=y.U;break;case"V":t.key=y.V;break;case"W":t.key=y.W;break;case"X":t.key=y.X;break;case"Y":t.key=y.Y;break;case"Z":t.key=y.Z;break;case" ":t.key=y.Space;break;case"ESCAPE":t.key=y.Escape,t.characters="";break;case"BACKSPACE":t.key=y.Backspace,t.characters="";break;case"DELETE":t.key=y.Delete,t.characters="";break;case"ENTER":t.key=y.Enter,t.characters=t.shiftIsHeld?"\u2028":"\n";break;case"CONTROL":t.key=y.Control,t.characters="";break;case"ALT":t.key=y.Option,t.characters="";break;case"SHIFT":t.key=y.Shift,t.characters="";break;case"ARROWLEFT":t.key=y.ArrowLeft,t.characters="";break;case"ARROWRIGHT":t.key=y.ArrowRight,t.characters="";break;case"ARROWUP":t.key=y.ArrowUp,t.characters="";break;case"ARROWDOWN":t.key=y.ArrowDown,t.characters="";break;case"DEAD":t.key=y.Unknown,t.characters=""}return t}(e);await t.execute("ubq/inputs/keyboardkey",n),e.currentTarget&&(s.value="")}async function E(){i=!0,await t.execute("ubq/text/compositionStart")}async function C(){i?(i=!1,s.value="",d(),t.execute("ubq/text/compositionEnd")):s.value=""}async function _(){if(!i)return;if(t.ubq.update(),await g())return;const e=t.ubq.unstable_getCursorPosition(),r=t.ubq.unstable_getCompositionRange(),n=e.end-r.start,o=p(s);e.start>=r.start&&e.start<=1+r.end&&n!==o&&C()}async function S(){_()}async function x(t){_(),t.target===e&&"Text"===r.getEditMode()&&(c(),t.preventDefault())}async function k(e){if(i&&!e.isComposing&&C(),null===e.data)return;const r=e.target,n=e.data;if(await g())b(a);else if(i){const e=f(n);t.execute("ubq/text/compositionUpdate",{value:n,cursorPosition:e})}else n.length>0&&("\n"!==n[0]&&b(n),r.value="")}function P(t){var r;null!=(r=t.relatedTarget)&&r instanceof HTMLElement&&(r instanceof HTMLTextAreaElement||r instanceof HTMLInputElement&&r.type.match("^(text|number|url|email|search|tel)$")||r.isContentEditable)&&function(t){const r=new CustomEvent("cesdk-blur",{composed:!0,bubbles:!0,cancelable:!0,detail:t});return e.dispatchEvent(r)}(t.relatedTarget)||function(t){const r=new CustomEvent("cesdk-refocus",{composed:!0,bubbles:!0,cancelable:!0,detail:t.relatedTarget}),n=e.dispatchEvent(r);n&&c()}(t)}}();return()=>{null==n||n()}}()}));return()=>{null==o||o(),i()}};function qt(e,t){const r=[],n=t=>{var r,n;const o=e.getBoundingClientRect(),i=null!==(r=null==o?void 0:o.top)&&void 0!==r?r:0,a=null!==(n=null==o?void 0:o.left)&&void 0!==n?n:0;return{position:{x:(t.clientX-a)*window.devicePixelRatio,y:(t.clientY-i)*window.devicePixelRatio},isTouch:!1,timestamp:t.timeStamp}},o=e=>{if("touch"===e.pointerType)return;const r=n(e);t.execute("ubq/inputs/mousemove",r)},i=e=>{if("touch"===e.pointerType)return;const o=Object.assign(Object.assign({},n(e)),{button:$t(e.button),state:g.Up,shiftIsHeld:!!e.shiftKey});r[e.button]=!1,e.currentTarget.releasePointerCapture(e.pointerId),t.execute("ubq/inputs/mousebutton",o),t.ubq.update()},a=e=>{if("touch"===e.pointerType)return;const o=Object.assign(Object.assign({},n(e)),{button:$t(e.button),state:g.Down,shiftIsHeld:!!e.shiftKey});r[e.button]=!0,e.currentTarget.setPointerCapture(e.pointerId),t.execute("ubq/inputs/mousebutton",o)},s=e=>{if("touch"===e.pointerType)return;const o=Object.assign(Object.assign({},n(e)),{shiftIsHeld:!!e.shiftKey});r.forEach(((e,r)=>{if(e){const e=Object.assign(Object.assign({},o),{button:r,state:g.Up});t.execute("ubq/inputs/mousebutton",e)}})),r.length=0},u=e=>{e.cancelable&&e.preventDefault()};return e.addEventListener("pointerdown",a),e.addEventListener("pointerup",i),e.addEventListener("pointercancel",i),e.addEventListener("pointermove",o),e.addEventListener("lostpointercapture",s),e.addEventListener("touchmove",u,{passive:!1}),()=>{e.removeEventListener("pointerdown",a),e.removeEventListener("pointerup",i),e.removeEventListener("pointercancel",i),e.removeEventListener("pointermove",o),e.removeEventListener("lostpointercapture",s),e.removeEventListener("touchmove",u),e=null}}function $t(e){switch(e){case 0:return m.Left;case 1:return m.Middle;case 2:return m.Right;default:return m.Unknown}}class Ht{constructor(){Object.defineProperty(this,"active",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"enableDebug",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"timestamp",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"baseTouches",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"touches",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"currentTransform",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"touchstart",{enumerable:!0,configurable:!0,writable:!0,value:e=>{this.touchAddRemove(e),this.timestamp=e.timeStamp,this.process("touchstart")}}),Object.defineProperty(this,"touchend",{enumerable:!0,configurable:!0,writable:!0,value:e=>{this.touchAddRemove(e),this.timestamp=e.timeStamp,this.process("touchend")}}),Object.defineProperty(this,"touchcancel",{enumerable:!0,configurable:!0,writable:!0,value:e=>{this.touchAddRemove(e),this.timestamp=e.timeStamp,this.process("touchcancel")}}),Object.defineProperty(this,"touchmove",{enumerable:!0,configurable:!0,writable:!0,value:e=>{this.touchUpdate(e),this.timestamp=e.timeStamp,this.process("touchmove")}}),Object.defineProperty(this,"debugState",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"handlers",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),this.currentTransform=this.emptyTransform()}touchAddRemove(e){const t=new Array(e.touches.length);for(let r=0;r<e.touches.length;r++){const n=e.touches.item(r);t[r]=Nt(n)}this.touches=t}touchUpdate(e){for(let t=0;t<e.touches.length;t++){const r=e.touches.item(t),n=this.touches.find((e=>e.identifier===r.identifier));if(!n)return;n.x=r.clientX,n.y=r.clientY}}listen(e){return e.addEventListener("touchstart",this.touchstart),e.addEventListener("touchend",this.touchend),e.addEventListener("touchcancel",this.touchcancel),e.addEventListener("touchmove",this.touchmove),()=>{e.removeEventListener("touchstart",this.touchstart),e.removeEventListener("touchend",this.touchend),e.removeEventListener("touchcancel",this.touchcancel),e.removeEventListener("touchmove",this.touchmove)}}debug(){var e,t,r,n,o,i,a,s;if(!this.enableDebug)return;const u=JSON.stringify(this.currentTransform);function l(e,[t,r,n],o){const i=document.createElement("div");return i.style.position="fixed",i.style.top="-25px",i.style.left="-25px",i.style.width="50px",i.style.height="50px",i.style.border=`3px ${o} rgb(${t},${r},${n})`,i.style.borderRadius="50%",i.style.borderStyle=o,i.style.backgroundColor=`rgba(${t},${r},${n}, 0.5)`,i.style.transformOrigin="center",i.style.textAlign="center",i.innerHTML=e,i.style.display="none",document.body.appendChild(i),i}this.debugState||(this.debugState={touches:[l("T1",[218,212,104],"solid"),l("T2",[218,212,104],"solid")],value:this.debugValueDiv(void 0,u,this.touches,[218,212,104]),baseTouches:[l("B1",[128,128,128],"solid"),l("B2",[128,128,128],"solid")]}),this.debugState.touches[0].style.display=this.touches[0]?"block":"none",this.debugState.touches[1].style.display=this.touches[1]?"block":"none",this.debugState.baseTouches[0].style.display=this.baseTouches[0]?"block":"none",this.debugState.baseTouches[1].style.display=this.baseTouches[1]?"block":"none",this.touches[0]&&(this.debugState.touches[0].style.transform=`translate(${null===(e=this.touches[0])||void 0===e?void 0:e.x}px, ${null===(t=this.touches[0])||void 0===t?void 0:t.y}px)`),this.touches[1]&&(this.debugState.touches[1].style.transform=`translate(${null===(r=this.touches[1])||void 0===r?void 0:r.x}px, ${null===(n=this.touches[1])||void 0===n?void 0:n.y}px)`),this.baseTouches[0]&&(this.debugState.baseTouches[0].style.transform=`translate(${null===(o=this.baseTouches[0])||void 0===o?void 0:o.x}px, ${null===(i=this.baseTouches[0])||void 0===i?void 0:i.y}px)`),this.baseTouches[1]&&(this.debugState.baseTouches[1].style.transform=`translate(${null===(a=this.baseTouches[1])||void 0===a?void 0:a.x}px, ${null===(s=this.baseTouches[1])||void 0===s?void 0:s.y}px)`),this.debugState.value=this.debugValueDiv(this.debugState.value,u,this.touches)}debugValueDiv(e,t,r,n){if(!e){const[t,r,o]=null!=n?n:[128,128,128];(e=document.createElement("div")).style.position="fixed",e.style.top="50px",e.style.left="50px",e.style.width="300px",e.style.height="100px",e.style.border=`3px solid rgb(${t},${r},${o})`,e.style.borderStyle="dashed",e.style.backgroundColor=`rgba(${t},${r},${o}, 0.5)`,e.style.transformOrigin="center",e.style.overflow="visible",e.style.textOverflow="visible",e.style.display="none",document.body.appendChild(e)}return this.active?e.style.borderStyle="solid":e.style.borderStyle="dashed",0===r.length?(e.style.display="none",e):(e.style.display="block",e.innerHTML=t,e)}resetBaseTouches(){this.baseTouches=this.touches.map(Nt)}process(e){if("touchcancel"===e)return this.resetBaseTouches(),this.reset(),this.debug(),void this.emit(_.Ended);"touchstart"!==e&&"touchend"!==e||(this.resetBaseTouches(),this.debug()),!this.active&&this.shouldStart()&&(this.active=!0,this.emit(_.Began)),"touchmove"===e&&(this.currentTransform=this.calculateTransform(),this.active&&this.emit(_.Changed)),this.debug(),this.active&&this.shouldStop()&&(this.active=!1,this.emit(_.Ended),this.reset())}shouldStart(){return 2===this.touches.length}shouldStop(){return 2!==this.touches.length}emit(e){const t={timestamp:this.timestamp,state:e,touchPoints:this.touches},r=this.makeEvent(t);for(const e of this.handlers)e(r)}addListener(e){return this.handlers.add(e),()=>{this.handlers.delete(e)}}reset(){this.active=!1,this.currentTransform=this.emptyTransform()}}function Nt(e){if(null!=e)return e instanceof Touch?{identifier:e.identifier,x:e.clientX,y:e.clientY}:{identifier:e.identifier,x:e.x,y:e.y}}class Vt extends Ht{makeEvent(e){const t=e.state===_.Began?{x:0,y:0}:this.currentTransform;return Object.assign(Object.assign({},e),{panDistance:t})}calculateTransform(){const e=Gt(this.touches),t=Gt(this.baseTouches);return{x:e.x-t.x,y:e.y-t.y}}emptyTransform(){return{x:0,y:0}}shouldStart(){return super.shouldStart()&&zt(this.calculateTransform())>Vt.PAN_THRESHOLD}}Object.defineProperty(Vt,"PAN_THRESHOLD",{enumerable:!0,configurable:!0,writable:!0,value:10});const Wt=Vt;function zt(e){return Math.sqrt(e.x**2+e.y**2)}function Gt(e){let t=0,r=0;for(let n=0;n<e.length;n++){const o=e[n];t+=o.x,r+=o.y}return t/=e.length,r/=e.length,{x:t,y:r}}class Yt extends Ht{makeEvent(e){return Object.assign(Object.assign({},e),{scale:this.currentTransform})}calculateTransform(){const e=this.baseTouches,t=this.touches;if(2!==e.length||2!==t.length)return 1;const r=Math.sqrt(Math.pow(e[0].x-e[1].x,2)+Math.pow(e[0].y-e[1].y,2));return Math.sqrt(Math.pow(t[0].x-t[1].x,2)+Math.pow(t[0].y-t[1].y,2))/r}emptyTransform(){return 1}shouldStart(){return super.shouldStart()&&Math.abs(this.calculateTransform()-1)>Yt.PINCH_THRESHOLD}}Object.defineProperty(Yt,"PINCH_THRESHOLD",{enumerable:!0,configurable:!0,writable:!0,value:.2});const Xt=Yt;class Kt extends Ht{constructor(){super(...arguments),Object.defineProperty(this,"lastPosition",{enumerable:!0,configurable:!0,writable:!0,value:{x:0,y:0}}),Object.defineProperty(this,"previousNumTouches",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"fingerDownTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"tapDetected",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"tapLocation",{enumerable:!0,configurable:!0,writable:!0,value:{x:0,y:0}})}makeEvent(e){const t=this.tapDetected?this.tapLocation:e.touchPoints[0];return e.state===_.Began?(this.lastPosition=t,{button:m.Left,state:g.Down,position:t,shiftIsHeld:!1,isTouch:!0,timestamp:e.timestamp}):e.state===_.Ended?{button:m.Left,state:g.Up,position:null!=t?t:this.lastPosition,shiftIsHeld:!1,isTouch:!0,timestamp:e.timestamp}:(this.lastPosition=t,{position:t,isTouch:!0,timestamp:e.timestamp})}process(e){if("touchstart"===e||"touchend"===e){this.tapDetected=!1;const e=1===this.touches.length&&0===this.previousNumTouches,t=0===this.touches.length&&1===this.previousNumTouches;e&&(this.fingerDownTimestamp=performance.now(),this.tapLocation=this.touches[0]),t&&performance.now()-this.fingerDownTimestamp<Kt.TAP_MAX_TIME&&(this.tapDetected=!0),this.previousNumTouches=this.touches.length}super.process(e)}calculateTransform(){if(0===this.touches.length||0===this.baseTouches.length)return{x:0,y:0};const e=this.touches[0],t=this.baseTouches[0];return{x:e.x-t.x,y:e.y-t.y}}emptyTransform(){return{x:0,y:0}}shouldStart(){return this.tapDetected||1===this.touches.length&&zt(this.calculateTransform())>Kt.DISTANCE_THRESHOLD}shouldStop(){return 1!==this.touches.length}}Object.defineProperty(Kt,"DISTANCE_THRESHOLD",{enumerable:!0,configurable:!0,writable:!0,value:5}),Object.defineProperty(Kt,"TAP_MAX_TIME",{enumerable:!0,configurable:!0,writable:!0,value:250});const Qt=Kt;class Zt extends Ht{makeEvent(e){return Object.assign(Object.assign({},e),{rotation:this.currentTransform})}calculateTransform(){const e=this.baseTouches,t=this.touches;if(e.length<2||t.length<2)return 0;const r=Math.atan2(e[1].y-e[0].y,e[1].x-e[0].x);return Math.atan2(t[1].y-t[0].y,t[1].x-t[0].x)-r}emptyTransform(){return 0}shouldStart(){return super.shouldStart()&&Math.abs(this.calculateTransform())>Zt.ROTATE_THRESHOLD}}Object.defineProperty(Zt,"ROTATE_THRESHOLD",{enumerable:!0,configurable:!0,writable:!0,value:.1});const Jt=Zt;function er(e,t){const r=[],n=new Qt;r.push(n.listen(e)),r.push(n.addListener((r=>{"button"in r?t.execute("ubq/inputs/mousebutton",tr(e,r)):t.execute("ubq/inputs/mousemove",tr(e,r))})));const o=new Wt;r.push(o.listen(e)),r.push(o.addListener((r=>{t.execute("ubq/inputs/touchpan",tr(e,r))})));const i=new Xt;r.push(i.listen(e)),r.push(i.addListener((r=>{t.execute("ubq/inputs/touchpinch",tr(e,r))})));const a=new Jt;return r.push(a.listen(e)),r.push(a.addListener((r=>{t.execute("ubq/inputs/touchrotate",tr(e,r))}))),()=>{r.forEach((e=>e()))}}function tr(e,t){var r;const n=null!==(r=window.devicePixelRatio)&&void 0!==r?r:1,{top:o,left:i}=e.getBoundingClientRect();if(1===n&&0===o&&0===i)return t;const a=e=>({x:(e.x-i)*n,y:(e.y-o)*n});if("position"in t)return Object.assign(Object.assign({},t),{position:a(t.position)});const s=t.touchPoints.map(a);return"panDistance"in t?Object.assign(Object.assign({},t),{touchPoints:s,panDistance:a(t.panDistance)}):Object.assign(Object.assign({},t),{touchPoints:s})}function rr(e,t,r=Number.EPSILON){return Math.abs(e-t)<r}async function nr(e,t,r,n,o={},i){var a,s;let u,l,c=0,d=null;const f=null!==(a=null==i?void 0:i.visibility)&&void 0!==a?a:or;globalThis.ubq_exportVideoTimeout=null==i?void 0:i.inactivityTimeout;const p=f.subscribe((()=>{null!==d&&(d=Date.now()),globalThis.ubq_browserTabHidden=!f.value()}));let h=null;function m(){clearTimeout(l),p(),null==h||h()}try{const a=new OffscreenCanvas(64,64),p=await Pt(a,Object.assign(Object.assign({},e),{audioOutput:"none"})),g=new xe(p),y=new he(p),v=new ve(p);h=()=>{p.delete()},function(e,t){for(const[r,n]of t)switch(e.getSettingType(r)){case"Bool":e.setSettingBool(r,n);break;case"Int":e.setSettingInt(r,n);break;case"Float":e.setSettingFloat(r,n);break;case"String":e.setSettingString(r,n);break;case"Color":e.setSettingColor(r,n);break;case"Enum":e.setSettingEnum(r,n)}}(v,t);const b=await Promise.all(r.map((e=>At(e)))),w={block:y,scene:g,editor:v};for(const e of b)null===(s=e.initialize)||void 0===s||s.call(e,w);const E=await g.loadFromString(n),C=y.getTotalSceneDuration(g.get());!function e(){if(!0===f.value()&&null!==d&&Date.now()-d>1e4)u(new Error("Video export timed out due to inactivity."));else{if(c<10){for(const e of b)e.update(w);p.update()}l=setTimeout(e,1)}}();const _=await new Promise(((t,r)=>{var n,a,s,l,f,h,m,g,y;u=r,null===(n=e.abortSignal)||void 0===n||n.addEventListener("abort",(()=>{r(new Error("AbortSignal received"))})),p.exportVideoToBuffer(null!==(a=o.block)&&void 0!==a?a:E,null!==(s=o.timeOffset)&&void 0!==s?s:0,null!==(l=o.duration)&&void 0!==l?l:C,le.Mp4,((e,t,r)=>{var n;c=e-t,d=Date.now(),null===(n=null==i?void 0:i.onProgress)||void 0===n||n.call(i,e,t,r)}),(e=>{"error"in e?r(e.error):t(e)}),{h264Profile:null!==(f=o.h264Profile)&&void 0!==f?f:77,h264Level:null!==(h=o.h264Level)&&void 0!==h?h:52,framerate:null!==(m=o.framerate)&&void 0!==m?m:30,useTargetSize:void 0!==o.width&&void 0!==o.height,targetWidth:null!==(g=o.width)&&void 0!==g?g:0,targetHeight:null!==(y=o.height)&&void 0!==y?y:0})}));return m(),_}catch(e){throw m(),e}}globalThis.ubq_browserTabHidden=!0;const or={value:()=>"undefined"==typeof document||"visible"===document.visibilityState,subscribe(e){if("undefined"==typeof document)return()=>{};{const t=()=>{e("visible"===document.visibilityState)};return document.addEventListener("visibilitychange",t),()=>{document.removeEventListener("visibilitychange",t)}}}};var ir;!function(e){e.start=function(e){return Object.assign(Object.assign({},e),{msg:"exportVideo"})},e.abort=function(){return{msg:"exportVideoAbort"}},e.finished=function(e){return Object.assign(Object.assign({},e),{msg:"exportVideoFinished"})},e.error=function(e){return Object.assign(Object.assign({},e),{msg:"exportVideoError"})},e.progress=function(e){return Object.assign(Object.assign({},e),{msg:"exportVideoProgress"})},e.log=function(e){return Object.assign(Object.assign({},e),{msg:"exportLog"})}}(ir||(ir={}));class ar{constructor(e,t){Object.defineProperty(this,"makeWorker",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"configuration",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.configuration=t,this.makeWorker=e}exportVideo(e,t,r,n,o){const{abortSignal:i,inactivityTimeout:a}=null!=o?o:{},s=this.makeWorker(),u=function(e){return{baseURL:e.baseURL,license:e.license,core:e.core,presets:e.presets,featureFlags:e.featureFlags,forceWebGL1:e.forceWebGL1,audioOutput:e.audioOutput,extensions:e.extensions}}(this.configuration),l=new Promise(((e,t)=>{if(s.onmessage=({data:r})=>{if("exportVideoFinished"===r.msg){const t=new Blob([r.data],{type:r.mimeType});e(t)}else"exportVideoError"===r.msg?t(r.error):"exportVideoProgress"===r.msg||("exportLog"===r.msg?this.configuration.logger(r.message,r.logLevel):console.error("Unknown message received ",r))},i){let e=!1;const t=()=>{e||(e=!0,s.postMessage(ir.abort()))};i.addEventListener("abort",t,{once:!0})}}));s.postMessage(ir.start({sceneString:e,engineSettings:t,pluginURLs:r,config:u,exportOptions:n,inactivityTimeout:a}));const c=()=>{s.postMessage({msg:"setVisibility",visible:"visible"===document.visibilityState})};return document.addEventListener("visibilitychange",c),l.finally((()=>{s.terminate(),document.removeEventListener("visibilitychange",c)})),l}}var sr,ur,lr,cr,dr,fr,pr,hr,mr,gr,yr,vr,br,wr,Er,Cr,_r,Sr,xr,kr,Tr,Pr,Ar,Fr=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},Lr=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 Dr{constructor(e,r,n){sr.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}),ur.set(this,void 0),Object.defineProperty(this,"reactor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),lr.set(this,void 0),cr.set(this,void 0),dr.set(this,void 0),fr.set(this,void 0),pr.set(this,[]),hr.set(this,[]),mr.set(this,void 0),gr.set(this,[]),br.set(this,[]),Er.set(this,void 0),xr.set(this,t()(function(){Lr(this,sr,"m",Pr).call(this)}.bind(this),100,{leading:!0,trailing:!1})),kr.set(this,void 0),Fr(this,mr,e,"f"),Fr(this,cr,new k(e),"f"),this.asset=new I(e),this.block=new he(e),this.editor=new ve(e),this.event=new Ee(e),this.scene=new xe(e),this.variable=new Ke(e),Fr(this,ur,new Ge(this.editor),"f");const o=new jt;this.reactor=o;const i=[this.reactor.decorateObject(Lr(this,cr,"f")),this.reactor.decorateObject(this.block),this.reactor.decorateObject(this.editor),this.reactor.decorateObject(this.scene)],a=this.wrapUpdate(o.wrapUpdateReactor);Lr(this,gr,"f").push((()=>{i.forEach((e=>e())),a(),this.reactor.dispose()})),this.block.exportVideo=function(e,t,r){return async(n,o,i,a)=>{const s=t.scene.get();if(null==s||!t.block.isValid(s))throw new Error("No valid scene available.");const u=await t.scene.saveToString(),l=function(e){const t=new Map,r=e.findAllSettings();for(const n of r)switch(e.getSettingType(n)){case"Bool":t.set(n,e.getSettingBool(n));break;case"Int":t.set(n,e.getSettingInt(n));break;case"Float":t.set(n,e.getSettingFloat(n));break;case"String":t.set(n,e.getSettingString(n));break;case"Color":t.set(n,e.getSettingColor(n));break;case"Enum":t.set(n,e.getSettingEnum(n))}return t}(t.editor),c=t.settings.unstable_workerFactory.value(),d=t.settings.unstable_videoExportInactivityTimeout.value();return c?new ar(c,e).exportVideo(u,l,r,a,{abortSignal:a.abortSignal,inactivityTimeout:d}):nr(a.abortSignal?Object.assign(Object.assign({},e),{abortSignal:a.abortSignal}):e,l,r,u,Object.assign({block:n,width:a.targetWidth,height:a.targetHeight},a),{onProgress:i,inactivityTimeout:d}).then((e=>new Blob([e],{type:le.Mp4})))}}(n,{block:this.block,scene:this.scene,editor:this.editor,settings:Lr(this,ur,"f")},Lr(this,pr,"f")),"getInternalCanvas"in r?(Fr(this,dr,r.getInternalCanvas(),"f"),Fr(this,fr,r,"f")):Fr(this,dr,r,"f"),Fr(this,lr,new ht(this),"f"),Lr(this,sr,"m",Cr).call(this),"undefined"!=typeof window&&window.Cypress&&(this.config=n,this.helper=Lr(this,cr,"f"))}async unstable_addPlugin(e){Lr(this,pr,"f").push(e);const t=await At(e),r={block:this.block,scene:this.scene,editor:this.editor};t.initialize&&t.initialize(r),Lr(this,hr,"f").push(t)}unstable_setWorkerFactory(e){Lr(this,ur,"f").unstable_workerFactory.update(e)}unstable_setVideoExportInactivityTimeout(e){Lr(this,ur,"f").unstable_videoExportInactivityTimeout.update(e)}wrapUpdate(e){return Lr(this,br,"f").push(e),()=>{const t=Lr(this,br,"f").indexOf(e);-1!==t&&Lr(this,br,"f").splice(t,1)}}get element(){return Lr(this,fr,"f")}dispose(){var e;Lr(this,gr,"f").forEach((e=>e())),Lr(this,sr,"m",Tr).call(this),this.asset.dispose(),Fr(this,dr,null,"f"),null===(e=Lr(this,fr,"f"))||void 0===e||e.dispose(),Fr(this,fr,void 0,"f"),Fr(this,cr,null,"f"),this.block=null,this.scene=null,this.variable=null,this.asset=null,this.editor=null,this.event=null,Lr(this,br,"f").length=0,Lr(this,mr,"f").delete(),Fr(this,mr,null,"f")}static async init(e,t){let r=function(e,t){return r(null==t?void 0:t.canvas)?null==t?void 0:t.canvas:r(e)?(console.warn("Passing an existing HTMLCanvasElement as a second parameter to CreativeEngine.init() is deprecated. Use the element property on the CreativeEngine instance to access a fully managed canvas to append into the DOM instead. For more information, have a look into our documentation at https://img.ly/docs/cesdk/next/engine/quickstart/#initialization."),e):void 0;function r(e){return"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement}}(t,e);let n;var o,i;console.log("[CreativeEngine] Revision ec2d018e09f9f78723bb50c2ee4358785ebfcf90"),r||(customElements.get("cesdk-canvas")||customElements.define("cesdk-canvas",(i=class extends HTMLElement{constructor(){super(),o.set(this,void 0),ot(this,o,document.createElement("canvas"),"f");const e=document.createElement("style");e.textContent=":host {display: block; width: 100%; height: 100%; contain: content;} canvas {position: absolute; inset: 0; width: 100%; height:100%; display: block; touch-action: none;}",this.attachShadow({mode:"closed"}).append(e,it(this,o,"f"))}getInternalCanvas(){if(!it(this,o,"f"))throw new Error("Internal canvas element is undefined");return it(this,o,"f")}dispose(){var e;null===(e=it(this,o,"f"))||void 0===e||e.remove(),ot(this,o,void 0,"f")}clear(){if(!it(this,o,"f"))return;const e=it(this,o,"f").width;it(this,o,"f").width=1,it(this,o,"f").width=e}},o=new WeakMap,i)),n=document.createElement("cesdk-canvas"),r=n.getInternalCanvas());const a=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),s=function(e={},t="https://cdn.img.ly/packages/imgly/cesdk-engine/1.18.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({},Je),logger:null!==(a=e.logger)&&void 0!==a?a:Ze,presets:null!==(s=e.presets)&&void 0!==s?s:{}});return null!==(u=(c=f.extensions).baseURL)&&void 0!==u||(c.baseURL=Je.baseURL),null!==(l=(d=f.extensions).entries)&&void 0!==l||(d.entries=Object.assign({},Je.entries)),f.baseURL=et(f.baseURL),f.baseURL=tt(f.baseURL),f.core.baseURL=et(f.core.baseURL,f.baseURL),f.core.baseURL=tt(f.core.baseURL),f.extensions.baseURL=tt(f.extensions.baseURL),f.extensions.entries=f.extensions.entries.map((e=>tt(e))),f}(a);if(!function(e){return!0===(null==e?void 0:e._skipConfigWarnings)}(e))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))s.logger(t,"Warning");const u=new this(await Pt(r,s),null!=n?n:r,s);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,u),u}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 rt(o,t,n,e)}(this.asset,e,t)}async addDemoAssetSources({baseURL:e="https://cdn.img.ly/assets/demo/v1",excludeAssetSourceIds:t=[],sceneMode:r="Design",withUploadAssetSources:n=!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 rt(d,a,i,e)}(this.asset,this.scene,t,r,n,void 0,e)}get _ubq(){return Lr(this,mr,"f")}get _camera(){return Lr(this,lr,"f")}get _helper(){return Lr(this,cr,"f")}}ur=new WeakMap,lr=new WeakMap,cr=new WeakMap,dr=new WeakMap,fr=new WeakMap,pr=new WeakMap,hr=new WeakMap,mr=new WeakMap,gr=new WeakMap,br=new WeakMap,Er=new WeakMap,xr=new WeakMap,kr=new WeakMap,sr=new WeakSet,yr=function(){if(!Lr(this,fr,"f"))return;const e=Lr(this,fr,"f").getInternalCanvas(),t=e.getBoundingClientRect();if(0===t.width||0===t.height)return;const r="undefined"!=typeof window?window.devicePixelRatio:1,n=t.width*r,o=t.height*r;e.width!==n&&(e.width=n),e.height!==o&&(e.height=o)},vr=function(){const{width:e,height:t}=Lr(this,dr,"f"),r="undefined"!=typeof window?window.devicePixelRatio:1,{height:n,width:o,pixelRatio:i}=Lr(this,lr,"f").settings.value();rr(o,e,1e-4)&&rr(n,t,1e-4)&&rr(i,r,1e-4)||Lr(this,lr,"f").settings.update({height:t,width:e,pixelRatio:window.devicePixelRatio})},wr=function(){return e=>{Lr(this,br,"f").reduce(((e,t)=>function(){let r=!1;if(t((function(){r=!0,e()})),!r)throw new Error(`Wrapper did not call update: ${t.toString()}`)}),Lr(this,sr,"m",Pr).bind(this,e))()}},Cr=function(e=!0){Lr(this,sr,"m",_r).call(this,e),Lr(this,sr,"m",Sr).call(this)},_r=function(e=!0){let t=0;if(Lr(this,Er,"f"))return;const r=()=>{const n=Lr(this,sr,"m",wr).call(this);Fr(this,Er,requestAnimationFrame(r),"f");try{n(e),t=0}catch(e){throw t++,t>=10&&(console.error("Repeated exceptions in update loop. Stopping loop."),Lr(this,sr,"m",Tr).call(this)),e}};Fr(this,Er,requestAnimationFrame(r),"f")},Sr=function(){var e,t;if(t=Lr(this,dr,"f"),!("undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement))return;const r=null!==(e=Lr(this,fr,"f"))&&void 0!==e?e:Lr(this,dr,"f"),n=[qt(r,Lr(this,cr,"f")),Ut(r,Lr(this,cr,"f"),this.editor),It(r,this.editor),er(r,Lr(this,cr,"f")),mt(Lr(this,dr,"f"),Lr(this,mr,"f"),(()=>{Lr(this,dr,"f").width=Lr(this,dr,"f").width})),at(r,Lr(this,xr,"f"))];Fr(this,kr,(()=>{n.reverse().forEach((e=>e()))}),"f")},Tr=function(){var e;null===(e=Lr(this,kr,"f"))||void 0===e||e.call(this),Fr(this,kr,void 0,"f"),Lr(this,Er,"f")&&(cancelAnimationFrame(Lr(this,Er,"f")),Fr(this,Er,0,"f"))},Pr=function(e=!0){for(const e of Lr(this,hr,"f"))e.update(this);e&&1===this.block.findByType(f.Scene).length&&Lr(this,sr,"m",Ar).call(this),Lr(this,sr,"m",yr).call(this),Lr(this,sr,"m",vr).call(this),Lr(this,mr,"f").update()},Ar=function(){if(Lr(this,lr,"f").clampCamera){const e={sceneSize:{x:0,y:0},scrollPercentage:{x:NaN,y:NaN}};Lr(this,cr,"f").execute("cesdk/clampCameraAndRender",{horizontalPaddingInPixels:this._camera.viewportPadding.value().x,verticalPaddingInPixels:this._camera.viewportPadding.value().y}).then((e=>{i()(Lr(this,lr,"f").clampResult.value(),e)||Lr(this,lr,"f").clampResult.update(e)}),(()=>{i()(Lr(this,lr,"f").clampResult.value(),e)||Lr(this,lr,"f").clampResult.update(e)}))}else Lr(this,cr,"f").execute("ubq/render")};const Br=function(){try{if("object"==typeof WebAssembly&&"function"==typeof WebAssembly.instantiate){const e=new WebAssembly.Module(Uint8Array.of(0,97,115,109,1,0,0,0));if(e instanceof WebAssembly.Module)return new WebAssembly.Instance(e)instanceof WebAssembly.Instance}}catch(e){return console.error(e),!1}return!1},Rr=1e6;async function Or(){if("undefined"==typeof window)throw new Error("Window is undefined");if(!("VideoFrame"in window&&"VideoDecoder"in window&&"VideoEncoder"in window))throw new Error("Missing required web video APIs");const e={codec:"avc1.4D0034",width:1920,height:1080,avc:{format:"annexb"},framerate:30};if(!await VideoEncoder.isConfigSupported(e))throw new Error("Encoder config not supported");const t=new OffscreenCanvas(e.width,e.height),r=t.getContext("webgl2");if(!r)throw new Error("Could not create WebGL2 context");return r.clearColor(1,0,1,1),r.clear(r.COLOR_BUFFER_BIT),new Promise(((r,n)=>{setTimeout((()=>{n(new Error("Timed out during video export"))}),1e4);const o=new VideoEncoder({output:()=>r(!0),error:e=>n(e)});o.configure(e);const i=new VideoFrame(t,{timestamp:0,duration:Rr/e.framerate});o.encode(i,{keyFrame:!0}),i.close(),o.flush().then((()=>{"closed"!==o.state&&o.close()}))}))}async function Mr(){if("undefined"==typeof window)throw new Error("Window is undefined");if(!("AudioDecoder"in window)||!("AudioEncoder"in window))throw new Error("Missing required web audio APIs");const e={codec:"mp4a.40.02",sampleRate:48e3,numberOfChannels:2,bitrate:128e3};if(!await AudioEncoder.isConfigSupported(e))throw new Error("Encoder config not supported");return new Promise(((t,r)=>{setTimeout((()=>{r(new Error("Timed out during audio export"))}),1e4);const n=new AudioEncoder({output:()=>t(!0),error:r});n.configure(e);const o=1024,i=new Float32Array(o*e.numberOfChannels);for(let e=0;e<o;++e){const t=e/o;i[2*e+0]=Math.sin(880*Math.PI*t),i[2*e+1]=Math.sin(888*Math.PI*t)}for(let t=0;t<10;++t){const r=new AudioData({format:"f32",sampleRate:e.sampleRate,numberOfFrames:o,numberOfChannels:e.numberOfChannels,timestamp:t*o/e.sampleRate*Rr,data:i});n.encode(r),r.close()}n.flush().then((()=>{"closed"!==n.state&&n.close()}))}))}function jr(){return"undefined"!=typeof window&&("VideoFrame"in window&&"VideoDecoder"in window&&"VideoEncoder"in window&&"AudioDecoder"in window&&"AudioEncoder"in window)}function Ir(){return Promise.all([Or(),Mr()]).then((e=>e.every((e=>e))),(()=>!1))}const Ur=function(){var e;try{const t=!!(null===(e={testKey:"testValue"})||void 0===e?void 0:e.testKey),r=!0,n="globalThis"in window,o="BigInt"in window,i="allSettled"in Promise,a="matchAll"in String.prototype,s=CSS.supports("(display: flex) and (gap: 8px)"),u="MediaRecorder"in window&&"pause"in window.MediaRecorder.prototype,l=CSS.supports("selector(:not(a, .b))"),c=CSS.supports("selector(:is(a))");return Br()&&t&&r&&n&&o&&i&&a&&s&&u&&l&&c}catch(e){return!1}};if("undefined"!=typeof WorkerGlobalScope){const e=Me((()=>!0)),t=new AbortController;self.onmessage=async({data:r})=>{"setVisibility"===r.msg?e.update(r.visible):"exportVideo"===r.msg?nr(Object.assign(Object.assign({},r.config),{logger:(e,t)=>{self.postMessage(ir.log({logLevel:t,message:e}))},abortSignal:t.signal}),r.engineSettings,r.pluginURLs,r.sceneString,r.exportOptions,{onProgress:(e,t,r)=>{self.postMessage(ir.progress({renderedFrames:e,encodedFrames:t,totalFrames:r}))},visibility:e,inactivityTimeout:r.inactivityTimeout}).then((e=>{self.postMessage(ir.finished({data:e,mimeType:le.Mp4}))}),(e=>{self.postMessage(ir.error({error:e}))})):"exportVideoAbort"===r.msg&&t.abort()}}})();var o=n.Ju,i=n.in,a=n.HY,s=n.F4,u=n.ZP,l=n.aY,c=n.Qx,d=n.Gr,f=n.Pf;export{o as DesignBlockType,i as LogLevel,a as MimeType,s as WorkerClient,u as default,l as supportsBrowser,c as supportsVideo,d as supportsVideoExport,f as supportsWasm};