diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 26d5a10..3547d4a 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -31,6 +31,10 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + - name: Install dependencies and build project + run: | + yarn install + yarn build - name: Setup Pages uses: actions/configure-pages@v5 - name: Upload artifact diff --git a/build/assets/duckdb-browser-eh.worker-D6ypKDsm.js b/build/assets/duckdb-browser-eh.worker-D6ypKDsm.js deleted file mode 100644 index 3583684..0000000 --- a/build/assets/duckdb-browser-eh.worker-D6ypKDsm.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict";var duckdb=(()=>{var Vc=Object.create;var xi=Object.defineProperty;var zc=Object.getOwnPropertyDescriptor;var jc=Object.getOwnPropertyNames;var $c=Object.getPrototypeOf,qc=Object.prototype.hasOwnProperty;var ha=(o,e)=>(e=Symbol[o])?e:Symbol.for("Symbol."+o);var xn=(o=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(o,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):o)(function(o){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+o+'" is not supported')});var fr=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports),pr=(o,e)=>{for(var t in e)xi(o,t,{get:e[t],enumerable:!0})},Co=(o,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of jc(e))!qc.call(o,n)&&n!==t&&xi(o,n,{get:()=>e[n],enumerable:!(r=zc(e,n))||r.enumerable});return o};var Mo=(o,e,t)=>(t=o!=null?Vc($c(o)):{},Co(e||!o||!o.__esModule?xi(t,"default",{value:o,enumerable:!0}):t,o)),Xc=o=>Co(xi({},"__esModule",{value:!0}),o);var Qc=function(o,e){this[0]=o,this[1]=e};var Cr=o=>{var e=o[ha("asyncIterator")],t=!1,r,n={};return e==null?(e=o[ha("iterator")](),r=a=>n[a]=l=>e[a](l)):(e=e.call(o),r=a=>n[a]=l=>{if(t){if(t=!1,a==="throw")throw l;return l}return t=!0,{done:!1,value:new Qc(new Promise(c=>{var u=e[a](l);if(!(u instanceof Object))throw TypeError("Object expected");c(u)}),1)}}),n[ha("iterator")]=()=>n,r("next"),"throw"in e?r("throw"):n.throw=a=>{throw a},"return"in e&&r("return"),n};var yo=fr(()=>{});var So=fr(()=>{});var Fc=fr(()=>{});var Eo=fr((lS,xc)=>{"use strict";xc.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}});var Tc=fr((exports,module)=>{"use strict";var DuckDB=(()=>{var o;var _scriptName=typeof document<"u"?(o=document.currentScript)==null?void 0:o.src:void 0;return typeof __filename<"u"&&(_scriptName=_scriptName||__filename),function(moduleArg={}){var moduleRtn,Module=moduleArg,readyPromiseResolve,readyPromiseReject,readyPromise=new Promise((e,t)=>{readyPromiseResolve=e,readyPromiseReject=t}),ENVIRONMENT_IS_WEB=typeof window=="object",ENVIRONMENT_IS_WORKER=typeof importScripts=="function",ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&process.type!="renderer",ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER,moduleOverrides=Object.assign({},Module),arguments_=[],thisProgram="./this.program",quit_=(e,t)=>{throw t},scriptDirectory="";function locateFile(e){return Module.locateFile?Module.locateFile(e,scriptDirectory):scriptDirectory+e}var readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=yo(),nodePath=So();scriptDirectory=__dirname+"/",readBinary=e=>{e=isFileURI(e)?new URL(e):nodePath.normalize(e);var t=fs.readFileSync(e);return t},readAsync=(e,t=!0)=>(e=isFileURI(e)?new URL(e):nodePath.normalize(e),new Promise((r,n)=>{fs.readFile(e,t?void 0:"utf8",(a,l)=>{a?n(a):r(t?l.buffer:l)})})),!Module.thisProgram&&process.argv.length>1&&(thisProgram=process.argv[1].replace(/\\/g,"/")),arguments_=process.argv.slice(2),quit_=(e,t)=>{throw process.exitCode=e,t}}else(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&(ENVIRONMENT_IS_WORKER?scriptDirectory=self.location.href:typeof document<"u"&&document.currentScript&&(scriptDirectory=document.currentScript.src),_scriptName&&(scriptDirectory=_scriptName),scriptDirectory.startsWith("blob:")?scriptDirectory="":scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1),ENVIRONMENT_IS_WORKER&&(readBinary=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),readAsync=e=>fetch(e,{credentials:"same-origin"}).then(t=>t.ok?t.arrayBuffer():Promise.reject(new Error(t.status+" : "+t.url))));var out=Module.print||console.log.bind(console),err=Module.printErr||console.error.bind(console);Object.assign(Module,moduleOverrides),moduleOverrides=null,Module.arguments&&(arguments_=Module.arguments),Module.thisProgram&&(thisProgram=Module.thisProgram);var dynamicLibraries=Module.dynamicLibraries||[],wasmBinary=Module.wasmBinary,wasmMemory,ABORT=!1,EXITSTATUS;function assert(e,t){e||abort(t)}var HEAP,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateMemoryViews(){var e=wasmMemory.buffer;Module.HEAP8=HEAP8=new Int8Array(e),Module.HEAP16=HEAP16=new Int16Array(e),Module.HEAPU8=HEAPU8=new Uint8Array(e),Module.HEAPU16=HEAPU16=new Uint16Array(e),Module.HEAP32=HEAP32=new Int32Array(e),Module.HEAPU32=HEAPU32=new Uint32Array(e),Module.HEAPF32=HEAPF32=new Float32Array(e),Module.HEAPF64=HEAPF64=new Float64Array(e)}if(Module.wasmMemory)wasmMemory=Module.wasmMemory;else{var INITIAL_MEMORY=Module.INITIAL_MEMORY||16777216;wasmMemory=new WebAssembly.Memory({initial:INITIAL_MEMORY/65536,maximum:65536})}updateMemoryViews();var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATEXIT__=[],__ATPOSTRUN__=[],__RELOC_FUNCS__=[],runtimeInitialized=!1;function preRun(){if(Module.preRun)for(typeof Module.preRun=="function"&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=!0,callRuntimeCallbacks(__RELOC_FUNCS__),!Module.noFSInit&&!FS.initialized&&FS.init(),FS.ignorePermissions=!1,TTY.init(),SOCKFS.root=FS.mount(SOCKFS,{},null),PIPEFS.root=FS.mount(PIPEFS,{},null),callRuntimeCallbacks(__ATINIT__)}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function postRun(){if(Module.postRun)for(typeof Module.postRun=="function"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(e){__ATPRERUN__.unshift(e)}function addOnInit(e){__ATINIT__.unshift(e)}function addOnPreMain(e){__ATMAIN__.unshift(e)}function addOnExit(e){}function addOnPostRun(e){__ATPOSTRUN__.unshift(e)}var runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null;function getUniqueRunDependency(e){return e}function addRunDependency(e){var t;runDependencies++,(t=Module.monitorRunDependencies)==null||t.call(Module,runDependencies)}function removeRunDependency(e){var r;if(runDependencies--,(r=Module.monitorRunDependencies)==null||r.call(Module,runDependencies),runDependencies==0&&(runDependencyWatcher!==null&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var t=dependenciesFulfilled;dependenciesFulfilled=null,t()}}function abort(e){var r;(r=Module.onAbort)==null||r.call(Module,e),e="Aborted("+e+")",err(e),ABORT=!0,e+=". Build with -sASSERTIONS for more info.",runtimeInitialized&&___trap();var t=new WebAssembly.RuntimeError(e);throw readyPromiseReject(t),t}var dataURIPrefix="data:application/octet-stream;base64,",isDataURI=e=>e.startsWith(dataURIPrefix),isFileURI=e=>e.startsWith("file://");function findWasmBinary(){var e="./duckdb-eh.wasm";return isDataURI(e)?e:locateFile(e)}var wasmBinaryFile;function getBinarySync(e){if(e==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(e);throw"both async and sync fetching of the wasm failed"}function getBinaryPromise(e){return wasmBinary?Promise.resolve().then(()=>getBinarySync(e)):readAsync(e).then(t=>new Uint8Array(t),()=>getBinarySync(e))}function instantiateArrayBuffer(e,t,r){return getBinaryPromise(e).then(n=>WebAssembly.instantiate(n,t)).then(r,n=>{err("failed to asynchronously prepare wasm: ".concat(n)),abort(n)})}function instantiateAsync(e,t,r,n){return!e&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(t)&&!ENVIRONMENT_IS_NODE&&typeof fetch=="function"?fetch(t,{credentials:"same-origin"}).then(a=>{var l=WebAssembly.instantiateStreaming(a,r);return l.then(n,function(c){return err("wasm streaming compile failed: ".concat(c)),err("falling back to ArrayBuffer instantiation"),instantiateArrayBuffer(t,r,n)})}):instantiateArrayBuffer(t,r,n)}function getWasmImports(){return{env:wasmImports,wasi_snapshot_preview1:wasmImports,"GOT.mem":new Proxy(wasmImports,GOTHandler),"GOT.func":new Proxy(wasmImports,GOTHandler)}}function createWasm(){var e=getWasmImports();function t(n,a){wasmExports=n.exports,wasmExports=relocateExports(wasmExports,1024);var l=getDylinkMetadata(a);return l.neededDynlibs&&(dynamicLibraries=l.neededDynlibs.concat(dynamicLibraries)),mergeLibSymbols(wasmExports,"main"),LDSO.init(),loadDylibs(),wasmExports=applySignatureConversions(wasmExports),addOnInit(wasmExports.__wasm_call_ctors),__RELOC_FUNCS__.push(wasmExports.__wasm_apply_data_relocs),removeRunDependency("wasm-instantiate"),wasmExports}addRunDependency("wasm-instantiate");function r(n){t(n.instance,n.module)}if(Module.instantiateWasm)try{return Module.instantiateWasm(e,t)}catch(n){err("Module.instantiateWasm callback failed with error: ".concat(n)),readyPromiseReject(n)}return wasmBinaryFile!=null||(wasmBinaryFile=findWasmBinary()),instantiateAsync(wasmBinary,wasmBinaryFile,e,r).catch(readyPromiseReject),{}}var tempDouble,tempI64,ASM_CONSTS={2182024:(e,t)=>{var r=typeof runtime=="object"&&runtime&&typeof runtime.whereToLoad=="function"&&runtime.whereToLoad?runtime.whereToLoad(UTF8ToString(e)):UTF8ToString(t),n=lengthBytesUTF8(r)+1,a=_malloc(n);return stringToUTF8(r,a,n),a},2182390:(e,t)=>{var r=UTF8ToString(e);if(typeof XMLHttpRequest>"u"){let L=Fc(),F=So(),I=yo();var n=r.split("/"),a=n.length,l=F.join(L.homedir(),".duckdb/extensions/"+n[a-4]+"/"+n[a-3]+"/"+n[a-2]+"/"),c=F.join(l,n[a-1]);try{if(I.existsSync(l)||I.mkdirSync(l,{recursive:!0}),I.existsSync(c))d=I.readFileSync(c);else{let T=new Int32Array(new SharedArrayBuffer(8));var u=xn("node:worker_threads").Worker,_=new u("const {Worker,isMainThread,parentPort,workerData,} = require('node:worker_threads');var times = 0;var SAB = 23;var Z = 0; async function ZZZ(e) {var x = await fetch(e);var res = await x.arrayBuffer();Atomics.store(SAB, 1, res.byteLength);Atomics.store(SAB, 0, 1);Atomics.notify(SAB, 1);Atomics.notify(SAB, 0);Z = res;};parentPort.on('message', function(event) {if (times == 0) {times++;SAB = event;} else if (times == 1) {times++; ZZZ(event);} else {const a = new Uint8Array(Z);const b = new Uint8Array(event.buffer);var K = Z.byteLength;for (var i = 0; i < K; i++) {b[i] = a[i];}Atomics.notify(event, 0);Atomics.store(SAB, 0, 2);Atomics.notify(SAB, 0);}});",{eval:!0}),d;T[0]=0,T[2]=4,_.postMessage(T),_.postMessage(r),Atomics.wait(T,0,0);let S=new Int32Array(new SharedArrayBuffer(T[1]+3-(T[1]+3)%4));_.postMessage(S),Atomics.wait(T,0,1);var f=new Uint8Array(S.buffer,0,T[1]);d=f,_.terminate(),I.writeFileSync(c,d)}}catch(T){return console.log("Error fetching module",T),0}}else{let L=new XMLHttpRequest;if(L.open("GET",r,!1),L.responseType="arraybuffer",L.send(null),L.status!=200)return 0;d=L.response}for(var p=WebAssembly.validate(d),m=d.byteLength,g=_malloc(m+4),h=new Uint8Array(d),b=0;b{if(!e)return AL.alcErr=40964,1},2185079:e=>{if(!AL.currentCtx)return err("alGetProcAddress() called without a valid context"),1;if(!e)return AL.currentCtx.err=40963,1}};function ExitStatus(e){this.name="ExitStatus",this.message="Program terminated with exit(".concat(e,")"),this.status=e}var GOT={},currentModuleWeakSymbols=new Set([]),GOTHandler={get(e,t){var r=GOT[t];return r||(r=GOT[t]=new WebAssembly.Global({value:"i32",mutable:!0})),currentModuleWeakSymbols.has(t)||(r.required=!0),r}},callRuntimeCallbacks=e=>{for(;e.length>0;)e.shift()(Module)},UTF8Decoder=typeof TextDecoder<"u"?new TextDecoder:void 0,UTF8ArrayToString=(e,t,r)=>{t>>>=0;for(var n=t+r,a=t;e[a]&&!(a>=n);)++a;if(a-t>16&&e.buffer&&UTF8Decoder)return UTF8Decoder.decode(e.subarray(t,a));for(var l="";t>10,56320|d&1023)}}return l},getDylinkMetadata=e=>{var t=0,r=0;function n(){return e[t++]}function a(){for(var C=0,k=1;;){var X=e[t++];if(C+=(X&127)*k,k*=128,!(X&128))break}return C}function l(){var C=a();return t+=C,UTF8ArrayToString(e,t-C,C)}function c(C,k){if(C)throw new Error(k)}var u="dylink.0";if(e instanceof WebAssembly.Module){var _=WebAssembly.Module.customSections(e,u);_.length===0&&(u="dylink",_=WebAssembly.Module.customSections(e,u)),c(_.length===0,"need dylink section"),e=new Uint8Array(_[0]),r=e.length}else{var d=new Uint32Array(new Uint8Array(e.subarray(0,24)).buffer),f=d[0]==1836278016;c(!f,"need to see wasm magic number"),c(e[8]!==0,"need the dylink section to be first"),t=9;var p=a();r=t+p,u=l()}var m={neededDynlibs:[],tlsExports:new Set,weakImports:new Set};if(u=="dylink"){m.memorySize=a(),m.memoryAlign=a(),m.tableSize=a(),m.tableAlign=a();for(var g=a(),h=0;h>>0];case"i8":return HEAP8[e>>>0];case"i16":return HEAP16[e>>>1>>>0];case"i32":return HEAP32[e>>>2>>>0];case"i64":abort("to do getValue(i64) use WASM_BIGINT");case"float":return HEAPF32[e>>>2>>>0];case"double":return HEAPF64[e>>>3>>>0];case"*":return HEAPU32[e>>>2>>>0];default:abort("invalid type for getValue: ".concat(t))}}var newDSO=(e,t,r)=>{var n={refcount:1/0,name:e,exports:r,global:!0};return LDSO.loadedLibsByName[e]=n,t!=null&&(LDSO.loadedLibsByHandle[t]=n),n},LDSO={loadedLibsByName:{},loadedLibsByHandle:{},init(){newDSO("__main__",0,wasmImports)}},___heap_base=2323520,alignMemory=(e,t)=>Math.ceil(e/t)*t,getMemory=e=>{if(runtimeInitialized)return _calloc(e,1);var t=___heap_base,r=t+alignMemory(e,16);return ___heap_base=r,GOT.__heap_base.value=r,t},isInternalSym=e=>["__cpp_exception","__c_longjmp","__wasm_apply_data_relocs","__dso_handle","__tls_size","__tls_align","__set_stack_limits","_emscripten_tls_init","__wasm_init_tls","__wasm_call_ctors","__start_em_asm","__stop_em_asm","__start_em_js","__stop_em_js"].includes(e)||e.startsWith("__em_js__"),uleb128Encode=(e,t)=>{e<128?t.push(e):t.push(e%128|128,e>>7)},sigToWasmTypes=e=>{for(var t={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"},r={parameters:[],results:e[0]=="v"?[]:[t[e[0]]]},n=1;n{var r=e.slice(0,1),n=e.slice(1),a={i:127,p:127,j:126,f:125,d:124,e:111};t.push(96),uleb128Encode(n.length,t);for(var l=0;l{if(typeof WebAssembly.Function=="function")return new WebAssembly.Function(sigToWasmTypes(t),e);var r=[1];generateFuncType(t,r);var n=[0,97,115,109,1,0,0,0,1];uleb128Encode(r.length,n),n.push(...r),n.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var a=new WebAssembly.Module(new Uint8Array(n)),l=new WebAssembly.Instance(a,{e:{f:e}}),c=l.exports.f;return c},wasmTable=new WebAssembly.Table({initial:24633,element:"anyfunc"}),getWasmTableEntry=e=>wasmTable.get(e),updateTableMap=(e,t)=>{if(functionsInTableMap)for(var r=e;r(functionsInTableMap||(functionsInTableMap=new WeakMap,updateTableMap(0,wasmTable.length)),functionsInTableMap.get(e)||0),freeTableIndexes=[],getEmptyTableSlot=()=>{if(freeTableIndexes.length)return freeTableIndexes.pop();try{wasmTable.grow(1)}catch(e){throw e instanceof RangeError?"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.":e}return wasmTable.length-1},setWasmTableEntry=(e,t)=>wasmTable.set(e,t),addFunction=(e,t)=>{var r=getFunctionAddress(e);if(r)return r;var n=getEmptyTableSlot();try{setWasmTableEntry(n,e)}catch(l){if(!(l instanceof TypeError))throw l;var a=convertJsFunctionToWasm(e,t);setWasmTableEntry(n,a)}return functionsInTableMap.set(e,n),n},updateGOT=(e,t)=>{for(var r in e)if(!isInternalSym(r)){var n=e[r];r.startsWith("orig$")&&(r=r.split("$")[1],t=!0),GOT[r]||(GOT[r]=new WebAssembly.Global({value:"i32",mutable:!0})),(t||GOT[r].value==0)&&(typeof n=="function"?GOT[r].value=addFunction(n):typeof n=="number"?GOT[r].value=n:err("unhandled export type for '".concat(r,"': ").concat(typeof n)))}},relocateExports=(e,t,r)=>{var n={};for(var a in e){var l=e[a];typeof l=="object"&&(l=l.value),typeof l=="number"&&(l+=t),n[a]=l}return updateGOT(n,r),n},isSymbolDefined=e=>{var t=wasmImports[e];return!(!t||t.stub)},resolveGlobalSymbol=(e,t=!1)=>{var r;return t&&"orig$"+e in wasmImports&&(e="orig$"+e),isSymbolDefined(e)&&(r=wasmImports[e]),{sym:r,name:e}},UTF8ToString=(e,t)=>(e>>>=0,e?UTF8ArrayToString(HEAPU8,e,t):""),loadWebAssemblyModule=(binary,flags,libName,localScope,handle)=>{var metadata=getDylinkMetadata(binary);currentModuleWeakSymbols=metadata.weakImports;function loadModule(){var firstLoad=!handle||!HEAP8[handle+8>>>0];if(firstLoad){var memAlign=Math.pow(2,metadata.memoryAlign),memoryBase=metadata.memorySize?alignMemory(getMemory(metadata.memorySize+memAlign),memAlign):0,tableBase=metadata.tableSize?wasmTable.length:0;handle&&(HEAP8[handle+8>>>0]=1,HEAPU32[handle+12>>>2>>>0]=memoryBase,HEAP32[handle+16>>>2>>>0]=metadata.memorySize,HEAPU32[handle+20>>>2>>>0]=tableBase,HEAP32[handle+24>>>2>>>0]=metadata.tableSize)}else memoryBase=HEAPU32[handle+12>>>2>>>0],tableBase=HEAPU32[handle+20>>>2>>>0];var tableGrowthNeeded=tableBase+metadata.tableSize-wasmTable.length;tableGrowthNeeded>0&&wasmTable.grow(tableGrowthNeeded);var moduleExports;function resolveSymbol(e){var t=resolveGlobalSymbol(e).sym;return!t&&localScope&&(t=localScope[e]),t||(t=moduleExports[e]),t}var proxyHandler={get(e,t){switch(t){case"__memory_base":return memoryBase;case"__table_base":return tableBase}if(t in wasmImports&&!wasmImports[t].stub)return wasmImports[t];if(!(t in e)){var r;e[t]=(...n)=>(r||(r=resolveSymbol(t)),r(...n))}return e[t]}},proxy=new Proxy({},proxyHandler),info={"GOT.mem":new Proxy({},GOTHandler),"GOT.func":new Proxy({},GOTHandler),env:proxy,wasi_snapshot_preview1:proxy};function postInstantiation(module,instance){updateTableMap(tableBase,metadata.tableSize),moduleExports=relocateExports(instance.exports,memoryBase),flags.allowUndefined||reportUndefinedSymbols();function addEmAsm(addr,body){for(var args=[],arity=0;arity<16&&body.indexOf("$"+arity)!=-1;arity++)args.push("$"+arity);args=args.join(",");var func="(".concat(args,") => { ").concat(body," };");ASM_CONSTS[start]=eval(func)}if("__start_em_asm"in moduleExports)for(var start=moduleExports.__start_em_asm,stop=moduleExports.__stop_em_asm;start ").concat(body,";");moduleExports[name]=eval(func)}for(var name in moduleExports)if(name.startsWith("__em_js__")){var start=moduleExports[name],jsString=UTF8ToString(start),parts=jsString.split("<::>");addEmJs(name.replace("__em_js__",""),parts[0],parts[1]),delete moduleExports[name]}var applyRelocs=moduleExports.__wasm_apply_data_relocs;applyRelocs&&(runtimeInitialized?applyRelocs():__RELOC_FUNCS__.push(applyRelocs));var init=moduleExports.__wasm_call_ctors;return init&&(runtimeInitialized?init():__ATINIT__.push(init)),moduleExports}if(flags.loadAsync){if(binary instanceof WebAssembly.Module){var instance=new WebAssembly.Instance(binary,info);return Promise.resolve(postInstantiation(binary,instance))}return WebAssembly.instantiate(binary,info).then(e=>postInstantiation(e.module,e.instance))}var module=binary instanceof WebAssembly.Module?binary:new WebAssembly.Module(binary),instance=new WebAssembly.Instance(module,info);return postInstantiation(module,instance)}return flags.loadAsync?metadata.neededDynlibs.reduce((e,t)=>e.then(()=>loadDynamicLibrary(t,flags,localScope)),Promise.resolve()).then(loadModule):(metadata.neededDynlibs.forEach(e=>loadDynamicLibrary(e,flags,localScope)),loadModule())},mergeLibSymbols=(e,t)=>{registerDynCallSymbols(e);for(var[r,n]of Object.entries(e))(l=>{isSymbolDefined(l)||(wasmImports[l]=n)})(r)},asyncLoad=(e,t,r,n)=>{var a=n?"":"al ".concat(e);readAsync(e).then(l=>{t(new Uint8Array(l)),a&&removeRunDependency(a)},l=>{if(r)r();else throw'Loading data file "'.concat(e,'" failed.')}),a&&addRunDependency(a)},preloadPlugins=Module.preloadPlugins||[],registerWasmPlugin=()=>{var e={promiseChainEnd:Promise.resolve(),canHandle:t=>!Module.noWasmDecoding&&t.endsWith(".so"),handle:(t,r,n,a)=>{e.promiseChainEnd=e.promiseChainEnd.then(()=>loadWebAssemblyModule(t,{loadAsync:!0,nodelete:!0},r,{})).then(l=>{preloadedWasm[r]=l,n(t)},l=>{err("failed to instantiate wasm: ".concat(r,": ").concat(l)),a()})}};preloadPlugins.push(e)},preloadedWasm={},registerDynCallSymbols=e=>{for(var[t,r]of Object.entries(e))t.startsWith("dynCall_")&&!Module.hasOwnProperty(t)&&(Module[t]=r)};function loadDynamicLibrary(e,t={global:!0,nodelete:!0},r,n){var a=LDSO.loadedLibsByName[e];if(a)return t.global?a.global||(a.global=!0,mergeLibSymbols(a.exports,e)):(r&&Object.assign(r,a.exports),registerDynCallSymbols(a.exports)),t.nodelete&&a.refcount!==1/0&&(a.refcount=1/0),a.refcount++,n&&(LDSO.loadedLibsByHandle[n]=a),t.loadAsync?Promise.resolve(!0):!0;a=newDSO(e,n,"loading"),a.refcount=t.nodelete?1/0:1,a.global=t.global;function l(){if(n){var _=HEAPU32[n+28>>>2>>>0],d=HEAPU32[n+32>>>2>>>0];if(_&&d){var f=HEAP8.slice(_,_+d);return t.loadAsync?Promise.resolve(f):f}}var p=locateFile(e);if(t.loadAsync)return new Promise((m,g)=>asyncLoad(p,m,g));if(!readBinary)throw new Error("".concat(p,": file not found, and synchronous loading of external files is not available"));return readBinary(p)}function c(){var _=preloadedWasm[e];return _?t.loadAsync?Promise.resolve(_):_:t.loadAsync?l().then(d=>loadWebAssemblyModule(d,t,e,r,n)):loadWebAssemblyModule(l(),t,e,r,n)}function u(_){a.global?mergeLibSymbols(_,e):r&&(Object.assign(r,_),registerDynCallSymbols(_)),a.exports=_}return t.loadAsync?c().then(_=>(u(_),!0)):(u(c()),!0)}var reportUndefinedSymbols=()=>{for(var[e,t]of Object.entries(GOT))if(t.value==0){var r=resolveGlobalSymbol(e,!0).sym;if(!r&&!t.required)continue;if(typeof r=="function")t.value=addFunction(r,r.sig);else if(typeof r=="number")t.value=r;else throw new Error("bad export type for '".concat(e,"': ").concat(typeof r))}},loadDylibs=()=>{if(!dynamicLibraries.length){reportUndefinedSymbols();return}addRunDependency("loadDylibs"),dynamicLibraries.reduce((e,t)=>e.then(()=>loadDynamicLibrary(t,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})),Promise.resolve()).then(()=>{reportUndefinedSymbols(),removeRunDependency("loadDylibs")})},noExitRuntime=Module.noExitRuntime||!0;function setValue(e,t,r="i8"){switch(r.endsWith("*")&&(r="*"),r){case"i1":HEAP8[e>>>0]=t;break;case"i8":HEAP8[e>>>0]=t;break;case"i16":HEAP16[e>>>1>>>0]=t;break;case"i32":HEAP32[e>>>2>>>0]=t;break;case"i64":abort("to do setValue(i64) use WASM_BIGINT");case"float":HEAPF32[e>>>2>>>0]=t;break;case"double":HEAPF64[e>>>3>>>0]=t;break;case"*":HEAPU32[e>>>2>>>0]=t;break;default:abort("invalid type for setValue: ".concat(r))}}function __ZN18duckdb_skiplistlib9skip_list19_throw_exceeds_sizeEm(...e){return wasmImports._ZN18duckdb_skiplistlib9skip_list19_throw_exceeds_sizeEm(...e)}__ZN18duckdb_skiplistlib9skip_list19_throw_exceeds_sizeEm.stub=!0;var convertI32PairToI53Checked=(e,t)=>t+2097152>>>0<4194305-!!e?(e>>>0)+t*4294967296:NaN;function ___assert_fail(e,t,r,n){e>>>=0,t>>>=0,n>>>=0,abort("Assertion failed: ".concat(UTF8ToString(e),", at: ")+[t?UTF8ToString(t):"unknown filename",r,n?UTF8ToString(n):"unknown function"])}___assert_fail.sig="vppip";var ___c_longjmp=new WebAssembly.Tag({parameters:["i32"]});function ___call_sighandler(e,t){return e>>>=0,getWasmTableEntry(e)(t)}___call_sighandler.sig="vpi";var ___cpp_exception=new WebAssembly.Tag({parameters:["i32"]}),___memory_base=new WebAssembly.Global({value:"i32",mutable:!1},1024),___stack_high=2323520,___stack_low=2257984,___stack_pointer=new WebAssembly.Global({value:"i32",mutable:!0},2323520),PATH={isAbs:e=>e.charAt(0)==="/",splitPath:e=>{var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return t.exec(e).slice(1)},normalizeArray:(e,t)=>{for(var r=0,n=e.length-1;n>=0;n--){var a=e[n];a==="."?e.splice(n,1):a===".."?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:e=>{var t=PATH.isAbs(e),r=e.substr(-1)==="/";return e=PATH.normalizeArray(e.split("/").filter(n=>!!n),!t).join("/"),!e&&!t&&(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=PATH.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"/";e=PATH.normalize(e),e=e.replace(/\/$/,"");var t=e.lastIndexOf("/");return t===-1?e:e.substr(t+1)},join:(...e)=>PATH.normalize(e.join("/")),join2:(e,t)=>PATH.normalize(e+"/"+t)},initRandomFill=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return n=>crypto.getRandomValues(n);if(ENVIRONMENT_IS_NODE)try{var e=xn("crypto"),t=e.randomFillSync;if(t)return n=>e.randomFillSync(n);var r=e.randomBytes;return n=>(n.set(r(n.byteLength)),n)}catch(n){}abort("initRandomDevice")},randomFill=e=>(randomFill=initRandomFill())(e),PATH_FS={resolve:(...e)=>{for(var t="",r=!1,n=e.length-1;n>=-1&&!r;n--){var a=n>=0?e[n]:FS.cwd();if(typeof a!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!a)return"";t=a+"/"+t,r=PATH.isAbs(a)}return t=PATH.normalizeArray(t.split("/").filter(l=>!!l),!r).join("/"),(r?"/":"")+t||"."},relative:(e,t)=>{e=PATH_FS.resolve(e).substr(1),t=PATH_FS.resolve(t).substr(1);function r(d){for(var f=0;f=0&&d[p]==="";p--);return f>p?[]:d.slice(f,p-f+1)}for(var n=r(e.split("/")),a=r(t.split("/")),l=Math.min(n.length,a.length),c=l,u=0;u{for(var t=0,r=0;r=55296&&n<=57343?(t+=4,++r):t+=3}return t},stringToUTF8Array=(e,t,r,n)=>{if(r>>>=0,!(n>0))return 0;for(var a=r,l=r+n-1,c=0;c=55296&&u<=57343){var _=e.charCodeAt(++c);u=65536+((u&1023)<<10)|_&1023}if(u<=127){if(r>=l)break;t[r++>>>0]=u}else if(u<=2047){if(r+1>=l)break;t[r++>>>0]=192|u>>6,t[r++>>>0]=128|u&63}else if(u<=65535){if(r+2>=l)break;t[r++>>>0]=224|u>>12,t[r++>>>0]=128|u>>6&63,t[r++>>>0]=128|u&63}else{if(r+3>=l)break;t[r++>>>0]=240|u>>18,t[r++>>>0]=128|u>>12&63,t[r++>>>0]=128|u>>6&63,t[r++>>>0]=128|u&63}}return t[r>>>0]=0,r-a};function intArrayFromString(e,t,r){var n=r>0?r:lengthBytesUTF8(e)+1,a=new Array(n),l=stringToUTF8Array(e,a,0,a.length);return t&&(a.length=l),a}var FS_stdin_getChar=()=>{if(!FS_stdin_getChar_buffer.length){var e=null;if(ENVIRONMENT_IS_NODE){var t=256,r=Buffer.alloc(t),n=0,a=process.stdin.fd;try{n=fs.readSync(a,r,0,t)}catch(l){if(l.toString().includes("EOF"))n=0;else throw l}n>0&&(e=r.slice(0,n).toString("utf-8"))}else typeof window<"u"&&typeof window.prompt=="function"&&(e=window.prompt("Input: "),e!==null&&(e+="\n"));if(!e)return null;FS_stdin_getChar_buffer=intArrayFromString(e,!0)}return FS_stdin_getChar_buffer.shift()},TTY={ttys:[],init(){},shutdown(){},register(e,t){TTY.ttys[e]={input:[],output:[],ops:t},FS.registerDevice(e,TTY.stream_ops)},stream_ops:{open(e){var t=TTY.ttys[e.node.rdev];if(!t)throw new FS.ErrnoError(43);e.tty=t,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,t,r,n,a){if(!e.tty||!e.tty.ops.get_char)throw new FS.ErrnoError(60);for(var l=0,c=0;c0&&(out(UTF8ArrayToString(e.output,0)),e.output=[])},ioctl_tcgets(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(e,t,r){return 0},ioctl_tiocgwinsz(e){return[24,80]}},default_tty1_ops:{put_char(e,t){t===null||t===10?(err(UTF8ArrayToString(e.output,0)),e.output=[]):t!=0&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(err(UTF8ArrayToString(e.output,0)),e.output=[])}}},zeroMemory=(e,t)=>(HEAPU8.fill(0,e,e+t),e),mmapAlloc=e=>{e=alignMemory(e,65536);var t=_emscripten_builtin_memalign(65536,e);return t?zeroMemory(t,e):0},MEMFS={ops_table:null,mount(e){return MEMFS.createNode(null,"/",16895,0)},createNode(e,t,r,n){if(FS.isBlkdev(r)||FS.isFIFO(r))throw new FS.ErrnoError(63);MEMFS.ops_table||(MEMFS.ops_table={dir:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,lookup:MEMFS.node_ops.lookup,mknod:MEMFS.node_ops.mknod,rename:MEMFS.node_ops.rename,unlink:MEMFS.node_ops.unlink,rmdir:MEMFS.node_ops.rmdir,readdir:MEMFS.node_ops.readdir,symlink:MEMFS.node_ops.symlink},stream:{llseek:MEMFS.stream_ops.llseek}},file:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:{llseek:MEMFS.stream_ops.llseek,read:MEMFS.stream_ops.read,write:MEMFS.stream_ops.write,allocate:MEMFS.stream_ops.allocate,mmap:MEMFS.stream_ops.mmap,msync:MEMFS.stream_ops.msync}},link:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,readlink:MEMFS.node_ops.readlink},stream:{}},chrdev:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:FS.chrdev_stream_ops}});var a=FS.createNode(e,t,r,n);return FS.isDir(a.mode)?(a.node_ops=MEMFS.ops_table.dir.node,a.stream_ops=MEMFS.ops_table.dir.stream,a.contents={}):FS.isFile(a.mode)?(a.node_ops=MEMFS.ops_table.file.node,a.stream_ops=MEMFS.ops_table.file.stream,a.usedBytes=0,a.contents=null):FS.isLink(a.mode)?(a.node_ops=MEMFS.ops_table.link.node,a.stream_ops=MEMFS.ops_table.link.stream):FS.isChrdev(a.mode)&&(a.node_ops=MEMFS.ops_table.chrdev.node,a.stream_ops=MEMFS.ops_table.chrdev.stream),a.timestamp=Date.now(),e&&(e.contents[t]=a,e.timestamp=a.timestamp),a},getFileDataAsTypedArray(e){return 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)){var n=1024*1024;t=Math.max(t,r*(r>>0),r!=0&&(t=Math.max(t,256));var a=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(a.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,t){if(e.usedBytes!=t)if(t==0)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=FS.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,FS.isDir(e.mode)?t.size=4096:FS.isFile(e.mode)?t.size=e.usedBytes:FS.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){t.mode!==void 0&&(e.mode=t.mode),t.timestamp!==void 0&&(e.timestamp=t.timestamp),t.size!==void 0&&MEMFS.resizeFileStorage(e,t.size)},lookup(e,t){throw FS.genericErrors[44]},mknod(e,t,r,n){return MEMFS.createNode(e,t,r,n)},rename(e,t,r){if(FS.isDir(e.mode)){var n;try{n=FS.lookupNode(t,r)}catch(l){}if(n)for(var a in n.contents)throw new FS.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},unlink(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir(e,t){var r=FS.lookupNode(e,t);for(var n in r.contents)throw new FS.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir(e){var t=[".",".."];for(var r of Object.keys(e.contents))t.push(r);return t},symlink(e,t,r){var n=MEMFS.createNode(e,t,41471,0);return n.link=r,n},readlink(e){if(!FS.isLink(e.mode))throw new FS.ErrnoError(28);return e.link}},stream_ops:{read(e,t,r,n,a){var l=e.node.contents;if(a>=e.node.usedBytes)return 0;var c=Math.min(e.node.usedBytes-a,n);if(c>8&&l.subarray)t.set(l.subarray(a,a+c),r);else for(var u=0;u0||r+t>>0))}return{ptr:l,allocated:c}},msync(e,t,r,n,a){return MEMFS.stream_ops.write(e,t,0,n,r,!1),0}}},FS_createDataFile=(e,t,r,n,a,l)=>{FS.createDataFile(e,t,r,n,a,l)},FS_handledByPreloadPlugin=(e,t,r,n)=>{typeof Browser<"u"&&Browser.init();var a=!1;return preloadPlugins.forEach(l=>{a||l.canHandle(t)&&(l.handle(e,t,r,n),a=!0)}),a},FS_createPreloadedFile=(e,t,r,n,a,l,c,u,_,d)=>{var f=t?PATH_FS.resolve(PATH.join2(e,t)):e,p="cp ".concat(f);function m(g){function h(b){d==null||d(),u||FS_createDataFile(e,t,b,n,a,_),l==null||l(),removeRunDependency(p)}FS_handledByPreloadPlugin(g,f,h,()=>{c==null||c(),removeRunDependency(p)})||h(g)}addRunDependency(p),typeof r=="string"?asyncLoad(r,m,c):m(r)},FS_modeStringToFlags=e=>{var t={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},r=t[e];if(typeof r>"u")throw new Error("Unknown file open mode: ".concat(e));return r},FS_getMode=(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},FS={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:class{constructor(e){this.name="ErrnoError",this.errno=e}},genericErrors:{},filesystems:null,syncFSRequests:0,readFiles:{},FSStream:class{constructor(){this.shared={}}get object(){return this.node}set object(e){this.node=e}get isRead(){return(this.flags&2097155)!==1}get isWrite(){return(this.flags&2097155)!==0}get isAppend(){return this.flags&1024}get flags(){return this.shared.flags}set flags(e){this.shared.flags=e}get position(){return this.shared.position}set position(e){this.shared.position=e}},FSNode:class{constructor(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=FS.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n,this.readMode=365,this.writeMode=146}get read(){return(this.mode&this.readMode)===this.readMode}set read(e){e?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(e){e?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return FS.isDir(this.mode)}get isDevice(){return FS.isChrdev(this.mode)}},lookupPath(e,t={}){if(e=PATH_FS.resolve(e),!e)return{path:"",node:null};var r={follow_mount:!0,recurse_count:0};if(t=Object.assign(r,t),t.recurse_count>8)throw new FS.ErrnoError(32);for(var n=e.split("/").filter(p=>!!p),a=FS.root,l="/",c=0;c40)throw new FS.ErrnoError(32)}}return{path:l,node:a}},getPath(e){for(var t;;){if(FS.isRoot(e)){var r=e.mount.mountpoint;return t?r[r.length-1]!=="/"?"".concat(r,"/").concat(t):r+t:r}t=t?"".concat(e.name,"/").concat(t):e.name,e=e.parent}},hashName(e,t){for(var r=0,n=0;n>>0)%FS.nameTable.length},hashAddNode(e){var t=FS.hashName(e.parent.id,e.name);e.name_next=FS.nameTable[t],FS.nameTable[t]=e},hashRemoveNode(e){var t=FS.hashName(e.parent.id,e.name);if(FS.nameTable[t]===e)FS.nameTable[t]=e.name_next;else for(var r=FS.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode(e,t){var r=FS.mayLookup(e);if(r)throw new FS.ErrnoError(r);for(var n=FS.hashName(e.id,t),a=FS.nameTable[n];a;a=a.name_next){var l=a.name;if(a.parent.id===e.id&&l===t)return a}return FS.lookup(e,t)},createNode(e,t,r,n){var a=new FS.FSNode(e,t,r,n);return FS.hashAddNode(a),a},destroyNode(e){FS.hashRemoveNode(e)},isRoot(e){return e===e.parent},isMountpoint(e){return!!e.mounted},isFile(e){return(e&61440)===32768},isDir(e){return(e&61440)===16384},isLink(e){return(e&61440)===40960},isChrdev(e){return(e&61440)===8192},isBlkdev(e){return(e&61440)===24576},isFIFO(e){return(e&61440)===4096},isSocket(e){return(e&49152)===49152},flagsToPermissionString(e){var t=["r","w","rw"][e&3];return e&512&&(t+="w"),t},nodePermissions(e,t){return FS.ignorePermissions?0:t.includes("r")&&!(e.mode&292)||t.includes("w")&&!(e.mode&146)||t.includes("x")&&!(e.mode&73)?2:0},mayLookup(e){if(!FS.isDir(e.mode))return 54;var t=FS.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate(e,t){try{var r=FS.lookupNode(e,t);return 20}catch(n){}return FS.nodePermissions(e,"wx")},mayDelete(e,t,r){var n;try{n=FS.lookupNode(e,t)}catch(l){return l.errno}var a=FS.nodePermissions(e,"wx");if(a)return a;if(r){if(!FS.isDir(n.mode))return 54;if(FS.isRoot(n)||FS.getPath(n)===FS.cwd())return 10}else if(FS.isDir(n.mode))return 31;return 0},mayOpen(e,t){return e?FS.isLink(e.mode)?32:FS.isDir(e.mode)&&(FS.flagsToPermissionString(t)!=="r"||t&512)?31:FS.nodePermissions(e,FS.flagsToPermissionString(t)):44},MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=FS.MAX_OPEN_FDS;e++)if(!FS.streams[e])return e;throw new FS.ErrnoError(33)},getStreamChecked(e){var t=FS.getStream(e);if(!t)throw new FS.ErrnoError(8);return t},getStream:e=>FS.streams[e],createStream(e,t=-1){return e=Object.assign(new FS.FSStream,e),t==-1&&(t=FS.nextfd()),e.fd=t,FS.streams[t]=e,e},closeStream(e){FS.streams[e]=null},dupStream(e,t=-1){var n,a;var r=FS.createStream(e,t);return(a=(n=r.stream_ops)==null?void 0:n.dup)==null||a.call(n,r),r},chrdev_stream_ops:{open(e){var r,n;var t=FS.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,(n=(r=e.stream_ops).open)==null||n.call(r,e)},llseek(){throw new FS.ErrnoError(70)}},major:e=>e>>8,minor:e=>e&255,makedev:(e,t)=>e<<8|t,registerDevice(e,t){FS.devices[e]={stream_ops:t}},getDevice:e=>FS.devices[e],getMounts(e){for(var t=[],r=[e];r.length;){var n=r.pop();t.push(n),r.push(...n.mounts)}return t},syncfs(e,t){typeof e=="function"&&(t=e,e=!1),FS.syncFSRequests++,FS.syncFSRequests>1&&err("warning: ".concat(FS.syncFSRequests," FS.syncfs operations in flight at once, probably just doing extra work"));var r=FS.getMounts(FS.root.mount),n=0;function a(c){return FS.syncFSRequests--,t(c)}function l(c){if(c)return l.errored?void 0:(l.errored=!0,a(c));++n>=r.length&&a(null)}r.forEach(c=>{if(!c.type.syncfs)return l(null);c.type.syncfs(c,e,l)})},mount(e,t,r){var n=r==="/",a=!r,l;if(n&&FS.root)throw new FS.ErrnoError(10);if(!n&&!a){var c=FS.lookupPath(r,{follow_mount:!1});if(r=c.path,l=c.node,FS.isMountpoint(l))throw new FS.ErrnoError(10);if(!FS.isDir(l.mode))throw new FS.ErrnoError(54)}var u={type:e,opts:t,mountpoint:r,mounts:[]},_=e.mount(u);return _.mount=u,u.root=_,n?FS.root=_:l&&(l.mounted=u,l.mount&&l.mount.mounts.push(u)),_},unmount(e){var t=FS.lookupPath(e,{follow_mount:!1});if(!FS.isMountpoint(t.node))throw new FS.ErrnoError(28);var r=t.node,n=r.mounted,a=FS.getMounts(n);Object.keys(FS.nameTable).forEach(c=>{for(var u=FS.nameTable[c];u;){var _=u.name_next;a.includes(u.mount)&&FS.destroyNode(u),u=_}}),r.mounted=null;var l=r.mount.mounts.indexOf(n);r.mount.mounts.splice(l,1)},lookup(e,t){return e.node_ops.lookup(e,t)},mknod(e,t,r){var n=FS.lookupPath(e,{parent:!0}),a=n.node,l=PATH.basename(e);if(!l||l==="."||l==="..")throw new FS.ErrnoError(28);var c=FS.mayCreate(a,l);if(c)throw new FS.ErrnoError(c);if(!a.node_ops.mknod)throw new FS.ErrnoError(63);return a.node_ops.mknod(a,l,t,r)},create(e,t){return t=t!==void 0?t:438,t&=4095,t|=32768,FS.mknod(e,t,0)},mkdir(e,t){return t=t!==void 0?t:511,t&=1023,t|=16384,FS.mknod(e,t,0)},mkdirTree(e,t){for(var r=e.split("/"),n="",a=0;a"u"&&(r=t,t=438),t|=8192,FS.mknod(e,t,r)},symlink(e,t){if(!PATH_FS.resolve(e))throw new FS.ErrnoError(44);var r=FS.lookupPath(t,{parent:!0}),n=r.node;if(!n)throw new FS.ErrnoError(44);var a=PATH.basename(t),l=FS.mayCreate(n,a);if(l)throw new FS.ErrnoError(l);if(!n.node_ops.symlink)throw new FS.ErrnoError(63);return n.node_ops.symlink(n,a,e)},rename(e,t){var r=PATH.dirname(e),n=PATH.dirname(t),a=PATH.basename(e),l=PATH.basename(t),c,u,_;if(c=FS.lookupPath(e,{parent:!0}),u=c.node,c=FS.lookupPath(t,{parent:!0}),_=c.node,!u||!_)throw new FS.ErrnoError(44);if(u.mount!==_.mount)throw new FS.ErrnoError(75);var d=FS.lookupNode(u,a),f=PATH_FS.relative(e,n);if(f.charAt(0)!==".")throw new FS.ErrnoError(28);if(f=PATH_FS.relative(t,r),f.charAt(0)!==".")throw new FS.ErrnoError(55);var p;try{p=FS.lookupNode(_,l)}catch(h){}if(d!==p){var m=FS.isDir(d.mode),g=FS.mayDelete(u,a,m);if(g)throw new FS.ErrnoError(g);if(g=p?FS.mayDelete(_,l,m):FS.mayCreate(_,l),g)throw new FS.ErrnoError(g);if(!u.node_ops.rename)throw new FS.ErrnoError(63);if(FS.isMountpoint(d)||p&&FS.isMountpoint(p))throw new FS.ErrnoError(10);if(_!==u&&(g=FS.nodePermissions(u,"w"),g))throw new FS.ErrnoError(g);FS.hashRemoveNode(d);try{u.node_ops.rename(d,_,l),d.parent=_}catch(h){throw h}finally{FS.hashAddNode(d)}}},rmdir(e){var t=FS.lookupPath(e,{parent:!0}),r=t.node,n=PATH.basename(e),a=FS.lookupNode(r,n),l=FS.mayDelete(r,n,!0);if(l)throw new FS.ErrnoError(l);if(!r.node_ops.rmdir)throw new FS.ErrnoError(63);if(FS.isMountpoint(a))throw new FS.ErrnoError(10);r.node_ops.rmdir(r,n),FS.destroyNode(a)},readdir(e){var t=FS.lookupPath(e,{follow:!0}),r=t.node;if(!r.node_ops.readdir)throw new FS.ErrnoError(54);return r.node_ops.readdir(r)},unlink(e){var t=FS.lookupPath(e,{parent:!0}),r=t.node;if(!r)throw new FS.ErrnoError(44);var n=PATH.basename(e),a=FS.lookupNode(r,n),l=FS.mayDelete(r,n,!1);if(l)throw new FS.ErrnoError(l);if(!r.node_ops.unlink)throw new FS.ErrnoError(63);if(FS.isMountpoint(a))throw new FS.ErrnoError(10);r.node_ops.unlink(r,n),FS.destroyNode(a)},readlink(e){var t=FS.lookupPath(e),r=t.node;if(!r)throw new FS.ErrnoError(44);if(!r.node_ops.readlink)throw new FS.ErrnoError(28);return PATH_FS.resolve(FS.getPath(r.parent),r.node_ops.readlink(r))},stat(e,t){var r=FS.lookupPath(e,{follow:!t}),n=r.node;if(!n)throw new FS.ErrnoError(44);if(!n.node_ops.getattr)throw new FS.ErrnoError(63);return n.node_ops.getattr(n)},lstat(e){return FS.stat(e,!0)},chmod(e,t,r){var n;if(typeof e=="string"){var a=FS.lookupPath(e,{follow:!r});n=a.node}else n=e;if(!n.node_ops.setattr)throw new FS.ErrnoError(63);n.node_ops.setattr(n,{mode:t&4095|n.mode&-4096,timestamp:Date.now()})},lchmod(e,t){FS.chmod(e,t,!0)},fchmod(e,t){var r=FS.getStreamChecked(e);FS.chmod(r.node,t)},chown(e,t,r,n){var a;if(typeof e=="string"){var l=FS.lookupPath(e,{follow:!n});a=l.node}else a=e;if(!a.node_ops.setattr)throw new FS.ErrnoError(63);a.node_ops.setattr(a,{timestamp:Date.now()})},lchown(e,t,r){FS.chown(e,t,r,!0)},fchown(e,t,r){var n=FS.getStreamChecked(e);FS.chown(n.node,t,r)},truncate(e,t){if(t<0)throw new FS.ErrnoError(28);var r;if(typeof e=="string"){var n=FS.lookupPath(e,{follow:!0});r=n.node}else r=e;if(!r.node_ops.setattr)throw new FS.ErrnoError(63);if(FS.isDir(r.mode))throw new FS.ErrnoError(31);if(!FS.isFile(r.mode))throw new FS.ErrnoError(28);var a=FS.nodePermissions(r,"w");if(a)throw new FS.ErrnoError(a);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate(e,t){var r=FS.getStreamChecked(e);if(!(r.flags&2097155))throw new FS.ErrnoError(28);FS.truncate(r.node,t)},utime(e,t,r){var n=FS.lookupPath(e,{follow:!0}),a=n.node;a.node_ops.setattr(a,{timestamp:Math.max(t,r)})},open(e,t,r){if(e==="")throw new FS.ErrnoError(44);t=typeof t=="string"?FS_modeStringToFlags(t):t,t&64?(r=typeof r>"u"?438:r,r=r&4095|32768):r=0;var n;if(typeof e=="object")n=e;else{e=PATH.normalize(e);try{var a=FS.lookupPath(e,{follow:!(t&131072)});n=a.node}catch(_){}}var l=!1;if(t&64)if(n){if(t&128)throw new FS.ErrnoError(20)}else n=FS.mknod(e,r,0),l=!0;if(!n)throw new FS.ErrnoError(44);if(FS.isChrdev(n.mode)&&(t&=-513),t&65536&&!FS.isDir(n.mode))throw new FS.ErrnoError(54);if(!l){var c=FS.mayOpen(n,t);if(c)throw new FS.ErrnoError(c)}t&512&&!l&&FS.truncate(n,0),t&=-131713;var u=FS.createStream({node:n,path:FS.getPath(n),flags:t,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return u.stream_ops.open&&u.stream_ops.open(u),Module.logReadFiles&&!(t&1)&&(e in FS.readFiles||(FS.readFiles[e]=1)),u},close(e){if(FS.isClosed(e))throw new FS.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(t){throw t}finally{FS.closeStream(e.fd)}e.fd=null},isClosed(e){return e.fd===null},llseek(e,t,r){if(FS.isClosed(e))throw new FS.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new FS.ErrnoError(70);if(r!=0&&r!=1&&r!=2)throw new FS.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read(e,t,r,n,a){if(n<0||a<0)throw new FS.ErrnoError(28);if(FS.isClosed(e))throw new FS.ErrnoError(8);if((e.flags&2097155)===1)throw new FS.ErrnoError(8);if(FS.isDir(e.node.mode))throw new FS.ErrnoError(31);if(!e.stream_ops.read)throw new FS.ErrnoError(28);var l=typeof a<"u";if(!l)a=e.position;else if(!e.seekable)throw new FS.ErrnoError(70);var c=e.stream_ops.read(e,t,r,n,a);return l||(e.position+=c),c},write(e,t,r,n,a,l){if(n<0||a<0)throw new FS.ErrnoError(28);if(FS.isClosed(e))throw new FS.ErrnoError(8);if(!(e.flags&2097155))throw new FS.ErrnoError(8);if(FS.isDir(e.node.mode))throw new FS.ErrnoError(31);if(!e.stream_ops.write)throw new FS.ErrnoError(28);e.seekable&&e.flags&1024&&FS.llseek(e,0,2);var c=typeof a<"u";if(!c)a=e.position;else if(!e.seekable)throw new FS.ErrnoError(70);var u=e.stream_ops.write(e,t,r,n,a,l);return c||(e.position+=u),u},allocate(e,t,r){if(FS.isClosed(e))throw new FS.ErrnoError(8);if(t<0||r<=0)throw new FS.ErrnoError(28);if(!(e.flags&2097155))throw new FS.ErrnoError(8);if(!FS.isFile(e.node.mode)&&!FS.isDir(e.node.mode))throw new FS.ErrnoError(43);if(!e.stream_ops.allocate)throw new FS.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap(e,t,r,n,a){if(n&2&&!(a&2)&&(e.flags&2097155)!==2)throw new FS.ErrnoError(2);if((e.flags&2097155)===1)throw new FS.ErrnoError(2);if(!e.stream_ops.mmap)throw new FS.ErrnoError(43);if(!t)throw new FS.ErrnoError(28);return e.stream_ops.mmap(e,t,r,n,a)},msync(e,t,r,n,a){return e.stream_ops.msync?e.stream_ops.msync(e,t,r,n,a):0},ioctl(e,t,r){if(!e.stream_ops.ioctl)throw new FS.ErrnoError(59);return e.stream_ops.ioctl(e,t,r)},readFile(e,t={}){if(t.flags=t.flags||0,t.encoding=t.encoding||"binary",t.encoding!=="utf8"&&t.encoding!=="binary")throw new Error('Invalid encoding type "'.concat(t.encoding,'"'));var r,n=FS.open(e,t.flags),a=FS.stat(e),l=a.size,c=new Uint8Array(l);return FS.read(n,c,0,l,0),t.encoding==="utf8"?r=UTF8ArrayToString(c,0):t.encoding==="binary"&&(r=c),FS.close(n),r},writeFile(e,t,r={}){r.flags=r.flags||577;var n=FS.open(e,r.flags,r.mode);if(typeof t=="string"){var a=new Uint8Array(lengthBytesUTF8(t)+1),l=stringToUTF8Array(t,a,0,a.length);FS.write(n,a,0,l,void 0,r.canOwn)}else if(ArrayBuffer.isView(t))FS.write(n,t,0,t.byteLength,void 0,r.canOwn);else throw new Error("Unsupported data type");FS.close(n)},cwd:()=>FS.currentPath,chdir(e){var t=FS.lookupPath(e,{follow:!0});if(t.node===null)throw new FS.ErrnoError(44);if(!FS.isDir(t.node.mode))throw new FS.ErrnoError(54);var r=FS.nodePermissions(t.node,"x");if(r)throw new FS.ErrnoError(r);FS.currentPath=t.path},createDefaultDirectories(){FS.mkdir("/tmp"),FS.mkdir("/home"),FS.mkdir("/home/web_user")},createDefaultDevices(){FS.mkdir("/dev"),FS.registerDevice(FS.makedev(1,3),{read:()=>0,write:(n,a,l,c,u)=>c}),FS.mkdev("/dev/null",FS.makedev(1,3)),TTY.register(FS.makedev(5,0),TTY.default_tty_ops),TTY.register(FS.makedev(6,0),TTY.default_tty1_ops),FS.mkdev("/dev/tty",FS.makedev(5,0)),FS.mkdev("/dev/tty1",FS.makedev(6,0));var e=new Uint8Array(1024),t=0,r=()=>(t===0&&(t=randomFill(e).byteLength),e[--t]);FS.createDevice("/dev","random",r),FS.createDevice("/dev","urandom",r),FS.mkdir("/dev/shm"),FS.mkdir("/dev/shm/tmp")},createSpecialDirectories(){FS.mkdir("/proc");var e=FS.mkdir("/proc/self");FS.mkdir("/proc/self/fd"),FS.mount({mount(){var t=FS.createNode(e,"fd",16895,73);return t.node_ops={lookup(r,n){var a=+n,l=FS.getStreamChecked(a),c={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>l.path}};return c.parent=c,c}},t}},{},"/proc/self/fd")},createStandardStreams(e,t,r){e?FS.createDevice("/dev","stdin",e):FS.symlink("/dev/tty","/dev/stdin"),t?FS.createDevice("/dev","stdout",null,t):FS.symlink("/dev/tty","/dev/stdout"),r?FS.createDevice("/dev","stderr",null,r):FS.symlink("/dev/tty1","/dev/stderr");var n=FS.open("/dev/stdin",0),a=FS.open("/dev/stdout",1),l=FS.open("/dev/stderr",1)},staticInit(){[44].forEach(e=>{FS.genericErrors[e]=new FS.ErrnoError(e),FS.genericErrors[e].stack=""}),FS.nameTable=new Array(4096),FS.mount(MEMFS,{},"/"),FS.createDefaultDirectories(),FS.createDefaultDevices(),FS.createSpecialDirectories(),FS.filesystems={MEMFS}},init(e,t,r){FS.initialized=!0,e!=null||(e=Module.stdin),t!=null||(t=Module.stdout),r!=null||(r=Module.stderr),FS.createStandardStreams(e,t,r)},quit(){FS.initialized=!1;for(var e=0;ethis.length-1||g<0)){var h=g%this.chunkSize,b=g/this.chunkSize|0;return this.getter(b)[h]}}setDataGetter(g){this.getter=g}cacheLength(){var g=new XMLHttpRequest;if(g.open("HEAD",r,!1),g.send(null),!(g.status>=200&&g.status<300||g.status===304))throw new Error("Couldn't load "+r+". Status: "+g.status);var h=Number(g.getResponseHeader("Content-length")),b,y=(b=g.getResponseHeader("Accept-Ranges"))&&b==="bytes",L=(b=g.getResponseHeader("Content-Encoding"))&&b==="gzip",F=1024*1024;y||(F=h);var I=(S,x)=>{if(S>x)throw new Error("invalid range ("+S+", "+x+") or no bytes requested!");if(x>h-1)throw new Error("only "+h+" bytes available! programmer error!");var E=new XMLHttpRequest;if(E.open("GET",r,!1),h!==F&&E.setRequestHeader("Range","bytes="+S+"-"+x),E.responseType="arraybuffer",E.overrideMimeType&&E.overrideMimeType("text/plain; charset=x-user-defined"),E.send(null),!(E.status>=200&&E.status<300||E.status===304))throw new Error("Couldn't load "+r+". Status: "+E.status);return E.response!==void 0?new Uint8Array(E.response||[]):intArrayFromString(E.responseText||"",!0)},T=this;T.setDataGetter(S=>{var x=S*F,E=(S+1)*F-1;if(E=Math.min(E,h-1),typeof T.chunks[S]>"u"&&(T.chunks[S]=I(x,E)),typeof T.chunks[S]>"u")throw new Error("doXHR failed!");return T.chunks[S]}),(L||!h)&&(F=h=1,h=this.getter(0).length,F=h,out("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=h,this._chunkSize=F,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if(typeof XMLHttpRequest<"u"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var c=new l,u={isDevice:!1,contents:c}}else var u={isDevice:!1,url:r};var _=FS.createFile(e,t,u,n,a);u.contents?_.contents=u.contents:u.url&&(_.contents=null,_.url=u.url),Object.defineProperties(_,{usedBytes:{get:function(){return this.contents.length}}});var d={},f=Object.keys(_.stream_ops);f.forEach(m=>{var g=_.stream_ops[m];d[m]=(...h)=>(FS.forceLoadFile(_),g(...h))});function p(m,g,h,b,y){var L=m.node.contents;if(y>=L.length)return 0;var F=Math.min(L.length-y,b);if(L.slice)for(var I=0;I(FS.forceLoadFile(_),p(m,g,h,b,y)),d.mmap=(m,g,h,b,y)=>{FS.forceLoadFile(_);var L=mmapAlloc(g);if(!L)throw new FS.ErrnoError(48);return p(m,HEAP8,L,g,h),{ptr:L,allocated:!0}},_.stream_ops=d,_}},SYSCALLS={DEFAULT_POLLMASK:5,calculateAt(e,t,r){if(PATH.isAbs(t))return t;var n;if(e===-100)n=FS.cwd();else{var a=SYSCALLS.getStreamFromFD(e);n=a.path}if(t.length==0){if(!r)throw new FS.ErrnoError(44);return n}return PATH.join2(n,t)},doStat(e,t,r){var n=e(t);HEAP32[r>>>2>>>0]=n.dev,HEAP32[r+4>>>2>>>0]=n.mode,HEAPU32[r+8>>>2>>>0]=n.nlink,HEAP32[r+12>>>2>>>0]=n.uid,HEAP32[r+16>>>2>>>0]=n.gid,HEAP32[r+20>>>2>>>0]=n.rdev,tempI64=[n.size>>>0,(tempDouble=n.size,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+24>>>2>>>0]=tempI64[0],HEAP32[r+28>>>2>>>0]=tempI64[1],HEAP32[r+32>>>2>>>0]=4096,HEAP32[r+36>>>2>>>0]=n.blocks;var a=n.atime.getTime(),l=n.mtime.getTime(),c=n.ctime.getTime();return tempI64=[Math.floor(a/1e3)>>>0,(tempDouble=Math.floor(a/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+40>>>2>>>0]=tempI64[0],HEAP32[r+44>>>2>>>0]=tempI64[1],HEAPU32[r+48>>>2>>>0]=a%1e3*1e3*1e3,tempI64=[Math.floor(l/1e3)>>>0,(tempDouble=Math.floor(l/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+56>>>2>>>0]=tempI64[0],HEAP32[r+60>>>2>>>0]=tempI64[1],HEAPU32[r+64>>>2>>>0]=l%1e3*1e3*1e3,tempI64=[Math.floor(c/1e3)>>>0,(tempDouble=Math.floor(c/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+72>>>2>>>0]=tempI64[0],HEAP32[r+76>>>2>>>0]=tempI64[1],HEAPU32[r+80>>>2>>>0]=c%1e3*1e3*1e3,tempI64=[n.ino>>>0,(tempDouble=n.ino,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+88>>>2>>>0]=tempI64[0],HEAP32[r+92>>>2>>>0]=tempI64[1],0},doMsync(e,t,r,n,a){if(!FS.isFile(t.node.mode))throw new FS.ErrnoError(43);if(n&2)return 0;var l=HEAPU8.slice(e,e+r);FS.msync(t,l,a,r,n)},getStreamFromFD(e){var t=FS.getStreamChecked(e);return t},varargs:void 0,getStr(e){var t=UTF8ToString(e);return t}};function ___syscall__newselect(e,t,r,n,a){t>>>=0,r>>>=0,n>>>=0,a>>>=0;try{for(var l=0,c=t?HEAP32[t>>>2>>>0]:0,u=t?HEAP32[t+4>>>2>>>0]:0,_=r?HEAP32[r>>>2>>>0]:0,d=r?HEAP32[r+4>>>2>>>0]:0,f=n?HEAP32[n>>>2>>>0]:0,p=n?HEAP32[n+4>>>2>>>0]:0,m=0,g=0,h=0,b=0,y=0,L=0,F=(t?HEAP32[t>>>2>>>0]:0)|(r?HEAP32[r>>>2>>>0]:0)|(n?HEAP32[n>>>2>>>0]:0),I=(t?HEAP32[t+4>>>2>>>0]:0)|(r?HEAP32[r+4>>>2>>>0]:0)|(n?HEAP32[n+4>>>2>>>0]:0),T=function(D,C,k,X){return D<32?C&X:k&X},S=0;S>>2>>>0]:0,M=t?HEAP32[a+4>>>2>>>0]:0;P=(A+M/1e6)*1e3}w=E.stream_ops.poll(E,P)}w&1&&T(S,c,u,x)&&(S<32?m=m|x:g=g|x,l++),w&4&&T(S,_,d,x)&&(S<32?h=h|x:b=b|x,l++),w&2&&T(S,f,p,x)&&(S<32?y=y|x:L=L|x,l++)}}return t&&(HEAP32[t>>>2>>>0]=m,HEAP32[t+4>>>2>>>0]=g),r&&(HEAP32[r>>>2>>>0]=h,HEAP32[r+4>>>2>>>0]=b),n&&(HEAP32[n>>>2>>>0]=y,HEAP32[n+4>>>2>>>0]=L),l}catch(D){if(typeof FS>"u"||D.name!=="ErrnoError")throw D;return-D.errno}}___syscall__newselect.sig="iipppp";var SOCKFS={mount(e){return Module.websocket=Module.websocket&&typeof Module.websocket=="object"?Module.websocket:{},Module.websocket._callbacks={},Module.websocket.on=function(t,r){return typeof r=="function"&&(this._callbacks[t]=r),this},Module.websocket.emit=function(t,r){typeof this._callbacks[t]=="function"&&this._callbacks[t].call(this,r)},FS.createNode(null,"/",16895,0)},createSocket(e,t,r){t&=-526337;var n=t==1;if(n&&r&&r!=6)throw new FS.ErrnoError(66);var a={family:e,type:t,protocol:r,server:null,error:null,peers:{},pending:[],recv_queue:[],sock_ops:SOCKFS.websocket_sock_ops},l=SOCKFS.nextname(),c=FS.createNode(SOCKFS.root,l,49152,0);c.sock=a;var u=FS.createStream({path:l,node:c,flags:2,seekable:!1,stream_ops:SOCKFS.stream_ops});return a.stream=u,a},getSocket(e){var t=FS.getStream(e);return!t||!FS.isSocket(t.node.mode)?null:t.node.sock},stream_ops:{poll(e){var t=e.node.sock;return t.sock_ops.poll(t)},ioctl(e,t,r){var n=e.node.sock;return n.sock_ops.ioctl(n,t,r)},read(e,t,r,n,a){var l=e.node.sock,c=l.sock_ops.recvmsg(l,n);return c?(t.set(c.buffer,r),c.buffer.length):0},write(e,t,r,n,a){var l=e.node.sock;return l.sock_ops.sendmsg(l,t,r,n)},close(e){var t=e.node.sock;t.sock_ops.close(t)}},nextname(){return SOCKFS.nextname.current||(SOCKFS.nextname.current=0),"socket["+SOCKFS.nextname.current+++"]"},websocket_sock_ops:{createPeer(e,t,r){var n;if(typeof t=="object"&&(n=t,t=null,r=null),n)if(n._socket)t=n._socket.remoteAddress,r=n._socket.remotePort;else{var a=/ws[s]?:\/\/([^:]+):(\d+)/.exec(n.url);if(!a)throw new Error("WebSocket URL must be in the format ws(s)://address:port");t=a[1],r=parseInt(a[2],10)}else try{var l=Module.websocket&&typeof Module.websocket=="object",c="ws:#".replace("#","//");if(l&&typeof Module.websocket.url=="string"&&(c=Module.websocket.url),c==="ws://"||c==="wss://"){var u=t.split("/");c=c+u[0]+":"+r+"/"+u.slice(1).join("/")}var _="binary";l&&typeof Module.websocket.subprotocol=="string"&&(_=Module.websocket.subprotocol);var d=void 0;_!=="null"&&(_=_.replace(/^ +| +$/g,"").split(/ *, */),d=_),l&&Module.websocket.subprotocol===null&&(_="null",d=void 0);var f;ENVIRONMENT_IS_NODE?f=Eo():f=WebSocket,n=new f(c,d),n.binaryType="arraybuffer"}catch(m){throw new FS.ErrnoError(23)}var p={addr:t,port:r,socket:n,dgram_send_queue:[]};return SOCKFS.websocket_sock_ops.addPeer(e,p),SOCKFS.websocket_sock_ops.handlePeerEvents(e,p),e.type===2&&typeof e.sport<"u"&&p.dgram_send_queue.push(new Uint8Array([255,255,255,255,112,111,114,116,(e.sport&65280)>>8,e.sport&255])),p},getPeer(e,t,r){return e.peers[t+":"+r]},addPeer(e,t){e.peers[t.addr+":"+t.port]=t},removePeer(e,t){delete e.peers[t.addr+":"+t.port]},handlePeerEvents(e,t){var r=!0,n=function(){Module.websocket.emit("open",e.stream.fd);try{for(var l=t.dgram_send_queue.shift();l;)t.socket.send(l),l=t.dgram_send_queue.shift()}catch(c){t.socket.close()}};function a(l){if(typeof l=="string"){var c=new TextEncoder;l=c.encode(l)}else{if(assert(l.byteLength!==void 0),l.byteLength==0)return;l=new Uint8Array(l)}var u=r;if(r=!1,u&&l.length===10&&l[0]===255&&l[1]===255&&l[2]===255&&l[3]===255&&l[4]===112&&l[5]===111&&l[6]===114&&l[7]===116){var _=l[8]<<8|l[9];SOCKFS.websocket_sock_ops.removePeer(e,t),t.port=_,SOCKFS.websocket_sock_ops.addPeer(e,t);return}e.recv_queue.push({addr:t.addr,port:t.port,data:l}),Module.websocket.emit("message",e.stream.fd)}ENVIRONMENT_IS_NODE?(t.socket.on("open",n),t.socket.on("message",function(l,c){c&&a(new Uint8Array(l).buffer)}),t.socket.on("close",function(){Module.websocket.emit("close",e.stream.fd)}),t.socket.on("error",function(l){e.error=14,Module.websocket.emit("error",[e.stream.fd,e.error,"ECONNREFUSED: Connection refused"])})):(t.socket.onopen=n,t.socket.onclose=function(){Module.websocket.emit("close",e.stream.fd)},t.socket.onmessage=function(c){a(c.data)},t.socket.onerror=function(l){e.error=14,Module.websocket.emit("error",[e.stream.fd,e.error,"ECONNREFUSED: Connection refused"])})},poll(e){if(e.type===1&&e.server)return e.pending.length?65:0;var t=0,r=e.type===1?SOCKFS.websocket_sock_ops.getPeer(e,e.daddr,e.dport):null;return(e.recv_queue.length||!r||r&&r.socket.readyState===r.socket.CLOSING||r&&r.socket.readyState===r.socket.CLOSED)&&(t|=65),(!r||r&&r.socket.readyState===r.socket.OPEN)&&(t|=4),(r&&r.socket.readyState===r.socket.CLOSING||r&&r.socket.readyState===r.socket.CLOSED)&&(t|=16),t},ioctl(e,t,r){switch(t){case 21531:var n=0;return e.recv_queue.length&&(n=e.recv_queue[0].data.length),HEAP32[r>>>2>>>0]=n,0;default:return 28}},close(e){if(e.server){try{e.server.close()}catch(a){}e.server=null}for(var t=Object.keys(e.peers),r=0;r{var t=SOCKFS.getSocket(e);if(!t)throw new FS.ErrnoError(8);return t},Sockets={BUFFER_SIZE:10240,MAX_BUFFER_SIZE:10485760,nextFd:1,fds:{},nextport:1,maxport:65535,peer:null,connections:{},portmap:{},localAddr:4261412874,addrPool:[33554442,50331658,67108874,83886090,100663306,117440522,134217738,150994954,167772170,184549386,201326602,218103818,234881034]},inetPton4=e=>{for(var t=e.split("."),r=0;r<4;r++){var n=Number(t[r]);if(isNaN(n))return null;t[r]=n}return(t[0]|t[1]<<8|t[2]<<16|t[3]<<24)>>>0},jstoi_q=e=>parseInt(e),inetPton6=e=>{var t,r,n,a,l,c=/^((?=.*::)(?!.*::.+::)(::)?([\dA-F]{1,4}:(:|\b)|){5}|([\dA-F]{1,4}:){6})((([\dA-F]{1,4}((?!\3)::|:\b|$))|(?!\2\3)){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4})$/i,u=[];if(!c.test(e))return null;if(e==="::")return[0,0,0,0,0,0,0,0];for(e.startsWith("::")?e=e.replace("::","Z:"):e=e.replace("::",":Z:"),e.indexOf(".")>0?(e=e.replace(new RegExp("[.]","g"),":"),t=e.split(":"),t[t.length-4]=jstoi_q(t[t.length-4])+jstoi_q(t[t.length-3])*256,t[t.length-3]=jstoi_q(t[t.length-2])+jstoi_q(t[t.length-1])*256,t=t.slice(0,t.length-2)):t=e.split(":"),n=0,a=0,r=0;r{switch(t){case 2:r=inetPton4(r),zeroMemory(e,16),a&&(HEAP32[a>>>2>>>0]=16),HEAP16[e>>>1>>>0]=t,HEAP32[e+4>>>2>>>0]=r,HEAP16[e+2>>>1>>>0]=_htons(n);break;case 10:r=inetPton6(r),zeroMemory(e,28),a&&(HEAP32[a>>>2>>>0]=28),HEAP32[e>>>2>>>0]=t,HEAP32[e+8>>>2>>>0]=r[0],HEAP32[e+12>>>2>>>0]=r[1],HEAP32[e+16>>>2>>>0]=r[2],HEAP32[e+20>>>2>>>0]=r[3],HEAP16[e+2>>>1>>>0]=_htons(n);break;default:return 5}return 0},DNS={address_map:{id:1,addrs:{},names:{}},lookup_name(e){var t=inetPton4(e);if(t!==null||(t=inetPton6(e),t!==null))return e;var r;if(DNS.address_map.addrs[e])r=DNS.address_map.addrs[e];else{var n=DNS.address_map.id++;assert(n<65535,"exceeded max address mappings of 65535"),r="172.29."+(n&255)+"."+(n&65280),DNS.address_map.names[r]=e,DNS.address_map.addrs[e]=r}return r},lookup_addr(e){return DNS.address_map.names[e]?DNS.address_map.names[e]:null}};function ___syscall_accept4(e,t,r,n,a,l){t>>>=0,r>>>=0;try{var c=getSocketFromFD(e),u=c.sock_ops.accept(c);if(t)var _=writeSockaddr(t,u.family,DNS.lookup_name(u.daddr),u.dport,r);return u.stream.fd}catch(d){if(typeof FS>"u"||d.name!=="ErrnoError")throw d;return-d.errno}}___syscall_accept4.sig="iippiii";var inetNtop4=e=>(e&255)+"."+(e>>8&255)+"."+(e>>16&255)+"."+(e>>24&255),inetNtop6=e=>{var t="",r=0,n=0,a=0,l=0,c=0,u=0,_=[e[0]&65535,e[0]>>16,e[1]&65535,e[1]>>16,e[2]&65535,e[2]>>16,e[3]&65535,e[3]>>16],d=!0,f="";for(u=0;u<5;u++)if(_[u]!==0){d=!1;break}if(d){if(f=inetNtop4(_[6]|_[7]<<16),_[5]===-1)return t="::ffff:",t+=f,t;if(_[5]===0)return t="::",f==="0.0.0.0"&&(f=""),f==="0.0.0.1"&&(f="1"),t+=f,t}for(r=0;r<8;r++)_[r]===0&&(r-a>1&&(c=0),a=r,c++),c>n&&(n=c,l=r-n+1);for(r=0;r<8;r++){if(n>1&&_[r]===0&&r>=l&&r{var r=HEAP16[e>>>1>>>0],n=_ntohs(HEAPU16[e+2>>>1>>>0]),a;switch(r){case 2:if(t!==16)return{errno:28};a=HEAP32[e+4>>>2>>>0],a=inetNtop4(a);break;case 10:if(t!==28)return{errno:28};a=[HEAP32[e+8>>>2>>>0],HEAP32[e+12>>>2>>>0],HEAP32[e+16>>>2>>>0],HEAP32[e+20>>>2>>>0]],a=inetNtop6(a);break;default:return{errno:5}}return{family:r,addr:a,port:n}},getSocketAddress=(e,t)=>{var r=readSockaddr(e,t);if(r.errno)throw new FS.ErrnoError(r.errno);return r.addr=DNS.lookup_addr(r.addr)||r.addr,r};function ___syscall_bind(e,t,r,n,a,l){t>>>=0,r>>>=0;try{var c=getSocketFromFD(e),u=getSocketAddress(t,r);return c.sock_ops.bind(c,u.addr,u.port),0}catch(_){if(typeof FS>"u"||_.name!=="ErrnoError")throw _;return-_.errno}}___syscall_bind.sig="iippiii";function ___syscall_chdir(e){e>>>=0;try{return e=SYSCALLS.getStr(e),FS.chdir(e),0}catch(t){if(typeof FS>"u"||t.name!=="ErrnoError")throw t;return-t.errno}}___syscall_chdir.sig="ip";function ___syscall_chmod(e,t){e>>>=0;try{return e=SYSCALLS.getStr(e),FS.chmod(e,t),0}catch(r){if(typeof FS>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}___syscall_chmod.sig="ipi";function ___syscall_connect(e,t,r,n,a,l){t>>>=0,r>>>=0;try{var c=getSocketFromFD(e),u=getSocketAddress(t,r);return c.sock_ops.connect(c,u.addr,u.port),0}catch(_){if(typeof FS>"u"||_.name!=="ErrnoError")throw _;return-_.errno}}___syscall_connect.sig="iippiii";function ___syscall_dup(e){try{var t=SYSCALLS.getStreamFromFD(e);return FS.dupStream(t).fd}catch(r){if(typeof FS>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}___syscall_dup.sig="ii";function ___syscall_dup3(e,t,r){try{var n=SYSCALLS.getStreamFromFD(e);if(n.fd===t)return-28;if(t<0||t>=FS.MAX_OPEN_FDS)return-8;var a=FS.getStream(t);return a&&FS.close(a),FS.dupStream(n,t).fd}catch(l){if(typeof FS>"u"||l.name!=="ErrnoError")throw l;return-l.errno}}___syscall_dup3.sig="iiii";function ___syscall_faccessat(e,t,r,n){t>>>=0;try{if(t=SYSCALLS.getStr(t),t=SYSCALLS.calculateAt(e,t),r&-8)return-28;var a=FS.lookupPath(t,{follow:!0}),l=a.node;if(!l)return-44;var c="";return r&4&&(c+="r"),r&2&&(c+="w"),r&1&&(c+="x"),c&&FS.nodePermissions(l,c)?-2:0}catch(u){if(typeof FS>"u"||u.name!=="ErrnoError")throw u;return-u.errno}}___syscall_faccessat.sig="iipii";var ___syscall_fadvise64=(e,t,r,n)=>0;___syscall_fadvise64.sig="iiiiiii";function ___syscall_fallocate(e,t,r,n,a,l){var c=convertI32PairToI53Checked(r,n),u=convertI32PairToI53Checked(a,l);try{if(isNaN(c))return 61;var _=SYSCALLS.getStreamFromFD(e);return FS.allocate(_,c,u),0}catch(d){if(typeof FS>"u"||d.name!=="ErrnoError")throw d;return-d.errno}}___syscall_fallocate.sig="iiiiiii";function ___syscall_fchdir(e){try{var t=SYSCALLS.getStreamFromFD(e);return FS.chdir(t.path),0}catch(r){if(typeof FS>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}___syscall_fchdir.sig="ii";function ___syscall_fchmod(e,t){try{return FS.fchmod(e,t),0}catch(r){if(typeof FS>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}___syscall_fchmod.sig="iii";function ___syscall_fchmodat2(e,t,r,n){t>>>=0;try{var a=n&256;return t=SYSCALLS.getStr(t),t=SYSCALLS.calculateAt(e,t),FS.chmod(t,r,a),0}catch(l){if(typeof FS>"u"||l.name!=="ErrnoError")throw l;return-l.errno}}___syscall_fchmodat2.sig="iipii";function ___syscall_fchown32(e,t,r){try{return FS.fchown(e,t,r),0}catch(n){if(typeof FS>"u"||n.name!=="ErrnoError")throw n;return-n.errno}}___syscall_fchown32.sig="iiii";function ___syscall_fchownat(e,t,r,n,a){t>>>=0;try{t=SYSCALLS.getStr(t);var l=a&256;return a=a&-257,t=SYSCALLS.calculateAt(e,t),(l?FS.lchown:FS.chown)(t,r,n),0}catch(c){if(typeof FS>"u"||c.name!=="ErrnoError")throw c;return-c.errno}}___syscall_fchownat.sig="iipiii";function syscallGetVarargI(){var e=HEAP32[+SYSCALLS.varargs>>>2>>>0];return SYSCALLS.varargs+=4,e}var syscallGetVarargP=syscallGetVarargI;function ___syscall_fcntl64(e,t,r){r>>>=0,SYSCALLS.varargs=r;try{var n=SYSCALLS.getStreamFromFD(e);switch(t){case 0:{var a=syscallGetVarargI();if(a<0)return-28;for(;FS.streams[a];)a++;var l;return l=FS.dupStream(n,a),l.fd}case 1:case 2:return 0;case 3:return n.flags;case 4:{var a=syscallGetVarargI();return n.flags|=a,0}case 12:{var a=syscallGetVarargP(),c=0;return HEAP16[a+c>>>1>>>0]=2,0}case 13:case 14:return 0}return-28}catch(u){if(typeof FS>"u"||u.name!=="ErrnoError")throw u;return-u.errno}}___syscall_fcntl64.sig="iiip";function ___syscall_fdatasync(e){try{var t=SYSCALLS.getStreamFromFD(e);return 0}catch(r){if(typeof FS>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}___syscall_fdatasync.sig="ii";function ___syscall_fstat64(e,t){t>>>=0;try{var r=SYSCALLS.getStreamFromFD(e);return SYSCALLS.doStat(FS.stat,r.path,t)}catch(n){if(typeof FS>"u"||n.name!=="ErrnoError")throw n;return-n.errno}}___syscall_fstat64.sig="iip";function ___syscall_statfs64(e,t,r){e>>>=0,t>>>=0,r>>>=0;try{return e=SYSCALLS.getStr(e),HEAP32[r+4>>>2>>>0]=4096,HEAP32[r+40>>>2>>>0]=4096,HEAP32[r+8>>>2>>>0]=1e6,HEAP32[r+12>>>2>>>0]=5e5,HEAP32[r+16>>>2>>>0]=5e5,HEAP32[r+20>>>2>>>0]=FS.nextInode,HEAP32[r+24>>>2>>>0]=1e6,HEAP32[r+28>>>2>>>0]=42,HEAP32[r+44>>>2>>>0]=2,HEAP32[r+36>>>2>>>0]=255,0}catch(n){if(typeof FS>"u"||n.name!=="ErrnoError")throw n;return-n.errno}}___syscall_statfs64.sig="ippp";function ___syscall_fstatfs64(e,t,r){t>>>=0,r>>>=0;try{var n=SYSCALLS.getStreamFromFD(e);return ___syscall_statfs64(0,t,r)}catch(a){if(typeof FS>"u"||a.name!=="ErrnoError")throw a;return-a.errno}}___syscall_fstatfs64.sig="iipp";function ___syscall_ftruncate64(e,t,r){var n=convertI32PairToI53Checked(t,r);try{return isNaN(n)?61:(FS.ftruncate(e,n),0)}catch(a){if(typeof FS>"u"||a.name!=="ErrnoError")throw a;return-a.errno}}___syscall_ftruncate64.sig="iiii";var stringToUTF8=(e,t,r)=>stringToUTF8Array(e,HEAPU8,t,r);function ___syscall_getcwd(e,t){e>>>=0,t>>>=0;try{if(t===0)return-28;var r=FS.cwd(),n=lengthBytesUTF8(r)+1;return t"u"||a.name!=="ErrnoError")throw a;return-a.errno}}___syscall_getcwd.sig="ipp";function ___syscall_getdents64(e,t,r){t>>>=0,r>>>=0;try{var n=SYSCALLS.getStreamFromFD(e);n.getdents||(n.getdents=FS.readdir(n.path));for(var a=280,l=0,c=FS.llseek(n,0,1),u=Math.floor(c/a);u>>0,(tempDouble=_,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[t+l>>>2>>>0]=tempI64[0],HEAP32[t+l+4>>>2>>>0]=tempI64[1],tempI64=[(u+1)*a>>>0,(tempDouble=(u+1)*a,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[t+l+8>>>2>>>0]=tempI64[0],HEAP32[t+l+12>>>2>>>0]=tempI64[1],HEAP16[t+l+16>>>1>>>0]=280,HEAP8[t+l+18>>>0]=d,stringToUTF8(f,t+l+19,256),l+=a,u+=1}return FS.llseek(n,u*a,0),l}catch(g){if(typeof FS>"u"||g.name!=="ErrnoError")throw g;return-g.errno}}___syscall_getdents64.sig="iipp";function ___syscall_getpeername(e,t,r,n,a,l){t>>>=0,r>>>=0;try{var c=getSocketFromFD(e);if(!c.daddr)return-53;var u=writeSockaddr(t,c.family,DNS.lookup_name(c.daddr),c.dport,r);return 0}catch(_){if(typeof FS>"u"||_.name!=="ErrnoError")throw _;return-_.errno}}___syscall_getpeername.sig="iippiii";function ___syscall_getsockname(e,t,r,n,a,l){t>>>=0,r>>>=0;try{var c=getSocketFromFD(e),u=writeSockaddr(t,c.family,DNS.lookup_name(c.saddr||"0.0.0.0"),c.sport,r);return 0}catch(_){if(typeof FS>"u"||_.name!=="ErrnoError")throw _;return-_.errno}}___syscall_getsockname.sig="iippiii";function ___syscall_getsockopt(e,t,r,n,a,l){n>>>=0,a>>>=0;try{var c=getSocketFromFD(e);return t===1&&r===4?(HEAP32[n>>>2>>>0]=c.error,HEAP32[a>>>2>>>0]=4,c.error=null,0):-50}catch(u){if(typeof FS>"u"||u.name!=="ErrnoError")throw u;return-u.errno}}___syscall_getsockopt.sig="iiiippi";function ___syscall_ioctl(e,t,r){r>>>=0,SYSCALLS.varargs=r;try{var n=SYSCALLS.getStreamFromFD(e);switch(t){case 21509:return n.tty?0:-59;case 21505:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var a=n.tty.ops.ioctl_tcgets(n),l=syscallGetVarargP();HEAP32[l>>>2>>>0]=a.c_iflag||0,HEAP32[l+4>>>2>>>0]=a.c_oflag||0,HEAP32[l+8>>>2>>>0]=a.c_cflag||0,HEAP32[l+12>>>2>>>0]=a.c_lflag||0;for(var c=0;c<32;c++)HEAP8[l+c+17>>>0]=a.c_cc[c]||0;return 0}return 0}case 21510:case 21511:case 21512:return n.tty?0:-59;case 21506:case 21507:case 21508:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){for(var l=syscallGetVarargP(),u=HEAP32[l>>>2>>>0],_=HEAP32[l+4>>>2>>>0],d=HEAP32[l+8>>>2>>>0],f=HEAP32[l+12>>>2>>>0],p=[],c=0;c<32;c++)p.push(HEAP8[l+c+17>>>0]);return n.tty.ops.ioctl_tcsets(n.tty,t,{c_iflag:u,c_oflag:_,c_cflag:d,c_lflag:f,c_cc:p})}return 0}case 21519:{if(!n.tty)return-59;var l=syscallGetVarargP();return HEAP32[l>>>2>>>0]=0,0}case 21520:return n.tty?-28:-59;case 21531:{var l=syscallGetVarargP();return FS.ioctl(n,t,l)}case 21523:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var m=n.tty.ops.ioctl_tiocgwinsz(n.tty),l=syscallGetVarargP();HEAP16[l>>>1>>>0]=m[0],HEAP16[l+2>>>1>>>0]=m[1]}return 0}case 21524:return n.tty?0:-59;case 21515:return n.tty?0:-59;default:return-28}}catch(g){if(typeof FS>"u"||g.name!=="ErrnoError")throw g;return-g.errno}}___syscall_ioctl.sig="iiip";function ___syscall_listen(e,t){try{var r=getSocketFromFD(e);return r.sock_ops.listen(r,t),0}catch(n){if(typeof FS>"u"||n.name!=="ErrnoError")throw n;return-n.errno}}___syscall_listen.sig="iiiiiii";function ___syscall_lstat64(e,t){e>>>=0,t>>>=0;try{return e=SYSCALLS.getStr(e),SYSCALLS.doStat(FS.lstat,e,t)}catch(r){if(typeof FS>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}___syscall_lstat64.sig="ipp";function ___syscall_mkdirat(e,t,r){t>>>=0;try{return t=SYSCALLS.getStr(t),t=SYSCALLS.calculateAt(e,t),t=PATH.normalize(t),t[t.length-1]==="/"&&(t=t.substr(0,t.length-1)),FS.mkdir(t,r,0),0}catch(n){if(typeof FS>"u"||n.name!=="ErrnoError")throw n;return-n.errno}}___syscall_mkdirat.sig="iipi";function ___syscall_mknodat(e,t,r,n){t>>>=0;try{switch(t=SYSCALLS.getStr(t),t=SYSCALLS.calculateAt(e,t),r&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return FS.mknod(t,r,n),0}catch(a){if(typeof FS>"u"||a.name!=="ErrnoError")throw a;return-a.errno}}___syscall_mknodat.sig="iipii";function ___syscall_newfstatat(e,t,r,n){t>>>=0,r>>>=0;try{t=SYSCALLS.getStr(t);var a=n&256,l=n&4096;return n=n&-6401,t=SYSCALLS.calculateAt(e,t,l),SYSCALLS.doStat(a?FS.lstat:FS.stat,t,r)}catch(c){if(typeof FS>"u"||c.name!=="ErrnoError")throw c;return-c.errno}}___syscall_newfstatat.sig="iippi";function ___syscall_openat(e,t,r,n){t>>>=0,n>>>=0,SYSCALLS.varargs=n;try{t=SYSCALLS.getStr(t),t=SYSCALLS.calculateAt(e,t);var a=n?syscallGetVarargI():0;return FS.open(t,r,a).fd}catch(l){if(typeof FS>"u"||l.name!=="ErrnoError")throw l;return-l.errno}}___syscall_openat.sig="iipip";var PIPEFS={BUCKET_BUFFER_SIZE:8192,mount(e){return FS.createNode(null,"/",16895,0)},createPipe(){var e={buckets:[],refcnt:2};e.buckets.push({buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:0,roffset:0});var t=PIPEFS.nextname(),r=PIPEFS.nextname(),n=FS.createNode(PIPEFS.root,t,4096,0),a=FS.createNode(PIPEFS.root,r,4096,0);n.pipe=e,a.pipe=e;var l=FS.createStream({path:t,node:n,flags:0,seekable:!1,stream_ops:PIPEFS.stream_ops});n.stream=l;var c=FS.createStream({path:r,node:a,flags:1,seekable:!1,stream_ops:PIPEFS.stream_ops});return a.stream=c,{readable_fd:l.fd,writable_fd:c.fd}},stream_ops:{poll(e){var t=e.node.pipe;if((e.flags&2097155)===1)return 260;if(t.buckets.length>0)for(var r=0;r0)return 65}return 0},ioctl(e,t,r){return 28},fsync(e){return 28},read(e,t,r,n,a){for(var l=e.node.pipe,c=0,u=0;u=u)return _.buffer.set(c,_.offset),_.offset+=u,u;d>0&&(_.buffer.set(c.subarray(0,d),_.offset),_.offset+=d,c=c.subarray(d,c.byteLength));for(var f=c.byteLength/PIPEFS.BUCKET_BUFFER_SIZE|0,p=c.byteLength%PIPEFS.BUCKET_BUFFER_SIZE,m=0;m0){var g={buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:c.byteLength,roffset:0};l.buckets.push(g),g.buffer.set(c)}return u},close(e){var t=e.node.pipe;t.refcnt--,t.refcnt===0&&(t.buckets=null)}},nextname(){return PIPEFS.nextname.current||(PIPEFS.nextname.current=0),"pipe["+PIPEFS.nextname.current+++"]"}};function ___syscall_pipe(e){e>>>=0;try{if(e==0)throw new FS.ErrnoError(21);var t=PIPEFS.createPipe();return HEAP32[e>>>2>>>0]=t.readable_fd,HEAP32[e+4>>>2>>>0]=t.writable_fd,0}catch(r){if(typeof FS>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}___syscall_pipe.sig="ip";function ___syscall_poll(e,t,r){e>>>=0;try{for(var n=0,a=0;a>>2>>>0],u=HEAP16[l+4>>>1>>>0],_=32,d=FS.getStream(c);d&&(_=SYSCALLS.DEFAULT_POLLMASK,d.stream_ops.poll&&(_=d.stream_ops.poll(d,-1))),_&=u|8|16,_&&n++,HEAP16[l+6>>>1>>>0]=_}return n}catch(f){if(typeof FS>"u"||f.name!=="ErrnoError")throw f;return-f.errno}}___syscall_poll.sig="ipii";function ___syscall_readlinkat(e,t,r,n){t>>>=0,r>>>=0,n>>>=0;try{if(t=SYSCALLS.getStr(t),t=SYSCALLS.calculateAt(e,t),n<=0)return-28;var a=FS.readlink(t),l=Math.min(n,lengthBytesUTF8(a)),c=HEAP8[r+l>>>0];return stringToUTF8(a,r,n+1),HEAP8[r+l>>>0]=c,l}catch(u){if(typeof FS>"u"||u.name!=="ErrnoError")throw u;return-u.errno}}___syscall_readlinkat.sig="iippp";function ___syscall_recvfrom(e,t,r,n,a,l){t>>>=0,r>>>=0,a>>>=0,l>>>=0;try{var c=getSocketFromFD(e),u=c.sock_ops.recvmsg(c,r);if(!u)return 0;if(a)var _=writeSockaddr(a,c.family,DNS.lookup_name(u.addr),u.port,l);return HEAPU8.set(u.buffer,t>>>0),u.buffer.byteLength}catch(d){if(typeof FS>"u"||d.name!=="ErrnoError")throw d;return-d.errno}}___syscall_recvfrom.sig="iippipp";function ___syscall_recvmsg(e,t,r,n,a,l){t>>>=0;try{for(var c=getSocketFromFD(e),u=HEAPU32[t+8>>>2>>>0],_=HEAP32[t+12>>>2>>>0],d=0,f=0;f<_;f++)d+=HEAP32[u+(8*f+4)>>>2>>>0];var p=c.sock_ops.recvmsg(c,d);if(!p)return 0;var m=HEAPU32[t>>>2>>>0];if(m)var g=writeSockaddr(m,c.family,DNS.lookup_name(p.addr),p.port);for(var h=0,b=p.buffer.byteLength,f=0;b>0&&f<_;f++){var y=HEAPU32[u+(8*f+0)>>>2>>>0],L=HEAP32[u+(8*f+4)>>>2>>>0];if(L){var F=Math.min(L,b),I=p.buffer.subarray(h,h+F);HEAPU8.set(I,y+h>>>0),h+=F,b-=F}}return h}catch(T){if(typeof FS>"u"||T.name!=="ErrnoError")throw T;return-T.errno}}___syscall_recvmsg.sig="iipiiii";function ___syscall_renameat(e,t,r,n){t>>>=0,n>>>=0;try{return t=SYSCALLS.getStr(t),n=SYSCALLS.getStr(n),t=SYSCALLS.calculateAt(e,t),n=SYSCALLS.calculateAt(r,n),FS.rename(t,n),0}catch(a){if(typeof FS>"u"||a.name!=="ErrnoError")throw a;return-a.errno}}___syscall_renameat.sig="iipip";function ___syscall_rmdir(e){e>>>=0;try{return e=SYSCALLS.getStr(e),FS.rmdir(e),0}catch(t){if(typeof FS>"u"||t.name!=="ErrnoError")throw t;return-t.errno}}___syscall_rmdir.sig="ip";function ___syscall_sendmsg(e,t,r,n,a,l){t>>>=0,n>>>=0,a>>>=0;try{var c=getSocketFromFD(e),u=HEAPU32[t+8>>>2>>>0],_=HEAP32[t+12>>>2>>>0],d,f,p=HEAPU32[t>>>2>>>0],m=HEAP32[t+4>>>2>>>0];if(p){var g=readSockaddr(p,m);if(g.errno)return-g.errno;f=g.port,d=DNS.lookup_addr(g.addr)||g.addr}for(var h=0,b=0;b<_;b++)h+=HEAP32[u+(8*b+4)>>>2>>>0];for(var y=new Uint8Array(h),L=0,b=0;b<_;b++)for(var F=HEAPU32[u+(8*b+0)>>>2>>>0],I=HEAP32[u+(8*b+4)>>>2>>>0],T=0;T>>0];return c.sock_ops.sendmsg(c,y,0,h,d,f)}catch(S){if(typeof FS>"u"||S.name!=="ErrnoError")throw S;return-S.errno}}___syscall_sendmsg.sig="iipippi";function ___syscall_sendto(e,t,r,n,a,l){t>>>=0,r>>>=0,a>>>=0,l>>>=0;try{var c=getSocketFromFD(e);if(!a)return FS.write(c.stream,HEAP8,t,r);var u=getSocketAddress(a,l);return c.sock_ops.sendmsg(c,HEAP8,t,r,u.addr,u.port)}catch(_){if(typeof FS>"u"||_.name!=="ErrnoError")throw _;return-_.errno}}___syscall_sendto.sig="iippipp";function ___syscall_socket(e,t,r){try{var n=SOCKFS.createSocket(e,t,r);return n.stream.fd}catch(a){if(typeof FS>"u"||a.name!=="ErrnoError")throw a;return-a.errno}}___syscall_socket.sig="iiiiiii";function ___syscall_stat64(e,t){e>>>=0,t>>>=0;try{return e=SYSCALLS.getStr(e),SYSCALLS.doStat(FS.stat,e,t)}catch(r){if(typeof FS>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}___syscall_stat64.sig="ipp";function ___syscall_symlink(e,t){e>>>=0,t>>>=0;try{return e=SYSCALLS.getStr(e),t=SYSCALLS.getStr(t),FS.symlink(e,t),0}catch(r){if(typeof FS>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}___syscall_symlink.sig="ipp";function ___syscall_symlinkat(e,t,r){e>>>=0,r>>>=0;try{return r=SYSCALLS.calculateAt(t,r),FS.symlink(e,r),0}catch(n){if(typeof FS>"u"||n.name!=="ErrnoError")throw n;return-n.errno}}___syscall_symlinkat.sig="ipip";function ___syscall_truncate64(e,t,r){e>>>=0;var n=convertI32PairToI53Checked(t,r);try{return isNaN(n)?61:(e=SYSCALLS.getStr(e),FS.truncate(e,n),0)}catch(a){if(typeof FS>"u"||a.name!=="ErrnoError")throw a;return-a.errno}}___syscall_truncate64.sig="ipii";function ___syscall_unlinkat(e,t,r){t>>>=0;try{return t=SYSCALLS.getStr(t),t=SYSCALLS.calculateAt(e,t),r===0?FS.unlink(t):r===512?FS.rmdir(t):abort("Invalid flags passed to unlinkat"),0}catch(n){if(typeof FS>"u"||n.name!=="ErrnoError")throw n;return-n.errno}}___syscall_unlinkat.sig="iipi";var readI53FromI64=e=>HEAPU32[e>>>2>>>0]+HEAP32[e+4>>>2>>>0]*4294967296;function ___syscall_utimensat(e,t,r,n){t>>>=0,r>>>=0;try{t=SYSCALLS.getStr(t),t=SYSCALLS.calculateAt(e,t,!0);var a=Date.now(),l,c;if(!r)l=a,c=a;else{var u=readI53FromI64(r),_=HEAP32[r+8>>>2>>>0];_==1073741823?l=a:_==1073741822?l=-1:l=u*1e3+_/1e6,r+=16,u=readI53FromI64(r),_=HEAP32[r+8>>>2>>>0],_==1073741823?c=a:_==1073741822?c=-1:c=u*1e3+_/1e6}return(c!=-1||l!=-1)&&FS.utime(t,l,c),0}catch(d){if(typeof FS>"u"||d.name!=="ErrnoError")throw d;return-d.errno}}___syscall_utimensat.sig="iippi";var ___table_base=new WebAssembly.Global({value:"i32",mutable:!1},1),__abort_js=()=>{abort("")};__abort_js.sig="v";var ENV={},stackAlloc=e=>__emscripten_stack_alloc(e),stringToUTF8OnStack=e=>{var t=lengthBytesUTF8(e)+1,r=stackAlloc(t);return stringToUTF8(e,r,t),r},stackSave=()=>_emscripten_stack_get_current(),stackRestore=e=>__emscripten_stack_restore(e),dlSetError=e=>{var t=stackSave(),r=stringToUTF8OnStack(e);___dl_seterr(r,0),stackRestore(t)},dlopenInternal=(e,t)=>{var r=UTF8ToString(e+36),n=HEAP32[e+4>>>2>>>0];r=PATH.normalize(r);var a=[],l=!!(n&256),c=l?null:{},u={global:l,nodelete:!!(n&4096),loadAsync:t.loadAsync};if(t.loadAsync)return loadDynamicLibrary(r,u,c,e);try{return loadDynamicLibrary(r,u,c,e)}catch(_){return dlSetError("Could not load dynamic lib: ".concat(r,"\n").concat(_)),0}};function __dlopen_js(e){return e>>>=0,dlopenInternal(e,{loadAsync:!1})}__dlopen_js.sig="pp";function __dlsym_js(e,t,r){e>>>=0,t>>>=0,r>>>=0,t=UTF8ToString(t);var n,a,l=LDSO.loadedLibsByHandle[e];if(!l.exports.hasOwnProperty(t)||l.exports[t].stub)return dlSetError('Tried to lookup unknown symbol "'.concat(t,'" in dynamic lib: ').concat(l.name)),0;a=Object.keys(l.exports).indexOf(t);var c="orig$"+t;if(n=l.exports[c],n?a=Object.keys(l.exports).indexOf(c):n=l.exports[t],typeof n=="function"){var u=getFunctionAddress(n);u?n=u:(n=addFunction(n,n.sig),HEAPU32[r>>>2>>>0]=a)}return n}__dlsym_js.sig="pppp";function __embind_register_bigint(e,t,r,n,a){e>>>=0,t>>>=0,r>>>=0}__embind_register_bigint.sig="vpppiiii";var embind_init_charCodes=()=>{for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);embind_charCodes=e},embind_charCodes,readLatin1String=e=>{for(var t="",r=e;HEAPU8[r>>>0];)t+=embind_charCodes[HEAPU8[r++>>>0]];return t},awaitingDependencies={},registeredTypes={},typeDependencies={},BindingError,throwBindingError=e=>{throw new BindingError(e)},InternalError,throwInternalError=e=>{throw new InternalError(e)},whenDependentTypesAreResolved=(e,t,r)=>{e.forEach(u=>typeDependencies[u]=t);function n(u){var _=r(u);_.length!==e.length&&throwInternalError("Mismatched type converter count");for(var d=0;d{registeredTypes.hasOwnProperty(u)?a[_]=registeredTypes[u]:(l.push(u),awaitingDependencies.hasOwnProperty(u)||(awaitingDependencies[u]=[]),awaitingDependencies[u].push(()=>{a[_]=registeredTypes[u],++c,c===l.length&&n(a)}))}),l.length===0&&n(a)};function sharedRegisterType(e,t,r={}){var n=t.name;if(e||throwBindingError('type "'.concat(n,'" must have a positive integer typeid pointer')),registeredTypes.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;throwBindingError("Cannot register type '".concat(n,"' twice"))}if(registeredTypes[e]=t,delete typeDependencies[e],awaitingDependencies.hasOwnProperty(e)){var a=awaitingDependencies[e];delete awaitingDependencies[e],a.forEach(l=>l())}}function registerType(e,t,r={}){return sharedRegisterType(e,t,r)}var GenericWireTypeSize=8;function __embind_register_bool(e,t,r,n){e>>>=0,t>>>=0,t=readLatin1String(t),registerType(e,{name:t,fromWireType:function(a){return!!a},toWireType:function(a,l){return l?r:n},argPackAdvance:GenericWireTypeSize,readValueFromPointer:function(a){return this.fromWireType(HEAPU8[a>>>0])},destructorFunction:null})}__embind_register_bool.sig="vppii";var emval_freelist=[],emval_handles=[];function __emval_decref(e){e>>>=0,e>9&&--emval_handles[e+1]===0&&(emval_handles[e]=void 0,emval_freelist.push(e))}__emval_decref.sig="vp";var count_emval_handles=()=>emval_handles.length/2-5-emval_freelist.length,init_emval=()=>{emval_handles.push(0,1,void 0,1,null,1,!0,1,!1,1),Module.count_emval_handles=count_emval_handles},Emval={toValue:e=>(e||throwBindingError("Cannot use deleted val. handle = "+e),emval_handles[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{let t=emval_freelist.pop()||emval_handles.length;return emval_handles[t]=e,emval_handles[t+1]=1,t}}}};function readPointer(e){return this.fromWireType(HEAPU32[e>>>2>>>0])}var EmValType={name:"emscripten::val",fromWireType:e=>{var t=Emval.toValue(e);return __emval_decref(e),t},toWireType:(e,t)=>Emval.toHandle(t),argPackAdvance:GenericWireTypeSize,readValueFromPointer:readPointer,destructorFunction:null};function __embind_register_emval(e){return e>>>=0,registerType(e,EmValType)}__embind_register_emval.sig="vp";var embindRepr=e=>{if(e===null)return"null";var t=typeof e;return t==="object"||t==="array"||t==="function"?e.toString():""+e},floatReadValueFromPointer=(e,t)=>{switch(t){case 4:return function(r){return this.fromWireType(HEAPF32[r>>>2>>>0])};case 8:return function(r){return this.fromWireType(HEAPF64[r>>>3>>>0])};default:throw new TypeError("invalid float width (".concat(t,"): ").concat(e))}},__embind_register_float=function(e,t,r){e>>>=0,t>>>=0,r>>>=0,t=readLatin1String(t),registerType(e,{name:t,fromWireType:n=>n,toWireType:(n,a)=>a,argPackAdvance:GenericWireTypeSize,readValueFromPointer:floatReadValueFromPointer(t,r),destructorFunction:null})};__embind_register_float.sig="vppp";var integerReadValueFromPointer=(e,t,r)=>{switch(t){case 1:return r?n=>HEAP8[n>>>0]:n=>HEAPU8[n>>>0];case 2:return r?n=>HEAP16[n>>>1>>>0]:n=>HEAPU16[n>>>1>>>0];case 4:return r?n=>HEAP32[n>>>2>>>0]:n=>HEAPU32[n>>>2>>>0];default:throw new TypeError("invalid integer width (".concat(t,"): ").concat(e))}};function __embind_register_integer(e,t,r,n,a){e>>>=0,t>>>=0,r>>>=0,t=readLatin1String(t),a===-1&&(a=4294967295);var l=f=>f;if(n===0){var c=32-8*r;l=f=>f<>>c}var u=t.includes("unsigned"),_=(f,p)=>{},d;u?d=function(f,p){return _(p,this.name),p>>>0}:d=function(f,p){return _(p,this.name),p},registerType(e,{name:t,fromWireType:l,toWireType:d,argPackAdvance:GenericWireTypeSize,readValueFromPointer:integerReadValueFromPointer(t,r,n!==0),destructorFunction:null})}__embind_register_integer.sig="vpppii";function __embind_register_memory_view(e,t,r){e>>>=0,r>>>=0;var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],a=n[t];function l(c){var u=HEAPU32[c>>>2>>>0],_=HEAPU32[c+4>>>2>>>0];return new a(HEAP8.buffer,_,u)}r=readLatin1String(r),registerType(e,{name:r,fromWireType:l,argPackAdvance:GenericWireTypeSize,readValueFromPointer:l},{ignoreDuplicateRegistrations:!0})}__embind_register_memory_view.sig="vpip";function __embind_register_std_string(e,t){e>>>=0,t>>>=0,t=readLatin1String(t);var r=t==="std::string";registerType(e,{name:t,fromWireType(n){var a=HEAPU32[n>>>2>>>0],l=n+4,c;if(r)for(var u=l,_=0;_<=a;++_){var d=l+_;if(_==a||HEAPU8[d>>>0]==0){var f=d-u,p=UTF8ToString(u,f);c===void 0?c=p:(c+="\0",c+=p),u=d+1}}else{for(var m=new Array(a),_=0;_>>0]);c=m.join("")}return _free(n),c},toWireType(n,a){a instanceof ArrayBuffer&&(a=new Uint8Array(a));var l,c=typeof a=="string";c||a instanceof Uint8Array||a instanceof Uint8ClampedArray||a instanceof Int8Array||throwBindingError("Cannot pass non-string to std::string"),r&&c?l=lengthBytesUTF8(a):l=a.length;var u=_malloc(4+l+1),_=u+4;if(HEAPU32[u>>>2>>>0]=l,r&&c)stringToUTF8(a,_,l+1);else if(c)for(var d=0;d255&&(_free(_),throwBindingError("String has UTF-16 code units that do not fit in 8 bits")),HEAPU8[_+d>>>0]=f}else for(var d=0;d>>0]=a[d];return n!==null&&n.push(_free,u),u},argPackAdvance:GenericWireTypeSize,readValueFromPointer:readPointer,destructorFunction(n){_free(n)}})}__embind_register_std_string.sig="vpp";var UTF16Decoder=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,UTF16ToString=(e,t)=>{for(var r=e,n=r>>1,a=n+t/2;!(n>=a)&&HEAPU16[n>>>0];)++n;if(r=n<<1,r-e>32&&UTF16Decoder)return UTF16Decoder.decode(HEAPU8.subarray(e>>>0,r>>>0));for(var l="",c=0;!(c>=t/2);++c){var u=HEAP16[e+c*2>>>1>>>0];if(u==0)break;l+=String.fromCharCode(u)}return l},stringToUTF16=(e,t,r)=>{if(r!=null||(r=2147483647),r<2)return 0;r-=2;for(var n=t,a=r>>1>>>0]=c,t+=2}return HEAP16[t>>>1>>>0]=0,t-n},lengthBytesUTF16=e=>e.length*2,UTF32ToString=(e,t)=>{for(var r=0,n="";!(r>=t/4);){var a=HEAP32[e+r*4>>>2>>>0];if(a==0)break;if(++r,a>=65536){var l=a-65536;n+=String.fromCharCode(55296|l>>10,56320|l&1023)}else n+=String.fromCharCode(a)}return n},stringToUTF32=(e,t,r)=>{if(t>>>=0,r!=null||(r=2147483647),r<4)return 0;for(var n=t,a=n+r-4,l=0;l=55296&&c<=57343){var u=e.charCodeAt(++l);c=65536+((c&1023)<<10)|u&1023}if(HEAP32[t>>>2>>>0]=c,t+=4,t+4>a)break}return HEAP32[t>>>2>>>0]=0,t-n},lengthBytesUTF32=e=>{for(var t=0,r=0;r=55296&&n<=57343&&++r,t+=4}return t},__embind_register_std_wstring=function(e,t,r){e>>>=0,t>>>=0,r>>>=0,r=readLatin1String(r);var n,a,l,c;t===2?(n=UTF16ToString,a=stringToUTF16,c=lengthBytesUTF16,l=u=>HEAPU16[u>>>1>>>0]):t===4&&(n=UTF32ToString,a=stringToUTF32,c=lengthBytesUTF32,l=u=>HEAPU32[u>>>2>>>0]),registerType(e,{name:r,fromWireType:u=>{for(var _=HEAPU32[u>>>2>>>0],d,f=u+4,p=0;p<=_;++p){var m=u+4+p*t;if(p==_||l(m)==0){var g=m-f,h=n(f,g);d===void 0?d=h:(d+="\0",d+=h),f=m+t}}return _free(u),d},toWireType:(u,_)=>{typeof _!="string"&&throwBindingError("Cannot pass non-string to C++ string type ".concat(r));var d=c(_),f=_malloc(4+d+t);return HEAPU32[f>>>2>>>0]=d/t,a(_,f+4,d+t),u!==null&&u.push(_free,f),f},argPackAdvance:GenericWireTypeSize,readValueFromPointer:readPointer,destructorFunction(u){_free(u)}})};__embind_register_std_wstring.sig="vppp";var __embind_register_void=function(e,t){e>>>=0,t>>>=0,t=readLatin1String(t),registerType(e,{isVoid:!0,name:t,argPackAdvance:0,fromWireType:()=>{},toWireType:(r,n)=>{}})};__embind_register_void.sig="vpp";var handleException=e=>{if(e instanceof ExitStatus||e=="unwind")return EXITSTATUS;quit_(1,e)},runtimeKeepaliveCounter=0,keepRuntimeAlive=()=>noExitRuntime||runtimeKeepaliveCounter>0,_proc_exit=e=>{var t;EXITSTATUS=e,keepRuntimeAlive()||((t=Module.onExit)==null||t.call(Module,e),ABORT=!0),quit_(e,new ExitStatus(e))};_proc_exit.sig="vi";var exitJS=(e,t)=>{EXITSTATUS=e,_proc_exit(e)},_exit=exitJS;_exit.sig="vi";var maybeExit=()=>{if(!keepRuntimeAlive())try{_exit(EXITSTATUS)}catch(e){handleException(e)}},callUserCallback=e=>{if(!ABORT)try{e(),maybeExit()}catch(t){handleException(t)}};function __emscripten_dlopen_js(e,t,r,n){e>>>=0,t>>>=0,r>>>=0,n>>>=0;function a(u){var _=UTF8ToString(e+36);dlSetError("'Could not load dynamic lib: ".concat(_,"\n").concat(u)),callUserCallback(()=>getWasmTableEntry(r)(e,n))}function l(){callUserCallback(()=>getWasmTableEntry(t)(e,n))}var c=dlopenInternal(e,{loadAsync:!0});c?c.then(l,a):a()}__emscripten_dlopen_js.sig="vpppp";var nowIsMonotonic=1,__emscripten_get_now_is_monotonic=()=>nowIsMonotonic;__emscripten_get_now_is_monotonic.sig="i";var getExecutableName=()=>thisProgram||"./this.program";function __emscripten_get_progname(e,t){e>>>=0,stringToUTF8(getExecutableName(),e,t)}__emscripten_get_progname.sig="vpi";function __emscripten_lookup_name(e){e>>>=0;var t=UTF8ToString(e);return inetPton4(DNS.lookup_name(t))}__emscripten_lookup_name.sig="ip";function __emscripten_memcpy_js(e,t,r){return e>>>=0,t>>>=0,r>>>=0,HEAPU8.copyWithin(e>>>0,t>>>0,t+r>>>0)}__emscripten_memcpy_js.sig="vppp";var __emscripten_runtime_keepalive_clear=()=>{noExitRuntime=!1,runtimeKeepaliveCounter=0};__emscripten_runtime_keepalive_clear.sig="v";function __emscripten_set_offscreencanvas_size(e,t,r){return e>>>=0,-1}__emscripten_set_offscreencanvas_size.sig="ipii";function __emscripten_system(e){if(e>>>=0,ENVIRONMENT_IS_NODE){if(!e)return 1;var t=UTF8ToString(e);if(!t.length)return 0;var r=["child_process"].map(xn),n=r.spawnSync(t,[],{shell:!0,stdio:"inherit"}),a=(c,u)=>c<<8|u;if(n.status===null){var l=c=>{switch(c){case"SIGHUP":return 1;case"SIGQUIT":return 3;case"SIGFPE":return 8;case"SIGKILL":return 9;case"SIGALRM":return 14;case"SIGTERM":return 15;default:return 2}};return a(0,l(n.signal))}return a(n.status,0)}return e?-52:0}__emscripten_system.sig="ip";function __gmtime_js(e,t,r){var n=convertI32PairToI53Checked(e,t);r>>>=0;var a=new Date(n*1e3);HEAP32[r>>>2>>>0]=a.getUTCSeconds(),HEAP32[r+4>>>2>>>0]=a.getUTCMinutes(),HEAP32[r+8>>>2>>>0]=a.getUTCHours(),HEAP32[r+12>>>2>>>0]=a.getUTCDate(),HEAP32[r+16>>>2>>>0]=a.getUTCMonth(),HEAP32[r+20>>>2>>>0]=a.getUTCFullYear()-1900,HEAP32[r+24>>>2>>>0]=a.getUTCDay();var l=Date.UTC(a.getUTCFullYear(),0,1,0,0,0,0),c=(a.getTime()-l)/(1e3*60*60*24)|0;HEAP32[r+28>>>2>>>0]=c}__gmtime_js.sig="viip";var isLeapYear=e=>e%4===0&&(e%100!==0||e%400===0),MONTH_DAYS_LEAP_CUMULATIVE=[0,31,60,91,121,152,182,213,244,274,305,335],MONTH_DAYS_REGULAR_CUMULATIVE=[0,31,59,90,120,151,181,212,243,273,304,334],ydayFromDate=e=>{var t=isLeapYear(e.getFullYear()),r=t?MONTH_DAYS_LEAP_CUMULATIVE:MONTH_DAYS_REGULAR_CUMULATIVE,n=r[e.getMonth()]+e.getDate()-1;return n};function __localtime_js(e,t,r){var n=convertI32PairToI53Checked(e,t);r>>>=0;var a=new Date(n*1e3);HEAP32[r>>>2>>>0]=a.getSeconds(),HEAP32[r+4>>>2>>>0]=a.getMinutes(),HEAP32[r+8>>>2>>>0]=a.getHours(),HEAP32[r+12>>>2>>>0]=a.getDate(),HEAP32[r+16>>>2>>>0]=a.getMonth(),HEAP32[r+20>>>2>>>0]=a.getFullYear()-1900,HEAP32[r+24>>>2>>>0]=a.getDay();var l=ydayFromDate(a)|0;HEAP32[r+28>>>2>>>0]=l,HEAP32[r+36>>>2>>>0]=-(a.getTimezoneOffset()*60);var c=new Date(a.getFullYear(),0,1),u=new Date(a.getFullYear(),6,1).getTimezoneOffset(),_=c.getTimezoneOffset(),d=(u!=_&&a.getTimezoneOffset()==Math.min(_,u))|0;HEAP32[r+32>>>2>>>0]=d}__localtime_js.sig="viip";var setTempRet0=e=>__emscripten_tempret_set(e),_setTempRet0=setTempRet0;Module._setTempRet0=_setTempRet0;var __mktime_js=function(e){e>>>=0;var t=(()=>{var r=new Date(HEAP32[e+20>>>2>>>0]+1900,HEAP32[e+16>>>2>>>0],HEAP32[e+12>>>2>>>0],HEAP32[e+8>>>2>>>0],HEAP32[e+4>>>2>>>0],HEAP32[e>>>2>>>0],0),n=HEAP32[e+32>>>2>>>0],a=r.getTimezoneOffset(),l=new Date(r.getFullYear(),0,1),c=new Date(r.getFullYear(),6,1).getTimezoneOffset(),u=l.getTimezoneOffset(),_=Math.min(u,c);if(n<0)HEAP32[e+32>>>2>>>0]=+(c!=u&&_==a);else if(n>0!=(_==a)){var d=Math.max(u,c),f=n>0?_:d;r.setTime(r.getTime()+(f-a)*6e4)}HEAP32[e+24>>>2>>>0]=r.getDay();var p=ydayFromDate(r)|0;HEAP32[e+28>>>2>>>0]=p,HEAP32[e>>>2>>>0]=r.getSeconds(),HEAP32[e+4>>>2>>>0]=r.getMinutes(),HEAP32[e+8>>>2>>>0]=r.getHours(),HEAP32[e+12>>>2>>>0]=r.getDate(),HEAP32[e+16>>>2>>>0]=r.getMonth(),HEAP32[e+20>>>2>>>0]=r.getYear();var m=r.getTime();return isNaN(m)?-1:m/1e3})();return setTempRet0((tempDouble=t,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)),t>>>0};__mktime_js.sig="ip";function __mmap_js(e,t,r,n,a,l,c,u){e>>>=0;var _=convertI32PairToI53Checked(a,l);c>>>=0,u>>>=0;try{if(isNaN(_))return 61;var d=SYSCALLS.getStreamFromFD(n),f=FS.mmap(d,e,_,t,r),p=f.ptr;return HEAP32[c>>>2>>>0]=f.allocated,HEAPU32[u>>>2>>>0]=p,0}catch(m){if(typeof FS>"u"||m.name!=="ErrnoError")throw m;return-m.errno}}__mmap_js.sig="ipiiiiipp";function __msync_js(e,t,r,n,a,l,c){e>>>=0,t>>>=0;var u=convertI32PairToI53Checked(l,c);try{return isNaN(u)?61:(SYSCALLS.doMsync(e,SYSCALLS.getStreamFromFD(a),t,n,u),0)}catch(_){if(typeof FS>"u"||_.name!=="ErrnoError")throw _;return-_.errno}}__msync_js.sig="ippiiiii";function __munmap_js(e,t,r,n,a,l,c){e>>>=0,t>>>=0;var u=convertI32PairToI53Checked(l,c);try{var _=SYSCALLS.getStreamFromFD(a);r&2&&SYSCALLS.doMsync(e,_,t,n,u)}catch(d){if(typeof FS>"u"||d.name!=="ErrnoError")throw d;return-d.errno}}__munmap_js.sig="ippiiiii";var timers={},_emscripten_get_now=()=>performance.now();_emscripten_get_now.sig="d";var __setitimer_js=(e,t)=>{if(timers[e]&&(clearTimeout(timers[e].id),delete timers[e]),!t)return 0;var r=setTimeout(()=>{delete timers[e],callUserCallback(()=>__emscripten_timeout(e,_emscripten_get_now()))},t);return timers[e]={id:r,timeout_ms:t},0};__setitimer_js.sig="iid";var __timegm_js=function(e){e>>>=0;var t=(()=>{var r=Date.UTC(HEAP32[e+20>>>2>>>0]+1900,HEAP32[e+16>>>2>>>0],HEAP32[e+12>>>2>>>0],HEAP32[e+8>>>2>>>0],HEAP32[e+4>>>2>>>0],HEAP32[e>>>2>>>0],0),n=new Date(r);HEAP32[e+24>>>2>>>0]=n.getUTCDay();var a=Date.UTC(n.getUTCFullYear(),0,1,0,0,0,0),l=(n.getTime()-a)/(1e3*60*60*24)|0;return HEAP32[e+28>>>2>>>0]=l,n.getTime()/1e3})();return setTempRet0((tempDouble=t,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)),t>>>0};__timegm_js.sig="ip";var __tzset_js=function(e,t,r,n){e>>>=0,t>>>=0,r>>>=0,n>>>=0;var a=new Date().getFullYear(),l=new Date(a,0,1),c=new Date(a,6,1),u=l.getTimezoneOffset(),_=c.getTimezoneOffset(),d=Math.max(u,_);HEAPU32[e>>>2>>>0]=d*60,HEAP32[t>>>2>>>0]=+(u!=_);var f=g=>{var h=g>=0?"-":"+",b=Math.abs(g),y=String(Math.floor(b/60)).padStart(2,"0"),L=String(b%60).padStart(2,"0");return"UTC".concat(h).concat(y).concat(L)},p=f(u),m=f(_);_{if(MainLoop.timingMode=e,MainLoop.timingValue=t,!MainLoop.func)return 1;if(MainLoop.running||(MainLoop.running=!0),e==0)MainLoop.scheduler=function(){var c=Math.max(0,MainLoop.tickStartTime+t-_emscripten_get_now())|0;setTimeout(MainLoop.runner,c)},MainLoop.method="timeout";else if(e==1)MainLoop.scheduler=function(){MainLoop.requestAnimationFrame(MainLoop.runner)},MainLoop.method="rAF";else if(e==2){if(typeof MainLoop.setImmediate>"u")if(typeof setImmediate>"u"){var r=[],n="setimmediate",a=l=>{(l.data===n||l.data.target===n)&&(l.stopPropagation(),r.shift()())};addEventListener("message",a,!0),MainLoop.setImmediate=l=>{var c;r.push(l),ENVIRONMENT_IS_WORKER?((c=Module.setImmediates)!=null||(Module.setImmediates=[]),Module.setImmediates.push(l),postMessage({target:n})):postMessage(n,"*")}}else MainLoop.setImmediate=setImmediate;MainLoop.scheduler=function(){MainLoop.setImmediate(MainLoop.runner)},MainLoop.method="immediate"}return 0};_emscripten_set_main_loop_timing.sig="iii";var setMainLoop=(e,t,r,n,a)=>{MainLoop.func=e,MainLoop.arg=n;var l=MainLoop.currentlyRunningMainloop;function c(){return l0){var _=Date.now(),d=MainLoop.queue.shift();if(d.func(d.arg),MainLoop.remainingBlockers){var f=MainLoop.remainingBlockers,p=f%1==0?f-1:Math.floor(f);d.counted?MainLoop.remainingBlockers=p:(p=p+.5,MainLoop.remainingBlockers=(8*f+p)/9)}if(MainLoop.updateStatus(),!c())return;setTimeout(MainLoop.runner,0);return}if(c()){if(MainLoop.currentFrameNumber=MainLoop.currentFrameNumber+1|0,MainLoop.timingMode==1&&MainLoop.timingValue>1&&MainLoop.currentFrameNumber%MainLoop.timingValue!=0){MainLoop.scheduler();return}else MainLoop.timingMode==0&&(MainLoop.tickStartTime=_emscripten_get_now());MainLoop.runIter(e),c()&&MainLoop.scheduler()}}},a||(t&&t>0?_emscripten_set_main_loop_timing(0,1e3/t):_emscripten_set_main_loop_timing(1,1),MainLoop.scheduler()),r)throw"unwind"},MainLoop={running:!1,scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],preMainLoop:[],postMainLoop:[],pause(){MainLoop.scheduler=null,MainLoop.currentlyRunningMainloop++},resume(){MainLoop.currentlyRunningMainloop++;var e=MainLoop.timingMode,t=MainLoop.timingValue,r=MainLoop.func;MainLoop.func=null,setMainLoop(r,0,!1,MainLoop.arg,!0),_emscripten_set_main_loop_timing(e,t),MainLoop.scheduler()},updateStatus(){var n,a;if(Module.setStatus){var e=Module.statusMessage||"Please wait...",t=(n=MainLoop.remainingBlockers)!=null?n:0,r=(a=MainLoop.expectedBlockers)!=null?a:0;t?t=MainLoop.nextRAF;)MainLoop.nextRAF+=1e3/60;var r=Math.max(MainLoop.nextRAF-t,0);setTimeout(e,r)},requestAnimationFrame(e){if(typeof requestAnimationFrame=="function"){requestAnimationFrame(e);return}var t=MainLoop.fakeRequestAnimationFrame;t(e)}},AL={QUEUE_INTERVAL:25,QUEUE_LOOKAHEAD:.1,DEVICE_NAME:"Emscripten OpenAL",CAPTURE_DEVICE_NAME:"Emscripten OpenAL capture",ALC_EXTENSIONS:{ALC_SOFT_pause_device:!0,ALC_SOFT_HRTF:!0},AL_EXTENSIONS:{AL_EXT_float32:!0,AL_SOFT_loop_points:!0,AL_SOFT_source_length:!0,AL_EXT_source_distance_model:!0,AL_SOFT_source_spatialize:!0},_alcErr:0,alcErr:0,deviceRefCounts:{},alcStringCache:{},paused:!1,stringCache:{},contexts:{},currentCtx:null,buffers:{0:{id:0,refCount:0,audioBuf:null,frequency:0,bytesPerSample:2,channels:1,length:0}},paramArray:[],_nextId:1,newId:()=>AL.freeIds.length>0?AL.freeIds.pop():AL._nextId++,freeIds:[],scheduleContextAudio:e=>{if(!(MainLoop.timingMode===1&&document.visibilityState!="visible"))for(var t in e.sources)AL.scheduleSourceAudio(e.sources[t])},scheduleSourceAudio:(e,t)=>{if(!(MainLoop.timingMode===1&&document.visibilityState!="visible")&&e.state===4114){for(var r=AL.updateSourceTime(e),n=e.bufStartTime,a=e.bufOffset,l=e.bufsProcessed,c=0;c=e.bufQueue.length)if(e.looping)l%=e.bufQueue.length;else break;var f=e.bufQueue[l%e.bufQueue.length];if(f.length===0){if(d++,d===e.bufQueue.length)break}else{var u=e.context.audioCtx.createBufferSource();u.buffer=f.audioBuf,u.playbackRate.value=e.playbackRate,(f.audioBuf._loopStart||f.audioBuf._loopEnd)&&(u.loopStart=f.audioBuf._loopStart,u.loopEnd=f.audioBuf._loopEnd);var p=0;e.type===4136&&e.looping?(p=Number.POSITIVE_INFINITY,u.loop=!0,f.audioBuf._loopStart&&(u.loopStart=f.audioBuf._loopStart),f.audioBuf._loopEnd&&(u.loopEnd=f.audioBuf._loopEnd)):p=(f.audioBuf.duration-a)/e.playbackRate,u._startOffset=a,u._duration=p,u._skipCount=d,d=0,u.connect(e.gain),typeof u.start<"u"?(n=Math.max(n,e.context.audioCtx.currentTime),u.start(n,a)):typeof u.noteOn<"u"&&(n=Math.max(n,e.context.audioCtx.currentTime),u.noteOn(n)),u._startTime=n,e.audioQueue.push(u),n+=p}a=0,l++}}},updateSourceTime:e=>{var t=e.context.audioCtx.currentTime;if(e.state!==4114)return t;isFinite(e.bufStartTime)||(e.bufStartTime=t-e.bufOffset/e.playbackRate,e.bufOffset=0);for(var r=0;e.audioQueue.length;){var n=e.audioQueue[0];if(e.bufsProcessed+=n._skipCount,r=n._startTime+n._duration,t=e.bufQueue.length&&!e.looping)AL.setSourceState(e,4116);else if(e.type===4136&&e.looping){var a=e.bufQueue[0];if(a.length===0)e.bufOffset=0;else{var l=(t-e.bufStartTime)*e.playbackRate,c=a.audioBuf._loopStart||0,u=a.audioBuf._loopEnd||a.audioBuf.duration;u<=c&&(u=a.audioBuf.duration),l0&&(e.bufStartTime+=Math.floor((t-e.bufStartTime)/_)*_)}for(var d=0;d=e.bufQueue.length)if(e.looping)e.bufsProcessed%=e.bufQueue.length;else{AL.setSourceState(e,4116);break}var a=e.bufQueue[e.bufsProcessed];if(a.length>0){if(r=e.bufStartTime+a.audioBuf.duration/e.playbackRate,t{AL.updateSourceTime(e);for(var t=1;t1&&(e.audioQueue.length=1)},stopSourceAudio:e=>{for(var t=0;t{t===4114?((e.state===4114||e.state==4116)&&(e.bufsProcessed=0,e.bufOffset=0),AL.stopSourceAudio(e),e.state=4114,e.bufStartTime=Number.NEGATIVE_INFINITY,AL.scheduleSourceAudio(e)):t===4115?e.state===4114&&(AL.updateSourceTime(e),AL.stopSourceAudio(e),e.state=4115):t===4116?e.state!==4113&&(e.state=4116,e.bufsProcessed=e.bufQueue.length,e.bufStartTime=Number.NEGATIVE_INFINITY,e.bufOffset=0,AL.stopSourceAudio(e)):t===4113&&e.state!==4113&&(e.state=4113,e.bufsProcessed=0,e.bufStartTime=Number.NEGATIVE_INFINITY,e.bufOffset=0,AL.stopSourceAudio(e))},initSourcePanner:e=>{if(e.type!==4144){for(var t=AL.buffers[0],r=0;r{for(var t in e.sources)AL.updateSourceGlobal(e.sources[t])},updateSourceGlobal:e=>{var t=e.panner;if(t){t.refDistance=e.refDistance,t.maxDistance=e.maxDistance,t.rolloffFactor=e.rolloffFactor,t.panningModel=e.context.hrtf?"HRTF":"equalpower";var r=e.context.sourceDistanceModel?e.distanceModel:e.context.distanceModel;switch(r){case 0:t.distanceModel="inverse",t.refDistance=340282e33;break;case 53249:case 53250:t.distanceModel="inverse";break;case 53251:case 53252:t.distanceModel="linear";break;case 53253:case 53254:t.distanceModel="exponential";break}}},updateListenerSpace:e=>{var t=e.audioCtx.listener;t.positionX?(t.positionX.value=e.listener.position[0],t.positionY.value=e.listener.position[1],t.positionZ.value=e.listener.position[2]):t.setPosition(e.listener.position[0],e.listener.position[1],e.listener.position[2]),t.forwardX?(t.forwardX.value=e.listener.direction[0],t.forwardY.value=e.listener.direction[1],t.forwardZ.value=e.listener.direction[2],t.upX.value=e.listener.up[0],t.upY.value=e.listener.up[1],t.upZ.value=e.listener.up[2]):t.setOrientation(e.listener.direction[0],e.listener.direction[1],e.listener.direction[2],e.listener.up[0],e.listener.up[1],e.listener.up[2]);for(var r in e.sources)AL.updateSourceSpace(e.sources[r])},updateSourceSpace:e=>{if(e.panner){var t=e.panner,r=e.position[0],n=e.position[1],a=e.position[2],l=e.direction[0],c=e.direction[1],u=e.direction[2],_=e.context.listener,d=_.position[0],f=_.position[1],p=_.position[2];if(e.relative){var m=-_.direction[0],g=-_.direction[1],h=-_.direction[2],b=_.up[0],y=_.up[1],L=_.up[2],F=(xo,To,Po)=>{var Io=Math.sqrt(xo*xo+To*To+Po*Po);return Io{if(e.state===4114){AL.cancelPendingSourceAudio(e);var t=e.audioQueue[0];if(!t)return;var r;e.type===4136&&e.looping?r=Number.POSITIVE_INFINITY:r=(t.buffer.duration-t._startOffset)/e.playbackRate,t._duration=r,t.playbackRate.value=e.playbackRate,AL.scheduleSourceAudio(e)}},sourceDuration:e=>{for(var t=0,r=0;r{AL.updateSourceTime(e);for(var t=0,r=0;r{var r=e.state==4114;if(r&&AL.setSourceState(e,4113),e.bufQueue[e.bufsProcessed].audioBuf!==null){for(e.bufsProcessed=0;t>e.bufQueue[e.bufsProcessed].audioBuf.duration;)t-=e.bufQueue[e.bufsProcessed].audioBuf.duration,e.bufsProcessed++;e.bufOffset=t}r&&AL.setSourceState(e,4114)},getGlobalParam:(e,t)=>{if(!AL.currentCtx)return null;switch(t){case 49152:return AL.currentCtx.dopplerFactor;case 49155:return AL.currentCtx.speedOfSound;case 53248:return AL.currentCtx.distanceModel;default:return AL.currentCtx.err=40962,null}},setGlobalParam:(e,t,r)=>{if(AL.currentCtx)switch(t){case 49152:if(!Number.isFinite(r)||r<0){AL.currentCtx.err=40963;return}AL.currentCtx.dopplerFactor=r,AL.updateListenerSpace(AL.currentCtx);break;case 49155:if(!Number.isFinite(r)||r<=0){AL.currentCtx.err=40963;return}AL.currentCtx.speedOfSound=r,AL.updateListenerSpace(AL.currentCtx);break;case 53248:switch(r){case 0:case 53249:case 53250:case 53251:case 53252:case 53253:case 53254:AL.currentCtx.distanceModel=r,AL.updateContextGlobal(AL.currentCtx);break;default:AL.currentCtx.err=40963;return}break;default:AL.currentCtx.err=40962;return}},getListenerParam:(e,t)=>{if(!AL.currentCtx)return null;switch(t){case 4100:return AL.currentCtx.listener.position;case 4102:return AL.currentCtx.listener.velocity;case 4111:return AL.currentCtx.listener.direction.concat(AL.currentCtx.listener.up);case 4106:return AL.currentCtx.gain.gain.value;default:return AL.currentCtx.err=40962,null}},setListenerParam:(e,t,r)=>{if(AL.currentCtx){if(r===null){AL.currentCtx.err=40962;return}var n=AL.currentCtx.listener;switch(t){case 4100:if(!Number.isFinite(r[0])||!Number.isFinite(r[1])||!Number.isFinite(r[2])){AL.currentCtx.err=40963;return}n.position[0]=r[0],n.position[1]=r[1],n.position[2]=r[2],AL.updateListenerSpace(AL.currentCtx);break;case 4102:if(!Number.isFinite(r[0])||!Number.isFinite(r[1])||!Number.isFinite(r[2])){AL.currentCtx.err=40963;return}n.velocity[0]=r[0],n.velocity[1]=r[1],n.velocity[2]=r[2],AL.updateListenerSpace(AL.currentCtx);break;case 4106:if(!Number.isFinite(r)||r<0){AL.currentCtx.err=40963;return}AL.currentCtx.gain.gain.value=r;break;case 4111:if(!Number.isFinite(r[0])||!Number.isFinite(r[1])||!Number.isFinite(r[2])||!Number.isFinite(r[3])||!Number.isFinite(r[4])||!Number.isFinite(r[5])){AL.currentCtx.err=40963;return}n.direction[0]=r[0],n.direction[1]=r[1],n.direction[2]=r[2],n.up[0]=r[3],n.up[1]=r[4],n.up[2]=r[5],AL.updateListenerSpace(AL.currentCtx);break;default:AL.currentCtx.err=40962;return}}},getBufferParam:(e,t,r)=>{if(AL.currentCtx){var n=AL.buffers[t];if(!n||t===0){AL.currentCtx.err=40961;return}switch(r){case 8193:return n.frequency;case 8194:return n.bytesPerSample*8;case 8195:return n.channels;case 8196:return n.length*n.bytesPerSample*n.channels;case 8213:return n.length===0?[0,0]:[(n.audioBuf._loopStart||0)*n.frequency,(n.audioBuf._loopEnd||n.length)*n.frequency];default:return AL.currentCtx.err=40962,null}}},setBufferParam:(e,t,r,n)=>{if(AL.currentCtx){var a=AL.buffers[t];if(!a||t===0){AL.currentCtx.err=40961;return}if(n===null){AL.currentCtx.err=40962;return}switch(r){case 8196:if(n!==0){AL.currentCtx.err=40963;return}break;case 8213:if(n[0]<0||n[0]>a.length||n[1]<0||n[1]>a.Length||n[0]>=n[1]){AL.currentCtx.err=40963;return}if(a.refCount>0){AL.currentCtx.err=40964;return}a.audioBuf&&(a.audioBuf._loopStart=n[0]/a.frequency,a.audioBuf._loopEnd=n[1]/a.frequency);break;default:AL.currentCtx.err=40962;return}}},getSourceParam:(e,t,r)=>{if(!AL.currentCtx)return null;var n=AL.currentCtx.sources[t];if(!n)return AL.currentCtx.err=40961,null;switch(r){case 514:return n.relative;case 4097:return n.coneInnerAngle;case 4098:return n.coneOuterAngle;case 4099:return n.pitch;case 4100:return n.position;case 4101:return n.direction;case 4102:return n.velocity;case 4103:return n.looping;case 4105:return n.type===4136?n.bufQueue[0].id:0;case 4106:return n.gain.gain.value;case 4109:return n.minGain;case 4110:return n.maxGain;case 4112:return n.state;case 4117:return n.bufQueue.length===1&&n.bufQueue[0].id===0?0:n.bufQueue.length;case 4118:return n.bufQueue.length===1&&n.bufQueue[0].id===0||n.looping?0:n.bufsProcessed;case 4128:return n.refDistance;case 4129:return n.rolloffFactor;case 4130:return n.coneOuterGain;case 4131:return n.maxDistance;case 4132:return AL.sourceTell(n);case 4133:var a=AL.sourceTell(n);return a>0&&(a*=n.bufQueue[0].frequency),a;case 4134:var a=AL.sourceTell(n);return a>0&&(a*=n.bufQueue[0].frequency*n.bufQueue[0].bytesPerSample),a;case 4135:return n.type;case 4628:return n.spatialize;case 8201:for(var u=0,l=0,c=0;c{if(AL.currentCtx){var a=AL.currentCtx.sources[t];if(!a){AL.currentCtx.err=40961;return}if(n===null){AL.currentCtx.err=40962;return}switch(r){case 514:if(n===1)a.relative=!0,AL.updateSourceSpace(a);else if(n===0)a.relative=!1,AL.updateSourceSpace(a);else{AL.currentCtx.err=40963;return}break;case 4097:if(!Number.isFinite(n)){AL.currentCtx.err=40963;return}a.coneInnerAngle=n,a.panner&&(a.panner.coneInnerAngle=n%360);break;case 4098:if(!Number.isFinite(n)){AL.currentCtx.err=40963;return}a.coneOuterAngle=n,a.panner&&(a.panner.coneOuterAngle=n%360);break;case 4099:if(!Number.isFinite(n)||n<=0){AL.currentCtx.err=40963;return}if(a.pitch===n)break;a.pitch=n,AL.updateSourceRate(a);break;case 4100:if(!Number.isFinite(n[0])||!Number.isFinite(n[1])||!Number.isFinite(n[2])){AL.currentCtx.err=40963;return}a.position[0]=n[0],a.position[1]=n[1],a.position[2]=n[2],AL.updateSourceSpace(a);break;case 4101:if(!Number.isFinite(n[0])||!Number.isFinite(n[1])||!Number.isFinite(n[2])){AL.currentCtx.err=40963;return}a.direction[0]=n[0],a.direction[1]=n[1],a.direction[2]=n[2],AL.updateSourceSpace(a);break;case 4102:if(!Number.isFinite(n[0])||!Number.isFinite(n[1])||!Number.isFinite(n[2])){AL.currentCtx.err=40963;return}a.velocity[0]=n[0],a.velocity[1]=n[1],a.velocity[2]=n[2],AL.updateSourceSpace(a);break;case 4103:if(n===1){if(a.looping=!0,AL.updateSourceTime(a),a.type===4136&&a.audioQueue.length>0){var l=a.audioQueue[0];l.loop=!0,l._duration=Number.POSITIVE_INFINITY}}else if(n===0){a.looping=!1;var c=AL.updateSourceTime(a);if(a.type===4136&&a.audioQueue.length>0){var l=a.audioQueue[0];l.loop=!1,l._duration=a.bufQueue[0].audioBuf.duration/a.playbackRate,l._startTime=c-a.bufOffset/a.playbackRate}}else{AL.currentCtx.err=40963;return}break;case 4105:if(a.state===4114||a.state===4115){AL.currentCtx.err=40964;return}if(n===0){for(var u in a.bufQueue)a.bufQueue[u].refCount--;a.bufQueue.length=1,a.bufQueue[0]=AL.buffers[0],a.bufsProcessed=0,a.type=4144}else{var _=AL.buffers[n];if(!_){AL.currentCtx.err=40963;return}for(var u in a.bufQueue)a.bufQueue[u].refCount--;a.bufQueue.length=0,_.refCount++,a.bufQueue=[_],a.bufsProcessed=0,a.type=4136}AL.initSourcePanner(a),AL.scheduleSourceAudio(a);break;case 4106:if(!Number.isFinite(n)||n<0){AL.currentCtx.err=40963;return}a.gain.gain.value=n;break;case 4109:if(!Number.isFinite(n)||n<0||n>Math.min(a.maxGain,1)){AL.currentCtx.err=40963;return}a.minGain=n;break;case 4110:if(!Number.isFinite(n)||n1){AL.currentCtx.err=40963;return}a.maxGain=n;break;case 4128:if(!Number.isFinite(n)||n<0){AL.currentCtx.err=40963;return}a.refDistance=n,a.panner&&(a.panner.refDistance=n);break;case 4129:if(!Number.isFinite(n)||n<0){AL.currentCtx.err=40963;return}a.rolloffFactor=n,a.panner&&(a.panner.rolloffFactor=n);break;case 4130:if(!Number.isFinite(n)||n<0||n>1){AL.currentCtx.err=40963;return}a.coneOuterGain=n,a.panner&&(a.panner.coneOuterGain=n);break;case 4131:if(!Number.isFinite(n)||n<0){AL.currentCtx.err=40963;return}a.maxDistance=n,a.panner&&(a.panner.maxDistance=n);break;case 4132:if(n<0||n>AL.sourceDuration(a)){AL.currentCtx.err=40963;return}AL.sourceSeek(a,n);break;case 4133:var p=AL.sourceDuration(a);if(p>0){var d;for(var f in a.bufQueue)if(f){d=a.bufQueue[f].frequency;break}n/=d}if(n<0||n>p){AL.currentCtx.err=40963;return}AL.sourceSeek(a,n);break;case 4134:var p=AL.sourceDuration(a);if(p>0){var m;for(var f in a.bufQueue)if(f){var _=a.bufQueue[f];m=_.frequency*_.bytesPerSample*_.channels;break}n/=m}if(n<0||n>p){AL.currentCtx.err=40963;return}AL.sourceSeek(a,n);break;case 4628:if(n!==0&&n!==1&&n!==2){AL.currentCtx.err=40963;return}a.spatialize=n,AL.initSourcePanner(a);break;case 8201:case 8202:case 8203:AL.currentCtx.err=40964;break;case 53248:switch(n){case 0:case 53249:case 53250:case 53251:case 53252:case 53253:case 53254:a.distanceModel=n,AL.currentCtx.sourceDistanceModel&&AL.updateContextGlobal(AL.currentCtx);break;default:AL.currentCtx.err=40963;return}break;default:AL.currentCtx.err=40962;return}}},captures:{},sharedCaptureAudioCtx:null,requireValidCaptureDevice:(e,t)=>{if(e===0)return AL.alcErr=40961,null;var r=AL.captures[e];if(!r)return AL.alcErr=40961,null;var n=r.mediaStreamError;return n?(AL.alcErr=40961,null):r}},_alBuffer3f=(e,t,r,n,a)=>{AL.setBufferParam("alBuffer3f",e,t,null)};_alBuffer3f.sig="viifff";var _alBuffer3i=(e,t,r,n,a)=>{AL.setBufferParam("alBuffer3i",e,t,null)};_alBuffer3i.sig="viiiii";function _alBufferData(e,t,r,n,a){if(r>>>=0,!!AL.currentCtx){var l=AL.buffers[e];if(!l){AL.currentCtx.err=40963;return}if(a<=0){AL.currentCtx.err=40963;return}var c=null;try{switch(t){case 4352:if(n>0){c=AL.currentCtx.audioCtx.createBuffer(1,n,a);for(var u=c.getChannelData(0),_=0;_>>0]*.0078125-1}l.bytesPerSample=1,l.channels=1,l.length=n;break;case 4353:if(n>0){c=AL.currentCtx.audioCtx.createBuffer(1,n>>1,a);var u=c.getChannelData(0);r>>=1;for(var _=0;_>1;++_)u[_]=HEAP16[r++>>>0]*30517578125e-15}l.bytesPerSample=2,l.channels=1,l.length=n>>1;break;case 4354:if(n>0){c=AL.currentCtx.audioCtx.createBuffer(2,n>>1,a);for(var u=c.getChannelData(0),d=c.getChannelData(1),_=0;_>1;++_)u[_]=HEAPU8[r++>>>0]*.0078125-1,d[_]=HEAPU8[r++>>>0]*.0078125-1}l.bytesPerSample=1,l.channels=2,l.length=n>>1;break;case 4355:if(n>0){c=AL.currentCtx.audioCtx.createBuffer(2,n>>2,a);var u=c.getChannelData(0),d=c.getChannelData(1);r>>=1;for(var _=0;_>2;++_)u[_]=HEAP16[r++>>>0]*30517578125e-15,d[_]=HEAP16[r++>>>0]*30517578125e-15}l.bytesPerSample=2,l.channels=2,l.length=n>>2;break;case 65552:if(n>0){c=AL.currentCtx.audioCtx.createBuffer(1,n>>2,a);var u=c.getChannelData(0);r>>=2;for(var _=0;_>2;++_)u[_]=HEAPF32[r++>>>0]}l.bytesPerSample=4,l.channels=1,l.length=n>>2;break;case 65553:if(n>0){c=AL.currentCtx.audioCtx.createBuffer(2,n>>3,a);var u=c.getChannelData(0),d=c.getChannelData(1);r>>=2;for(var _=0;_>3;++_)u[_]=HEAPF32[r++>>>0],d[_]=HEAPF32[r++>>>0]}l.bytesPerSample=4,l.channels=2,l.length=n>>3;break;default:AL.currentCtx.err=40963;return}l.frequency=a,l.audioBuf=c}catch(f){AL.currentCtx.err=40963;return}}}_alBufferData.sig="viipii";var _alBufferf=(e,t,r)=>{AL.setBufferParam("alBufferf",e,t,null)};_alBufferf.sig="viif";function _alBufferfv(e,t,r){if(r>>>=0,!!AL.currentCtx){if(!r){AL.currentCtx.err=40963;return}AL.setBufferParam("alBufferfv",e,t,null)}}_alBufferfv.sig="viip";var _alBufferi=(e,t,r)=>{AL.setBufferParam("alBufferi",e,t,null)};_alBufferi.sig="viii";function _alBufferiv(e,t,r){if(r>>>=0,!!AL.currentCtx){if(!r){AL.currentCtx.err=40963;return}switch(t){case 8213:AL.paramArray[0]=HEAP32[r>>>2>>>0],AL.paramArray[1]=HEAP32[r+4>>>2>>>0],AL.setBufferParam("alBufferiv",e,t,AL.paramArray);break;default:AL.setBufferParam("alBufferiv",e,t,null);break}}}_alBufferiv.sig="viip";function _alDeleteBuffers(e,t){if(t>>>=0,!!AL.currentCtx){for(var r=0;r>>2>>>0];if(n!==0){if(!AL.buffers[n]){AL.currentCtx.err=40961;return}if(AL.buffers[n].refCount){AL.currentCtx.err=40964;return}}}for(var r=0;r>>2>>>0];n!==0&&(AL.deviceRefCounts[AL.buffers[n].deviceId]--,delete AL.buffers[n],AL.freeIds.push(n))}}}_alDeleteBuffers.sig="vip";var _alSourcei=(e,t,r)=>{switch(t){case 514:case 4097:case 4098:case 4103:case 4105:case 4128:case 4129:case 4131:case 4132:case 4133:case 4134:case 4628:case 8201:case 8202:case 53248:AL.setSourceParam("alSourcei",e,t,r);break;default:AL.setSourceParam("alSourcei",e,t,null);break}};_alSourcei.sig="viii";function _alDeleteSources(e,t){if(t>>>=0,!!AL.currentCtx){for(var r=0;r>>2>>>0];if(!AL.currentCtx.sources[n]){AL.currentCtx.err=40961;return}}for(var r=0;r>>2>>>0];AL.setSourceState(AL.currentCtx.sources[n],4116),_alSourcei(n,4105,0),delete AL.currentCtx.sources[n],AL.freeIds.push(n)}}}_alDeleteSources.sig="vip";var _alDisable=e=>{if(AL.currentCtx)switch(e){case 512:AL.currentCtx.sourceDistanceModel=!1,AL.updateContextGlobal(AL.currentCtx);break;default:AL.currentCtx.err=40962;return}};_alDisable.sig="vi";var _alDistanceModel=e=>{AL.setGlobalParam("alDistanceModel",53248,e)};_alDistanceModel.sig="vi";var _alDopplerFactor=e=>{AL.setGlobalParam("alDopplerFactor",49152,e)};_alDopplerFactor.sig="vf";var _alDopplerVelocity=e=>{if(warnOnce("alDopplerVelocity() is deprecated, and only kept for compatibility with OpenAL 1.0. Use alSpeedOfSound() instead."),!!AL.currentCtx&&e<=0){AL.currentCtx.err=40963;return}};_alDopplerVelocity.sig="vf";var _alEnable=e=>{if(AL.currentCtx)switch(e){case 512:AL.currentCtx.sourceDistanceModel=!0,AL.updateContextGlobal(AL.currentCtx);break;default:AL.currentCtx.err=40962;return}};_alEnable.sig="vi";function _alGenBuffers(e,t){if(t>>>=0,!!AL.currentCtx)for(var r=0;r>>2>>>0]=n.id}}_alGenBuffers.sig="vip";function _alGenSources(e,t){if(t>>>=0,!!AL.currentCtx)for(var r=0;r>>2>>>0]=a.id}}_alGenSources.sig="vip";var _alGetBoolean=e=>{var t=AL.getGlobalParam("alGetBoolean",e);if(t===null)return 0;switch(e){case 49152:case 49155:case 53248:return t!==0?1:0;default:return AL.currentCtx.err=40962,0}};_alGetBoolean.sig="ii";function _alGetBooleanv(e,t){t>>>=0;var r=AL.getGlobalParam("alGetBooleanv",e);if(!(r===null||!t))switch(e){case 49152:case 49155:case 53248:HEAP8[t>>>0]=r;break;default:AL.currentCtx.err=40962;return}}_alGetBooleanv.sig="vip";function _alGetBuffer3f(e,t,r,n,a){r>>>=0,n>>>=0,a>>>=0;var l=AL.getBufferParam("alGetBuffer3f",e,t);if(l!==null){if(!r||!n||!a){AL.currentCtx.err=40963;return}AL.currentCtx.err=40962}}_alGetBuffer3f.sig="viippp";function _alGetBuffer3i(e,t,r,n,a){r>>>=0,n>>>=0,a>>>=0;var l=AL.getBufferParam("alGetBuffer3i",e,t);if(l!==null){if(!r||!n||!a){AL.currentCtx.err=40963;return}AL.currentCtx.err=40962}}_alGetBuffer3i.sig="viippp";function _alGetBufferf(e,t,r){r>>>=0;var n=AL.getBufferParam("alGetBufferf",e,t);if(n!==null){if(!r){AL.currentCtx.err=40963;return}AL.currentCtx.err=40962}}_alGetBufferf.sig="viip";function _alGetBufferfv(e,t,r){r>>>=0;var n=AL.getBufferParam("alGetBufferfv",e,t);if(n!==null){if(!r){AL.currentCtx.err=40963;return}AL.currentCtx.err=40962}}_alGetBufferfv.sig="viip";function _alGetBufferi(e,t,r){r>>>=0;var n=AL.getBufferParam("alGetBufferi",e,t);if(n!==null){if(!r){AL.currentCtx.err=40963;return}switch(t){case 8193:case 8194:case 8195:case 8196:HEAP32[r>>>2>>>0]=n;break;default:AL.currentCtx.err=40962;return}}}_alGetBufferi.sig="viip";function _alGetBufferiv(e,t,r){r>>>=0;var n=AL.getBufferParam("alGetBufferiv",e,t);if(n!==null){if(!r){AL.currentCtx.err=40963;return}switch(t){case 8193:case 8194:case 8195:case 8196:HEAP32[r>>>2>>>0]=n;break;case 8213:HEAP32[r>>>2>>>0]=n[0],HEAP32[r+4>>>2>>>0]=n[1];break;default:AL.currentCtx.err=40962;return}}}_alGetBufferiv.sig="viip";var _alGetDouble=e=>{var t=AL.getGlobalParam("alGetDouble",e);if(t===null)return 0;switch(e){case 49152:case 49155:case 53248:return t;default:return AL.currentCtx.err=40962,0}};_alGetDouble.sig="di";function _alGetDoublev(e,t){t>>>=0;var r=AL.getGlobalParam("alGetDoublev",e);if(!(r===null||!t))switch(e){case 49152:case 49155:case 53248:HEAPF64[t>>>3>>>0]=r;break;default:AL.currentCtx.err=40962;return}}_alGetDoublev.sig="vip";function _alGetEnumValue(e){if(e>>>=0,!AL.currentCtx)return 0;if(!e)return AL.currentCtx.err=40963,0;var t=UTF8ToString(e);switch(t){case"AL_BITS":return 8194;case"AL_BUFFER":return 4105;case"AL_BUFFERS_PROCESSED":return 4118;case"AL_BUFFERS_QUEUED":return 4117;case"AL_BYTE_OFFSET":return 4134;case"AL_CHANNELS":return 8195;case"AL_CONE_INNER_ANGLE":return 4097;case"AL_CONE_OUTER_ANGLE":return 4098;case"AL_CONE_OUTER_GAIN":return 4130;case"AL_DIRECTION":return 4101;case"AL_DISTANCE_MODEL":return 53248;case"AL_DOPPLER_FACTOR":return 49152;case"AL_DOPPLER_VELOCITY":return 49153;case"AL_EXPONENT_DISTANCE":return 53253;case"AL_EXPONENT_DISTANCE_CLAMPED":return 53254;case"AL_EXTENSIONS":return 45060;case"AL_FORMAT_MONO16":return 4353;case"AL_FORMAT_MONO8":return 4352;case"AL_FORMAT_STEREO16":return 4355;case"AL_FORMAT_STEREO8":return 4354;case"AL_FREQUENCY":return 8193;case"AL_GAIN":return 4106;case"AL_INITIAL":return 4113;case"AL_INVALID":return-1;case"AL_ILLEGAL_ENUM":case"AL_INVALID_ENUM":return 40962;case"AL_INVALID_NAME":return 40961;case"AL_ILLEGAL_COMMAND":case"AL_INVALID_OPERATION":return 40964;case"AL_INVALID_VALUE":return 40963;case"AL_INVERSE_DISTANCE":return 53249;case"AL_INVERSE_DISTANCE_CLAMPED":return 53250;case"AL_LINEAR_DISTANCE":return 53251;case"AL_LINEAR_DISTANCE_CLAMPED":return 53252;case"AL_LOOPING":return 4103;case"AL_MAX_DISTANCE":return 4131;case"AL_MAX_GAIN":return 4110;case"AL_MIN_GAIN":return 4109;case"AL_NONE":return 0;case"AL_NO_ERROR":return 0;case"AL_ORIENTATION":return 4111;case"AL_OUT_OF_MEMORY":return 40965;case"AL_PAUSED":return 4115;case"AL_PENDING":return 8209;case"AL_PITCH":return 4099;case"AL_PLAYING":return 4114;case"AL_POSITION":return 4100;case"AL_PROCESSED":return 8210;case"AL_REFERENCE_DISTANCE":return 4128;case"AL_RENDERER":return 45059;case"AL_ROLLOFF_FACTOR":return 4129;case"AL_SAMPLE_OFFSET":return 4133;case"AL_SEC_OFFSET":return 4132;case"AL_SIZE":return 8196;case"AL_SOURCE_RELATIVE":return 514;case"AL_SOURCE_STATE":return 4112;case"AL_SOURCE_TYPE":return 4135;case"AL_SPEED_OF_SOUND":return 49155;case"AL_STATIC":return 4136;case"AL_STOPPED":return 4116;case"AL_STREAMING":return 4137;case"AL_UNDETERMINED":return 4144;case"AL_UNUSED":return 8208;case"AL_VELOCITY":return 4102;case"AL_VENDOR":return 45057;case"AL_VERSION":return 45058;case"AL_AUTO_SOFT":return 2;case"AL_SOURCE_DISTANCE_MODEL":return 512;case"AL_SOURCE_SPATIALIZE_SOFT":return 4628;case"AL_LOOP_POINTS_SOFT":return 8213;case"AL_BYTE_LENGTH_SOFT":return 8201;case"AL_SAMPLE_LENGTH_SOFT":return 8202;case"AL_SEC_LENGTH_SOFT":return 8203;case"AL_FORMAT_MONO_FLOAT32":return 65552;case"AL_FORMAT_STEREO_FLOAT32":return 65553;default:return AL.currentCtx.err=40963,0}}_alGetEnumValue.sig="ip";var _alGetError=()=>{if(!AL.currentCtx)return 40964;var e=AL.currentCtx.err;return AL.currentCtx.err=0,e};_alGetError.sig="i";var _alGetFloat=e=>{var t=AL.getGlobalParam("alGetFloat",e);if(t===null)return 0;switch(e){case 49152:case 49155:case 53248:return t;default:return 0}};_alGetFloat.sig="fi";function _alGetFloatv(e,t){t>>>=0;var r=AL.getGlobalParam("alGetFloatv",e);if(!(r===null||!t))switch(e){case 49152:case 49155:case 53248:HEAPF32[t>>>2>>>0]=r;break;default:AL.currentCtx.err=40962;return}}_alGetFloatv.sig="vip";var _alGetInteger=e=>{var t=AL.getGlobalParam("alGetInteger",e);if(t===null)return 0;switch(e){case 49152:case 49155:case 53248:return t;default:return AL.currentCtx.err=40962,0}};_alGetInteger.sig="ii";function _alGetIntegerv(e,t){t>>>=0;var r=AL.getGlobalParam("alGetIntegerv",e);if(!(r===null||!t))switch(e){case 49152:case 49155:case 53248:HEAP32[t>>>2>>>0]=r;break;default:AL.currentCtx.err=40962;return}}_alGetIntegerv.sig="vip";function _alGetListener3f(e,t,r,n){t>>>=0,r>>>=0,n>>>=0;var a=AL.getListenerParam("alGetListener3f",e);if(a!==null){if(!t||!r||!n){AL.currentCtx.err=40963;return}switch(e){case 4100:case 4102:HEAPF32[t>>>2>>>0]=a[0],HEAPF32[r>>>2>>>0]=a[1],HEAPF32[n>>>2>>>0]=a[2];break;default:AL.currentCtx.err=40962;return}}}_alGetListener3f.sig="vippp";function _alGetListener3i(e,t,r,n){t>>>=0,r>>>=0,n>>>=0;var a=AL.getListenerParam("alGetListener3i",e);if(a!==null){if(!t||!r||!n){AL.currentCtx.err=40963;return}switch(e){case 4100:case 4102:HEAP32[t>>>2>>>0]=a[0],HEAP32[r>>>2>>>0]=a[1],HEAP32[n>>>2>>>0]=a[2];break;default:AL.currentCtx.err=40962;return}}}_alGetListener3i.sig="vippp";function _alGetListenerf(e,t){t>>>=0;var r=AL.getListenerParam("alGetListenerf",e);if(r!==null){if(!t){AL.currentCtx.err=40963;return}switch(e){case 4106:HEAPF32[t>>>2>>>0]=r;break;default:AL.currentCtx.err=40962;return}}}_alGetListenerf.sig="vip";function _alGetListenerfv(e,t){t>>>=0;var r=AL.getListenerParam("alGetListenerfv",e);if(r!==null){if(!t){AL.currentCtx.err=40963;return}switch(e){case 4100:case 4102:HEAPF32[t>>>2>>>0]=r[0],HEAPF32[t+4>>>2>>>0]=r[1],HEAPF32[t+8>>>2>>>0]=r[2];break;case 4111:HEAPF32[t>>>2>>>0]=r[0],HEAPF32[t+4>>>2>>>0]=r[1],HEAPF32[t+8>>>2>>>0]=r[2],HEAPF32[t+12>>>2>>>0]=r[3],HEAPF32[t+16>>>2>>>0]=r[4],HEAPF32[t+20>>>2>>>0]=r[5];break;default:AL.currentCtx.err=40962;return}}}_alGetListenerfv.sig="vip";function _alGetListeneri(e,t){t>>>=0;var r=AL.getListenerParam("alGetListeneri",e);if(r!==null){if(!t){AL.currentCtx.err=40963;return}AL.currentCtx.err=40962}}_alGetListeneri.sig="vip";function _alGetListeneriv(e,t){t>>>=0;var r=AL.getListenerParam("alGetListeneriv",e);if(r!==null){if(!t){AL.currentCtx.err=40963;return}switch(e){case 4100:case 4102:HEAP32[t>>>2>>>0]=r[0],HEAP32[t+4>>>2>>>0]=r[1],HEAP32[t+8>>>2>>>0]=r[2];break;case 4111:HEAP32[t>>>2>>>0]=r[0],HEAP32[t+4>>>2>>>0]=r[1],HEAP32[t+8>>>2>>>0]=r[2],HEAP32[t+12>>>2>>>0]=r[3],HEAP32[t+16>>>2>>>0]=r[4],HEAP32[t+20>>>2>>>0]=r[5];break;default:AL.currentCtx.err=40962;return}}}_alGetListeneriv.sig="vip";function _alGetSource3f(e,t,r,n,a){r>>>=0,n>>>=0,a>>>=0;var l=AL.getSourceParam("alGetSource3f",e,t);if(l!==null){if(!r||!n||!a){AL.currentCtx.err=40963;return}switch(t){case 4100:case 4101:case 4102:HEAPF32[r>>>2>>>0]=l[0],HEAPF32[n>>>2>>>0]=l[1],HEAPF32[a>>>2>>>0]=l[2];break;default:AL.currentCtx.err=40962;return}}}_alGetSource3f.sig="viippp";function _alGetSource3i(e,t,r,n,a){r>>>=0,n>>>=0,a>>>=0;var l=AL.getSourceParam("alGetSource3i",e,t);if(l!==null){if(!r||!n||!a){AL.currentCtx.err=40963;return}switch(t){case 4100:case 4101:case 4102:HEAP32[r>>>2>>>0]=l[0],HEAP32[n>>>2>>>0]=l[1],HEAP32[a>>>2>>>0]=l[2];break;default:AL.currentCtx.err=40962;return}}}_alGetSource3i.sig="viippp";function _alGetSourcef(e,t,r){r>>>=0;var n=AL.getSourceParam("alGetSourcef",e,t);if(n!==null){if(!r){AL.currentCtx.err=40963;return}switch(t){case 4097:case 4098:case 4099:case 4106:case 4109:case 4110:case 4128:case 4129:case 4130:case 4131:case 4132:case 4133:case 4134:case 8203:HEAPF32[r>>>2>>>0]=n;break;default:AL.currentCtx.err=40962;return}}}_alGetSourcef.sig="viip";function _alGetSourcefv(e,t,r){r>>>=0;var n=AL.getSourceParam("alGetSourcefv",e,t);if(n!==null){if(!r){AL.currentCtx.err=40963;return}switch(t){case 4097:case 4098:case 4099:case 4106:case 4109:case 4110:case 4128:case 4129:case 4130:case 4131:case 4132:case 4133:case 4134:case 8203:HEAPF32[r>>>2>>>0]=n[0];break;case 4100:case 4101:case 4102:HEAPF32[r>>>2>>>0]=n[0],HEAPF32[r+4>>>2>>>0]=n[1],HEAPF32[r+8>>>2>>>0]=n[2];break;default:AL.currentCtx.err=40962;return}}}_alGetSourcefv.sig="viip";function _alGetSourcei(e,t,r){r>>>=0;var n=AL.getSourceParam("alGetSourcei",e,t);if(n!==null){if(!r){AL.currentCtx.err=40963;return}switch(t){case 514:case 4097:case 4098:case 4103:case 4105:case 4112:case 4117:case 4118:case 4128:case 4129:case 4131:case 4132:case 4133:case 4134:case 4135:case 4628:case 8201:case 8202:case 53248:HEAP32[r>>>2>>>0]=n;break;default:AL.currentCtx.err=40962;return}}}_alGetSourcei.sig="viip";function _alGetSourceiv(e,t,r){r>>>=0;var n=AL.getSourceParam("alGetSourceiv",e,t);if(n!==null){if(!r){AL.currentCtx.err=40963;return}switch(t){case 514:case 4097:case 4098:case 4103:case 4105:case 4112:case 4117:case 4118:case 4128:case 4129:case 4131:case 4132:case 4133:case 4134:case 4135:case 4628:case 8201:case 8202:case 53248:HEAP32[r>>>2>>>0]=n;break;case 4100:case 4101:case 4102:HEAP32[r>>>2>>>0]=n[0],HEAP32[r+4>>>2>>>0]=n[1],HEAP32[r+8>>>2>>>0]=n[2];break;default:AL.currentCtx.err=40962;return}}}_alGetSourceiv.sig="viip";var stringToNewUTF8=e=>{var t=lengthBytesUTF8(e)+1,r=_malloc(t);return r&&stringToUTF8(e,r,t),r};function _alGetString(e){if(AL.stringCache[e])return AL.stringCache[e];var t;switch(e){case 0:t="No Error";break;case 40961:t="Invalid Name";break;case 40962:t="Invalid Enum";break;case 40963:t="Invalid Value";break;case 40964:t="Invalid Operation";break;case 40965:t="Out of Memory";break;case 45057:t="Emscripten";break;case 45058:t="1.1";break;case 45059:t="WebAudio";break;case 45060:t=Object.keys(AL.AL_EXTENSIONS).join(" ");break;default:return AL.currentCtx&&(AL.currentCtx.err=40962),0}return t=stringToNewUTF8(t),AL.stringCache[e]=t,t}_alGetString.sig="pi";var _alIsBuffer=e=>!(!AL.currentCtx||e>AL.buffers.length||!AL.buffers[e]);_alIsBuffer.sig="ii";var _alIsEnabled=e=>{if(!AL.currentCtx)return 0;switch(e){case 512:return AL.currentCtx.sourceDistanceModel?0:1;default:return AL.currentCtx.err=40962,0}};_alIsEnabled.sig="ii";function _alIsExtensionPresent(e){e>>>=0;var t=UTF8ToString(e);return AL.AL_EXTENSIONS[t]?1:0}_alIsExtensionPresent.sig="ip";var _alIsSource=e=>!(!AL.currentCtx||!AL.currentCtx.sources[e]);_alIsSource.sig="ii";var _alListener3f=(e,t,r,n)=>{switch(e){case 4100:case 4102:AL.paramArray[0]=t,AL.paramArray[1]=r,AL.paramArray[2]=n,AL.setListenerParam("alListener3f",e,AL.paramArray);break;default:AL.setListenerParam("alListener3f",e,null);break}};_alListener3f.sig="vifff";var _alListener3i=(e,t,r,n)=>{switch(e){case 4100:case 4102:AL.paramArray[0]=t,AL.paramArray[1]=r,AL.paramArray[2]=n,AL.setListenerParam("alListener3i",e,AL.paramArray);break;default:AL.setListenerParam("alListener3i",e,null);break}};_alListener3i.sig="viiii";var _alListenerf=(e,t)=>{switch(e){case 4106:AL.setListenerParam("alListenerf",e,t);break;default:AL.setListenerParam("alListenerf",e,null);break}};_alListenerf.sig="vif";function _alListenerfv(e,t){if(t>>>=0,!!AL.currentCtx){if(!t){AL.currentCtx.err=40963;return}switch(e){case 4100:case 4102:AL.paramArray[0]=HEAPF32[t>>>2>>>0],AL.paramArray[1]=HEAPF32[t+4>>>2>>>0],AL.paramArray[2]=HEAPF32[t+8>>>2>>>0],AL.setListenerParam("alListenerfv",e,AL.paramArray);break;case 4111:AL.paramArray[0]=HEAPF32[t>>>2>>>0],AL.paramArray[1]=HEAPF32[t+4>>>2>>>0],AL.paramArray[2]=HEAPF32[t+8>>>2>>>0],AL.paramArray[3]=HEAPF32[t+12>>>2>>>0],AL.paramArray[4]=HEAPF32[t+16>>>2>>>0],AL.paramArray[5]=HEAPF32[t+20>>>2>>>0],AL.setListenerParam("alListenerfv",e,AL.paramArray);break;default:AL.setListenerParam("alListenerfv",e,null);break}}}_alListenerfv.sig="vip";var _alListeneri=(e,t)=>{AL.setListenerParam("alListeneri",e,null)};_alListeneri.sig="vii";function _alListeneriv(e,t){if(t>>>=0,!!AL.currentCtx){if(!t){AL.currentCtx.err=40963;return}switch(e){case 4100:case 4102:AL.paramArray[0]=HEAP32[t>>>2>>>0],AL.paramArray[1]=HEAP32[t+4>>>2>>>0],AL.paramArray[2]=HEAP32[t+8>>>2>>>0],AL.setListenerParam("alListeneriv",e,AL.paramArray);break;case 4111:AL.paramArray[0]=HEAP32[t>>>2>>>0],AL.paramArray[1]=HEAP32[t+4>>>2>>>0],AL.paramArray[2]=HEAP32[t+8>>>2>>>0],AL.paramArray[3]=HEAP32[t+12>>>2>>>0],AL.paramArray[4]=HEAP32[t+16>>>2>>>0],AL.paramArray[5]=HEAP32[t+20>>>2>>>0],AL.setListenerParam("alListeneriv",e,AL.paramArray);break;default:AL.setListenerParam("alListeneriv",e,null);break}}}_alListeneriv.sig="vip";var _alSource3f=(e,t,r,n,a)=>{switch(t){case 4100:case 4101:case 4102:AL.paramArray[0]=r,AL.paramArray[1]=n,AL.paramArray[2]=a,AL.setSourceParam("alSource3f",e,t,AL.paramArray);break;default:AL.setSourceParam("alSource3f",e,t,null);break}};_alSource3f.sig="viifff";var _alSource3i=(e,t,r,n,a)=>{switch(t){case 4100:case 4101:case 4102:AL.paramArray[0]=r,AL.paramArray[1]=n,AL.paramArray[2]=a,AL.setSourceParam("alSource3i",e,t,AL.paramArray);break;default:AL.setSourceParam("alSource3i",e,t,null);break}};_alSource3i.sig="viiiii";var _alSourcePause=e=>{if(AL.currentCtx){var t=AL.currentCtx.sources[e];if(!t){AL.currentCtx.err=40961;return}AL.setSourceState(t,4115)}};_alSourcePause.sig="vi";function _alSourcePausev(e,t){if(t>>>=0,!!AL.currentCtx){t||(AL.currentCtx.err=40963);for(var r=0;r>>2>>>0]]){AL.currentCtx.err=40961;return}for(var r=0;r>>2>>>0];AL.setSourceState(AL.currentCtx.sources[n],4115)}}}_alSourcePausev.sig="vip";var _alSourcePlay=e=>{if(AL.currentCtx){var t=AL.currentCtx.sources[e];if(!t){AL.currentCtx.err=40961;return}AL.setSourceState(t,4114)}};_alSourcePlay.sig="vi";function _alSourcePlayv(e,t){if(t>>>=0,!!AL.currentCtx){t||(AL.currentCtx.err=40963);for(var r=0;r>>2>>>0]]){AL.currentCtx.err=40961;return}for(var r=0;r>>2>>>0];AL.setSourceState(AL.currentCtx.sources[n],4114)}}}_alSourcePlayv.sig="vip";function _alSourceQueueBuffers(e,t,r){if(r>>>=0,!!AL.currentCtx){var n=AL.currentCtx.sources[e];if(!n){AL.currentCtx.err=40961;return}if(n.type===4136){AL.currentCtx.err=40964;return}if(t!==0){for(var a=AL.buffers[0],l=0;l>>2>>>0],u=AL.buffers[c];if(!u){AL.currentCtx.err=40961;return}a.id!==0&&(u.frequency!==a.frequency||u.bytesPerSample!==a.bytesPerSample||u.channels!==a.channels)&&(AL.currentCtx.err=40964)}n.bufQueue.length===1&&n.bufQueue[0].id===0&&(n.bufQueue.length=0),n.type=4137;for(var l=0;l>>2>>>0],u=AL.buffers[c];u.refCount++,n.bufQueue.push(u)}n.looping&&AL.cancelPendingSourceAudio(n),AL.initSourcePanner(n),AL.scheduleSourceAudio(n)}}}_alSourceQueueBuffers.sig="viip";var _alSourceRewind=e=>{if(AL.currentCtx){var t=AL.currentCtx.sources[e];if(!t){AL.currentCtx.err=40961;return}AL.setSourceState(t,4116),AL.setSourceState(t,4113)}};_alSourceRewind.sig="vi";function _alSourceRewindv(e,t){if(t>>>=0,!!AL.currentCtx){t||(AL.currentCtx.err=40963);for(var r=0;r>>2>>>0]]){AL.currentCtx.err=40961;return}for(var r=0;r>>2>>>0];AL.setSourceState(AL.currentCtx.sources[n],4113)}}}_alSourceRewindv.sig="vip";var _alSourceStop=e=>{if(AL.currentCtx){var t=AL.currentCtx.sources[e];if(!t){AL.currentCtx.err=40961;return}AL.setSourceState(t,4116)}};_alSourceStop.sig="vi";function _alSourceStopv(e,t){if(t>>>=0,!!AL.currentCtx){t||(AL.currentCtx.err=40963);for(var r=0;r>>2>>>0]]){AL.currentCtx.err=40961;return}for(var r=0;r>>2>>>0];AL.setSourceState(AL.currentCtx.sources[n],4116)}}}_alSourceStopv.sig="vip";function _alSourceUnqueueBuffers(e,t,r){if(r>>>=0,!!AL.currentCtx){var n=AL.currentCtx.sources[e];if(!n){AL.currentCtx.err=40961;return}if(t>(n.bufQueue.length===1&&n.bufQueue[0].id===0?0:n.bufsProcessed)){AL.currentCtx.err=40963;return}if(t!==0){for(var a=0;a>>2>>>0]=l.id,n.bufsProcessed--}n.bufQueue.length===0&&n.bufQueue.push(AL.buffers[0]),AL.initSourcePanner(n),AL.scheduleSourceAudio(n)}}}_alSourceUnqueueBuffers.sig="viip";var _alSourcef=(e,t,r)=>{switch(t){case 4097:case 4098:case 4099:case 4106:case 4109:case 4110:case 4128:case 4129:case 4130:case 4131:case 4132:case 4133:case 4134:case 8203:AL.setSourceParam("alSourcef",e,t,r);break;default:AL.setSourceParam("alSourcef",e,t,null);break}};_alSourcef.sig="viif";function _alSourcefv(e,t,r){if(r>>>=0,!!AL.currentCtx){if(!r){AL.currentCtx.err=40963;return}switch(t){case 4097:case 4098:case 4099:case 4106:case 4109:case 4110:case 4128:case 4129:case 4130:case 4131:case 4132:case 4133:case 4134:case 8203:var n=HEAPF32[r>>>2>>>0];AL.setSourceParam("alSourcefv",e,t,n);break;case 4100:case 4101:case 4102:AL.paramArray[0]=HEAPF32[r>>>2>>>0],AL.paramArray[1]=HEAPF32[r+4>>>2>>>0],AL.paramArray[2]=HEAPF32[r+8>>>2>>>0],AL.setSourceParam("alSourcefv",e,t,AL.paramArray);break;default:AL.setSourceParam("alSourcefv",e,t,null);break}}}_alSourcefv.sig="viip";function _alSourceiv(e,t,r){if(r>>>=0,!!AL.currentCtx){if(!r){AL.currentCtx.err=40963;return}switch(t){case 514:case 4097:case 4098:case 4103:case 4105:case 4128:case 4129:case 4131:case 4132:case 4133:case 4134:case 4628:case 8201:case 8202:case 53248:var n=HEAP32[r>>>2>>>0];AL.setSourceParam("alSourceiv",e,t,n);break;case 4100:case 4101:case 4102:AL.paramArray[0]=HEAP32[r>>>2>>>0],AL.paramArray[1]=HEAP32[r+4>>>2>>>0],AL.paramArray[2]=HEAP32[r+8>>>2>>>0],AL.setSourceParam("alSourceiv",e,t,AL.paramArray);break;default:AL.setSourceParam("alSourceiv",e,t,null);break}}}_alSourceiv.sig="viip";var _alSpeedOfSound=e=>{AL.setGlobalParam("alSpeedOfSound",49155,e)};_alSpeedOfSound.sig="vf";var _alcCaptureCloseDevice=function(e){var r,n,a,l;e>>>=0;var t=AL.requireValidCaptureDevice(e,"alcCaptureCloseDevice");return t?(delete AL.captures[e],AL.freeIds.push(e),(r=t.mediaStreamSourceNode)==null||r.disconnect(),(n=t.mergerNode)==null||n.disconnect(),(a=t.splitterNode)==null||a.disconnect(),(l=t.scriptProcessorNode)==null||l.disconnect(),t.mediaStream&&t.mediaStream.getTracks().forEach(c=>c.stop()),delete t.buffers,t.capturedFrameCount=0,t.isCapturing=!1,!0):!1};_alcCaptureCloseDevice.sig="ip";var listenOnce=(e,t,r)=>{e.addEventListener(t,r,{once:!0})},autoResumeAudioContext=(e,t)=>{t||(t=[document,document.getElementById("canvas")]),["keydown","mousedown","touchstart"].forEach(r=>{t.forEach(n=>{n&&listenOnce(n,r,()=>{e.state==="suspended"&&e.resume()})})})};function _alcCaptureOpenDevice(e,t,r,n){var I;e>>>=0;var a=AL.CAPTURE_DEVICE_NAME;if(e!==0&&(a=UTF8ToString(e),a!==AL.CAPTURE_DEVICE_NAME))return AL.alcErr=40965,0;if(n<0)return AL.alcErr=40964,0;navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia;var l=navigator.getUserMedia||navigator.mediaDevices&&navigator.mediaDevices.getUserMedia;if(!l)return AL.alcErr=40965,0;var c=window.AudioContext||window.webkitAudioContext;if(!AL.sharedCaptureAudioCtx)try{AL.sharedCaptureAudioCtx=new c}catch(T){return AL.alcErr=40965,0}autoResumeAudioContext(AL.sharedCaptureAudioCtx);var u;switch(r){case 65552:case 4353:case 4352:u=1;break;case 65553:case 4355:case 4354:u=2;break;default:return AL.alcErr=40964,0}function _(T){return new Float32Array(T)}function d(T){return new Int16Array(T)}function f(T){return new Uint8Array(T)}var p,m;switch(r){case 65552:case 65553:p="f32",m=_;break;case 4353:case 4355:p="i16",m=d;break;case 4352:case 4354:p="u8",m=f;break}var g=[];try{for(var h=0;h{b.mediaStreamError=T},L=T=>{b.mediaStreamSourceNode=b.audioCtx.createMediaStreamSource(T),b.mediaStream=T;var S=1;switch(b.mediaStreamSourceNode.channelCountMode){case"max":S=u;break;case"clamped-max":S=Math.min(u,b.mediaStreamSourceNode.channelCount);break;case"explicit":S=b.mediaStreamSourceNode.channelCount;break}b.inputChannelCount=S;var x=512;b.scriptProcessorNode=b.audioCtx.createScriptProcessor(x,S,u),S>u?(b.mergerNode=b.audioCtx.createChannelMerger(S),b.mediaStreamSourceNode.connect(b.mergerNode),b.mergerNode.connect(b.scriptProcessorNode)):S{if(b.isCapturing){var w=b,P=E.inputBuffer;switch(r){case 65552:for(var D=P.getChannelData(0),A=0;A>>=0,t>>>=0;var n=AL.requireValidCaptureDevice(e,"alcCaptureSamples");if(!n)return;var a=n.requestedSampleRate,l=n.audioCtx.sampleRate,c=l/a;if(r<0||r>n.capturedFrameCount/c){AL.alcErr=40964;return}function u(I,T){HEAPF32[t+4*I>>>2>>>0]=T}function _(I,T){HEAP16[t+2*I>>>1>>>0]=T}function d(I,T){HEAP8[t+I>>>0]=T}var f;switch(n.requestedSampleType){case"f32":f=u;break;case"i16":f=_;break;case"u8":f=d;break;default:return}if(Math.floor(c)==c)for(var p=0,m=0;m>>=0;var t=AL.requireValidCaptureDevice(e,"alcCaptureStart");t&&(t.isCapturing||(t.isCapturing=!0,t.capturedFrameCount=0,t.capturePlayhead=0))}_alcCaptureStart.sig="vp";function _alcCaptureStop(e){e>>>=0;var t=AL.requireValidCaptureDevice(e,"alcCaptureStop");t&&(t.isCapturing=!1)}_alcCaptureStop.sig="vp";function _alcCloseDevice(e){return e>>>=0,!(e in AL.deviceRefCounts)||AL.deviceRefCounts[e]>0?0:(delete AL.deviceRefCounts[e],AL.freeIds.push(e),1)}_alcCloseDevice.sig="ip";function _alcCreateContext(e,t){if(e>>>=0,t>>>=0,!(e in AL.deviceRefCounts))return AL.alcErr=40961,0;var r=null,n=[],a=null;if(t>>=2,t)for(var l=0,c=0;l=HEAP32[t++>>>0],n.push(l),l!==0;)switch(c=HEAP32[t++>>>0],n.push(c),l){case 4103:r||(r={}),r.sampleRate=c;break;case 4112:case 4113:break;case 6546:switch(c){case 0:a=!1;break;case 1:a=!0;break;case 2:break;default:return AL.alcErr=40964,0}break;case 6550:if(c!==0)return AL.alcErr=40964,0;break;default:return AL.alcErr=40964,0}var u=window.AudioContext||window.webkitAudioContext,_=null;try{r?_=new u(r):_=new u}catch(g){return g.name==="NotSupportedError"?AL.alcErr=40964:AL.alcErr=40961,0}autoResumeAudioContext(_),typeof _.createGain>"u"&&(_.createGain=_.createGainNode);var d=_.createGain();d.connect(_.destination);var f={deviceId:e,id:AL.newId(),attrs:n,audioCtx:_,listener:{position:[0,0,0],velocity:[0,0,0],direction:[0,0,0],up:[0,0,0]},sources:[],interval:setInterval(()=>AL.scheduleContextAudio(f),AL.QUEUE_INTERVAL),gain:d,distanceModel:53250,speedOfSound:343.3,dopplerFactor:1,sourceDistanceModel:!1,hrtf:a||!1,_err:0,get err(){return this._err},set err(g){(this._err===0||g===0)&&(this._err=g)}};if(AL.deviceRefCounts[e]++,AL.contexts[f.id]=f,a!==null)for(var p in AL.contexts){var m=AL.contexts[p];m.deviceId===e&&(m.hrtf=a,AL.updateContextGlobal(m))}return f.id}_alcCreateContext.sig="ppp";function _alcDestroyContext(e){e>>>=0;var t=AL.contexts[e];if(AL.currentCtx===t){AL.alcErr=40962;return}AL.contexts[e].interval&&clearInterval(AL.contexts[e].interval),AL.deviceRefCounts[t.deviceId]--,delete AL.contexts[e],AL.freeIds.push(e)}_alcDestroyContext.sig="vp";function _alcGetContextsDevice(e){return e>>>=0,e in AL.contexts?AL.contexts[e].deviceId:0}_alcGetContextsDevice.sig="pp";function _alcGetCurrentContext(){return AL.currentCtx!==null?AL.currentCtx.id:0}_alcGetCurrentContext.sig="p";function _alcGetEnumValue(e,t){if(e>>>=0,t>>>=0,e!==0&&!(e in AL.deviceRefCounts))return 0;if(!t)return AL.alcErr=40964,0;var r=UTF8ToString(t);switch(r){case"ALC_NO_ERROR":return 0;case"ALC_INVALID_DEVICE":return 40961;case"ALC_INVALID_CONTEXT":return 40962;case"ALC_INVALID_ENUM":return 40963;case"ALC_INVALID_VALUE":return 40964;case"ALC_OUT_OF_MEMORY":return 40965;case"ALC_MAJOR_VERSION":return 4096;case"ALC_MINOR_VERSION":return 4097;case"ALC_ATTRIBUTES_SIZE":return 4098;case"ALC_ALL_ATTRIBUTES":return 4099;case"ALC_DEFAULT_DEVICE_SPECIFIER":return 4100;case"ALC_DEVICE_SPECIFIER":return 4101;case"ALC_EXTENSIONS":return 4102;case"ALC_FREQUENCY":return 4103;case"ALC_REFRESH":return 4104;case"ALC_SYNC":return 4105;case"ALC_MONO_SOURCES":return 4112;case"ALC_STEREO_SOURCES":return 4113;case"ALC_CAPTURE_DEVICE_SPECIFIER":return 784;case"ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER":return 785;case"ALC_CAPTURE_SAMPLES":return 786;case"ALC_HRTF_SOFT":return 6546;case"ALC_HRTF_ID_SOFT":return 6550;case"ALC_DONT_CARE_SOFT":return 2;case"ALC_HRTF_STATUS_SOFT":return 6547;case"ALC_NUM_HRTF_SPECIFIERS_SOFT":return 6548;case"ALC_HRTF_SPECIFIER_SOFT":return 6549;case"ALC_HRTF_DISABLED_SOFT":return 0;case"ALC_HRTF_ENABLED_SOFT":return 1;case"ALC_HRTF_DENIED_SOFT":return 2;case"ALC_HRTF_REQUIRED_SOFT":return 3;case"ALC_HRTF_HEADPHONES_DETECTED_SOFT":return 4;case"ALC_HRTF_UNSUPPORTED_FORMAT_SOFT":return 5;default:return AL.alcErr=40964,0}}_alcGetEnumValue.sig="ipp";function _alcGetError(e){e>>>=0;var t=AL.alcErr;return AL.alcErr=0,t}_alcGetError.sig="ip";function _alcGetIntegerv(e,t,r,n){if(e>>>=0,n>>>=0,!(r===0||!n))switch(t){case 4096:HEAP32[n>>>2>>>0]=1;break;case 4097:HEAP32[n>>>2>>>0]=1;break;case 4098:if(!(e in AL.deviceRefCounts)){AL.alcErr=40961;return}if(!AL.currentCtx){AL.alcErr=40962;return}HEAP32[n>>>2>>>0]=AL.currentCtx.attrs.length;break;case 4099:if(!(e in AL.deviceRefCounts)){AL.alcErr=40961;return}if(!AL.currentCtx){AL.alcErr=40962;return}for(var a=0;a>>2>>>0]=AL.currentCtx.attrs[a];break;case 4103:if(!(e in AL.deviceRefCounts)){AL.alcErr=40961;return}if(!AL.currentCtx){AL.alcErr=40962;return}HEAP32[n>>>2>>>0]=AL.currentCtx.audioCtx.sampleRate;break;case 4112:case 4113:if(!(e in AL.deviceRefCounts)){AL.alcErr=40961;return}if(!AL.currentCtx){AL.alcErr=40962;return}HEAP32[n>>>2>>>0]=2147483647;break;case 6546:case 6547:if(!(e in AL.deviceRefCounts)){AL.alcErr=40961;return}var l=0;for(var c in AL.contexts){var u=AL.contexts[c];u.deviceId===e&&(l=u.hrtf?1:0)}HEAP32[n>>>2>>>0]=l;break;case 6548:if(!(e in AL.deviceRefCounts)){AL.alcErr=40961;return}HEAP32[n>>>2>>>0]=1;break;case 131075:if(!(e in AL.deviceRefCounts)){AL.alcErr=40961;return}if(!AL.currentCtx){AL.alcErr=40962;return}HEAP32[n>>>2>>>0]=1;case 786:var _=AL.requireValidCaptureDevice(e,"alcGetIntegerv");if(!_)return;var d=_.capturedFrameCount,f=_.requestedSampleRate,p=_.audioCtx.sampleRate,m=Math.floor(d*(f/p));HEAP32[n>>>2>>>0]=m;break;default:AL.alcErr=40963;return}}_alcGetIntegerv.sig="vpiip";function _alcGetString(e,t){if(e>>>=0,AL.alcStringCache[t])return AL.alcStringCache[t];var r;switch(t){case 0:r="No Error";break;case 40961:r="Invalid Device";break;case 40962:r="Invalid Context";break;case 40963:r="Invalid Enum";break;case 40964:r="Invalid Value";break;case 40965:r="Out of Memory";break;case 4100:if(typeof AudioContext<"u"||typeof webkitAudioContext<"u")r=AL.DEVICE_NAME;else return 0;break;case 4101:typeof AudioContext<"u"||typeof webkitAudioContext<"u"?r=AL.DEVICE_NAME+"\0":r="\0";break;case 785:r=AL.CAPTURE_DEVICE_NAME;break;case 784:if(e===0)r=AL.CAPTURE_DEVICE_NAME+"\0";else{var n=AL.requireValidCaptureDevice(e,"alcGetString");if(!n)return 0;r=n.deviceName}break;case 4102:if(!e)return AL.alcErr=40961,0;r=Object.keys(AL.ALC_EXTENSIONS).join(" ");break;default:return AL.alcErr=40963,0}return r=stringToNewUTF8(r),AL.alcStringCache[t]=r,r}_alcGetString.sig="ppi";function _alcIsExtensionPresent(e,t){e>>>=0,t>>>=0;var r=UTF8ToString(t);return AL.ALC_EXTENSIONS[r]?1:0}_alcIsExtensionPresent.sig="ipp";function _alcMakeContextCurrent(e){return e>>>=0,e===0?AL.currentCtx=null:AL.currentCtx=AL.contexts[e],1}_alcMakeContextCurrent.sig="ip";function _alcOpenDevice(e){if(e>>>=0,e){var t=UTF8ToString(e);if(t!==AL.DEVICE_NAME)return 0}if(typeof AudioContext<"u"||typeof webkitAudioContext<"u"){var r=AL.newId();return AL.deviceRefCounts[r]=0,r}return 0}_alcOpenDevice.sig="pp";function _alcProcessContext(e){e>>>=0}_alcProcessContext.sig="vp";function _alcSuspendContext(e){e>>>=0}_alcSuspendContext.sig="vp";function _duckdb_web_fs_directory_create(e,t){return e>>>=0,globalThis.DUCKDB_RUNTIME.createDirectory(Module,e,t)}_duckdb_web_fs_directory_create.sig="vpi";function _duckdb_web_fs_directory_exists(e,t){return e>>>=0,globalThis.DUCKDB_RUNTIME.checkDirectory(Module,e,t)}_duckdb_web_fs_directory_exists.sig="ipi";function _duckdb_web_fs_directory_list_files(e,t){return e>>>=0,globalThis.DUCKDB_RUNTIME.listDirectoryEntries(Module,e,t)}_duckdb_web_fs_directory_list_files.sig="ipi";function _duckdb_web_fs_directory_remove(e,t){return e>>>=0,globalThis.DUCKDB_RUNTIME.removeDirectory(Module,e,t)}_duckdb_web_fs_directory_remove.sig="vpi";function _duckdb_web_fs_file_close(e){return globalThis.DUCKDB_RUNTIME.closeFile(Module,e)}_duckdb_web_fs_file_close.sig="vi";function _duckdb_web_fs_file_exists(e,t){return e>>>=0,globalThis.DUCKDB_RUNTIME.checkFile(Module,e,t)}_duckdb_web_fs_file_exists.sig="ipi";function _duckdb_web_fs_file_get_last_modified_time(e){return globalThis.DUCKDB_RUNTIME.getLastFileModificationTime(Module,e)}_duckdb_web_fs_file_get_last_modified_time.sig="ii";function _duckdb_web_fs_file_move(e,t,r,n){return e>>>=0,r>>>=0,globalThis.DUCKDB_RUNTIME.moveFile(Module,e,t,r,n)}_duckdb_web_fs_file_move.sig="vpipi";function _duckdb_web_fs_file_open(e,t){return globalThis.DUCKDB_RUNTIME.openFile(Module,e,t)}_duckdb_web_fs_file_open.sig="pii";function _duckdb_web_fs_file_read(e,t,r,n){return t>>>=0,globalThis.DUCKDB_RUNTIME.readFile(Module,e,t,r,n)}_duckdb_web_fs_file_read.sig="iipid";function _duckdb_web_fs_file_truncate(e,t){return globalThis.DUCKDB_RUNTIME.truncateFile(Module,e,t)}_duckdb_web_fs_file_truncate.sig="vid";function _duckdb_web_fs_file_write(e,t,r,n){return t>>>=0,globalThis.DUCKDB_RUNTIME.writeFile(Module,e,t,r,n)}_duckdb_web_fs_file_write.sig="iipid";function _duckdb_web_fs_get_default_data_protocol(e){return globalThis.DUCKDB_RUNTIME.getDefaultDataProtocol(e)}_duckdb_web_fs_get_default_data_protocol.sig="i";function _duckdb_web_fs_glob(e,t){return e>>>=0,globalThis.DUCKDB_RUNTIME.glob(Module,e,t)}_duckdb_web_fs_glob.sig="vpi";function _duckdb_web_test_platform_feature(e){return globalThis.DUCKDB_RUNTIME.testPlatformFeature(Module,e)}_duckdb_web_test_platform_feature.sig="ii";function _duckdb_web_udf_scalar_call(e,t,r,n,a,l){return e>>>=0,r>>>=0,a>>>=0,globalThis.DUCKDB_RUNTIME.callScalarUDF(Module,e,t,r,n,a,l)}_duckdb_web_udf_scalar_call.sig="vpipipi";var _emscripten_alcDevicePauseSOFT=e=>{if(!(e in AL.deviceRefCounts)){AL.alcErr=40961;return}if(!AL.paused){AL.paused=!0;for(var t in AL.contexts){var r=AL.contexts[t];r.deviceId===e&&(r.audioCtx.suspend(),clearInterval(r.interval),r.interval=null)}}};_emscripten_alcDevicePauseSOFT.sig="vi";var _emscripten_alcDeviceResumeSOFT=e=>{if(!(e in AL.deviceRefCounts)){AL.alcErr=40961;return}if(AL.paused){AL.paused=!1;for(var t in AL.contexts){var r=AL.contexts[t];r.deviceId===e&&(r.interval=setInterval(()=>AL.scheduleContextAudio(r),AL.QUEUE_INTERVAL),r.audioCtx.resume())}}};_emscripten_alcDeviceResumeSOFT.sig="vi";var _emscripten_alcGetStringiSOFT=(e,t,r)=>{if(!(e in AL.deviceRefCounts))return AL.alcErr=40961,0;if(AL.alcStringCache[t])return AL.alcStringCache[t];var n;switch(t){case 6549:if(r===0)n="Web Audio HRTF";else return AL.alcErr=40964,0;break;default:return r!==0?(AL.alcErr=40963,0):_alcGetString(e,t)}return n=stringToNewUTF8(n),AL.alcStringCache[t]=n,n};_emscripten_alcGetStringiSOFT.sig="iiii";var _emscripten_alcResetDeviceSOFT=(e,t)=>{if(!(e in AL.deviceRefCounts))return AL.alcErr=40961,0;var r=null;if(t>>=2,t)for(var n=0,a=0;n=HEAP32[t++>>>0],n!==0;)switch(a=HEAP32[t++>>>0],n){case 6546:a===1?r=!0:a===0&&(r=!1);break}if(r!==null)for(var l in AL.contexts){var c=AL.contexts[l];c.deviceId===e&&(c.hrtf=r,AL.updateContextGlobal(c))}return 1};_emscripten_alcResetDeviceSOFT.sig="iii";var readEmAsmArgsArray=[],readEmAsmArgs=(e,t)=>{readEmAsmArgsArray.length=0;for(var r;r=HEAPU8[e++>>>0];){var n=r!=105;n&=r!=112,t+=n&&t%8?4:0,readEmAsmArgsArray.push(r==112?HEAPU32[t>>>2>>>0]:r==105?HEAP32[t>>>2>>>0]:HEAPF64[t>>>3>>>0]),t+=n?8:4}return readEmAsmArgsArray},runEmAsmFunction=(e,t,r)=>{var n=readEmAsmArgs(t,r);return ASM_CONSTS[e](...n)};function _emscripten_asm_const_int(e,t,r){return e>>>=0,t>>>=0,r>>>=0,runEmAsmFunction(e,t,r)}_emscripten_asm_const_int.sig="ippp";function _emscripten_asm_const_ptr(e,t,r){return e>>>=0,t>>>=0,r>>>=0,runEmAsmFunction(e,t,r)}_emscripten_asm_const_ptr.sig="pppp";function _emscripten_console_error(e){e>>>=0,console.error(UTF8ToString(e))}_emscripten_console_error.sig="vp";function _emscripten_console_log(e){e>>>=0,console.log(UTF8ToString(e))}_emscripten_console_log.sig="vp";function _emscripten_console_trace(e){e>>>=0,console.trace(UTF8ToString(e))}_emscripten_console_trace.sig="vp";function _emscripten_console_warn(e){e>>>=0,console.warn(UTF8ToString(e))}_emscripten_console_warn.sig="vp";var _emscripten_date_now=()=>Date.now();_emscripten_date_now.sig="d";function _emscripten_err(e){return e>>>=0,err(UTF8ToString(e))}_emscripten_err.sig="vp";var getHeapMax=()=>4294901760;function _emscripten_get_heap_max(){return getHeapMax()}_emscripten_get_heap_max.sig="p";var _emscripten_get_now_res=()=>ENVIRONMENT_IS_NODE?1:1e3;_emscripten_get_now_res.sig="d";var GLctx,webgl_enable_ANGLE_instanced_arrays=e=>{var t=e.getExtension("ANGLE_instanced_arrays");if(t)return e.vertexAttribDivisor=(r,n)=>t.vertexAttribDivisorANGLE(r,n),e.drawArraysInstanced=(r,n,a,l)=>t.drawArraysInstancedANGLE(r,n,a,l),e.drawElementsInstanced=(r,n,a,l,c)=>t.drawElementsInstancedANGLE(r,n,a,l,c),1},webgl_enable_OES_vertex_array_object=e=>{var t=e.getExtension("OES_vertex_array_object");if(t)return e.createVertexArray=()=>t.createVertexArrayOES(),e.deleteVertexArray=r=>t.deleteVertexArrayOES(r),e.bindVertexArray=r=>t.bindVertexArrayOES(r),e.isVertexArray=r=>t.isVertexArrayOES(r),1},webgl_enable_WEBGL_draw_buffers=e=>{var t=e.getExtension("WEBGL_draw_buffers");if(t)return e.drawBuffers=(r,n)=>t.drawBuffersWEBGL(r,n),1},webgl_enable_EXT_polygon_offset_clamp=e=>!!(e.extPolygonOffsetClamp=e.getExtension("EXT_polygon_offset_clamp")),webgl_enable_EXT_clip_control=e=>!!(e.extClipControl=e.getExtension("EXT_clip_control")),webgl_enable_WEBGL_polygon_mode=e=>!!(e.webglPolygonMode=e.getExtension("WEBGL_polygon_mode")),webgl_enable_WEBGL_multi_draw=e=>!!(e.multiDrawWebgl=e.getExtension("WEBGL_multi_draw")),getEmscriptenSupportedExtensions=e=>{var t=["ANGLE_instanced_arrays","EXT_blend_minmax","EXT_disjoint_timer_query","EXT_frag_depth","EXT_shader_texture_lod","EXT_sRGB","OES_element_index_uint","OES_fbo_render_mipmap","OES_standard_derivatives","OES_texture_float","OES_texture_half_float","OES_texture_half_float_linear","OES_vertex_array_object","WEBGL_color_buffer_float","WEBGL_depth_texture","WEBGL_draw_buffers","EXT_clip_control","EXT_color_buffer_half_float","EXT_depth_clamp","EXT_float_blend","EXT_polygon_offset_clamp","EXT_texture_compression_bptc","EXT_texture_compression_rgtc","EXT_texture_filter_anisotropic","KHR_parallel_shader_compile","OES_texture_float_linear","WEBGL_blend_func_extended","WEBGL_compressed_texture_astc","WEBGL_compressed_texture_etc","WEBGL_compressed_texture_etc1","WEBGL_compressed_texture_s3tc","WEBGL_compressed_texture_s3tc_srgb","WEBGL_debug_renderer_info","WEBGL_debug_shaders","WEBGL_lose_context","WEBGL_multi_draw","WEBGL_polygon_mode"];return(e.getSupportedExtensions()||[]).filter(r=>t.includes(r))},GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:[],offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,unpackRowLength:0,recordError:e=>{GL.lastError||(GL.lastError=e)},getNewId:e=>{for(var t=GL.counter++,r=e.length;r{for(var a=0;a>>2>>>0]=c}},getSource:(e,t,r,n)=>{for(var a="",l=0;l>>2>>>0]:void 0;a+=UTF8ToString(HEAPU32[r+l*4>>>2>>>0],c)}return a},createContext:(e,t)=>{if(!e.getContextSafariWebGL2Fixed){let l=function(c,u){var _=e.getContextSafariWebGL2Fixed(c,u);return c=="webgl"==_ instanceof WebGLRenderingContext?_:null};var a=l;e.getContextSafariWebGL2Fixed=e.getContext,e.getContext=l}var r=e.getContext("webgl",t);if(!r)return 0;var n=GL.registerContext(r,t);return n},registerContext:(e,t)=>{var r=GL.getNewId(GL.contexts),n={handle:r,attributes:t,version:t.majorVersion,GLctx:e};return e.canvas&&(e.canvas.GLctxObject=n),GL.contexts[r]=n,(typeof t.enableExtensionsByDefault>"u"||t.enableExtensionsByDefault)&&GL.initExtensions(n),r},makeContextCurrent:e=>{var t;return GL.currentContext=GL.contexts[e],Module.ctx=GLctx=(t=GL.currentContext)==null?void 0:t.GLctx,!(e&&!GLctx)},getContext:e=>GL.contexts[e],deleteContext:e=>{GL.currentContext===GL.contexts[e]&&(GL.currentContext=null),typeof JSEvents=="object"&&JSEvents.removeAllHandlersOnTarget(GL.contexts[e].GLctx.canvas),GL.contexts[e]&&GL.contexts[e].GLctx.canvas&&(GL.contexts[e].GLctx.canvas.GLctxObject=void 0),GL.contexts[e]=null},initExtensions:e=>{if(e||(e=GL.currentContext),!e.initExtensionsDone){e.initExtensionsDone=!0;var t=e.GLctx;webgl_enable_WEBGL_multi_draw(t),webgl_enable_EXT_polygon_offset_clamp(t),webgl_enable_EXT_clip_control(t),webgl_enable_WEBGL_polygon_mode(t),webgl_enable_ANGLE_instanced_arrays(t),webgl_enable_OES_vertex_array_object(t),webgl_enable_WEBGL_draw_buffers(t),t.disjointTimerQueryExt=t.getExtension("EXT_disjoint_timer_query"),getEmscriptenSupportedExtensions(t).forEach(r=>{!r.includes("lose_context")&&!r.includes("debug")&&t.getExtension(r)})}}},_glActiveTexture=e=>GLctx.activeTexture(e);_glActiveTexture.sig="vi";var _emscripten_glActiveTexture=_glActiveTexture;_emscripten_glActiveTexture.sig="vi";var _glAttachShader=(e,t)=>{GLctx.attachShader(GL.programs[e],GL.shaders[t])};_glAttachShader.sig="vii";var _emscripten_glAttachShader=_glAttachShader;_emscripten_glAttachShader.sig="vii";var _glBeginQueryEXT=(e,t)=>{GLctx.disjointTimerQueryExt.beginQueryEXT(e,GL.queries[t])};_glBeginQueryEXT.sig="vii";var _emscripten_glBeginQueryEXT=_glBeginQueryEXT;function _glBindAttribLocation(e,t,r){r>>>=0,GLctx.bindAttribLocation(GL.programs[e],t,UTF8ToString(r))}_glBindAttribLocation.sig="viip";var _emscripten_glBindAttribLocation=_glBindAttribLocation;_emscripten_glBindAttribLocation.sig="viip";var _glBindBuffer=(e,t)=>{GLctx.bindBuffer(e,GL.buffers[t])};_glBindBuffer.sig="vii";var _emscripten_glBindBuffer=_glBindBuffer;_emscripten_glBindBuffer.sig="vii";var _glBindFramebuffer=(e,t)=>{GLctx.bindFramebuffer(e,GL.framebuffers[t])};_glBindFramebuffer.sig="vii";var _emscripten_glBindFramebuffer=_glBindFramebuffer;_emscripten_glBindFramebuffer.sig="vii";var _glBindRenderbuffer=(e,t)=>{GLctx.bindRenderbuffer(e,GL.renderbuffers[t])};_glBindRenderbuffer.sig="vii";var _emscripten_glBindRenderbuffer=_glBindRenderbuffer;_emscripten_glBindRenderbuffer.sig="vii";var _glBindTexture=(e,t)=>{GLctx.bindTexture(e,GL.textures[t])};_glBindTexture.sig="vii";var _emscripten_glBindTexture=_glBindTexture;_emscripten_glBindTexture.sig="vii";var _glBindVertexArray=e=>{GLctx.bindVertexArray(GL.vaos[e])};_glBindVertexArray.sig="vi";var _glBindVertexArrayOES=_glBindVertexArray;_glBindVertexArrayOES.sig="vi";var _emscripten_glBindVertexArrayOES=_glBindVertexArrayOES;_emscripten_glBindVertexArrayOES.sig="vi";var _glBlendColor=(e,t,r,n)=>GLctx.blendColor(e,t,r,n);_glBlendColor.sig="vffff";var _emscripten_glBlendColor=_glBlendColor;_emscripten_glBlendColor.sig="vffff";var _glBlendEquation=e=>GLctx.blendEquation(e);_glBlendEquation.sig="vi";var _emscripten_glBlendEquation=_glBlendEquation;_emscripten_glBlendEquation.sig="vi";var _glBlendEquationSeparate=(e,t)=>GLctx.blendEquationSeparate(e,t);_glBlendEquationSeparate.sig="vii";var _emscripten_glBlendEquationSeparate=_glBlendEquationSeparate;_emscripten_glBlendEquationSeparate.sig="vii";var _glBlendFunc=(e,t)=>GLctx.blendFunc(e,t);_glBlendFunc.sig="vii";var _emscripten_glBlendFunc=_glBlendFunc;_emscripten_glBlendFunc.sig="vii";var _glBlendFuncSeparate=(e,t,r,n)=>GLctx.blendFuncSeparate(e,t,r,n);_glBlendFuncSeparate.sig="viiii";var _emscripten_glBlendFuncSeparate=_glBlendFuncSeparate;_emscripten_glBlendFuncSeparate.sig="viiii";function _glBufferData(e,t,r,n){t>>>=0,r>>>=0,GLctx.bufferData(e,r?HEAPU8.subarray(r>>>0,r+t>>>0):t,n)}_glBufferData.sig="vippi";var _emscripten_glBufferData=_glBufferData;_emscripten_glBufferData.sig="vippi";function _glBufferSubData(e,t,r,n){t>>>=0,r>>>=0,n>>>=0,GLctx.bufferSubData(e,t,HEAPU8.subarray(n>>>0,n+r>>>0))}_glBufferSubData.sig="vippp";var _emscripten_glBufferSubData=_glBufferSubData;_emscripten_glBufferSubData.sig="vippp";var _glCheckFramebufferStatus=e=>GLctx.checkFramebufferStatus(e);_glCheckFramebufferStatus.sig="ii";var _emscripten_glCheckFramebufferStatus=_glCheckFramebufferStatus;_emscripten_glCheckFramebufferStatus.sig="ii";var _glClear=e=>GLctx.clear(e);_glClear.sig="vi";var _emscripten_glClear=_glClear;_emscripten_glClear.sig="vi";var _glClearColor=(e,t,r,n)=>GLctx.clearColor(e,t,r,n);_glClearColor.sig="vffff";var _emscripten_glClearColor=_glClearColor;_emscripten_glClearColor.sig="vffff";var _glClearDepthf=e=>GLctx.clearDepth(e);_glClearDepthf.sig="vf";var _emscripten_glClearDepthf=_glClearDepthf;_emscripten_glClearDepthf.sig="vf";var _glClearStencil=e=>GLctx.clearStencil(e);_glClearStencil.sig="vi";var _emscripten_glClearStencil=_glClearStencil;_emscripten_glClearStencil.sig="vi";var _glClipControlEXT=(e,t)=>{GLctx.extClipControl.clipControlEXT(e,t)};_glClipControlEXT.sig="vii";var _emscripten_glClipControlEXT=_glClipControlEXT,_glColorMask=(e,t,r,n)=>{GLctx.colorMask(!!e,!!t,!!r,!!n)};_glColorMask.sig="viiii";var _emscripten_glColorMask=_glColorMask;_emscripten_glColorMask.sig="viiii";var _glCompileShader=e=>{GLctx.compileShader(GL.shaders[e])};_glCompileShader.sig="vi";var _emscripten_glCompileShader=_glCompileShader;_emscripten_glCompileShader.sig="vi";function _glCompressedTexImage2D(e,t,r,n,a,l,c,u){u>>>=0,GLctx.compressedTexImage2D(e,t,r,n,a,l,HEAPU8.subarray(u>>>0,u+c>>>0))}_glCompressedTexImage2D.sig="viiiiiiip";var _emscripten_glCompressedTexImage2D=_glCompressedTexImage2D;_emscripten_glCompressedTexImage2D.sig="viiiiiiip";function _glCompressedTexSubImage2D(e,t,r,n,a,l,c,u,_){_>>>=0,GLctx.compressedTexSubImage2D(e,t,r,n,a,l,c,HEAPU8.subarray(_>>>0,_+u>>>0))}_glCompressedTexSubImage2D.sig="viiiiiiiip";var _emscripten_glCompressedTexSubImage2D=_glCompressedTexSubImage2D;_emscripten_glCompressedTexSubImage2D.sig="viiiiiiiip";var _glCopyTexImage2D=(e,t,r,n,a,l,c,u)=>GLctx.copyTexImage2D(e,t,r,n,a,l,c,u);_glCopyTexImage2D.sig="viiiiiiii";var _emscripten_glCopyTexImage2D=_glCopyTexImage2D;_emscripten_glCopyTexImage2D.sig="viiiiiiii";var _glCopyTexSubImage2D=(e,t,r,n,a,l,c,u)=>GLctx.copyTexSubImage2D(e,t,r,n,a,l,c,u);_glCopyTexSubImage2D.sig="viiiiiiii";var _emscripten_glCopyTexSubImage2D=_glCopyTexSubImage2D;_emscripten_glCopyTexSubImage2D.sig="viiiiiiii";var _glCreateProgram=()=>{var e=GL.getNewId(GL.programs),t=GLctx.createProgram();return t.name=e,t.maxUniformLength=t.maxAttributeLength=t.maxUniformBlockNameLength=0,t.uniformIdCounter=1,GL.programs[e]=t,e};_glCreateProgram.sig="i";var _emscripten_glCreateProgram=_glCreateProgram;_emscripten_glCreateProgram.sig="i";var _glCreateShader=e=>{var t=GL.getNewId(GL.shaders);return GL.shaders[t]=GLctx.createShader(e),t};_glCreateShader.sig="ii";var _emscripten_glCreateShader=_glCreateShader;_emscripten_glCreateShader.sig="ii";var _glCullFace=e=>GLctx.cullFace(e);_glCullFace.sig="vi";var _emscripten_glCullFace=_glCullFace;_emscripten_glCullFace.sig="vi";function _glDeleteBuffers(e,t){t>>>=0;for(var r=0;r>>2>>>0],a=GL.buffers[n];a&&(GLctx.deleteBuffer(a),a.name=0,GL.buffers[n]=null)}}_glDeleteBuffers.sig="vip";var _emscripten_glDeleteBuffers=_glDeleteBuffers;_emscripten_glDeleteBuffers.sig="vip";function _glDeleteFramebuffers(e,t){t>>>=0;for(var r=0;r>>2>>>0],a=GL.framebuffers[n];a&&(GLctx.deleteFramebuffer(a),a.name=0,GL.framebuffers[n]=null)}}_glDeleteFramebuffers.sig="vip";var _emscripten_glDeleteFramebuffers=_glDeleteFramebuffers;_emscripten_glDeleteFramebuffers.sig="vip";var _glDeleteProgram=e=>{if(e){var t=GL.programs[e];if(!t){GL.recordError(1281);return}GLctx.deleteProgram(t),t.name=0,GL.programs[e]=null}};_glDeleteProgram.sig="vi";var _emscripten_glDeleteProgram=_glDeleteProgram;_emscripten_glDeleteProgram.sig="vi";function _glDeleteQueriesEXT(e,t){t>>>=0;for(var r=0;r>>2>>>0],a=GL.queries[n];a&&(GLctx.disjointTimerQueryExt.deleteQueryEXT(a),GL.queries[n]=null)}}_glDeleteQueriesEXT.sig="vip";var _emscripten_glDeleteQueriesEXT=_glDeleteQueriesEXT;function _glDeleteRenderbuffers(e,t){t>>>=0;for(var r=0;r>>2>>>0],a=GL.renderbuffers[n];a&&(GLctx.deleteRenderbuffer(a),a.name=0,GL.renderbuffers[n]=null)}}_glDeleteRenderbuffers.sig="vip";var _emscripten_glDeleteRenderbuffers=_glDeleteRenderbuffers;_emscripten_glDeleteRenderbuffers.sig="vip";var _glDeleteShader=e=>{if(e){var t=GL.shaders[e];if(!t){GL.recordError(1281);return}GLctx.deleteShader(t),GL.shaders[e]=null}};_glDeleteShader.sig="vi";var _emscripten_glDeleteShader=_glDeleteShader;_emscripten_glDeleteShader.sig="vi";function _glDeleteTextures(e,t){t>>>=0;for(var r=0;r>>2>>>0],a=GL.textures[n];a&&(GLctx.deleteTexture(a),a.name=0,GL.textures[n]=null)}}_glDeleteTextures.sig="vip";var _emscripten_glDeleteTextures=_glDeleteTextures;_emscripten_glDeleteTextures.sig="vip";function _glDeleteVertexArrays(e,t){t>>>=0;for(var r=0;r>>2>>>0];GLctx.deleteVertexArray(GL.vaos[n]),GL.vaos[n]=null}}_glDeleteVertexArrays.sig="vip";var _glDeleteVertexArraysOES=_glDeleteVertexArrays;_glDeleteVertexArraysOES.sig="vip";var _emscripten_glDeleteVertexArraysOES=_glDeleteVertexArraysOES;_emscripten_glDeleteVertexArraysOES.sig="vip";var _glDepthFunc=e=>GLctx.depthFunc(e);_glDepthFunc.sig="vi";var _emscripten_glDepthFunc=_glDepthFunc;_emscripten_glDepthFunc.sig="vi";var _glDepthMask=e=>{GLctx.depthMask(!!e)};_glDepthMask.sig="vi";var _emscripten_glDepthMask=_glDepthMask;_emscripten_glDepthMask.sig="vi";var _glDepthRangef=(e,t)=>GLctx.depthRange(e,t);_glDepthRangef.sig="vff";var _emscripten_glDepthRangef=_glDepthRangef;_emscripten_glDepthRangef.sig="vff";var _glDetachShader=(e,t)=>{GLctx.detachShader(GL.programs[e],GL.shaders[t])};_glDetachShader.sig="vii";var _emscripten_glDetachShader=_glDetachShader;_emscripten_glDetachShader.sig="vii";var _glDisable=e=>GLctx.disable(e);_glDisable.sig="vi";var _emscripten_glDisable=_glDisable;_emscripten_glDisable.sig="vi";var _glDisableVertexAttribArray=e=>{GLctx.disableVertexAttribArray(e)};_glDisableVertexAttribArray.sig="vi";var _emscripten_glDisableVertexAttribArray=_glDisableVertexAttribArray;_emscripten_glDisableVertexAttribArray.sig="vi";var _glDrawArrays=(e,t,r)=>{GLctx.drawArrays(e,t,r)};_glDrawArrays.sig="viii";var _emscripten_glDrawArrays=_glDrawArrays;_emscripten_glDrawArrays.sig="viii";var _glDrawArraysInstanced=(e,t,r,n)=>{GLctx.drawArraysInstanced(e,t,r,n)};_glDrawArraysInstanced.sig="viiii";var _glDrawArraysInstancedANGLE=_glDrawArraysInstanced,_emscripten_glDrawArraysInstancedANGLE=_glDrawArraysInstancedANGLE,tempFixedLengthArray=[];function _glDrawBuffers(e,t){t>>>=0;for(var r=tempFixedLengthArray[e],n=0;n>>2>>>0];GLctx.drawBuffers(r)}_glDrawBuffers.sig="vip";var _glDrawBuffersWEBGL=_glDrawBuffers,_emscripten_glDrawBuffersWEBGL=_glDrawBuffersWEBGL;function _glDrawElements(e,t,r,n){n>>>=0,GLctx.drawElements(e,t,r,n)}_glDrawElements.sig="viiip";var _emscripten_glDrawElements=_glDrawElements;_emscripten_glDrawElements.sig="viiip";function _glDrawElementsInstanced(e,t,r,n,a){n>>>=0,GLctx.drawElementsInstanced(e,t,r,n,a)}_glDrawElementsInstanced.sig="viiipi";var _glDrawElementsInstancedANGLE=_glDrawElementsInstanced,_emscripten_glDrawElementsInstancedANGLE=_glDrawElementsInstancedANGLE,_glEnable=e=>GLctx.enable(e);_glEnable.sig="vi";var _emscripten_glEnable=_glEnable;_emscripten_glEnable.sig="vi";var _glEnableVertexAttribArray=e=>{GLctx.enableVertexAttribArray(e)};_glEnableVertexAttribArray.sig="vi";var _emscripten_glEnableVertexAttribArray=_glEnableVertexAttribArray;_emscripten_glEnableVertexAttribArray.sig="vi";var _glEndQueryEXT=e=>{GLctx.disjointTimerQueryExt.endQueryEXT(e)};_glEndQueryEXT.sig="vi";var _emscripten_glEndQueryEXT=_glEndQueryEXT,_glFinish=()=>GLctx.finish();_glFinish.sig="v";var _emscripten_glFinish=_glFinish;_emscripten_glFinish.sig="v";var _glFlush=()=>GLctx.flush();_glFlush.sig="v";var _emscripten_glFlush=_glFlush;_emscripten_glFlush.sig="v";var _glFramebufferRenderbuffer=(e,t,r,n)=>{GLctx.framebufferRenderbuffer(e,t,r,GL.renderbuffers[n])};_glFramebufferRenderbuffer.sig="viiii";var _emscripten_glFramebufferRenderbuffer=_glFramebufferRenderbuffer;_emscripten_glFramebufferRenderbuffer.sig="viiii";var _glFramebufferTexture2D=(e,t,r,n,a)=>{GLctx.framebufferTexture2D(e,t,r,GL.textures[n],a)};_glFramebufferTexture2D.sig="viiiii";var _emscripten_glFramebufferTexture2D=_glFramebufferTexture2D;_emscripten_glFramebufferTexture2D.sig="viiiii";var _glFrontFace=e=>GLctx.frontFace(e);_glFrontFace.sig="vi";var _emscripten_glFrontFace=_glFrontFace;_emscripten_glFrontFace.sig="vi";function _glGenBuffers(e,t){t>>>=0,GL.genObject(e,t,"createBuffer",GL.buffers)}_glGenBuffers.sig="vip";var _emscripten_glGenBuffers=_glGenBuffers;_emscripten_glGenBuffers.sig="vip";function _glGenFramebuffers(e,t){t>>>=0,GL.genObject(e,t,"createFramebuffer",GL.framebuffers)}_glGenFramebuffers.sig="vip";var _emscripten_glGenFramebuffers=_glGenFramebuffers;_emscripten_glGenFramebuffers.sig="vip";function _glGenQueriesEXT(e,t){t>>>=0;for(var r=0;r>>2>>>0]=0;return}var a=GL.getNewId(GL.queries);n.name=a,GL.queries[a]=n,HEAP32[t+r*4>>>2>>>0]=a}}_glGenQueriesEXT.sig="vip";var _emscripten_glGenQueriesEXT=_glGenQueriesEXT;function _glGenRenderbuffers(e,t){t>>>=0,GL.genObject(e,t,"createRenderbuffer",GL.renderbuffers)}_glGenRenderbuffers.sig="vip";var _emscripten_glGenRenderbuffers=_glGenRenderbuffers;_emscripten_glGenRenderbuffers.sig="vip";function _glGenTextures(e,t){t>>>=0,GL.genObject(e,t,"createTexture",GL.textures)}_glGenTextures.sig="vip";var _emscripten_glGenTextures=_glGenTextures;_emscripten_glGenTextures.sig="vip";function _glGenVertexArrays(e,t){t>>>=0,GL.genObject(e,t,"createVertexArray",GL.vaos)}_glGenVertexArrays.sig="vip";var _glGenVertexArraysOES=_glGenVertexArrays;_glGenVertexArraysOES.sig="vip";var _emscripten_glGenVertexArraysOES=_glGenVertexArraysOES;_emscripten_glGenVertexArraysOES.sig="vip";var _glGenerateMipmap=e=>GLctx.generateMipmap(e);_glGenerateMipmap.sig="vi";var _emscripten_glGenerateMipmap=_glGenerateMipmap;_emscripten_glGenerateMipmap.sig="vi";var __glGetActiveAttribOrUniform=(e,t,r,n,a,l,c,u)=>{t=GL.programs[t];var _=GLctx[e](t,r);if(_){var d=u&&stringToUTF8(_.name,u,n);a&&(HEAP32[a>>>2>>>0]=d),l&&(HEAP32[l>>>2>>>0]=_.size),c&&(HEAP32[c>>>2>>>0]=_.type)}};function _glGetActiveAttrib(e,t,r,n,a,l,c){n>>>=0,a>>>=0,l>>>=0,c>>>=0,__glGetActiveAttribOrUniform("getActiveAttrib",e,t,r,n,a,l,c)}_glGetActiveAttrib.sig="viiipppp";var _emscripten_glGetActiveAttrib=_glGetActiveAttrib;_emscripten_glGetActiveAttrib.sig="viiipppp";function _glGetActiveUniform(e,t,r,n,a,l,c){n>>>=0,a>>>=0,l>>>=0,c>>>=0,__glGetActiveAttribOrUniform("getActiveUniform",e,t,r,n,a,l,c)}_glGetActiveUniform.sig="viiipppp";var _emscripten_glGetActiveUniform=_glGetActiveUniform;_emscripten_glGetActiveUniform.sig="viiipppp";function _glGetAttachedShaders(e,t,r,n){r>>>=0,n>>>=0;var a=GLctx.getAttachedShaders(GL.programs[e]),l=a.length;l>t&&(l=t),HEAP32[r>>>2>>>0]=l;for(var c=0;c>>2>>>0]=u}}_glGetAttachedShaders.sig="viipp";var _emscripten_glGetAttachedShaders=_glGetAttachedShaders;_emscripten_glGetAttachedShaders.sig="viipp";function _glGetAttribLocation(e,t){return t>>>=0,GLctx.getAttribLocation(GL.programs[e],UTF8ToString(t))}_glGetAttribLocation.sig="iip";var _emscripten_glGetAttribLocation=_glGetAttribLocation;_emscripten_glGetAttribLocation.sig="iip";var writeI53ToI64=(e,t)=>{HEAPU32[e>>>2>>>0]=t;var r=HEAPU32[e>>>2>>>0];HEAPU32[e+4>>>2>>>0]=(t-r)/4294967296},emscriptenWebGLGet=(e,t,r)=>{if(!t){GL.recordError(1281);return}var n=void 0;switch(e){case 36346:n=1;break;case 36344:r!=0&&r!=1&&GL.recordError(1280);return;case 36345:n=0;break;case 34466:var a=GLctx.getParameter(34467);n=a?a.length:0;break}if(n===void 0){var l=GLctx.getParameter(e);switch(typeof l){case"number":n=l;break;case"boolean":n=l?1:0;break;case"string":GL.recordError(1280);return;case"object":if(l===null)switch(e){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 34068:{n=0;break}default:{GL.recordError(1280);return}}else if(l instanceof Float32Array||l instanceof Uint32Array||l instanceof Int32Array||l instanceof Array){for(var c=0;c>>2>>>0]=l[c];break;case 2:HEAPF32[t+c*4>>>2>>>0]=l[c];break;case 4:HEAP8[t+c>>>0]=l[c]?1:0;break}return}else try{n=l.name|0}catch(u){GL.recordError(1280),err("GL_INVALID_ENUM in glGet".concat(r,"v: Unknown object returned from WebGL getParameter(").concat(e,")! (error: ").concat(u,")"));return}break;default:GL.recordError(1280),err("GL_INVALID_ENUM in glGet".concat(r,"v: Native code calling glGet").concat(r,"v(").concat(e,") and it returns ").concat(l," of type ").concat(typeof l,"!"));return}}switch(r){case 1:writeI53ToI64(t,n);break;case 0:HEAP32[t>>>2>>>0]=n;break;case 2:HEAPF32[t>>>2>>>0]=n;break;case 4:HEAP8[t>>>0]=n?1:0;break}};function _glGetBooleanv(e,t){return t>>>=0,emscriptenWebGLGet(e,t,4)}_glGetBooleanv.sig="vip";var _emscripten_glGetBooleanv=_glGetBooleanv;_emscripten_glGetBooleanv.sig="vip";function _glGetBufferParameteriv(e,t,r){if(r>>>=0,!r){GL.recordError(1281);return}HEAP32[r>>>2>>>0]=GLctx.getBufferParameter(e,t)}_glGetBufferParameteriv.sig="viip";var _emscripten_glGetBufferParameteriv=_glGetBufferParameteriv;_emscripten_glGetBufferParameteriv.sig="viip";var _glGetError=()=>{var e=GLctx.getError()||GL.lastError;return GL.lastError=0,e};_glGetError.sig="i";var _emscripten_glGetError=_glGetError;_emscripten_glGetError.sig="i";function _glGetFloatv(e,t){return t>>>=0,emscriptenWebGLGet(e,t,2)}_glGetFloatv.sig="vip";var _emscripten_glGetFloatv=_glGetFloatv;_emscripten_glGetFloatv.sig="vip";function _glGetFramebufferAttachmentParameteriv(e,t,r,n){n>>>=0;var a=GLctx.getFramebufferAttachmentParameter(e,t,r);(a instanceof WebGLRenderbuffer||a instanceof WebGLTexture)&&(a=a.name|0),HEAP32[n>>>2>>>0]=a}_glGetFramebufferAttachmentParameteriv.sig="viiip";var _emscripten_glGetFramebufferAttachmentParameteriv=_glGetFramebufferAttachmentParameteriv;_emscripten_glGetFramebufferAttachmentParameteriv.sig="viiip";function _glGetIntegerv(e,t){return t>>>=0,emscriptenWebGLGet(e,t,0)}_glGetIntegerv.sig="vip";var _emscripten_glGetIntegerv=_glGetIntegerv;_emscripten_glGetIntegerv.sig="vip";function _glGetProgramInfoLog(e,t,r,n){r>>>=0,n>>>=0;var a=GLctx.getProgramInfoLog(GL.programs[e]);a===null&&(a="(unknown error)");var l=t>0&&n?stringToUTF8(a,n,t):0;r&&(HEAP32[r>>>2>>>0]=l)}_glGetProgramInfoLog.sig="viipp";var _emscripten_glGetProgramInfoLog=_glGetProgramInfoLog;_emscripten_glGetProgramInfoLog.sig="viipp";function _glGetProgramiv(e,t,r){if(r>>>=0,!r){GL.recordError(1281);return}if(e>=GL.counter){GL.recordError(1281);return}if(e=GL.programs[e],t==35716){var n=GLctx.getProgramInfoLog(e);n===null&&(n="(unknown error)"),HEAP32[r>>>2>>>0]=n.length+1}else if(t==35719){if(!e.maxUniformLength)for(var a=GLctx.getProgramParameter(e,35718),l=0;l>>2>>>0]=e.maxUniformLength}else if(t==35722){if(!e.maxAttributeLength)for(var c=GLctx.getProgramParameter(e,35721),l=0;l>>2>>>0]=e.maxAttributeLength}else if(t==35381){if(!e.maxUniformBlockNameLength)for(var u=GLctx.getProgramParameter(e,35382),l=0;l>>2>>>0]=e.maxUniformBlockNameLength}else HEAP32[r>>>2>>>0]=GLctx.getProgramParameter(e,t)}_glGetProgramiv.sig="viip";var _emscripten_glGetProgramiv=_glGetProgramiv;_emscripten_glGetProgramiv.sig="viip";function _glGetQueryObjecti64vEXT(e,t,r){if(r>>>=0,!r){GL.recordError(1281);return}var n=GL.queries[e],a;a=GLctx.disjointTimerQueryExt.getQueryObjectEXT(n,t);var l;typeof a=="boolean"?l=a?1:0:l=a,writeI53ToI64(r,l)}_glGetQueryObjecti64vEXT.sig="viip";var _emscripten_glGetQueryObjecti64vEXT=_glGetQueryObjecti64vEXT;function _glGetQueryObjectivEXT(e,t,r){if(r>>>=0,!r){GL.recordError(1281);return}var n=GL.queries[e],a=GLctx.disjointTimerQueryExt.getQueryObjectEXT(n,t),l;typeof a=="boolean"?l=a?1:0:l=a,HEAP32[r>>>2>>>0]=l}_glGetQueryObjectivEXT.sig="viip";var _emscripten_glGetQueryObjectivEXT=_glGetQueryObjectivEXT,_glGetQueryObjectui64vEXT=_glGetQueryObjecti64vEXT,_emscripten_glGetQueryObjectui64vEXT=_glGetQueryObjectui64vEXT,_glGetQueryObjectuivEXT=_glGetQueryObjectivEXT,_emscripten_glGetQueryObjectuivEXT=_glGetQueryObjectuivEXT;function _glGetQueryivEXT(e,t,r){if(r>>>=0,!r){GL.recordError(1281);return}HEAP32[r>>>2>>>0]=GLctx.disjointTimerQueryExt.getQueryEXT(e,t)}_glGetQueryivEXT.sig="viip";var _emscripten_glGetQueryivEXT=_glGetQueryivEXT;function _glGetRenderbufferParameteriv(e,t,r){if(r>>>=0,!r){GL.recordError(1281);return}HEAP32[r>>>2>>>0]=GLctx.getRenderbufferParameter(e,t)}_glGetRenderbufferParameteriv.sig="viip";var _emscripten_glGetRenderbufferParameteriv=_glGetRenderbufferParameteriv;_emscripten_glGetRenderbufferParameteriv.sig="viip";function _glGetShaderInfoLog(e,t,r,n){r>>>=0,n>>>=0;var a=GLctx.getShaderInfoLog(GL.shaders[e]);a===null&&(a="(unknown error)");var l=t>0&&n?stringToUTF8(a,n,t):0;r&&(HEAP32[r>>>2>>>0]=l)}_glGetShaderInfoLog.sig="viipp";var _emscripten_glGetShaderInfoLog=_glGetShaderInfoLog;_emscripten_glGetShaderInfoLog.sig="viipp";function _glGetShaderPrecisionFormat(e,t,r,n){r>>>=0,n>>>=0;var a=GLctx.getShaderPrecisionFormat(e,t);HEAP32[r>>>2>>>0]=a.rangeMin,HEAP32[r+4>>>2>>>0]=a.rangeMax,HEAP32[n>>>2>>>0]=a.precision}_glGetShaderPrecisionFormat.sig="viipp";var _emscripten_glGetShaderPrecisionFormat=_glGetShaderPrecisionFormat;_emscripten_glGetShaderPrecisionFormat.sig="viipp";function _glGetShaderSource(e,t,r,n){r>>>=0,n>>>=0;var a=GLctx.getShaderSource(GL.shaders[e]);if(a){var l=t>0&&n?stringToUTF8(a,n,t):0;r&&(HEAP32[r>>>2>>>0]=l)}}_glGetShaderSource.sig="viipp";var _emscripten_glGetShaderSource=_glGetShaderSource;_emscripten_glGetShaderSource.sig="viipp";function _glGetShaderiv(e,t,r){if(r>>>=0,!r){GL.recordError(1281);return}if(t==35716){var n=GLctx.getShaderInfoLog(GL.shaders[e]);n===null&&(n="(unknown error)");var a=n?n.length+1:0;HEAP32[r>>>2>>>0]=a}else if(t==35720){var l=GLctx.getShaderSource(GL.shaders[e]),c=l?l.length+1:0;HEAP32[r>>>2>>>0]=c}else HEAP32[r>>>2>>>0]=GLctx.getShaderParameter(GL.shaders[e],t)}_glGetShaderiv.sig="viip";var _emscripten_glGetShaderiv=_glGetShaderiv;_emscripten_glGetShaderiv.sig="viip";var webglGetExtensions=function e(){var t=getEmscriptenSupportedExtensions(GLctx);return t=t.concat(t.map(r=>"GL_"+r)),t};function _glGetString(e){var t=GL.stringCache[e];if(!t){switch(e){case 7939:t=stringToNewUTF8(webglGetExtensions().join(" "));break;case 7936:case 7937:case 37445:case 37446:var r=GLctx.getParameter(e);r||GL.recordError(1280),t=r?stringToNewUTF8(r):0;break;case 7938:var n=GLctx.getParameter(7938),a="OpenGL ES 2.0 (".concat(n,")");t=stringToNewUTF8(a);break;case 35724:var l=GLctx.getParameter(35724),c=/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/,u=l.match(c);u!==null&&(u[1].length==3&&(u[1]=u[1]+"0"),l="OpenGL ES GLSL ES ".concat(u[1]," (").concat(l,")")),t=stringToNewUTF8(l);break;default:GL.recordError(1280)}GL.stringCache[e]=t}return t}_glGetString.sig="pi";var _emscripten_glGetString=_glGetString;_emscripten_glGetString.sig="pi";function _glGetTexParameterfv(e,t,r){if(r>>>=0,!r){GL.recordError(1281);return}HEAPF32[r>>>2>>>0]=GLctx.getTexParameter(e,t)}_glGetTexParameterfv.sig="viip";var _emscripten_glGetTexParameterfv=_glGetTexParameterfv;_emscripten_glGetTexParameterfv.sig="viip";function _glGetTexParameteriv(e,t,r){if(r>>>=0,!r){GL.recordError(1281);return}HEAP32[r>>>2>>>0]=GLctx.getTexParameter(e,t)}_glGetTexParameteriv.sig="viip";var _emscripten_glGetTexParameteriv=_glGetTexParameteriv;_emscripten_glGetTexParameteriv.sig="viip";var webglGetLeftBracePos=e=>e.slice(-1)=="]"&&e.lastIndexOf("["),webglPrepareUniformLocationsBeforeFirstUse=e=>{var t=e.uniformLocsById,r=e.uniformSizeAndIdsByName,n,a;if(!t){e.uniformLocsById=t={},e.uniformArrayNamesById={};var l=GLctx.getProgramParameter(e,35718);for(n=0;n0?u.slice(0,d):u,p=e.uniformIdCounter;for(e.uniformIdCounter+=_,r[f]=[_,p],a=0;a<_;++a)t[p]=a,e.uniformArrayNamesById[p++]=f}}};function _glGetUniformLocation(e,t){if(t>>>=0,t=UTF8ToString(t),e=GL.programs[e]){webglPrepareUniformLocationsBeforeFirstUse(e);var r=e.uniformLocsById,n=0,a=t,l=webglGetLeftBracePos(t);l>0&&(n=jstoi_q(t.slice(l+1))>>>0,a=t.slice(0,l));var c=e.uniformSizeAndIdsByName[a];if(c&&n{var t=GLctx.currentProgram;if(t){var r=t.uniformLocsById[e];return typeof r=="number"&&(t.uniformLocsById[e]=r=GLctx.getUniformLocation(t,t.uniformArrayNamesById[e]+(r>0?"[".concat(r,"]"):""))),r}else GL.recordError(1282)},emscriptenWebGLGetUniform=(e,t,r,n)=>{if(!r){GL.recordError(1281);return}e=GL.programs[e],webglPrepareUniformLocationsBeforeFirstUse(e);var a=GLctx.getUniform(e,webglGetUniformLocation(t));if(typeof a=="number"||typeof a=="boolean")switch(n){case 0:HEAP32[r>>>2>>>0]=a;break;case 2:HEAPF32[r>>>2>>>0]=a;break}else for(var l=0;l>>2>>>0]=a[l];break;case 2:HEAPF32[r+l*4>>>2>>>0]=a[l];break}};function _glGetUniformfv(e,t,r){r>>>=0,emscriptenWebGLGetUniform(e,t,r,2)}_glGetUniformfv.sig="viip";var _emscripten_glGetUniformfv=_glGetUniformfv;_emscripten_glGetUniformfv.sig="viip";function _glGetUniformiv(e,t,r){r>>>=0,emscriptenWebGLGetUniform(e,t,r,0)}_glGetUniformiv.sig="viip";var _emscripten_glGetUniformiv=_glGetUniformiv;_emscripten_glGetUniformiv.sig="viip";function _glGetVertexAttribPointerv(e,t,r){if(r>>>=0,!r){GL.recordError(1281);return}HEAP32[r>>>2>>>0]=GLctx.getVertexAttribOffset(e,t)}_glGetVertexAttribPointerv.sig="viip";var _emscripten_glGetVertexAttribPointerv=_glGetVertexAttribPointerv;_emscripten_glGetVertexAttribPointerv.sig="viip";var emscriptenWebGLGetVertexAttrib=(e,t,r,n)=>{if(!r){GL.recordError(1281);return}var a=GLctx.getVertexAttrib(e,t);if(t==34975)HEAP32[r>>>2>>>0]=a&&a.name;else if(typeof a=="number"||typeof a=="boolean")switch(n){case 0:HEAP32[r>>>2>>>0]=a;break;case 2:HEAPF32[r>>>2>>>0]=a;break;case 5:HEAP32[r>>>2>>>0]=Math.fround(a);break}else for(var l=0;l>>2>>>0]=a[l];break;case 2:HEAPF32[r+l*4>>>2>>>0]=a[l];break;case 5:HEAP32[r+l*4>>>2>>>0]=Math.fround(a[l]);break}};function _glGetVertexAttribfv(e,t,r){r>>>=0,emscriptenWebGLGetVertexAttrib(e,t,r,2)}_glGetVertexAttribfv.sig="viip";var _emscripten_glGetVertexAttribfv=_glGetVertexAttribfv;_emscripten_glGetVertexAttribfv.sig="viip";function _glGetVertexAttribiv(e,t,r){r>>>=0,emscriptenWebGLGetVertexAttrib(e,t,r,5)}_glGetVertexAttribiv.sig="viip";var _emscripten_glGetVertexAttribiv=_glGetVertexAttribiv;_emscripten_glGetVertexAttribiv.sig="viip";var _glHint=(e,t)=>GLctx.hint(e,t);_glHint.sig="vii";var _emscripten_glHint=_glHint;_emscripten_glHint.sig="vii";var _glIsBuffer=e=>{var t=GL.buffers[e];return t?GLctx.isBuffer(t):0};_glIsBuffer.sig="ii";var _emscripten_glIsBuffer=_glIsBuffer;_emscripten_glIsBuffer.sig="ii";var _glIsEnabled=e=>GLctx.isEnabled(e);_glIsEnabled.sig="ii";var _emscripten_glIsEnabled=_glIsEnabled;_emscripten_glIsEnabled.sig="ii";var _glIsFramebuffer=e=>{var t=GL.framebuffers[e];return t?GLctx.isFramebuffer(t):0};_glIsFramebuffer.sig="ii";var _emscripten_glIsFramebuffer=_glIsFramebuffer;_emscripten_glIsFramebuffer.sig="ii";var _glIsProgram=e=>(e=GL.programs[e],e?GLctx.isProgram(e):0);_glIsProgram.sig="ii";var _emscripten_glIsProgram=_glIsProgram;_emscripten_glIsProgram.sig="ii";var _glIsQueryEXT=e=>{var t=GL.queries[e];return t?GLctx.disjointTimerQueryExt.isQueryEXT(t):0};_glIsQueryEXT.sig="ii";var _emscripten_glIsQueryEXT=_glIsQueryEXT,_glIsRenderbuffer=e=>{var t=GL.renderbuffers[e];return t?GLctx.isRenderbuffer(t):0};_glIsRenderbuffer.sig="ii";var _emscripten_glIsRenderbuffer=_glIsRenderbuffer;_emscripten_glIsRenderbuffer.sig="ii";var _glIsShader=e=>{var t=GL.shaders[e];return t?GLctx.isShader(t):0};_glIsShader.sig="ii";var _emscripten_glIsShader=_glIsShader;_emscripten_glIsShader.sig="ii";var _glIsTexture=e=>{var t=GL.textures[e];return t?GLctx.isTexture(t):0};_glIsTexture.sig="ii";var _emscripten_glIsTexture=_glIsTexture;_emscripten_glIsTexture.sig="ii";var _glIsVertexArray=e=>{var t=GL.vaos[e];return t?GLctx.isVertexArray(t):0};_glIsVertexArray.sig="ii";var _glIsVertexArrayOES=_glIsVertexArray;_glIsVertexArrayOES.sig="ii";var _emscripten_glIsVertexArrayOES=_glIsVertexArrayOES;_emscripten_glIsVertexArrayOES.sig="ii";var _glLineWidth=e=>GLctx.lineWidth(e);_glLineWidth.sig="vf";var _emscripten_glLineWidth=_glLineWidth;_emscripten_glLineWidth.sig="vf";var _glLinkProgram=e=>{e=GL.programs[e],GLctx.linkProgram(e),e.uniformLocsById=0,e.uniformSizeAndIdsByName={}};_glLinkProgram.sig="vi";var _emscripten_glLinkProgram=_glLinkProgram;_emscripten_glLinkProgram.sig="vi";var _glPixelStorei=(e,t)=>{e==3317?GL.unpackAlignment=t:e==3314&&(GL.unpackRowLength=t),GLctx.pixelStorei(e,t)};_glPixelStorei.sig="vii";var _emscripten_glPixelStorei=_glPixelStorei;_emscripten_glPixelStorei.sig="vii";var _glPolygonModeWEBGL=(e,t)=>{GLctx.webglPolygonMode.polygonModeWEBGL(e,t)};_glPolygonModeWEBGL.sig="vii";var _emscripten_glPolygonModeWEBGL=_glPolygonModeWEBGL,_glPolygonOffset=(e,t)=>GLctx.polygonOffset(e,t);_glPolygonOffset.sig="vff";var _emscripten_glPolygonOffset=_glPolygonOffset;_emscripten_glPolygonOffset.sig="vff";var _glPolygonOffsetClampEXT=(e,t,r)=>{GLctx.extPolygonOffsetClamp.polygonOffsetClampEXT(e,t,r)};_glPolygonOffsetClampEXT.sig="vfff";var _emscripten_glPolygonOffsetClampEXT=_glPolygonOffsetClampEXT,_glQueryCounterEXT=(e,t)=>{GLctx.disjointTimerQueryExt.queryCounterEXT(GL.queries[e],t)};_glQueryCounterEXT.sig="vii";var _emscripten_glQueryCounterEXT=_glQueryCounterEXT,computeUnpackAlignedImageSize=(e,t,r)=>{function n(c,u){return c+u-1&-u}var a=(GL.unpackRowLength||e)*r,l=n(a,GL.unpackAlignment);return t*l},colorChannelsInGlTextureFormat=e=>{var t={5:3,6:4,8:2,29502:3,29504:4};return t[e-6402]||1},heapObjectForWebGLType=e=>(e-=5120,e==1?HEAPU8:e==4?HEAP32:e==6?HEAPF32:e==5||e==28922?HEAPU32:HEAPU16),toTypedArrayIndex=(e,t)=>e>>>31-Math.clz32(t.BYTES_PER_ELEMENT),emscriptenWebGLGetTexPixelData=(e,t,r,n,a,l)=>{var c=heapObjectForWebGLType(e),u=colorChannelsInGlTextureFormat(t)*c.BYTES_PER_ELEMENT,_=computeUnpackAlignedImageSize(r,n,u);return c.subarray(toTypedArrayIndex(a,c)>>>0,toTypedArrayIndex(a+_,c)>>>0)};function _glReadPixels(e,t,r,n,a,l,c){c>>>=0;var u=emscriptenWebGLGetTexPixelData(l,a,r,n,c,a);if(!u){GL.recordError(1280);return}GLctx.readPixels(e,t,r,n,a,l,u)}_glReadPixels.sig="viiiiiip";var _emscripten_glReadPixels=_glReadPixels;_emscripten_glReadPixels.sig="viiiiiip";var _glReleaseShaderCompiler=()=>{};_glReleaseShaderCompiler.sig="v";var _emscripten_glReleaseShaderCompiler=_glReleaseShaderCompiler;_emscripten_glReleaseShaderCompiler.sig="v";var _glRenderbufferStorage=(e,t,r,n)=>GLctx.renderbufferStorage(e,t,r,n);_glRenderbufferStorage.sig="viiii";var _emscripten_glRenderbufferStorage=_glRenderbufferStorage;_emscripten_glRenderbufferStorage.sig="viiii";var _glSampleCoverage=(e,t)=>{GLctx.sampleCoverage(e,!!t)};_glSampleCoverage.sig="vfi";var _emscripten_glSampleCoverage=_glSampleCoverage;_emscripten_glSampleCoverage.sig="vfi";var _glScissor=(e,t,r,n)=>GLctx.scissor(e,t,r,n);_glScissor.sig="viiii";var _emscripten_glScissor=_glScissor;_emscripten_glScissor.sig="viiii";function _glShaderBinary(e,t,r,n,a){t>>>=0,n>>>=0,GL.recordError(1280)}_glShaderBinary.sig="vipipi";var _emscripten_glShaderBinary=_glShaderBinary;_emscripten_glShaderBinary.sig="vipipi";function _glShaderSource(e,t,r,n){r>>>=0,n>>>=0;var a=GL.getSource(e,t,r,n);GLctx.shaderSource(GL.shaders[e],a)}_glShaderSource.sig="viipp";var _emscripten_glShaderSource=_glShaderSource;_emscripten_glShaderSource.sig="viipp";var _glStencilFunc=(e,t,r)=>GLctx.stencilFunc(e,t,r);_glStencilFunc.sig="viii";var _emscripten_glStencilFunc=_glStencilFunc;_emscripten_glStencilFunc.sig="viii";var _glStencilFuncSeparate=(e,t,r,n)=>GLctx.stencilFuncSeparate(e,t,r,n);_glStencilFuncSeparate.sig="viiii";var _emscripten_glStencilFuncSeparate=_glStencilFuncSeparate;_emscripten_glStencilFuncSeparate.sig="viiii";var _glStencilMask=e=>GLctx.stencilMask(e);_glStencilMask.sig="vi";var _emscripten_glStencilMask=_glStencilMask;_emscripten_glStencilMask.sig="vi";var _glStencilMaskSeparate=(e,t)=>GLctx.stencilMaskSeparate(e,t);_glStencilMaskSeparate.sig="vii";var _emscripten_glStencilMaskSeparate=_glStencilMaskSeparate;_emscripten_glStencilMaskSeparate.sig="vii";var _glStencilOp=(e,t,r)=>GLctx.stencilOp(e,t,r);_glStencilOp.sig="viii";var _emscripten_glStencilOp=_glStencilOp;_emscripten_glStencilOp.sig="viii";var _glStencilOpSeparate=(e,t,r,n)=>GLctx.stencilOpSeparate(e,t,r,n);_glStencilOpSeparate.sig="viiii";var _emscripten_glStencilOpSeparate=_glStencilOpSeparate;_emscripten_glStencilOpSeparate.sig="viiii";function _glTexImage2D(e,t,r,n,a,l,c,u,_){_>>>=0;var d=_?emscriptenWebGLGetTexPixelData(u,c,n,a,_,r):null;GLctx.texImage2D(e,t,r,n,a,l,c,u,d)}_glTexImage2D.sig="viiiiiiiip";var _emscripten_glTexImage2D=_glTexImage2D;_emscripten_glTexImage2D.sig="viiiiiiiip";var _glTexParameterf=(e,t,r)=>GLctx.texParameterf(e,t,r);_glTexParameterf.sig="viif";var _emscripten_glTexParameterf=_glTexParameterf;_emscripten_glTexParameterf.sig="viif";function _glTexParameterfv(e,t,r){r>>>=0;var n=HEAPF32[r>>>2>>>0];GLctx.texParameterf(e,t,n)}_glTexParameterfv.sig="viip";var _emscripten_glTexParameterfv=_glTexParameterfv;_emscripten_glTexParameterfv.sig="viip";var _glTexParameteri=(e,t,r)=>GLctx.texParameteri(e,t,r);_glTexParameteri.sig="viii";var _emscripten_glTexParameteri=_glTexParameteri;_emscripten_glTexParameteri.sig="viii";function _glTexParameteriv(e,t,r){r>>>=0;var n=HEAP32[r>>>2>>>0];GLctx.texParameteri(e,t,n)}_glTexParameteriv.sig="viip";var _emscripten_glTexParameteriv=_glTexParameteriv;_emscripten_glTexParameteriv.sig="viip";function _glTexSubImage2D(e,t,r,n,a,l,c,u,_){_>>>=0;var d=_?emscriptenWebGLGetTexPixelData(u,c,a,l,_,0):null;GLctx.texSubImage2D(e,t,r,n,a,l,c,u,d)}_glTexSubImage2D.sig="viiiiiiiip";var _emscripten_glTexSubImage2D=_glTexSubImage2D;_emscripten_glTexSubImage2D.sig="viiiiiiiip";var _glUniform1f=(e,t)=>{GLctx.uniform1f(webglGetUniformLocation(e),t)};_glUniform1f.sig="vif";var _emscripten_glUniform1f=_glUniform1f;_emscripten_glUniform1f.sig="vif";var miniTempWebGLFloatBuffers=[];function _glUniform1fv(e,t,r){if(r>>>=0,t<=288)for(var n=miniTempWebGLFloatBuffers[t],a=0;a>>2>>>0];else var n=HEAPF32.subarray(r>>>2>>>0,r+t*4>>>2>>>0);GLctx.uniform1fv(webglGetUniformLocation(e),n)}_glUniform1fv.sig="viip";var _emscripten_glUniform1fv=_glUniform1fv;_emscripten_glUniform1fv.sig="viip";var _glUniform1i=(e,t)=>{GLctx.uniform1i(webglGetUniformLocation(e),t)};_glUniform1i.sig="vii";var _emscripten_glUniform1i=_glUniform1i;_emscripten_glUniform1i.sig="vii";var miniTempWebGLIntBuffers=[];function _glUniform1iv(e,t,r){if(r>>>=0,t<=288)for(var n=miniTempWebGLIntBuffers[t],a=0;a>>2>>>0];else var n=HEAP32.subarray(r>>>2>>>0,r+t*4>>>2>>>0);GLctx.uniform1iv(webglGetUniformLocation(e),n)}_glUniform1iv.sig="viip";var _emscripten_glUniform1iv=_glUniform1iv;_emscripten_glUniform1iv.sig="viip";var _glUniform2f=(e,t,r)=>{GLctx.uniform2f(webglGetUniformLocation(e),t,r)};_glUniform2f.sig="viff";var _emscripten_glUniform2f=_glUniform2f;_emscripten_glUniform2f.sig="viff";function _glUniform2fv(e,t,r){if(r>>>=0,t<=144){t*=2;for(var n=miniTempWebGLFloatBuffers[t],a=0;a>>2>>>0],n[a+1]=HEAPF32[r+(4*a+4)>>>2>>>0]}else var n=HEAPF32.subarray(r>>>2>>>0,r+t*8>>>2>>>0);GLctx.uniform2fv(webglGetUniformLocation(e),n)}_glUniform2fv.sig="viip";var _emscripten_glUniform2fv=_glUniform2fv;_emscripten_glUniform2fv.sig="viip";var _glUniform2i=(e,t,r)=>{GLctx.uniform2i(webglGetUniformLocation(e),t,r)};_glUniform2i.sig="viii";var _emscripten_glUniform2i=_glUniform2i;_emscripten_glUniform2i.sig="viii";function _glUniform2iv(e,t,r){if(r>>>=0,t<=144){t*=2;for(var n=miniTempWebGLIntBuffers[t],a=0;a>>2>>>0],n[a+1]=HEAP32[r+(4*a+4)>>>2>>>0]}else var n=HEAP32.subarray(r>>>2>>>0,r+t*8>>>2>>>0);GLctx.uniform2iv(webglGetUniformLocation(e),n)}_glUniform2iv.sig="viip";var _emscripten_glUniform2iv=_glUniform2iv;_emscripten_glUniform2iv.sig="viip";var _glUniform3f=(e,t,r,n)=>{GLctx.uniform3f(webglGetUniformLocation(e),t,r,n)};_glUniform3f.sig="vifff";var _emscripten_glUniform3f=_glUniform3f;_emscripten_glUniform3f.sig="vifff";function _glUniform3fv(e,t,r){if(r>>>=0,t<=96){t*=3;for(var n=miniTempWebGLFloatBuffers[t],a=0;a>>2>>>0],n[a+1]=HEAPF32[r+(4*a+4)>>>2>>>0],n[a+2]=HEAPF32[r+(4*a+8)>>>2>>>0]}else var n=HEAPF32.subarray(r>>>2>>>0,r+t*12>>>2>>>0);GLctx.uniform3fv(webglGetUniformLocation(e),n)}_glUniform3fv.sig="viip";var _emscripten_glUniform3fv=_glUniform3fv;_emscripten_glUniform3fv.sig="viip";var _glUniform3i=(e,t,r,n)=>{GLctx.uniform3i(webglGetUniformLocation(e),t,r,n)};_glUniform3i.sig="viiii";var _emscripten_glUniform3i=_glUniform3i;_emscripten_glUniform3i.sig="viiii";function _glUniform3iv(e,t,r){if(r>>>=0,t<=96){t*=3;for(var n=miniTempWebGLIntBuffers[t],a=0;a>>2>>>0],n[a+1]=HEAP32[r+(4*a+4)>>>2>>>0],n[a+2]=HEAP32[r+(4*a+8)>>>2>>>0]}else var n=HEAP32.subarray(r>>>2>>>0,r+t*12>>>2>>>0);GLctx.uniform3iv(webglGetUniformLocation(e),n)}_glUniform3iv.sig="viip";var _emscripten_glUniform3iv=_glUniform3iv;_emscripten_glUniform3iv.sig="viip";var _glUniform4f=(e,t,r,n,a)=>{GLctx.uniform4f(webglGetUniformLocation(e),t,r,n,a)};_glUniform4f.sig="viffff";var _emscripten_glUniform4f=_glUniform4f;_emscripten_glUniform4f.sig="viffff";function _glUniform4fv(e,t,r){if(r>>>=0,t<=72){var n=miniTempWebGLFloatBuffers[4*t],a=HEAPF32;r=r>>>2,t*=4;for(var l=0;l>>0],n[l+1]=a[c+1>>>0],n[l+2]=a[c+2>>>0],n[l+3]=a[c+3>>>0]}}else var n=HEAPF32.subarray(r>>>2>>>0,r+t*16>>>2>>>0);GLctx.uniform4fv(webglGetUniformLocation(e),n)}_glUniform4fv.sig="viip";var _emscripten_glUniform4fv=_glUniform4fv;_emscripten_glUniform4fv.sig="viip";var _glUniform4i=(e,t,r,n,a)=>{GLctx.uniform4i(webglGetUniformLocation(e),t,r,n,a)};_glUniform4i.sig="viiiii";var _emscripten_glUniform4i=_glUniform4i;_emscripten_glUniform4i.sig="viiiii";function _glUniform4iv(e,t,r){if(r>>>=0,t<=72){t*=4;for(var n=miniTempWebGLIntBuffers[t],a=0;a>>2>>>0],n[a+1]=HEAP32[r+(4*a+4)>>>2>>>0],n[a+2]=HEAP32[r+(4*a+8)>>>2>>>0],n[a+3]=HEAP32[r+(4*a+12)>>>2>>>0]}else var n=HEAP32.subarray(r>>>2>>>0,r+t*16>>>2>>>0);GLctx.uniform4iv(webglGetUniformLocation(e),n)}_glUniform4iv.sig="viip";var _emscripten_glUniform4iv=_glUniform4iv;_emscripten_glUniform4iv.sig="viip";function _glUniformMatrix2fv(e,t,r,n){if(n>>>=0,t<=72){t*=4;for(var a=miniTempWebGLFloatBuffers[t],l=0;l>>2>>>0],a[l+1]=HEAPF32[n+(4*l+4)>>>2>>>0],a[l+2]=HEAPF32[n+(4*l+8)>>>2>>>0],a[l+3]=HEAPF32[n+(4*l+12)>>>2>>>0]}else var a=HEAPF32.subarray(n>>>2>>>0,n+t*16>>>2>>>0);GLctx.uniformMatrix2fv(webglGetUniformLocation(e),!!r,a)}_glUniformMatrix2fv.sig="viiip";var _emscripten_glUniformMatrix2fv=_glUniformMatrix2fv;_emscripten_glUniformMatrix2fv.sig="viiip";function _glUniformMatrix3fv(e,t,r,n){if(n>>>=0,t<=32){t*=9;for(var a=miniTempWebGLFloatBuffers[t],l=0;l>>2>>>0],a[l+1]=HEAPF32[n+(4*l+4)>>>2>>>0],a[l+2]=HEAPF32[n+(4*l+8)>>>2>>>0],a[l+3]=HEAPF32[n+(4*l+12)>>>2>>>0],a[l+4]=HEAPF32[n+(4*l+16)>>>2>>>0],a[l+5]=HEAPF32[n+(4*l+20)>>>2>>>0],a[l+6]=HEAPF32[n+(4*l+24)>>>2>>>0],a[l+7]=HEAPF32[n+(4*l+28)>>>2>>>0],a[l+8]=HEAPF32[n+(4*l+32)>>>2>>>0]}else var a=HEAPF32.subarray(n>>>2>>>0,n+t*36>>>2>>>0);GLctx.uniformMatrix3fv(webglGetUniformLocation(e),!!r,a)}_glUniformMatrix3fv.sig="viiip";var _emscripten_glUniformMatrix3fv=_glUniformMatrix3fv;_emscripten_glUniformMatrix3fv.sig="viiip";function _glUniformMatrix4fv(e,t,r,n){if(n>>>=0,t<=18){var a=miniTempWebGLFloatBuffers[16*t],l=HEAPF32;n=n>>>2,t*=16;for(var c=0;c>>0],a[c+1]=l[u+1>>>0],a[c+2]=l[u+2>>>0],a[c+3]=l[u+3>>>0],a[c+4]=l[u+4>>>0],a[c+5]=l[u+5>>>0],a[c+6]=l[u+6>>>0],a[c+7]=l[u+7>>>0],a[c+8]=l[u+8>>>0],a[c+9]=l[u+9>>>0],a[c+10]=l[u+10>>>0],a[c+11]=l[u+11>>>0],a[c+12]=l[u+12>>>0],a[c+13]=l[u+13>>>0],a[c+14]=l[u+14>>>0],a[c+15]=l[u+15>>>0]}}else var a=HEAPF32.subarray(n>>>2>>>0,n+t*64>>>2>>>0);GLctx.uniformMatrix4fv(webglGetUniformLocation(e),!!r,a)}_glUniformMatrix4fv.sig="viiip";var _emscripten_glUniformMatrix4fv=_glUniformMatrix4fv;_emscripten_glUniformMatrix4fv.sig="viiip";var _glUseProgram=e=>{e=GL.programs[e],GLctx.useProgram(e),GLctx.currentProgram=e};_glUseProgram.sig="vi";var _emscripten_glUseProgram=_glUseProgram;_emscripten_glUseProgram.sig="vi";var _glValidateProgram=e=>{GLctx.validateProgram(GL.programs[e])};_glValidateProgram.sig="vi";var _emscripten_glValidateProgram=_glValidateProgram;_emscripten_glValidateProgram.sig="vi";var _glVertexAttrib1f=(e,t)=>GLctx.vertexAttrib1f(e,t);_glVertexAttrib1f.sig="vif";var _emscripten_glVertexAttrib1f=_glVertexAttrib1f;_emscripten_glVertexAttrib1f.sig="vif";function _glVertexAttrib1fv(e,t){t>>>=0,GLctx.vertexAttrib1f(e,HEAPF32[t>>>2])}_glVertexAttrib1fv.sig="vip";var _emscripten_glVertexAttrib1fv=_glVertexAttrib1fv;_emscripten_glVertexAttrib1fv.sig="vip";var _glVertexAttrib2f=(e,t,r)=>GLctx.vertexAttrib2f(e,t,r);_glVertexAttrib2f.sig="viff";var _emscripten_glVertexAttrib2f=_glVertexAttrib2f;_emscripten_glVertexAttrib2f.sig="viff";function _glVertexAttrib2fv(e,t){t>>>=0,GLctx.vertexAttrib2f(e,HEAPF32[t>>>2],HEAPF32[t+4>>>2])}_glVertexAttrib2fv.sig="vip";var _emscripten_glVertexAttrib2fv=_glVertexAttrib2fv;_emscripten_glVertexAttrib2fv.sig="vip";var _glVertexAttrib3f=(e,t,r,n)=>GLctx.vertexAttrib3f(e,t,r,n);_glVertexAttrib3f.sig="vifff";var _emscripten_glVertexAttrib3f=_glVertexAttrib3f;_emscripten_glVertexAttrib3f.sig="vifff";function _glVertexAttrib3fv(e,t){t>>>=0,GLctx.vertexAttrib3f(e,HEAPF32[t>>>2],HEAPF32[t+4>>>2],HEAPF32[t+8>>>2])}_glVertexAttrib3fv.sig="vip";var _emscripten_glVertexAttrib3fv=_glVertexAttrib3fv;_emscripten_glVertexAttrib3fv.sig="vip";var _glVertexAttrib4f=(e,t,r,n,a)=>GLctx.vertexAttrib4f(e,t,r,n,a);_glVertexAttrib4f.sig="viffff";var _emscripten_glVertexAttrib4f=_glVertexAttrib4f;_emscripten_glVertexAttrib4f.sig="viffff";function _glVertexAttrib4fv(e,t){t>>>=0,GLctx.vertexAttrib4f(e,HEAPF32[t>>>2],HEAPF32[t+4>>>2],HEAPF32[t+8>>>2],HEAPF32[t+12>>>2])}_glVertexAttrib4fv.sig="vip";var _emscripten_glVertexAttrib4fv=_glVertexAttrib4fv;_emscripten_glVertexAttrib4fv.sig="vip";var _glVertexAttribDivisor=(e,t)=>{GLctx.vertexAttribDivisor(e,t)};_glVertexAttribDivisor.sig="vii";var _glVertexAttribDivisorANGLE=_glVertexAttribDivisor,_emscripten_glVertexAttribDivisorANGLE=_glVertexAttribDivisorANGLE;function _glVertexAttribPointer(e,t,r,n,a,l){l>>>=0,GLctx.vertexAttribPointer(e,t,r,!!n,a,l)}_glVertexAttribPointer.sig="viiiiip";var _emscripten_glVertexAttribPointer=_glVertexAttribPointer;_emscripten_glVertexAttribPointer.sig="viiiiip";var _glViewport=(e,t,r,n)=>GLctx.viewport(e,t,r,n);_glViewport.sig="viiii";var _emscripten_glViewport=_glViewport;_emscripten_glViewport.sig="viiii";function _emscripten_out(e){return e>>>=0,out(UTF8ToString(e))}_emscripten_out.sig="vp";class HandleAllocator{constructor(){this.allocated=[void 0],this.freelist=[]}get(t){return this.allocated[t]}has(t){return this.allocated[t]!==void 0}allocate(t){var r=this.freelist.pop()||this.allocated.length;return this.allocated[r]=t,r}free(t){this.allocated[t]=void 0,this.freelist.push(t)}}var promiseMap=new HandleAllocator,makePromise=()=>{var e={};return e.promise=new Promise((t,r)=>{e.reject=r,e.resolve=t}),e.id=promiseMap.allocate(e),e};function _emscripten_promise_create(){return makePromise().id}_emscripten_promise_create.sig="p";function _emscripten_promise_destroy(e){e>>>=0,promiseMap.free(e)}_emscripten_promise_destroy.sig="vp";var getPromise=e=>promiseMap.get(e).promise;function _emscripten_promise_resolve(e,t,r){e>>>=0,r>>>=0;var n=promiseMap.get(e);switch(t){case 0:n.resolve(r);return;case 1:n.resolve(getPromise(r));return;case 2:n.resolve(getPromise(r)),_emscripten_promise_destroy(r);return;case 3:n.reject(r);return}}_emscripten_promise_resolve.sig="vpip";var growMemory=e=>{var t=wasmMemory.buffer,r=(e-t.byteLength+65535)/65536;try{return wasmMemory.grow(r),updateMemoryViews(),1}catch(n){}};function _emscripten_resize_heap(e){e>>>=0;var t=HEAPU8.length,r=getHeapMax();if(e>r)return!1;for(var n=1;n<=4;n*=2){var a=t*(1+.2/n);a=Math.min(a,e+100663296);var l=Math.min(r,alignMemory(Math.max(e,a),65536)),c=growMemory(l);if(c)return!0}return!1}_emscripten_resize_heap.sig="ip";function _emscripten_wget_data(e,t,r,n){throw e>>>=0,t>>>=0,r>>>=0,n>>>=0,"Please compile your program with async support in order to use asynchronous operations like emscripten_wget_data"}_emscripten_wget_data.sig="vpppp";var getEnvStrings=()=>{if(!getEnvStrings.strings){var e=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:e,_:getExecutableName()};for(var r in ENV)ENV[r]===void 0?delete t[r]:t[r]=ENV[r];var n=[];for(var r in t)n.push("".concat(r,"=").concat(t[r]));getEnvStrings.strings=n}return getEnvStrings.strings},stringToAscii=(e,t)=>{for(var r=0;r>>0]=e.charCodeAt(r);HEAP8[t>>>0]=0},_environ_get=function(e,t){e>>>=0,t>>>=0;var r=0;return getEnvStrings().forEach((n,a)=>{var l=t+r;HEAPU32[e+a*4>>>2>>>0]=l,stringToAscii(n,l),r+=n.length+1}),0};_environ_get.sig="ipp";var _environ_sizes_get=function(e,t){e>>>=0,t>>>=0;var r=getEnvStrings();HEAPU32[e>>>2>>>0]=r.length;var n=0;return r.forEach(a=>n+=a.length+1),HEAPU32[t>>>2>>>0]=n,0};_environ_sizes_get.sig="ipp";function _fd_close(e){try{var t=SYSCALLS.getStreamFromFD(e);return FS.close(t),0}catch(r){if(typeof FS>"u"||r.name!=="ErrnoError")throw r;return r.errno}}_fd_close.sig="ii";function _fd_fdstat_get(e,t){t>>>=0;try{var r=0,n=0,a=0,l=SYSCALLS.getStreamFromFD(e),c=l.tty?2:FS.isDir(l.mode)?3:FS.isLink(l.mode)?7:4;return HEAP8[t>>>0]=c,HEAP16[t+2>>>1>>>0]=a,tempI64=[r>>>0,(tempDouble=r,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[t+8>>>2>>>0]=tempI64[0],HEAP32[t+12>>>2>>>0]=tempI64[1],tempI64=[n>>>0,(tempDouble=n,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[t+16>>>2>>>0]=tempI64[0],HEAP32[t+20>>>2>>>0]=tempI64[1],0}catch(u){if(typeof FS>"u"||u.name!=="ErrnoError")throw u;return u.errno}}_fd_fdstat_get.sig="iip";var doReadv=(e,t,r,n)=>{for(var a=0,l=0;l>>2>>>0],u=HEAPU32[t+4>>>2>>>0];t+=8;var _=FS.read(e,HEAP8,c,u,n);if(_<0)return-1;if(a+=_,_>>=0,r>>>=0;var c=convertI32PairToI53Checked(n,a);l>>>=0;try{if(isNaN(c))return 61;var u=SYSCALLS.getStreamFromFD(e),_=doReadv(u,t,r,c);return HEAPU32[l>>>2>>>0]=_,0}catch(d){if(typeof FS>"u"||d.name!=="ErrnoError")throw d;return d.errno}}_fd_pread.sig="iippiip";var doWritev=(e,t,r,n)=>{for(var a=0,l=0;l>>2>>>0],u=HEAPU32[t+4>>>2>>>0];t+=8;var _=FS.write(e,HEAP8,c,u,n);if(_<0)return-1;if(a+=_,_>>=0,r>>>=0;var c=convertI32PairToI53Checked(n,a);l>>>=0;try{if(isNaN(c))return 61;var u=SYSCALLS.getStreamFromFD(e),_=doWritev(u,t,r,c);return HEAPU32[l>>>2>>>0]=_,0}catch(d){if(typeof FS>"u"||d.name!=="ErrnoError")throw d;return d.errno}}_fd_pwrite.sig="iippiip";function _fd_read(e,t,r,n){t>>>=0,r>>>=0,n>>>=0;try{var a=SYSCALLS.getStreamFromFD(e),l=doReadv(a,t,r);return HEAPU32[n>>>2>>>0]=l,0}catch(c){if(typeof FS>"u"||c.name!=="ErrnoError")throw c;return c.errno}}_fd_read.sig="iippp";function _fd_seek(e,t,r,n,a){var l=convertI32PairToI53Checked(t,r);a>>>=0;try{if(isNaN(l))return 61;var c=SYSCALLS.getStreamFromFD(e);return FS.llseek(c,l,n),tempI64=[c.position>>>0,(tempDouble=c.position,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[a>>>2>>>0]=tempI64[0],HEAP32[a+4>>>2>>>0]=tempI64[1],c.getdents&&l===0&&n===0&&(c.getdents=null),0}catch(u){if(typeof FS>"u"||u.name!=="ErrnoError")throw u;return u.errno}}_fd_seek.sig="iiiiip";function _fd_sync(e){var r;try{var t=SYSCALLS.getStreamFromFD(e);return(r=t.stream_ops)!=null&&r.fsync?t.stream_ops.fsync(t):0}catch(n){if(typeof FS>"u"||n.name!=="ErrnoError")throw n;return n.errno}}_fd_sync.sig="ii";function _fd_write(e,t,r,n){t>>>=0,r>>>=0,n>>>=0;try{var a=SYSCALLS.getStreamFromFD(e),l=doWritev(a,t,r);return HEAPU32[n>>>2>>>0]=l,0}catch(c){if(typeof FS>"u"||c.name!=="ErrnoError")throw c;return c.errno}}_fd_write.sig="iippp";function _getaddrinfo(e,t,r,n){e>>>=0,t>>>=0,r>>>=0,n>>>=0;var a=[],l=null,c=0,u=0,_=0,d=0,f=0,p=0,m,g;function h(b,y,L,F,I,T){var S,x,E,w;return x=b===10?28:16,I=b===10?inetNtop6(I):inetNtop4(I),S=_malloc(x),w=writeSockaddr(S,b,I,T),assert(!w),E=_malloc(32),HEAP32[E+4>>>2>>>0]=b,HEAP32[E+8>>>2>>>0]=y,HEAP32[E+12>>>2>>>0]=L,HEAPU32[E+24>>>2>>>0]=F,HEAPU32[E+20>>>2>>>0]=S,b===10?HEAP32[E+16>>>2>>>0]=28:HEAP32[E+16>>>2>>>0]=16,HEAP32[E+28>>>2>>>0]=0,E}if(r&&(_=HEAP32[r>>>2>>>0],d=HEAP32[r+4>>>2>>>0],f=HEAP32[r+8>>>2>>>0],p=HEAP32[r+12>>>2>>>0]),f&&!p&&(p=f===2?17:6),!f&&p&&(f=p===17?2:1),p===0&&(p=6),f===0&&(f=1),!e&&!t)return-2;if(_&-1088||r!==0&&HEAP32[r>>>2>>>0]&2&&!e)return-1;if(_&32)return-2;if(f!==0&&f!==1&&f!==2)return-7;if(d!==0&&d!==2&&d!==10)return-6;if(t&&(t=UTF8ToString(t),u=parseInt(t,10),isNaN(u)))return _&1024?-2:-8;if(!e)return d===0&&(d=2),_&1||(d===2?c=_htonl(2130706433):c=[0,0,0,1]),m=h(d,f,p,null,c,u),HEAPU32[n>>>2>>>0]=m,0;if(e=UTF8ToString(e),c=inetPton4(e),c!==null)if(d===0||d===2)d=2;else if(d===10&&_&8)c=[0,0,_htonl(65535),c],d=10;else return-2;else if(c=inetPton6(e),c!==null)if(d===0||d===10)d=10;else return-2;return c!=null?(m=h(d,f,p,e,c,u),HEAPU32[n>>>2>>>0]=m,0):_&4?-2:(e=DNS.lookup_name(e),c=inetPton4(e),d===0?d=2:d===10&&(c=[0,0,_htonl(65535),c]),m=h(d,f,p,null,c,u),HEAPU32[n>>>2>>>0]=m,0)}_getaddrinfo.sig="ipppp";function _getentropy(e,t){return e>>>=0,t>>>=0,randomFill(HEAPU8.subarray(e>>>0,e+t>>>0)),0}_getentropy.sig="ipp";function _getnameinfo(e,t,r,n,a,l,c){e>>>=0,r>>>=0,a>>>=0;var u=readSockaddr(e,t);if(u.errno)return-6;var _=u.port,d=u.addr,f=!1;if(r&&n){var p;if(c&1||!(p=DNS.lookup_addr(d))){if(c&8)return-2}else d=p;var m=stringToUTF8(d,r,n);m+1>=n&&(f=!0)}if(a&&l){_=""+_;var m=stringToUTF8(_,a,l);m+1>=l&&(f=!0)}return f?-12:0}_getnameinfo.sig="ipipipii";function _pthread_kill(...e){return wasmImports.pthread_kill(...e)}_pthread_kill.stub=!0;var arraySum=(e,t)=>{for(var r=0,n=0;n<=t;r+=e[n++]);return r},MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31],MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31],addDays=(e,t)=>{for(var r=new Date(e.getTime());t>0;){var n=isLeapYear(r.getFullYear()),a=r.getMonth(),l=(n?MONTH_DAYS_LEAP:MONTH_DAYS_REGULAR)[a];if(t>l-r.getDate())t-=l-r.getDate()+1,r.setDate(1),a<11?r.setMonth(a+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1));else return r.setDate(r.getDate()+t),r}return r};function _strptime(e,t,r){e>>>=0,t>>>=0,r>>>=0;for(var n=UTF8ToString(t),a="\\!@#$^&*()+=-[]/{}|:<>?,.",l=0,c=a.length;lu[oe]||Z).replace(/%(.)/g,(Z,oe)=>{let Q=_[oe];return Q?(m.push(oe),"(".concat(Q,")")):oe}).replace(/\s+/g,"\\s*"),h=new RegExp("^"+g,"i").exec(UTF8ToString(e));function b(){function Z(oe,Q,ke){return typeof oe!="number"||isNaN(oe)?Q:oe>=Q?oe<=ke?oe:ke:Q}return{year:Z(HEAP32[r+20>>>2>>>0]+1900,1970,9999),month:Z(HEAP32[r+16>>>2>>>0],0,11),day:Z(HEAP32[r+12>>>2>>>0],1,31),hour:Z(HEAP32[r+8>>>2>>>0],0,23),min:Z(HEAP32[r+4>>>2>>>0],0,59),sec:Z(HEAP32[r>>>2>>>0],0,59),gmtoff:0}}if(h){var y=b(),L,F=Z=>{var oe=m.indexOf(Z);if(oe>=0)return h[oe+1]};if((L=F("S"))&&(y.sec=jstoi_q(L)),(L=F("M"))&&(y.min=jstoi_q(L)),L=F("H"))y.hour=jstoi_q(L);else if(L=F("I")){var I=jstoi_q(L);(L=F("p"))&&(I+=L.toUpperCase()[0]==="P"?12:0),y.hour=I}if(L=F("Y"))y.year=jstoi_q(L);else if(L=F("y")){var T=jstoi_q(L);(L=F("C"))?T+=jstoi_q(L)*100:T+=T<69?2e3:1900,y.year=T}if((L=F("m"))?y.month=jstoi_q(L)-1:(L=F("b"))&&(y.month=d[L.substring(0,3).toUpperCase()]||0),L=F("d"))y.day=jstoi_q(L);else if(L=F("j"))for(var S=jstoi_q(L),x=isLeapYear(y.year),E=0;E<12;++E){var w=arraySum(x?MONTH_DAYS_LEAP:MONTH_DAYS_REGULAR,E-1);S<=w+(x?MONTH_DAYS_LEAP:MONTH_DAYS_REGULAR)[E]&&(y.day=S-w)}else if(L=F("a")){var P=L.substring(0,3).toUpperCase();if(L=F("U")){var A=f[P],M=jstoi_q(L),D=new Date(y.year,0,1),C;D.getDay()===0?C=addDays(D,A+7*(M-1)):C=addDays(D,7-D.getDay()+A+7*(M-1)),y.day=C.getDate(),y.month=C.getMonth()}else if(L=F("W")){var A=p[P],M=jstoi_q(L),D=new Date(y.year,0,1),C;D.getDay()===1?C=addDays(D,A+7*(M-1)):C=addDays(D,7-D.getDay()+1+A+7*(M-1)),y.day=C.getDate(),y.month=C.getMonth()}}if(L=F("z"))if(L.toLowerCase()==="z")y.gmtoff=0;else{var k=L.match(/^((?:\-|\+)\d\d):?(\d\d)?/);y.gmtoff=k[1]*3600,k[2]&&(y.gmtoff+=y.gmtoff>0?k[2]*60:-k[2]*60)}var X=new Date(y.year,y.month,y.day,y.hour,y.min,y.sec,0);return HEAP32[r>>>2>>>0]=X.getSeconds(),HEAP32[r+4>>>2>>>0]=X.getMinutes(),HEAP32[r+8>>>2>>>0]=X.getHours(),HEAP32[r+12>>>2>>>0]=X.getDate(),HEAP32[r+16>>>2>>>0]=X.getMonth(),HEAP32[r+20>>>2>>>0]=X.getFullYear()-1900,HEAP32[r+24>>>2>>>0]=X.getDay(),HEAP32[r+28>>>2>>>0]=arraySum(isLeapYear(X.getFullYear())?MONTH_DAYS_LEAP:MONTH_DAYS_REGULAR,X.getMonth()-1)+X.getDate()-1,HEAP32[r+32>>>2>>>0]=0,HEAP32[r+36>>>2>>>0]=y.gmtoff,e+intArrayFromString(h[0]).length-1}return 0}_strptime.sig="pppp";var getCFunc=e=>{var t=Module["_"+e];return t},writeArrayToMemory=(e,t)=>{HEAP8.set(e,t>>>0)},ccall=(e,t,r,n,a)=>{var l={string:h=>{var b=0;return h!=null&&h!==0&&(b=stringToUTF8OnStack(h)),b},array:h=>{var b=stackAlloc(h.length);return writeArrayToMemory(h,b),b}};function c(h){return t==="string"?UTF8ToString(h):t==="boolean"?!!h:h}var u=getCFunc(e),_=[],d=0;if(n)for(var f=0;f{t>9223372036854776e3?(HEAPU32[e>>>2>>>0]=4294967295,HEAPU32[e+4>>>2>>>0]=2147483647):t<-9223372036854776e3?(HEAPU32[e>>>2>>>0]=0,HEAPU32[e+4>>>2>>>0]=2147483648):writeI53ToI64(e,t)},writeI53ToI64Signaling=(e,t)=>{if(t>9223372036854776e3||t<-9223372036854776e3)throw"RangeError: ".concat(t);writeI53ToI64(e,t)},writeI53ToU64Clamped=(e,t)=>{t>18446744073709552e3?(HEAPU32[e>>>2>>>0]=4294967295,HEAPU32[e+4>>>2>>>0]=4294967295):t<0?(HEAPU32[e>>>2>>>0]=0,HEAPU32[e+4>>>2>>>0]=0):writeI53ToI64(e,t)},writeI53ToU64Signaling=(e,t)=>{if(t<0||t>18446744073709552e3)throw"RangeError: ".concat(t);writeI53ToI64(e,t)},readI53FromU64=e=>HEAPU32[e>>>2>>>0]+HEAPU32[e+4>>>2>>>0]*4294967296,convertI32PairToI53=(e,t)=>(e>>>0)+t*4294967296,convertU32PairToI53=(e,t)=>(e>>>0)+(t>>>0)*4294967296,getTempRet0=e=>__emscripten_tempret_get(),_stackAlloc=stackAlloc,_stackSave=stackSave,_stackRestore=stackSave,_getTempRet0=getTempRet0;Module._getTempRet0=_getTempRet0;var ptrToString=e=>"0x"+e.toString(16).padStart(8,"0");function _emscripten_notify_memory_growth(e){e>>>=0,updateMemoryViews()}_emscripten_notify_memory_growth.sig="vp";var withStackSave=e=>{var t=stackSave(),r=e();return stackRestore(t),r},ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135},strError=e=>UTF8ToString(_strerror(e)),Protocols={list:[],map:{}},_setprotoent=e=>{function t(l,c,u){var _=_malloc(l.length+1);stringToAscii(l,_);for(var d=0,f=u.length,p=_malloc((f+1)*4),m=0;m>>2>>>0]=h}HEAPU32[p+d>>>2>>>0]=0;var b=_malloc(12);return HEAPU32[b>>>2>>>0]=_,HEAPU32[b+4>>>2>>>0]=p,HEAP32[b+8>>>2>>>0]=c,b}var r=Protocols.list,n=Protocols.map;if(r.length===0){var a=t("tcp",6,["TCP"]);r.push(a),n.tcp=n[6]=a,a=t("udp",17,["UDP"]),r.push(a),n.udp=n[17]=a}_setprotoent.index=0};_setprotoent.sig="vi";var _endprotoent=()=>{};_endprotoent.sig="v";function _getprotoent(e){if(_setprotoent.index===Protocols.list.length)return 0;var t=Protocols.list[_setprotoent.index++];return t}_getprotoent.sig="p";function _getprotobyname(e){e>>>=0,e=UTF8ToString(e),_setprotoent(!0);var t=Protocols.map[e];return t}_getprotobyname.sig="pp";function _getprotobynumber(e){_setprotoent(!0);var t=Protocols.map[e];return t}_getprotobynumber.sig="pi";function _emscripten_run_script(ptr){ptr>>>=0,eval(UTF8ToString(ptr))}_emscripten_run_script.sig="vp";function _emscripten_run_script_int(ptr){return ptr>>>=0,eval(UTF8ToString(ptr))|0}_emscripten_run_script_int.sig="ip";function _emscripten_run_script_string(ptr){ptr>>>=0;var s=eval(UTF8ToString(ptr));if(s==null)return 0;s+="";var me=_emscripten_run_script_string,len=lengthBytesUTF8(s);return(!me.bufferSize||me.bufferSizeMath.random();_emscripten_random.sig="f";var warnOnce=e=>{warnOnce.shown||(warnOnce.shown={}),warnOnce.shown[e]||(warnOnce.shown[e]=1,ENVIRONMENT_IS_NODE&&(e="warning: "+e),err(e))};function jsStackTrace(){return new Error().stack.toString()}function getCallstack(e){var t=jsStackTrace(),r=t.lastIndexOf("_emscripten_log"),n=t.lastIndexOf("_emscripten_get_callstack"),a=t.indexOf("\n",Math.max(r,n))+1;t=t.slice(a),e&8&&typeof emscripten_source_map>"u"&&(warnOnce('Source map information is not available, emscripten_log with EM_LOG_C_STACK will be ignored. Build with "--pre-js $EMSCRIPTEN/src/emscripten-source-map.min.js" linker flag to add source map loading to code.'),e^=8,e|=16);var l=t.split("\n");t="";var c=new RegExp("\\s*(.*?)@(.*?):([0-9]+):([0-9]+)"),u=new RegExp("\\s*(.*?)@(.*):(.*)(:(.*))?"),_=new RegExp("\\s*at (.*?) \\((.*):(.*):(.*)\\)");for(var d in l){var f=l[d],p="",m="",g=0,h=0,b=_.exec(f);if(b&&b.length==5)p=b[1],m=b[2],g=b[3],h=b[4];else if(b=c.exec(f)||u.exec(f),b&&b.length>=4)p=b[1],m=b[2],g=b[3],h=b[4]|0;else{t+=f+"\n";continue}var y=!1;if(e&8){var L=emscripten_source_map.originalPositionFor({line:g,column:h});y=L==null?void 0:L.source,y&&(e&64&&(L.source=L.source.substring(L.source.replace(/\\/g,"/").lastIndexOf("/")+1)),t+=" at ".concat(p," (").concat(L.source,":").concat(L.line,":").concat(L.column,")\n"))}(e&16||!y)&&(e&64&&(m=m.substring(m.replace(/\\/g,"/").lastIndexOf("/")+1)),t+=(y?" = ".concat(p):" at ".concat(p))+" (".concat(m,":").concat(g,":").concat(h,")\n"))}return t=t.replace(/\s+$/,""),t}var emscriptenLog=(e,t)=>{e&24&&(t=t.replace(/\s+$/,""),t+=(t.length>0?"\n":"")+getCallstack(e)),e&1?e&4?console.error(t):e&2?console.warn(t):e&512?console.info(t):e&256?console.debug(t):console.log(t):e&6?err(t):out(t)},reallyNegative=e=>e<0||e===0&&1/e===-1/0,reSign=(e,t)=>{if(e<=0)return e;var r=t<=32?Math.abs(1<=r&&(t<=32||e>r)&&(e=-2*r+e),e},unSign=(e,t)=>e>=0?e:t<=32?2*Math.abs(1<{for(var t=e;HEAPU8[t>>>0];)++t;return t-e},formatString=(e,t)=>{var r=e,n=t;function a(Ee,Fe){return(Fe==="double"||Fe==="i64")&&Ee&7&&(Ee+=4),Ee}function l(Ee){var Fe;return n=a(n,Ee),Ee==="double"?(Fe=HEAPF64[n>>>3>>>0],n+=8):Ee=="i64"?(Fe=[HEAP32[n>>>2>>>0],HEAP32[n+4>>>2>>>0]],n+=8):(Ee="i32",Fe=HEAP32[n>>>2>>>0],n+=4),Fe}for(var c=[],u,_,d;;){var f=r;if(u=HEAP8[r>>>0],u===0)break;if(_=HEAP8[r+1>>>0],u==37){var p=!1,m=!1,g=!1,h=!1,b=!1;e:for(;;){switch(_){case 43:p=!0;break;case 45:m=!0;break;case 35:g=!0;break;case 48:if(h)break e;h=!0;break;case 32:b=!0;break;default:break e}r++,_=HEAP8[r+1>>>0]}var y=0;if(_==42)y=l("i32"),r++,_=HEAP8[r+1>>>0];else for(;_>=48&&_<=57;)y=y*10+(_-48),r++,_=HEAP8[r+1>>>0];var L=!1,F=-1;if(_==46){if(F=0,L=!0,r++,_=HEAP8[r+1>>>0],_==42)F=l("i32"),r++;else for(;;){var I=HEAP8[r+1>>>0];if(I<48||I>57)break;F=F*10+(I-48),r++}_=HEAP8[r+1>>>0]}F<0&&(F=6,L=!1);var T;switch(String.fromCharCode(_)){case"h":var S=HEAP8[r+2>>>0];S==104?(r++,T=1):T=2;break;case"l":var S=HEAP8[r+2>>>0];S==108?(r++,T=8):T=4;break;case"L":case"q":case"j":T=8;break;case"z":case"t":case"I":T=4;break;default:T=null}switch(T&&r++,_=HEAP8[r+1>>>0],String.fromCharCode(_)){case"d":case"i":case"u":case"o":case"x":case"X":case"p":{var x=_==100||_==105;T=T||4,d=l("i"+T*8);var E;if(T==8&&(d=_==117?convertU32PairToI53(d[0],d[1]):convertI32PairToI53(d[0],d[1])),T<=4){var w=Math.pow(256,T)-1;d=(x?reSign:unSign)(d&w,T*8)}var P=Math.abs(d),A="";if(_==100||_==105)E=reSign(d,8*T).toString(10);else if(_==117)E=unSign(d,8*T).toString(10),d=Math.abs(d);else if(_==111)E=(g?"0":"")+P.toString(8);else if(_==120||_==88){if(A=g&&d!=0?"0x":"",d<0){d=-d,E=(P-1).toString(16);for(var M=[],D=0;D=0&&(p?A="+"+A:b&&(A=" "+A)),E.charAt(0)=="-"&&(A="-"+A,E=E.substr(1));A.length+E.lengthc.push(Ee.charCodeAt(0)));break}case"f":case"F":case"e":case"E":case"g":case"G":{d=l("double");var E;if(isNaN(d))E="nan",h=!1;else if(!isFinite(d))E=(d<0?"-":"")+"inf",h=!1;else{var C=!1,k=Math.min(F,20);if(_==103||_==71){C=!0,F=F||1;var X=parseInt(d.toExponential(k).split("e")[1],10);F>X&&X>=-4?(_=(_==103?"f":"F").charCodeAt(0),F-=X+1):(_=(_==103?"e":"E").charCodeAt(0),F--),k=Math.min(F,20)}_==101||_==69?(E=d.toExponential(k),/[eE][-+]\d$/.test(E)&&(E=E.slice(0,-1)+"0"+E.slice(-1))):(_==102||_==70)&&(E=d.toFixed(k),d===0&&reallyNegative(d)&&(E="-"+E));var Z=E.split("e");if(C&&!g)for(;Z[0].length>1&&Z[0].includes(".")&&(Z[0].slice(-1)=="0"||Z[0].slice(-1)==".");)Z[0]=Z[0].slice(0,-1);else for(g&&E.indexOf(".")==-1&&(Z[0]+=".");F>k++;)Z[0]+="0";E=Z[0]+(Z.length>1?"e"+Z[1]:""),_==69&&(E=E.toUpperCase()),d>=0&&(p?E="+"+E:b&&(E=" "+E))}for(;E.lengthc.push(Fe.charCodeAt(0)));break}case"s":{var oe=l("i8*"),Q=oe?strLen(oe):6;if(L&&(Q=Math.min(Q,F)),!m)for(;Q>>0]);else c=c.concat(intArrayFromString("(null)".substr(0,Q),!0));if(m)for(;Q0;)c.push(32);m||c.push(l("i8"));break}case"n":{var ke=l("i32*");HEAP32[ke>>>2>>>0]=c.length;break}case"%":{c.push(u);break}default:for(var D=f;D>>0])}r+=2}else c.push(u),r+=1}return c};function _emscripten_log(e,t,r){t>>>=0,r>>>=0;var n=formatString(t,r),a=UTF8ArrayToString(n,0);emscriptenLog(e,a)}_emscripten_log.sig="vipp";function _emscripten_get_compiler_setting(e){throw e>>>=0,"You must build with -sRETAIN_COMPILER_SETTINGS for getCompilerSetting or emscripten_get_compiler_setting to work"}_emscripten_get_compiler_setting.sig="pp";var _emscripten_has_asyncify=()=>0;_emscripten_has_asyncify.sig="i";function _emscripten_debugger(){debugger}_emscripten_debugger.sig="v";function _emscripten_print_double(e,t,r){t>>>=0;var n=e+"";return t?stringToUTF8(n,t,r):lengthBytesUTF8(n)}_emscripten_print_double.sig="idpi";function _emscripten_asm_const_double(e,t,r){return e>>>=0,t>>>=0,r>>>=0,runEmAsmFunction(e,t,r)}_emscripten_asm_const_double.sig="dppp";var runMainThreadEmAsm=(e,t,r,n)=>{var a=readEmAsmArgs(t,r);return ASM_CONSTS[e](...a)};function _emscripten_asm_const_int_sync_on_main_thread(e,t,r){return e>>>=0,t>>>=0,r>>>=0,runMainThreadEmAsm(e,t,r,1)}_emscripten_asm_const_int_sync_on_main_thread.sig="ippp";function _emscripten_asm_const_ptr_sync_on_main_thread(e,t,r){return e>>>=0,t>>>=0,r>>>=0,runMainThreadEmAsm(e,t,r,1)}_emscripten_asm_const_ptr_sync_on_main_thread.sig="pppp";var _emscripten_asm_const_double_sync_on_main_thread=_emscripten_asm_const_int_sync_on_main_thread;_emscripten_asm_const_double_sync_on_main_thread.sig="dppp";function _emscripten_asm_const_async_on_main_thread(e,t,r){return e>>>=0,t>>>=0,r>>>=0,runMainThreadEmAsm(e,t,r,0)}_emscripten_asm_const_async_on_main_thread.sig="vppp";var jstoi_s=Number;function __Unwind_Backtrace(e,t){e>>>=0,t>>>=0;for(var r=getCallstack(),n=r.split("\n"),a=0;a>>=0,t>>>=0,abort("Unwind_GetIPInfo")}__Unwind_GetIPInfo.sig="ppp";function __Unwind_FindEnclosingFunction(e){return e>>>=0,0}__Unwind_FindEnclosingFunction.sig="pp";function __Unwind_RaiseException(e){return e>>>=0,err("Warning: _Unwind_RaiseException is not correctly implemented"),___cxa_throw(e,0,0)}Module.__Unwind_RaiseException=__Unwind_RaiseException,__Unwind_RaiseException.sig="ip";function __Unwind_DeleteException(e){e>>>=0,err("TODO: Unwind_DeleteException")}Module.__Unwind_DeleteException=__Unwind_DeleteException,__Unwind_DeleteException.sig="vp";var createDyncallWrapper=e=>{var t=[],r=[0,97,115,109,1,0,0,0];t.push(r);var n=[e[0].replace("j","i"),"i",e.slice(1).replace(/j/g,"ii")].join(""),a=[3];generateFuncType(n,a),generateFuncType(e,a),generateFuncType("vi",a);var l=[1];uleb128Encode(a.length,l),l.push(...a),t.push(l);var c=[2,15,2,1,101,1,116,1,112,0,0,1,101,1,114,0,2];t.push(c);var u=[3,2,1,0];t.push(u);var _=[7,5,1,1,102,0,1];t.push(_);var d=[];e[0]==="j"?d=[1,1,126]:d.push(0);function f(I){d.push(32),uleb128Encode(I,d)}for(var p=1,m=1;m{e=e.replace(/p/g,"i"),"dynCall_"+e in Module||(Module["dynCall_"+e]=createDyncallWrapper(e));var n=Module["dynCall_"+e];return n(t,...r)},dynCall=(e,t,r=[])=>{if(e.includes("j"))return dynCallLegacy(e,t,r);var n=getWasmTableEntry(t)(...r);return e[0]=="p"?n>>>0:n},getDynCaller=(e,t)=>(...r)=>dynCall(e,t,r),_emscripten_exit_with_live_runtime=()=>{throw"unwind"};_emscripten_exit_with_live_runtime.sig="v";var _emscripten_force_exit=e=>{__emscripten_runtime_keepalive_clear(),_exit(e)};_emscripten_force_exit.sig="vi";function _emscripten_outn(e,t){return e>>>=0,t>>>=0,out(UTF8ToString(e,t))}_emscripten_outn.sig="vpp";function _emscripten_errn(e,t){return e>>>=0,t>>>=0,err(UTF8ToString(e,t))}_emscripten_errn.sig="vpp";var _emscripten_throw_number=e=>{throw e};_emscripten_throw_number.sig="vd";function _emscripten_throw_string(e){throw e>>>=0,UTF8ToString(e)}_emscripten_throw_string.sig="vp";var runtimeKeepalivePush=()=>{runtimeKeepaliveCounter+=1};runtimeKeepalivePush.sig="v";var runtimeKeepalivePop=()=>{runtimeKeepaliveCounter-=1};runtimeKeepalivePop.sig="v";var _emscripten_runtime_keepalive_push=runtimeKeepalivePush;_emscripten_runtime_keepalive_push.sig="v";var _emscripten_runtime_keepalive_pop=runtimeKeepalivePop;_emscripten_runtime_keepalive_pop.sig="v";var _emscripten_runtime_keepalive_check=keepRuntimeAlive;_emscripten_runtime_keepalive_check.sig="i";var asmjsMangle=e=>(e=="__main_argc_argv"&&(e="main"),e.startsWith("dynCall_")?e:"_"+e),___global_base=1024;function __emscripten_fs_load_embedded_files(e){e>>>=0;do{var t=HEAPU32[e>>>2>>>0];e+=4;var r=HEAPU32[e>>>2>>>0];e+=4;var n=HEAPU32[e>>>2>>>0];e+=4;var a=UTF8ToString(t);FS.createPath("/",PATH.dirname(a),!0,!0),FS.createDataFile(a,null,HEAP8.subarray(n>>>0,n+r>>>0),!0,!0,!0)}while(HEAPU32[e>>>2>>>0])}__emscripten_fs_load_embedded_files.sig="vp";var POINTER_SIZE=4;function getNativeTypeSize(e){switch(e){case"i1":case"i8":case"u8":return 1;case"i16":case"u16":return 2;case"i32":case"u32":return 4;case"i64":case"u64":return 8;case"float":return 4;case"double":return 8;default:{if(e[e.length-1]==="*")return POINTER_SIZE;if(e[0]==="i"){let t=Number(e.substr(1));return assert(t%8===0,"getNativeTypeSize invalid bits ".concat(t,", ").concat(e," type")),t/8}return 0}}}var STACK_SIZE=65536,STACK_ALIGN=16,ASSERTIONS=0,cwrap=(e,t,r,n)=>{var a=!r||r.every(c=>c==="number"||c==="boolean"),l=t!=="string";return l&&a&&!n?getCFunc(e):(...c)=>ccall(e,t,r,c,n)},removeFunction=e=>{functionsInTableMap.delete(getWasmTableEntry(e)),setWasmTableEntry(e,null),freeTableIndexes.push(e)},_emscripten_math_cbrt=Math.cbrt;_emscripten_math_cbrt.sig="dd";var _emscripten_math_pow=Math.pow;_emscripten_math_pow.sig="ddd";var _emscripten_math_random=Math.random;_emscripten_math_random.sig="d";var _emscripten_math_sign=Math.sign;_emscripten_math_sign.sig="dd";var _emscripten_math_sqrt=Math.sqrt;_emscripten_math_sqrt.sig="dd";var _emscripten_math_exp=Math.exp;_emscripten_math_exp.sig="dd";var _emscripten_math_expm1=Math.expm1;_emscripten_math_expm1.sig="dd";var _emscripten_math_fmod=(e,t)=>e%t;_emscripten_math_fmod.sig="ddd";var _emscripten_math_log=Math.log;_emscripten_math_log.sig="dd";var _emscripten_math_log1p=Math.log1p;_emscripten_math_log1p.sig="dd";var _emscripten_math_log10=Math.log10;_emscripten_math_log10.sig="dd";var _emscripten_math_log2=Math.log2;_emscripten_math_log2.sig="dd";var _emscripten_math_round=Math.round;_emscripten_math_round.sig="dd";var _emscripten_math_acos=Math.acos;_emscripten_math_acos.sig="dd";var _emscripten_math_acosh=Math.acosh;_emscripten_math_acosh.sig="dd";var _emscripten_math_asin=Math.asin;_emscripten_math_asin.sig="dd";var _emscripten_math_asinh=Math.asinh;_emscripten_math_asinh.sig="dd";var _emscripten_math_atan=Math.atan;_emscripten_math_atan.sig="dd";var _emscripten_math_atanh=Math.atanh;_emscripten_math_atanh.sig="dd";var _emscripten_math_atan2=Math.atan2;_emscripten_math_atan2.sig="ddd";var _emscripten_math_cos=Math.cos;_emscripten_math_cos.sig="dd";var _emscripten_math_cosh=Math.cosh;_emscripten_math_cosh.sig="dd";function _emscripten_math_hypot(e,t){t>>>=0;for(var r=[],n=0;n>>3>>>0]);return Math.hypot(...r)}_emscripten_math_hypot.sig="dip";var _emscripten_math_sin=Math.sin;_emscripten_math_sin.sig="dd";var _emscripten_math_sinh=Math.sinh;_emscripten_math_sinh.sig="dd";var _emscripten_math_tan=Math.tan;_emscripten_math_tan.sig="dd";var _emscripten_math_tanh=Math.tanh;_emscripten_math_tanh.sig="dd";function intArrayToString(e){for(var t=[],r=0;r255&&(n&=255),t.push(String.fromCharCode(n))}return t.join("")}var AsciiToString=e=>{e>>>=0;for(var t="";;){var r=HEAPU8[e++>>>0];if(!r)return t;t+=String.fromCharCode(r)}},JSEvents={removeAllEventListeners(){for(;JSEvents.eventHandlers.length;)JSEvents._removeHandler(JSEvents.eventHandlers.length-1);JSEvents.deferredCalls=[]},inEventHandler:0,deferredCalls:[],deferCall(e,t,r){function n(l,c){if(l.length!=c.length)return!1;for(var u in l)if(l[u]!=c[u])return!1;return!0}for(var a of JSEvents.deferredCalls)if(a.targetFunction==e&&n(a.argsList,r))return;JSEvents.deferredCalls.push({targetFunction:e,precedence:t,argsList:r}),JSEvents.deferredCalls.sort((l,c)=>l.precedencet.targetFunction!=e)},canPerformEventHandlerRequests(){return navigator.userActivation?navigator.userActivation.isActive:JSEvents.inEventHandler&&JSEvents.currentEventHandler.allowsDeferredCalls},runDeferredCalls(){if(JSEvents.canPerformEventHandlerRequests()){var e=JSEvents.deferredCalls;JSEvents.deferredCalls=[];for(var t of e)t.targetFunction(...t.argsList)}},eventHandlers:[],removeAllHandlersOnTarget:(e,t)=>{for(var r=0;re>2?UTF8ToString(e):e,specialHTMLTargets=[0,typeof document<"u"?document:0,typeof window<"u"?window:0],findEventTarget=e=>{e=maybeCStringToJsString(e);var t=specialHTMLTargets[e]||(typeof document<"u"?document.querySelector(e):void 0);return t},registerKeyEventCallback=(e,t,r,n,a,l,c)=>{JSEvents.keyEvent||(JSEvents.keyEvent=_malloc(160));var u=d=>{var f=JSEvents.keyEvent;HEAPF64[f>>>3>>>0]=d.timeStamp;var p=f>>>2;HEAP32[p+2>>>0]=d.location,HEAP8[f+12>>>0]=d.ctrlKey,HEAP8[f+13>>>0]=d.shiftKey,HEAP8[f+14>>>0]=d.altKey,HEAP8[f+15>>>0]=d.metaKey,HEAP8[f+16>>>0]=d.repeat,HEAP32[p+5>>>0]=d.charCode,HEAP32[p+6>>>0]=d.keyCode,HEAP32[p+7>>>0]=d.which,stringToUTF8(d.key||"",f+32,32),stringToUTF8(d.code||"",f+64,32),stringToUTF8(d.char||"",f+96,32),stringToUTF8(d.locale||"",f+128,32),getWasmTableEntry(n)(a,f,t)&&d.preventDefault()},_={target:findEventTarget(e),eventTypeString:l,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)},findCanvasEventTarget=findEventTarget;function _emscripten_set_keypress_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerKeyEventCallback(e,t,r,n,1,"keypress",a)}_emscripten_set_keypress_callback_on_thread.sig="ippipp";function _emscripten_set_keydown_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerKeyEventCallback(e,t,r,n,2,"keydown",a)}_emscripten_set_keydown_callback_on_thread.sig="ippipp";function _emscripten_set_keyup_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerKeyEventCallback(e,t,r,n,3,"keyup",a)}_emscripten_set_keyup_callback_on_thread.sig="ippipp";var getBoundingClientRect=e=>specialHTMLTargets.indexOf(e)<0?e.getBoundingClientRect():{left:0,top:0},fillMouseEventData=(e,t,r)=>{HEAPF64[e>>>3>>>0]=t.timeStamp;var n=e>>>2;HEAP32[n+2>>>0]=t.screenX,HEAP32[n+3>>>0]=t.screenY,HEAP32[n+4>>>0]=t.clientX,HEAP32[n+5>>>0]=t.clientY,HEAP8[e+24>>>0]=t.ctrlKey,HEAP8[e+25>>>0]=t.shiftKey,HEAP8[e+26>>>0]=t.altKey,HEAP8[e+27>>>0]=t.metaKey,HEAP16[n*2+14>>>0]=t.button,HEAP16[n*2+15>>>0]=t.buttons,HEAP32[n+8>>>0]=t.movementX,HEAP32[n+9>>>0]=t.movementY;var a=getBoundingClientRect(r);HEAP32[n+10>>>0]=t.clientX-(a.left|0),HEAP32[n+11>>>0]=t.clientY-(a.top|0)},registerMouseEventCallback=(e,t,r,n,a,l,c)=>{JSEvents.mouseEvent||(JSEvents.mouseEvent=_malloc(64)),e=findEventTarget(e);var u=(d=event)=>{fillMouseEventData(JSEvents.mouseEvent,d,e),getWasmTableEntry(n)(a,JSEvents.mouseEvent,t)&&d.preventDefault()},_={target:e,allowsDeferredCalls:l!="mousemove"&&l!="mouseenter"&&l!="mouseleave",eventTypeString:l,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)};function _emscripten_set_click_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerMouseEventCallback(e,t,r,n,4,"click",a)}_emscripten_set_click_callback_on_thread.sig="ippipp";function _emscripten_set_mousedown_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerMouseEventCallback(e,t,r,n,5,"mousedown",a)}_emscripten_set_mousedown_callback_on_thread.sig="ippipp";function _emscripten_set_mouseup_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerMouseEventCallback(e,t,r,n,6,"mouseup",a)}_emscripten_set_mouseup_callback_on_thread.sig="ippipp";function _emscripten_set_dblclick_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerMouseEventCallback(e,t,r,n,7,"dblclick",a)}_emscripten_set_dblclick_callback_on_thread.sig="ippipp";function _emscripten_set_mousemove_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerMouseEventCallback(e,t,r,n,8,"mousemove",a)}_emscripten_set_mousemove_callback_on_thread.sig="ippipp";function _emscripten_set_mouseenter_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerMouseEventCallback(e,t,r,n,33,"mouseenter",a)}_emscripten_set_mouseenter_callback_on_thread.sig="ippipp";function _emscripten_set_mouseleave_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerMouseEventCallback(e,t,r,n,34,"mouseleave",a)}_emscripten_set_mouseleave_callback_on_thread.sig="ippipp";function _emscripten_set_mouseover_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerMouseEventCallback(e,t,r,n,35,"mouseover",a)}_emscripten_set_mouseover_callback_on_thread.sig="ippipp";function _emscripten_set_mouseout_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerMouseEventCallback(e,t,r,n,36,"mouseout",a)}_emscripten_set_mouseout_callback_on_thread.sig="ippipp";function _emscripten_get_mouse_status(e){return e>>>=0,JSEvents.mouseEvent?(HEAP8.set(HEAP8.subarray(JSEvents.mouseEvent>>>0,JSEvents.mouseEvent+64>>>0),e>>>0),0):-7}_emscripten_get_mouse_status.sig="ip";var registerWheelEventCallback=(e,t,r,n,a,l,c)=>{JSEvents.wheelEvent||(JSEvents.wheelEvent=_malloc(96));var u=(d=event)=>{var f=JSEvents.wheelEvent;fillMouseEventData(f,d,e),HEAPF64[f+64>>>3>>>0]=d.deltaX,HEAPF64[f+72>>>3>>>0]=d.deltaY,HEAPF64[f+80>>>3>>>0]=d.deltaZ,HEAP32[f+88>>>2>>>0]=d.deltaMode,getWasmTableEntry(n)(a,f,t)&&d.preventDefault()},_={target:e,allowsDeferredCalls:!0,eventTypeString:l,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)};function _emscripten_set_wheel_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,e=findEventTarget(e),e?typeof e.onwheel<"u"?registerWheelEventCallback(e,t,r,n,9,"wheel",a):-1:-4}_emscripten_set_wheel_callback_on_thread.sig="ippipp";var registerUiEventCallback=(e,t,r,n,a,l,c)=>{JSEvents.uiEvent||(JSEvents.uiEvent=_malloc(36)),e=findEventTarget(e);var u=(d=event)=>{if(d.target==e){var f=document.body;if(f){var p=JSEvents.uiEvent;HEAP32[p>>>2>>>0]=0,HEAP32[p+4>>>2>>>0]=f.clientWidth,HEAP32[p+8>>>2>>>0]=f.clientHeight,HEAP32[p+12>>>2>>>0]=innerWidth,HEAP32[p+16>>>2>>>0]=innerHeight,HEAP32[p+20>>>2>>>0]=outerWidth,HEAP32[p+24>>>2>>>0]=outerHeight,HEAP32[p+28>>>2>>>0]=pageXOffset|0,HEAP32[p+32>>>2>>>0]=pageYOffset|0,getWasmTableEntry(n)(a,p,t)&&d.preventDefault()}}},_={target:e,eventTypeString:l,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)};function _emscripten_set_resize_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerUiEventCallback(e,t,r,n,10,"resize",a)}_emscripten_set_resize_callback_on_thread.sig="ippipp";function _emscripten_set_scroll_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerUiEventCallback(e,t,r,n,11,"scroll",a)}_emscripten_set_scroll_callback_on_thread.sig="ippipp";var registerFocusEventCallback=(e,t,r,n,a,l,c)=>{JSEvents.focusEvent||(JSEvents.focusEvent=_malloc(256));var u=(d=event)=>{var f=JSEvents.getNodeNameForTarget(d.target),p=d.target.id?d.target.id:"",m=JSEvents.focusEvent;stringToUTF8(f,m+0,128),stringToUTF8(p,m+128,128),getWasmTableEntry(n)(a,m,t)&&d.preventDefault()},_={target:findEventTarget(e),eventTypeString:l,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)};function _emscripten_set_blur_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerFocusEventCallback(e,t,r,n,12,"blur",a)}_emscripten_set_blur_callback_on_thread.sig="ippipp";function _emscripten_set_focus_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerFocusEventCallback(e,t,r,n,13,"focus",a)}_emscripten_set_focus_callback_on_thread.sig="ippipp";function _emscripten_set_focusin_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerFocusEventCallback(e,t,r,n,14,"focusin",a)}_emscripten_set_focusin_callback_on_thread.sig="ippipp";function _emscripten_set_focusout_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerFocusEventCallback(e,t,r,n,15,"focusout",a)}_emscripten_set_focusout_callback_on_thread.sig="ippipp";var fillDeviceOrientationEventData=(e,t,r)=>{HEAPF64[e>>>3>>>0]=t.alpha,HEAPF64[e+8>>>3>>>0]=t.beta,HEAPF64[e+16>>>3>>>0]=t.gamma,HEAP8[e+24>>>0]=t.absolute},registerDeviceOrientationEventCallback=(e,t,r,n,a,l,c)=>{JSEvents.deviceOrientationEvent||(JSEvents.deviceOrientationEvent=_malloc(32));var u=(d=event)=>{fillDeviceOrientationEventData(JSEvents.deviceOrientationEvent,d,e),getWasmTableEntry(n)(a,JSEvents.deviceOrientationEvent,t)&&d.preventDefault()},_={target:findEventTarget(e),eventTypeString:l,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)};function _emscripten_set_deviceorientation_callback_on_thread(e,t,r,n){return e>>>=0,r>>>=0,n>>>=0,registerDeviceOrientationEventCallback(2,e,t,r,16,"deviceorientation",n)}_emscripten_set_deviceorientation_callback_on_thread.sig="ipipp";function _emscripten_get_deviceorientation_status(e){return e>>>=0,JSEvents.deviceOrientationEvent?(HEAP32.set(HEAP32.subarray(JSEvents.deviceOrientationEvent>>>0,32),e>>>0),0):-7}_emscripten_get_deviceorientation_status.sig="ip";var fillDeviceMotionEventData=(e,t,r)=>{var n=0,a=t.acceleration;n|=a&&1;var l=t.accelerationIncludingGravity;n|=l&&2;var c=t.rotationRate;n|=c&&4,a=a||{},l=l||{},c=c||{},HEAPF64[e>>>3>>>0]=a.x,HEAPF64[e+8>>>3>>>0]=a.y,HEAPF64[e+16>>>3>>>0]=a.z,HEAPF64[e+24>>>3>>>0]=l.x,HEAPF64[e+32>>>3>>>0]=l.y,HEAPF64[e+40>>>3>>>0]=l.z,HEAPF64[e+48>>>3>>>0]=c.alpha,HEAPF64[e+56>>>3>>>0]=c.beta,HEAPF64[e+64>>>3>>>0]=c.gamma},registerDeviceMotionEventCallback=(e,t,r,n,a,l,c)=>{JSEvents.deviceMotionEvent||(JSEvents.deviceMotionEvent=_malloc(80));var u=(d=event)=>{fillDeviceMotionEventData(JSEvents.deviceMotionEvent,d,e),getWasmTableEntry(n)(a,JSEvents.deviceMotionEvent,t)&&d.preventDefault()},_={target:findEventTarget(e),eventTypeString:l,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)};function _emscripten_set_devicemotion_callback_on_thread(e,t,r,n){return e>>>=0,r>>>=0,n>>>=0,registerDeviceMotionEventCallback(2,e,t,r,17,"devicemotion",n)}_emscripten_set_devicemotion_callback_on_thread.sig="ipipp";function _emscripten_get_devicemotion_status(e){return e>>>=0,JSEvents.deviceMotionEvent?(HEAP32.set(HEAP32.subarray(JSEvents.deviceMotionEvent>>>0,80),e>>>0),0):-7}_emscripten_get_devicemotion_status.sig="ip";var screenOrientation=()=>{if(window.screen)return screen.orientation||screen.mozOrientation||screen.webkitOrientation},fillOrientationChangeEventData=e=>{var t=["portrait-primary","portrait-secondary","landscape-primary","landscape-secondary"],r=["portrait","portrait","landscape","landscape"],n=0,a=0,l=screenOrientation();typeof l=="object"?(n=t.indexOf(l.type),n<0&&(n=r.indexOf(l.type)),n>=0&&(n=1<>>2>>>0]=n,HEAP32[e+4>>>2>>>0]=a},registerOrientationChangeEventCallback=(e,t,r,n,a,l,c)=>{JSEvents.orientationChangeEvent||(JSEvents.orientationChangeEvent=_malloc(8));var u=(d=event)=>{var f=JSEvents.orientationChangeEvent;fillOrientationChangeEventData(f),getWasmTableEntry(n)(a,f,t)&&d.preventDefault()},_={target:e,eventTypeString:l,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)};function _emscripten_set_orientationchange_callback_on_thread(e,t,r,n){return e>>>=0,r>>>=0,n>>>=0,!window.screen||!screen.orientation?-1:registerOrientationChangeEventCallback(screen.orientation,e,t,r,18,"change",n)}_emscripten_set_orientationchange_callback_on_thread.sig="ipipp";function _emscripten_get_orientation_status(e){return e>>>=0,!screenOrientation()&&typeof orientation>"u"?-1:(fillOrientationChangeEventData(e),0)}_emscripten_get_orientation_status.sig="ip";var _emscripten_lock_orientation=e=>{var t=[];e&1&&t.push("portrait-primary"),e&2&&t.push("portrait-secondary"),e&4&&t.push("landscape-primary"),e&8&&t.push("landscape-secondary");var r;if(screen.lockOrientation)r=screen.lockOrientation(t);else if(screen.mozLockOrientation)r=screen.mozLockOrientation(t);else if(screen.webkitLockOrientation)r=screen.webkitLockOrientation(t);else return-1;return r?0:-6};_emscripten_lock_orientation.sig="ii";var _emscripten_unlock_orientation=()=>{if(screen.unlockOrientation)screen.unlockOrientation();else if(screen.mozUnlockOrientation)screen.mozUnlockOrientation();else if(screen.webkitUnlockOrientation)screen.webkitUnlockOrientation();else return-1;return 0};_emscripten_unlock_orientation.sig="i";var fillFullscreenChangeEventData=e=>{var t=document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement,r=!!t;HEAP8[e>>>0]=r,HEAP8[e+1>>>0]=JSEvents.fullscreenEnabled();var n=r?t:JSEvents.previousFullscreenElement,a=JSEvents.getNodeNameForTarget(n),l=(n==null?void 0:n.id)||"";stringToUTF8(a,e+2,128),stringToUTF8(l,e+130,128),HEAP32[e+260>>>2>>>0]=n?n.clientWidth:0,HEAP32[e+264>>>2>>>0]=n?n.clientHeight:0,HEAP32[e+268>>>2>>>0]=screen.width,HEAP32[e+272>>>2>>>0]=screen.height,r&&(JSEvents.previousFullscreenElement=t)},registerFullscreenChangeEventCallback=(e,t,r,n,a,l,c)=>{JSEvents.fullscreenChangeEvent||(JSEvents.fullscreenChangeEvent=_malloc(276));var u=(d=event)=>{var f=JSEvents.fullscreenChangeEvent;fillFullscreenChangeEventData(f),getWasmTableEntry(n)(a,f,t)&&d.preventDefault()},_={target:e,eventTypeString:l,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)};function _emscripten_set_fullscreenchange_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,JSEvents.fullscreenEnabled()?(e=findEventTarget(e),e?(registerFullscreenChangeEventCallback(e,t,r,n,19,"webkitfullscreenchange",a),registerFullscreenChangeEventCallback(e,t,r,n,19,"fullscreenchange",a)):-4):-1}_emscripten_set_fullscreenchange_callback_on_thread.sig="ippipp";function _emscripten_get_fullscreen_status(e){return e>>>=0,JSEvents.fullscreenEnabled()?(fillFullscreenChangeEventData(e),0):-1}_emscripten_get_fullscreen_status.sig="ip";function _emscripten_get_canvas_element_size(e,t,r){e>>>=0,t>>>=0,r>>>=0;var n=findCanvasEventTarget(e);if(!n)return-4;HEAP32[t>>>2>>>0]=n.width,HEAP32[r>>>2>>>0]=n.height}_emscripten_get_canvas_element_size.sig="ippp";var getCanvasElementSize=e=>{var t=stackSave(),r=stackAlloc(8),n=r+4,a=stringToUTF8OnStack(e.id),l=_emscripten_get_canvas_element_size(a,r,n),c=[HEAP32[r>>>2>>>0],HEAP32[n>>>2>>>0]];return stackRestore(t),c};function _emscripten_set_canvas_element_size(e,t,r){e>>>=0;var n=findCanvasEventTarget(e);return n?(n.width=t,n.height=r,0):-4}_emscripten_set_canvas_element_size.sig="ipii";var setCanvasElementSize=(e,t,r)=>{if(!e.controlTransferredOffscreen)e.width=t,e.height=r;else{var n=stackSave(),a=stringToUTF8OnStack(e.id);_emscripten_set_canvas_element_size(a,t,r),stackRestore(n)}},registerRestoreOldStyle=e=>{var t=getCanvasElementSize(e),r=t[0],n=t[1],a=e.style.width,l=e.style.height,c=e.style.backgroundColor,u=document.body.style.backgroundColor,_=e.style.paddingLeft,d=e.style.paddingRight,f=e.style.paddingTop,p=e.style.paddingBottom,m=e.style.marginLeft,g=e.style.marginRight,h=e.style.marginTop,b=e.style.marginBottom,y=document.body.style.margin,L=document.documentElement.style.overflow,F=document.body.scroll,I=e.style.imageRendering;function T(){var S=document.fullscreenElement||document.webkitFullscreenElement;S||(document.removeEventListener("fullscreenchange",T),document.removeEventListener("webkitfullscreenchange",T),setCanvasElementSize(e,r,n),e.style.width=a,e.style.height=l,e.style.backgroundColor=c,u||(document.body.style.backgroundColor="white"),document.body.style.backgroundColor=u,e.style.paddingLeft=_,e.style.paddingRight=d,e.style.paddingTop=f,e.style.paddingBottom=p,e.style.marginLeft=m,e.style.marginRight=g,e.style.marginTop=h,e.style.marginBottom=b,document.body.style.margin=y,document.documentElement.style.overflow=L,document.body.scroll=F,e.style.imageRendering=I,e.GLctxObject&&e.GLctxObject.GLctx.viewport(0,0,r,n),currentFullscreenStrategy.canvasResizedCallback&&getWasmTableEntry(currentFullscreenStrategy.canvasResizedCallback)(37,0,currentFullscreenStrategy.canvasResizedCallbackUserData))}return document.addEventListener("fullscreenchange",T),document.addEventListener("webkitfullscreenchange",T),T},setLetterbox=(e,t,r)=>{e.style.paddingLeft=e.style.paddingRight=r+"px",e.style.paddingTop=e.style.paddingBottom=t+"px"},JSEvents_resizeCanvasForFullscreen=(e,t)=>{var y,L;var r=registerRestoreOldStyle(e),n=t.softFullscreen?innerWidth:screen.width,a=t.softFullscreen?innerHeight:screen.height,l=getBoundingClientRect(e),c=l.width,u=l.height,_=getCanvasElementSize(e),d=_[0],f=_[1];if(t.scaleMode==3)setLetterbox(e,(a-u)/2,(n-c)/2),n=c,a=u;else if(t.scaleMode==2)if(n*f{if((t.scaleMode!=0||t.canvasResolutionScaleMode!=0)&&JSEvents_resizeCanvasForFullscreen(e,t),e.requestFullscreen)e.requestFullscreen();else if(e.webkitRequestFullscreen)e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);else return JSEvents.fullscreenEnabled()?-3:-1;return currentFullscreenStrategy=t,t.canvasResizedCallback&&getWasmTableEntry(t.canvasResizedCallback)(37,0,t.canvasResizedCallbackUserData),0},hideEverythingExceptGivenElement=e=>{for(var t=e,r=t.parentNode,n=[];t!=document.body;){for(var a=r.children,l=0;l{for(var t of e)t.node.style.display=t.displayState},currentFullscreenStrategy={},restoreOldWindowedStyle=null,softFullscreenResizeWebGLRenderTarget=()=>{var e=devicePixelRatio,t=currentFullscreenStrategy.canvasResolutionScaleMode==2,r=currentFullscreenStrategy.scaleMode==2,n=currentFullscreenStrategy.canvasResolutionScaleMode!=0,a=currentFullscreenStrategy.scaleMode==3,l=t?Math.round(innerWidth*e):innerWidth,c=t?Math.round(innerHeight*e):innerHeight,u=l,_=c,d=currentFullscreenStrategy.target,f=getCanvasElementSize(d),p=f[0],m=f[1],g;if(r&&(u*mp*_&&(u=_*p/m|0),g=(c-_)/2|0),n&&(setCanvasElementSize(d,u,_),d.GLctxObject&&d.GLctxObject.GLctx.viewport(0,0,u,_)),t&&(g/=e,u/=e,_/=e,u=Math.round(u*1e4)/1e4,_=Math.round(_*1e4)/1e4,g=Math.round(g*1e4)/1e4),a){var h=(innerHeight-jstoi_q(d.style.height))/2,b=(innerWidth-jstoi_q(d.style.width))/2;setLetterbox(d,h,b)}else{d.style.width=u+"px",d.style.height=_+"px";var b=(innerWidth-u)/2;setLetterbox(d,g,b)}!a&¤tFullscreenStrategy.canvasResizedCallback&&getWasmTableEntry(currentFullscreenStrategy.canvasResizedCallback)(37,0,currentFullscreenStrategy.canvasResizedCallbackUserData)},doRequestFullscreen=(e,t)=>JSEvents.fullscreenEnabled()?(e=findEventTarget(e),e?!e.requestFullscreen&&!e.webkitRequestFullscreen?-3:JSEvents.canPerformEventHandlerRequests()?JSEvents_requestFullscreen(e,t):t.deferUntilInEventHandler?(JSEvents.deferCall(JSEvents_requestFullscreen,1,[e,t]),1):-2:-4):-1;function _emscripten_request_fullscreen(e,t){e>>>=0;var r={scaleMode:0,canvasResolutionScaleMode:0,filteringMode:0,deferUntilInEventHandler:t,canvasResizedCallbackTargetThread:2};return doRequestFullscreen(e,r)}_emscripten_request_fullscreen.sig="ipi";function _emscripten_request_fullscreen_strategy(e,t,r){e>>>=0,r>>>=0;var n={scaleMode:HEAP32[r>>>2>>>0],canvasResolutionScaleMode:HEAP32[r+4>>>2>>>0],filteringMode:HEAP32[r+8>>>2>>>0],deferUntilInEventHandler:t,canvasResizedCallback:HEAP32[r+12>>>2>>>0],canvasResizedCallbackUserData:HEAP32[r+16>>>2>>>0]};return doRequestFullscreen(e,n)}_emscripten_request_fullscreen_strategy.sig="ipip";function _emscripten_enter_soft_fullscreen(e,t){if(e>>>=0,t>>>=0,e=findEventTarget(e),!e)return-4;var r={scaleMode:HEAP32[t>>>2>>>0],canvasResolutionScaleMode:HEAP32[t+4>>>2>>>0],filteringMode:HEAP32[t+8>>>2>>>0],canvasResizedCallback:HEAP32[t+12>>>2>>>0],canvasResizedCallbackUserData:HEAP32[t+16>>>2>>>0],target:e,softFullscreen:!0},n=JSEvents_resizeCanvasForFullscreen(e,r);document.documentElement.style.overflow="hidden",document.body.scroll="no",document.body.style.margin="0px";var a=hideEverythingExceptGivenElement(e);function l(){n(),restoreHiddenElements(a),removeEventListener("resize",softFullscreenResizeWebGLRenderTarget),r.canvasResizedCallback&&getWasmTableEntry(r.canvasResizedCallback)(37,0,r.canvasResizedCallbackUserData),currentFullscreenStrategy=0}return restoreOldWindowedStyle=l,currentFullscreenStrategy=r,addEventListener("resize",softFullscreenResizeWebGLRenderTarget),r.canvasResizedCallback&&getWasmTableEntry(r.canvasResizedCallback)(37,0,r.canvasResizedCallbackUserData),0}_emscripten_enter_soft_fullscreen.sig="ipp";var _emscripten_exit_soft_fullscreen=()=>(restoreOldWindowedStyle==null||restoreOldWindowedStyle(),restoreOldWindowedStyle=null,0);_emscripten_exit_soft_fullscreen.sig="i";var _emscripten_exit_fullscreen=()=>{if(!JSEvents.fullscreenEnabled())return-1;JSEvents.removeDeferredCalls(JSEvents_requestFullscreen);var e=specialHTMLTargets[1];if(e.exitFullscreen)e.fullscreenElement&&e.exitFullscreen();else if(e.webkitExitFullscreen)e.webkitFullscreenElement&&e.webkitExitFullscreen();else return-1;return 0};_emscripten_exit_fullscreen.sig="i";var fillPointerlockChangeEventData=e=>{var t=document.pointerLockElement||document.mozPointerLockElement||document.webkitPointerLockElement||document.msPointerLockElement,r=!!t;HEAP8[e>>>0]=r;var n=JSEvents.getNodeNameForTarget(t),a=(t==null?void 0:t.id)||"";stringToUTF8(n,e+1,128),stringToUTF8(a,e+129,128)},registerPointerlockChangeEventCallback=(e,t,r,n,a,l,c)=>{JSEvents.pointerlockChangeEvent||(JSEvents.pointerlockChangeEvent=_malloc(257));var u=(d=event)=>{var f=JSEvents.pointerlockChangeEvent;fillPointerlockChangeEventData(f),getWasmTableEntry(n)(a,f,t)&&d.preventDefault()},_={target:e,eventTypeString:l,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)};function _emscripten_set_pointerlockchange_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,!document||!document.body||!document.body.requestPointerLock&&!document.body.mozRequestPointerLock&&!document.body.webkitRequestPointerLock&&!document.body.msRequestPointerLock?-1:(e=findEventTarget(e),e?(registerPointerlockChangeEventCallback(e,t,r,n,20,"mozpointerlockchange",a),registerPointerlockChangeEventCallback(e,t,r,n,20,"webkitpointerlockchange",a),registerPointerlockChangeEventCallback(e,t,r,n,20,"mspointerlockchange",a),registerPointerlockChangeEventCallback(e,t,r,n,20,"pointerlockchange",a)):-4)}_emscripten_set_pointerlockchange_callback_on_thread.sig="ippipp";var registerPointerlockErrorEventCallback=(e,t,r,n,a,l,c)=>{var u=(d=event)=>{getWasmTableEntry(n)(a,0,t)&&d.preventDefault()},_={target:e,eventTypeString:l,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)};function _emscripten_set_pointerlockerror_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,!document||!document.body.requestPointerLock&&!document.body.mozRequestPointerLock&&!document.body.webkitRequestPointerLock&&!document.body.msRequestPointerLock?-1:(e=findEventTarget(e),e?(registerPointerlockErrorEventCallback(e,t,r,n,38,"mozpointerlockerror",a),registerPointerlockErrorEventCallback(e,t,r,n,38,"webkitpointerlockerror",a),registerPointerlockErrorEventCallback(e,t,r,n,38,"mspointerlockerror",a),registerPointerlockErrorEventCallback(e,t,r,n,38,"pointerlockerror",a)):-4)}_emscripten_set_pointerlockerror_callback_on_thread.sig="ippipp";function _emscripten_get_pointerlock_status(e){return e>>>=0,e&&fillPointerlockChangeEventData(e),!document.body||!document.body.requestPointerLock&&!document.body.mozRequestPointerLock&&!document.body.webkitRequestPointerLock&&!document.body.msRequestPointerLock?-1:0}_emscripten_get_pointerlock_status.sig="ip";var requestPointerLock=e=>{if(e.requestPointerLock)e.requestPointerLock();else return document.body.requestPointerLock?-3:-1;return 0};function _emscripten_request_pointerlock(e,t){return e>>>=0,e=findEventTarget(e),e?e.requestPointerLock?JSEvents.canPerformEventHandlerRequests()?requestPointerLock(e):t?(JSEvents.deferCall(requestPointerLock,2,[e]),1):-2:-1:-4}_emscripten_request_pointerlock.sig="ipi";var _emscripten_exit_pointerlock=()=>{if(JSEvents.removeDeferredCalls(requestPointerLock),document.exitPointerLock)document.exitPointerLock();else return-1;return 0};_emscripten_exit_pointerlock.sig="i";var _emscripten_vibrate=e=>navigator.vibrate?(navigator.vibrate(e),0):-1;_emscripten_vibrate.sig="ii";function _emscripten_vibrate_pattern(e,t){if(e>>>=0,!navigator.vibrate)return-1;for(var r=[],n=0;n>>2>>>0];r.push(a)}return navigator.vibrate(r),0}_emscripten_vibrate_pattern.sig="ipi";var fillVisibilityChangeEventData=e=>{var t=["hidden","visible","prerender","unloaded"],r=t.indexOf(document.visibilityState);HEAP8[e>>>0]=document.hidden,HEAP32[e+4>>>2>>>0]=r},registerVisibilityChangeEventCallback=(e,t,r,n,a,l,c)=>{JSEvents.visibilityChangeEvent||(JSEvents.visibilityChangeEvent=_malloc(8));var u=(d=event)=>{var f=JSEvents.visibilityChangeEvent;fillVisibilityChangeEventData(f),getWasmTableEntry(n)(a,f,t)&&d.preventDefault()},_={target:e,eventTypeString:l,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)};function _emscripten_set_visibilitychange_callback_on_thread(e,t,r,n){return e>>>=0,r>>>=0,n>>>=0,specialHTMLTargets[1]?registerVisibilityChangeEventCallback(specialHTMLTargets[1],e,t,r,21,"visibilitychange",n):-4}_emscripten_set_visibilitychange_callback_on_thread.sig="ipipp";function _emscripten_get_visibility_status(e){return e>>>=0,typeof document.visibilityState>"u"&&typeof document.hidden>"u"?-1:(fillVisibilityChangeEventData(e),0)}_emscripten_get_visibility_status.sig="ip";var registerTouchEventCallback=(e,t,r,n,a,l,c)=>{JSEvents.touchEvent||(JSEvents.touchEvent=_malloc(1552)),e=findEventTarget(e);var u=d=>{var f,p={},m=d.touches;for(let F of m)F.isChanged=F.onTarget=0,p[F.identifier]=F;for(let F of d.changedTouches)F.isChanged=1,p[F.identifier]=F;for(let F of d.targetTouches)p[F.identifier].onTarget=1;var g=JSEvents.touchEvent;HEAPF64[g>>>3>>>0]=d.timeStamp,HEAP8[g+12>>>0]=d.ctrlKey,HEAP8[g+13>>>0]=d.shiftKey,HEAP8[g+14>>>0]=d.altKey,HEAP8[g+15>>>0]=d.metaKey;var h=g+16,b=getBoundingClientRect(e),y=0;for(let F of Object.values(p)){var L=h>>>2;if(HEAP32[L+0>>>0]=F.identifier,HEAP32[L+1>>>0]=F.screenX,HEAP32[L+2>>>0]=F.screenY,HEAP32[L+3>>>0]=F.clientX,HEAP32[L+4>>>0]=F.clientY,HEAP32[L+5>>>0]=F.pageX,HEAP32[L+6>>>0]=F.pageY,HEAP8[h+28>>>0]=F.isChanged,HEAP8[h+29>>>0]=F.onTarget,HEAP32[L+8>>>0]=F.clientX-(b.left|0),HEAP32[L+9>>>0]=F.clientY-(b.top|0),h+=48,++y>31)break}HEAP32[g+8>>>2>>>0]=y,getWasmTableEntry(n)(a,g,t)&&d.preventDefault()},_={target:e,allowsDeferredCalls:l=="touchstart"||l=="touchend",eventTypeString:l,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)};function _emscripten_set_touchstart_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerTouchEventCallback(e,t,r,n,22,"touchstart",a)}_emscripten_set_touchstart_callback_on_thread.sig="ippipp";function _emscripten_set_touchend_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerTouchEventCallback(e,t,r,n,23,"touchend",a)}_emscripten_set_touchend_callback_on_thread.sig="ippipp";function _emscripten_set_touchmove_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerTouchEventCallback(e,t,r,n,24,"touchmove",a)}_emscripten_set_touchmove_callback_on_thread.sig="ippipp";function _emscripten_set_touchcancel_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerTouchEventCallback(e,t,r,n,25,"touchcancel",a)}_emscripten_set_touchcancel_callback_on_thread.sig="ippipp";var fillGamepadEventData=(e,t)=>{HEAPF64[e>>>3>>>0]=t.timestamp;for(var r=0;r>>3>>>0]=t.axes[r];for(var r=0;r>>3>>>0]=t.buttons[r].value:HEAPF64[e+r*8+528>>>3>>>0]=t.buttons[r];for(var r=0;r>>0]=t.buttons[r].pressed:HEAP8[e+r+1040>>>0]=t.buttons[r]==1;HEAP8[e+1104>>>0]=t.connected,HEAP32[e+1108>>>2>>>0]=t.index,HEAP32[e+8>>>2>>>0]=t.axes.length,HEAP32[e+12>>>2>>>0]=t.buttons.length,stringToUTF8(t.id,e+1112,64),stringToUTF8(t.mapping,e+1176,64)},registerGamepadEventCallback=(e,t,r,n,a,l,c)=>{JSEvents.gamepadEvent||(JSEvents.gamepadEvent=_malloc(1240));var u=(d=event)=>{var f=JSEvents.gamepadEvent;fillGamepadEventData(f,d.gamepad),getWasmTableEntry(n)(a,f,t)&&d.preventDefault()},_={target:findEventTarget(e),allowsDeferredCalls:!0,eventTypeString:l,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)},_emscripten_sample_gamepad_data=()=>{try{if(navigator.getGamepads)return(JSEvents.lastGamepadState=navigator.getGamepads())?0:-1}catch(e){navigator.getGamepads=null}return-1};_emscripten_sample_gamepad_data.sig="i";function _emscripten_set_gamepadconnected_callback_on_thread(e,t,r,n){return e>>>=0,r>>>=0,n>>>=0,_emscripten_sample_gamepad_data()?-1:registerGamepadEventCallback(2,e,t,r,26,"gamepadconnected",n)}_emscripten_set_gamepadconnected_callback_on_thread.sig="ipipp";function _emscripten_set_gamepaddisconnected_callback_on_thread(e,t,r,n){return e>>>=0,r>>>=0,n>>>=0,_emscripten_sample_gamepad_data()?-1:registerGamepadEventCallback(2,e,t,r,27,"gamepaddisconnected",n)}_emscripten_set_gamepaddisconnected_callback_on_thread.sig="ipipp";var _emscripten_get_num_gamepads=()=>JSEvents.lastGamepadState.length;_emscripten_get_num_gamepads.sig="i";function _emscripten_get_gamepad_status(e,t){return t>>>=0,e<0||e>=JSEvents.lastGamepadState.length?-5:JSEvents.lastGamepadState[e]?(fillGamepadEventData(t,JSEvents.lastGamepadState[e]),0):-7}_emscripten_get_gamepad_status.sig="iip";var registerBeforeUnloadEventCallback=(e,t,r,n,a,l)=>{var c=(_=event)=>{var d=getWasmTableEntry(n)(a,0,t);if(d&&(d=UTF8ToString(d)),d)return _.preventDefault(),_.returnValue=d,d},u={target:findEventTarget(e),eventTypeString:l,callbackfunc:n,handlerFunc:c,useCapture:r};return JSEvents.registerOrRemoveHandler(u)};function _emscripten_set_beforeunload_callback_on_thread(e,t,r){return e>>>=0,t>>>=0,r>>>=0,typeof onbeforeunload>"u"?-1:r!==1?-5:registerBeforeUnloadEventCallback(2,e,!0,t,28,"beforeunload")}_emscripten_set_beforeunload_callback_on_thread.sig="ippp";var fillBatteryEventData=(e,t)=>{HEAPF64[e>>>3>>>0]=t.chargingTime,HEAPF64[e+8>>>3>>>0]=t.dischargingTime,HEAPF64[e+16>>>3>>>0]=t.level,HEAP8[e+24>>>0]=t.charging},battery=()=>navigator.battery||navigator.mozBattery||navigator.webkitBattery,registerBatteryEventCallback=(e,t,r,n,a,l,c)=>{JSEvents.batteryEvent||(JSEvents.batteryEvent=_malloc(32));var u=(d=event)=>{var f=JSEvents.batteryEvent;fillBatteryEventData(f,battery()),getWasmTableEntry(n)(a,f,t)&&d.preventDefault()},_={target:findEventTarget(e),eventTypeString:l,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)};function _emscripten_set_batterychargingchange_callback_on_thread(e,t,r){return e>>>=0,t>>>=0,r>>>=0,battery()?registerBatteryEventCallback(battery(),e,!0,t,29,"chargingchange",r):-1}_emscripten_set_batterychargingchange_callback_on_thread.sig="ippp";function _emscripten_set_batterylevelchange_callback_on_thread(e,t,r){return e>>>=0,t>>>=0,r>>>=0,battery()?registerBatteryEventCallback(battery(),e,!0,t,30,"levelchange",r):-1}_emscripten_set_batterylevelchange_callback_on_thread.sig="ippp";function _emscripten_get_battery_status(e){return e>>>=0,battery()?(fillBatteryEventData(e,battery()),0):-1}_emscripten_get_battery_status.sig="ip";function _emscripten_set_element_css_size(e,t,r){return e>>>=0,e=findEventTarget(e),e?(e.style.width=t+"px",e.style.height=r+"px",0):-4}_emscripten_set_element_css_size.sig="ipdd";function _emscripten_get_element_css_size(e,t,r){if(e>>>=0,t>>>=0,r>>>=0,e=findEventTarget(e),!e)return-4;var n=getBoundingClientRect(e);return HEAPF64[t>>>3>>>0]=n.width,HEAPF64[r>>>3>>>0]=n.height,0}_emscripten_get_element_css_size.sig="ippp";var _emscripten_html5_remove_all_event_listeners=()=>JSEvents.removeAllEventListeners();_emscripten_html5_remove_all_event_listeners.sig="v";var _emscripten_request_animation_frame=function(e,t){return e>>>=0,t>>>=0,requestAnimationFrame(r=>getWasmTableEntry(e)(r,t))};_emscripten_request_animation_frame.sig="ipp";var _emscripten_cancel_animation_frame=e=>cancelAnimationFrame(e);_emscripten_cancel_animation_frame.sig="vi";function _emscripten_request_animation_frame_loop(e,t){e>>>=0,t>>>=0;function r(n){getWasmTableEntry(e)(n,t)&&requestAnimationFrame(r)}return requestAnimationFrame(r)}_emscripten_request_animation_frame_loop.sig="vpp";var _emscripten_performance_now=()=>performance.now();_emscripten_performance_now.sig="d";var _emscripten_get_device_pixel_ratio=()=>typeof devicePixelRatio=="number"&&devicePixelRatio||1;_emscripten_get_device_pixel_ratio.sig="d";function _emscripten_get_callstack(e,t,r){t>>>=0;var n=getCallstack(e);if(!t||r<=0)return lengthBytesUTF8(n)+1;var a=stringToUTF8(n,t,r);return a+1}_emscripten_get_callstack.sig="iipi";var convertFrameToPC=e=>(abort("Cannot use convertFrameToPC (needed by __builtin_return_address) without -sUSE_OFFSET_CONVERTER"),0);function _emscripten_return_address(e){var t=jsStackTrace().split("\n");t[0]=="Error"&&t.shift();var r=t[e+3];return convertFrameToPC(r)}_emscripten_return_address.sig="pi";var UNWIND_CACHE={},saveInUnwindCache=e=>{e.forEach(t=>{var r=convertFrameToPC(t);r&&(UNWIND_CACHE[r]=t)})};function _emscripten_stack_snapshot(){var e=jsStackTrace().split("\n");return e[0]=="Error"&&e.shift(),saveInUnwindCache(e),UNWIND_CACHE.last_addr=convertFrameToPC(e[3]),UNWIND_CACHE.last_stack=e,UNWIND_CACHE.last_addr}_emscripten_stack_snapshot.sig="p";function _emscripten_stack_unwind_buffer(e,t,r){e>>>=0,t>>>=0;var n;UNWIND_CACHE.last_addr==e?n=UNWIND_CACHE.last_stack:(n=jsStackTrace().split("\n"),n[0]=="Error"&&n.shift(),saveInUnwindCache(n));for(var a=3;n[a]&&convertFrameToPC(n[a])!=e;)++a;for(var l=0;l>>2>>>0]=convertFrameToPC(n[l+a]);return l}_emscripten_stack_unwind_buffer.sig="ippi";function _emscripten_pc_get_function(e){return e>>>=0,abort("Cannot use emscripten_pc_get_function without -sUSE_OFFSET_CONVERTER"),0}_emscripten_pc_get_function.sig="pp";var convertPCtoSourceLocation=e=>{if(UNWIND_CACHE.last_get_source_pc==e)return UNWIND_CACHE.last_source;var t,r;if(!r){var n=UNWIND_CACHE[e];if(!n)return null;(t=/\((.*):(\d+):(\d+)\)$/.exec(n))?r={file:t[1],line:t[2],column:t[3]}:(t=/@(.*):(\d+):(\d+)/.exec(n))&&(r={file:t[1],line:t[2],column:t[3]})}return UNWIND_CACHE.last_get_source_pc=e,UNWIND_CACHE.last_source=r,r};function _emscripten_pc_get_file(e){e>>>=0;var t=convertPCtoSourceLocation(e);return t?(_emscripten_pc_get_file.ret&&_free(_emscripten_pc_get_file.ret),_emscripten_pc_get_file.ret=stringToNewUTF8(t.file),_emscripten_pc_get_file.ret):0}_emscripten_pc_get_file.sig="pp";function _emscripten_pc_get_line(e){e>>>=0;var t=convertPCtoSourceLocation(e);return t?t.line:0}_emscripten_pc_get_line.sig="ip";function _emscripten_pc_get_column(e){e>>>=0;var t=convertPCtoSourceLocation(e);return t&&t.column||0}_emscripten_pc_get_column.sig="ip";var _sched_yield=()=>0;Module._sched_yield=_sched_yield,_sched_yield.sig="i";function _random_get(e,t){e>>>=0,t>>>=0;try{return _getentropy(e,t),0}catch(r){if(typeof FS>"u"||r.name!=="ErrnoError")throw r;return r.errno}}_random_get.sig="ipp";var checkWasiClock=e=>e==0||e==1||e==2||e==3;function _clock_time_get(e,t,r,n){var a=convertI32PairToI53Checked(t,r);if(n>>>=0,!checkWasiClock(e))return 28;var l;if(e===0)l=Date.now();else if(nowIsMonotonic)l=_emscripten_get_now();else return 52;var c=Math.round(l*1e3*1e3);return HEAP32[n>>>2>>>0]=c>>>0,HEAP32[n+4>>>2>>>0]=c/Math.pow(2,32)>>>0,0}_clock_time_get.sig="iiiip";function _clock_res_get(e,t){if(t>>>=0,!checkWasiClock(e))return 28;var r;if(e===0)r=1e6;else if(nowIsMonotonic)r=_emscripten_get_now_res();else return 52;return HEAP32[t>>>2>>>0]=r>>>0,HEAP32[t+4>>>2>>>0]=r/Math.pow(2,32)>>>0,0}_clock_res_get.sig="iip";var wasiRightsToMuslOFlags=e=>{if(e&2&&e&64)return 2;if(e&2)return 0;if(e&64)return 1;throw new FS.ErrnoError(28)},wasiOFlagsToMuslOFlags=e=>{var t=0;return e&1&&(t|=64),e&8&&(t|=512),e&2&&(t|=65536),e&4&&(t|=128),t},_emscripten_unwind_to_js_event_loop=()=>{throw"unwind"};_emscripten_unwind_to_js_event_loop.sig="v";var safeSetTimeout=(e,t)=>setTimeout(()=>{callUserCallback(e)},t),setImmediateWrapped=e=>{setImmediateWrapped.mapping||(setImmediateWrapped.mapping=[]);var t=setImmediateWrapped.mapping.length;return setImmediateWrapped.mapping[t]=setImmediate(()=>{setImmediateWrapped.mapping[t]=void 0,e()}),t},clearImmediateWrapped=e=>{clearImmediate(setImmediateWrapped.mapping[e]),setImmediateWrapped.mapping[e]=void 0},polyfillSetImmediate=()=>{},_emscripten_set_immediate=function(e,t){return e>>>=0,t>>>=0,emSetImmediate(()=>{callUserCallback(()=>getWasmTableEntry(e)(t))})};_emscripten_set_immediate.sig="ipp";var _emscripten_clear_immediate=e=>{emClearImmediate(e)};_emscripten_clear_immediate.sig="vi";var _emscripten_set_immediate_loop=function(e,t){e>>>=0,t>>>=0;function r(){callUserCallback(()=>{getWasmTableEntry(e)(t)&&emSetImmediate(r)})}emSetImmediate(r)};_emscripten_set_immediate_loop.sig="vpp";var _emscripten_set_timeout=function(e,t,r){return e>>>=0,r>>>=0,safeSetTimeout(()=>getWasmTableEntry(e)(r),t)};_emscripten_set_timeout.sig="ipdp";var _emscripten_clear_timeout=clearTimeout;_emscripten_clear_timeout.sig="vi";var _emscripten_set_timeout_loop=function(e,t,r){e>>>=0,r>>>=0;function n(){var a=_emscripten_get_now(),l=a+t;callUserCallback(()=>{getWasmTableEntry(e)(a,r)&&setTimeout(n,l-_emscripten_get_now())})}return setTimeout(n,0)};_emscripten_set_timeout_loop.sig="vpdp";var _emscripten_set_interval=function(e,t,r){return e>>>=0,r>>>=0,setInterval(()=>{callUserCallback(()=>getWasmTableEntry(e)(r))},t)};_emscripten_set_interval.sig="ipdp";var _emscripten_clear_interval=e=>{clearInterval(e)};_emscripten_clear_interval.sig="vi";var registerPostMainLoop=e=>{typeof MainLoop<"u"&&MainLoop.postMainLoop.push(e)},registerPreMainLoop=e=>{typeof MainLoop<"u"&&MainLoop.preMainLoop.push(e)};function _emscripten_get_main_loop_timing(e,t){e>>>=0,t>>>=0,e&&(HEAP32[e>>>2>>>0]=MainLoop.timingMode),t&&(HEAP32[t>>>2>>>0]=MainLoop.timingValue)}_emscripten_get_main_loop_timing.sig="vpp";function _emscripten_set_main_loop(e,t,r){e>>>=0;var n=getWasmTableEntry(e);setMainLoop(n,t,r)}_emscripten_set_main_loop.sig="vpii";var _emscripten_set_main_loop_arg=function(e,t,r,n){e>>>=0,t>>>=0;var a=()=>getWasmTableEntry(e)(t);setMainLoop(a,r,n,t)};_emscripten_set_main_loop_arg.sig="vppii";var _emscripten_cancel_main_loop=()=>{MainLoop.pause(),MainLoop.func=null};_emscripten_cancel_main_loop.sig="v";var _emscripten_pause_main_loop=()=>{MainLoop.pause()};_emscripten_pause_main_loop.sig="v";var _emscripten_resume_main_loop=()=>{MainLoop.resume()};_emscripten_resume_main_loop.sig="v";var __emscripten_push_main_loop_blocker=function(e,t,r){e>>>=0,t>>>=0,r>>>=0,MainLoop.queue.push({func:()=>{getWasmTableEntry(e)(t)},name:UTF8ToString(r),counted:!0}),MainLoop.updateStatus()};__emscripten_push_main_loop_blocker.sig="vppp";var __emscripten_push_uncounted_main_loop_blocker=function(e,t,r){e>>>=0,t>>>=0,r>>>=0,MainLoop.queue.push({func:()=>{getWasmTableEntry(e)(t)},name:UTF8ToString(r),counted:!1}),MainLoop.updateStatus()};__emscripten_push_uncounted_main_loop_blocker.sig="vppp";var _emscripten_set_main_loop_expected_blockers=e=>{MainLoop.expectedBlockers=e,MainLoop.remainingBlockers=e,MainLoop.updateStatus()};_emscripten_set_main_loop_expected_blockers.sig="vi";var idsToPromises=(e,t)=>{for(var r=[],n=0;n>>2>>>0];r[n]=getPromise(a)}return r},makePromiseCallback=(e,t)=>r=>{var n=stackSave(),a=stackAlloc(POINTER_SIZE);HEAPU32[a>>>2>>>0]=0;try{var l=getWasmTableEntry(e)(a,t,r),c=HEAPU32[a>>>2>>>0]}catch(_){throw typeof _!="number"?0:_}finally{stackRestore(n)}switch(l){case 0:return c;case 1:return getPromise(c);case 2:var u=getPromise(c);return _emscripten_promise_destroy(c),u;case 3:throw c}};function _emscripten_promise_then(e,t,r,n){e>>>=0,t>>>=0,r>>>=0,n>>>=0;var a=getPromise(e),l=promiseMap.allocate({promise:a.then(makePromiseCallback(t,n),makePromiseCallback(r,n))});return l}_emscripten_promise_then.sig="ppppp";var _emscripten_promise_all=function(e,t,r){e>>>=0,t>>>=0,r>>>=0;var n=idsToPromises(e,r),a=promiseMap.allocate({promise:Promise.all(n).then(l=>{if(t)for(var c=0;c>>2>>>0]=u}return t})});return a};_emscripten_promise_all.sig="pppp";var setPromiseResult=(e,t,r)=>{var n=t?0:3;HEAP32[e>>>2>>>0]=n,HEAPU32[e+4>>>2>>>0]=r},_emscripten_promise_all_settled=function(e,t,r){e>>>=0,t>>>=0,r>>>=0;var n=idsToPromises(e,r),a=promiseMap.allocate({promise:Promise.allSettled(n).then(l=>{if(t)for(var c=t,u=0;u>>=0,t>>>=0,r>>>=0;var n=idsToPromises(e,r),a=promiseMap.allocate({promise:Promise.any(n).catch(l=>{if(t)for(var c=0;c>>2>>>0]=l.errors[c];throw t})});return a};_emscripten_promise_any.sig="pppp";function _emscripten_promise_race(e,t){e>>>=0,t>>>=0;var r=idsToPromises(e,t),n=promiseMap.allocate({promise:Promise.race(r)});return n}_emscripten_promise_race.sig="ppp";function _emscripten_promise_await(e,t){e>>>=0,t>>>=0,abort("emscripten_promise_await is only available with ASYNCIFY")}_emscripten_promise_await.sig="vpp";var getExceptionMessageCommon=e=>{var t=stackSave(),r=stackAlloc(4),n=stackAlloc(4);___get_exception_message(e,r,n);var a=HEAPU32[r>>>2>>>0],l=HEAPU32[n>>>2>>>0],c=UTF8ToString(a);_free(a);var u;return l&&(u=UTF8ToString(l),_free(l)),stackRestore(t),[c,u]},getCppExceptionTag=()=>___cpp_exception,getCppExceptionThrownObjectFromWebAssemblyException=e=>{var t=e.getArg(getCppExceptionTag(),0);return ___thrown_object_from_unwind_exception(t)},incrementExceptionRefcount=e=>{var t=getCppExceptionThrownObjectFromWebAssemblyException(e);___cxa_increment_exception_refcount(t)},decrementExceptionRefcount=e=>{var t=getCppExceptionThrownObjectFromWebAssemblyException(e);___cxa_decrement_exception_refcount(t)},getExceptionMessage=e=>{var t=getCppExceptionThrownObjectFromWebAssemblyException(e);return getExceptionMessageCommon(t)},Browser={useWebGL:!1,isFullscreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init(){if(Browser.initted)return;Browser.initted=!0;var e={};e.canHandle=function(l){return!Module.noImageDecoding&&/\.(jpg|jpeg|png|bmp|webp)$/i.test(l)},e.handle=function(l,c,u,_){var d=new Blob([l],{type:Browser.getMimetype(c)});d.size!==l.length&&(d=new Blob([new Uint8Array(l).buffer],{type:Browser.getMimetype(c)}));var f=URL.createObjectURL(d),p=new Image;p.onload=()=>{var m=document.createElement("canvas");m.width=p.width,m.height=p.height;var g=m.getContext("2d");g.drawImage(p,0,0),preloadedImages[c]=m,URL.revokeObjectURL(f),u==null||u(l)},p.onerror=m=>{err("Image ".concat(f," could not be decoded")),_==null||_()},p.src=f},preloadPlugins.push(e);var t={};t.canHandle=function(l){return!Module.noAudioDecoding&&l.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},t.handle=function(l,c,u,_){var d=!1;function f(b){d||(d=!0,preloadedAudios[c]=b,u==null||u(l))}function p(){d||(d=!0,preloadedAudios[c]=new Audio,_==null||_())}var m=new Blob([l],{type:Browser.getMimetype(c)}),g=URL.createObjectURL(m),h=new Audio;h.addEventListener("canplaythrough",()=>f(h),!1),h.onerror=function(y){if(d)return;err("warning: browser could not fully decode audio ".concat(c,", trying slower base64 approach"));function L(F){for(var I="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",T="=",S="",x=0,E=0,w=0;w=6;){var P=x>>E-6&63;E-=6,S+=I[P]}return E==2?(S+=I[(x&3)<<4],S+=T+T):E==4&&(S+=I[(x&15)<<2],S+=T),S}h.src="data:audio/x-"+c.substr(-3)+";base64,"+L(l),f(h)},h.src=g,safeSetTimeout(()=>{f(h)},1e4)},preloadPlugins.push(t);function r(){Browser.pointerLock=document.pointerLockElement===Module.canvas||document.mozPointerLockElement===Module.canvas||document.webkitPointerLockElement===Module.canvas||document.msPointerLockElement===Module.canvas}var n=Module.canvas;n&&(n.requestPointerLock=n.requestPointerLock||n.mozRequestPointerLock||n.webkitRequestPointerLock||n.msRequestPointerLock||(()=>{}),n.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||(()=>{}),n.exitPointerLock=n.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",r,!1),document.addEventListener("mozpointerlockchange",r,!1),document.addEventListener("webkitpointerlockchange",r,!1),document.addEventListener("mspointerlockchange",r,!1),Module.elementPointerLock&&n.addEventListener("click",a=>{!Browser.pointerLock&&Module.canvas.requestPointerLock&&(Module.canvas.requestPointerLock(),a.preventDefault())},!1))},createContext(e,t,r,n){if(t&&Module.ctx&&e==Module.canvas)return Module.ctx;var a,l;if(t){var c={antialias:!1,alpha:!1,majorVersion:1};if(n)for(var u in n)c[u]=n[u];typeof GL<"u"&&(l=GL.createContext(e,c),l&&(a=GL.getContext(l).GLctx))}else a=e.getContext("2d");return a?(r&&(Module.ctx=a,t&&GL.makeContextCurrent(l),Browser.useWebGL=t,Browser.moduleContextCreatedCallbacks.forEach(_=>_()),Browser.init()),a):null},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen(e,t){Browser.lockPointer=e,Browser.resizeCanvas=t,typeof Browser.lockPointer>"u"&&(Browser.lockPointer=!0),typeof Browser.resizeCanvas>"u"&&(Browser.resizeCanvas=!1);var r=Module.canvas;function n(){var c,u;Browser.isFullscreen=!1;var l=r.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===l?(r.exitFullscreen=Browser.exitFullscreen,Browser.lockPointer&&r.requestPointerLock(),Browser.isFullscreen=!0,Browser.resizeCanvas?Browser.setFullscreenCanvasSize():Browser.updateCanvasDimensions(r)):(l.parentNode.insertBefore(r,l),l.parentNode.removeChild(l),Browser.resizeCanvas?Browser.setWindowedCanvasSize():Browser.updateCanvasDimensions(r)),(c=Module.onFullScreen)==null||c.call(Module,Browser.isFullscreen),(u=Module.onFullscreen)==null||u.call(Module,Browser.isFullscreen)}Browser.fullscreenHandlersInstalled||(Browser.fullscreenHandlersInstalled=!0,document.addEventListener("fullscreenchange",n,!1),document.addEventListener("mozfullscreenchange",n,!1),document.addEventListener("webkitfullscreenchange",n,!1),document.addEventListener("MSFullscreenChange",n,!1));var a=document.createElement("div");r.parentNode.insertBefore(a,r),a.appendChild(r),a.requestFullscreen=a.requestFullscreen||a.mozRequestFullScreen||a.msRequestFullscreen||(a.webkitRequestFullscreen?()=>a.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):null)||(a.webkitRequestFullScreen?()=>a.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT):null),a.requestFullscreen()},exitFullscreen(){if(!Browser.isFullscreen)return!1;var e=document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||(()=>{});return e.apply(document,[]),!0},safeSetTimeout(e,t){return safeSetTimeout(e,t)},getMimetype(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(e){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(e)},getMovementX(e){return e.movementX||e.mozMovementX||e.webkitMovementX||0},getMovementY(e){return e.movementY||e.mozMovementY||e.webkitMovementY||0},getMouseWheelDelta(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:{},calculateMouseCoords(e,t){var r=Module.canvas.getBoundingClientRect(),n=Module.canvas.width,a=Module.canvas.height,l=typeof window.scrollX<"u"?window.scrollX:window.pageXOffset,c=typeof window.scrollY<"u"?window.scrollY:window.pageYOffset,u=e-(l+r.left),_=t-(c+r.top);return u=u*(n/r.width),_=_*(a/r.height),{x:u,y:_}},setMouseCoords(e,t){let{x:r,y:n}=Browser.calculateMouseCoords(e,t);Browser.mouseMovementX=r-Browser.mouseX,Browser.mouseMovementY=n-Browser.mouseY,Browser.mouseX=r,Browser.mouseY=n},calculateMouseEvent(e){if(Browser.pointerLock)e.type!="mousemove"&&"mozMovementX"in e?Browser.mouseMovementX=Browser.mouseMovementY=0:(Browser.mouseMovementX=Browser.getMovementX(e),Browser.mouseMovementY=Browser.getMovementY(e)),Browser.mouseX+=Browser.mouseMovementX,Browser.mouseY+=Browser.mouseMovementY;else{if(e.type==="touchstart"||e.type==="touchend"||e.type==="touchmove"){var t=e.touch;if(t===void 0)return;var r=Browser.calculateMouseCoords(t.pageX,t.pageY);if(e.type==="touchstart")Browser.lastTouches[t.identifier]=r,Browser.touches[t.identifier]=r;else if(e.type==="touchend"||e.type==="touchmove"){var n=Browser.touches[t.identifier];n||(n=r),Browser.lastTouches[t.identifier]=n,Browser.touches[t.identifier]=r}return}Browser.setMouseCoords(e.pageX,e.pageY)}},resizeListeners:[],updateResizeListeners(){var e=Module.canvas;Browser.resizeListeners.forEach(t=>t(e.width,e.height))},setCanvasSize(e,t,r){var n=Module.canvas;Browser.updateCanvasDimensions(n,e,t),r||Browser.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize(){if(typeof SDL<"u"){var e=HEAPU32[SDL.screen>>>2>>>0];e=e|8388608,HEAP32[SDL.screen>>>2>>>0]=e}Browser.updateCanvasDimensions(Module.canvas),Browser.updateResizeListeners()},setWindowedCanvasSize(){if(typeof SDL<"u"){var e=HEAPU32[SDL.screen>>>2>>>0];e=e&-8388609,HEAP32[SDL.screen>>>2>>>0]=e}Browser.updateCanvasDimensions(Module.canvas),Browser.updateResizeListeners()},updateCanvasDimensions(e,t,r){t&&r?(e.widthNative=t,e.heightNative=r):(t=e.widthNative,r=e.heightNative);var n=t,a=r;if(Module.forcedAspectRatio&&Module.forcedAspectRatio>0&&(n/a>>=0,t>>>=0,r>>>=0;var n=UTF8ToString(e),a=FS.analyzePath(n);return a.exists?(FS.createPreloadedFile(PATH.dirname(n),PATH.basename(n),new Uint8Array(a.object.contents),!0,!0,()=>{t&&getWasmTableEntry(t)(e)},()=>{r&&getWasmTableEntry(r)(e)},!0),0):-1};_emscripten_run_preload_plugins.sig="ippp";var Browser_asyncPrepareDataCounter=0,_emscripten_run_preload_plugins_data=function(e,t,r,n,a,l){e>>>=0,r>>>=0,n>>>=0,a>>>=0,l>>>=0;var c=UTF8ToString(r),u="prepare_data_"+Browser_asyncPrepareDataCounter+++"."+c,_=stringToNewUTF8(u);FS.createPreloadedFile("/",u,HEAPU8.subarray(e>>>0,e+t>>>0),!0,!0,()=>{a&&getWasmTableEntry(a)(n,_)},()=>{l&&getWasmTableEntry(l)(n)},!0)};_emscripten_run_preload_plugins_data.sig="vpipppp";var _emscripten_async_run_script=function(e,t){e>>>=0,safeSetTimeout(()=>_emscripten_run_script(e),t)};_emscripten_async_run_script.sig="vpi";var _emscripten_async_load_script=function(url,onload,onerror){url>>>=0,onload>>>=0,onerror>>>=0,url=UTF8ToString(url);var loadDone=()=>{if(onload){var e=()=>callUserCallback(getWasmTableEntry(onload));runDependencies>0?dependenciesFulfilled=e:e()}},loadError=()=>{onerror&&callUserCallback(getWasmTableEntry(onerror))};if(ENVIRONMENT_IS_NODE){readAsync(url,!1).then(data=>{eval(data),loadDone()},loadError);return}var script=document.createElement("script");script.onload=loadDone,script.onerror=loadError,script.src=url,document.body.appendChild(script)};_emscripten_async_load_script.sig="vppp";var safeRequestAnimationFrame=e=>MainLoop.requestAnimationFrame(()=>{callUserCallback(e)});function _emscripten_async_call(e,t,r){e>>>=0,t>>>=0;function n(){getWasmTableEntry(e)(t)}r>=0||ENVIRONMENT_IS_NODE?safeSetTimeout(n,r):safeRequestAnimationFrame(n)}_emscripten_async_call.sig="vppi";function _emscripten_get_window_title(){var e=256;return _emscripten_get_window_title.buffer||(_emscripten_get_window_title.buffer=_malloc(e)),stringToUTF8(document.title,_emscripten_get_window_title.buffer,e),_emscripten_get_window_title.buffer}_emscripten_get_window_title.sig="p";function _emscripten_set_window_title(e){return e>>>=0,document.title=UTF8ToString(e)}_emscripten_set_window_title.sig="vp";function _emscripten_get_screen_size(e,t){e>>>=0,t>>>=0,HEAP32[e>>>2>>>0]=screen.width,HEAP32[t>>>2>>>0]=screen.height}_emscripten_get_screen_size.sig="vpp";var _emscripten_hide_mouse=()=>{for(var e=document.styleSheets[0],t=e.cssRules,r=0;r{Browser.setCanvasSize(e,t)};_emscripten_set_canvas_size.sig="vii";function _emscripten_get_canvas_size(e,t,r){e>>>=0,t>>>=0,r>>>=0;var n=Module.canvas;HEAP32[e>>>2>>>0]=n.width,HEAP32[t>>>2>>>0]=n.height,HEAP32[r>>>2>>>0]=Browser.isFullscreen?1:0}_emscripten_get_canvas_size.sig="vppp";function _emscripten_create_worker(e){e>>>=0,e=UTF8ToString(e);var t=Browser.workers.length,r={worker:new Worker(e),callbacks:[],awaited:0,buffer:0,bufferSize:0};return r.worker.onmessage=function(a){if(!ABORT){var l=Browser.workers[t];if(l){var c=a.data.callbackId,u=l.callbacks[c];if(u){a.data.finalResponse&&(l.awaited--,l.callbacks[c]=null);var _=a.data.data;_?(_.byteLength||(_=new Uint8Array(_)),(!l.buffer||l.bufferSize<_.length)&&(l.buffer&&_free(l.buffer),l.bufferSize=_.length,l.buffer=_malloc(_.length)),HEAPU8.set(_,l.buffer>>>0),u.func(l.buffer,_.length,u.arg)):u.func(0,0,u.arg)}}}},Browser.workers.push(r),t}_emscripten_create_worker.sig="ip";var _emscripten_destroy_worker=e=>{var t=Browser.workers[e];t.worker.terminate(),t.buffer&&_free(t.buffer),Browser.workers[e]=null};_emscripten_destroy_worker.sig="vi";function _emscripten_call_worker(e,t,r,n,a,l){t>>>=0,r>>>=0,a>>>=0,l>>>=0,t=UTF8ToString(t);var c=Browser.workers[e],u=-1;a&&(u=c.callbacks.length,c.callbacks.push({func:getWasmTableEntry(a),arg:l}),c.awaited++);var _={funcName:t,callbackId:u,data:r?new Uint8Array(HEAPU8.subarray(r>>>0,r+n>>>0)):0};r?c.worker.postMessage(_,[_.data.buffer]):c.worker.postMessage(_)}_emscripten_call_worker.sig="vippipp";var _emscripten_get_worker_queue_size=e=>{var t=Browser.workers[e];return t?t.awaited:-1};_emscripten_get_worker_queue_size.sig="ii";var getPreloadedImageData=(e,t,r)=>{e=PATH_FS.resolve(e);var n=preloadedImages[e];if(!n)return 0;var a=n.getContext("2d"),l=a.getImageData(0,0,n.width,n.height),c=_malloc(n.width*n.height*4);return HEAPU8.set(l.data,c>>>0),HEAP32[t>>>2>>>0]=n.width,HEAP32[r>>>2>>>0]=n.height,c};function _emscripten_get_preloaded_image_data(e,t,r){return e>>>=0,t>>>=0,r>>>=0,getPreloadedImageData(UTF8ToString(e),t,r)}_emscripten_get_preloaded_image_data.sig="pppp";var getPreloadedImageData__data=["$PATH_FS","malloc"];function _emscripten_get_preloaded_image_data_from_FILE(e,t,r){e>>>=0,t>>>=0,r>>>=0;var n=_fileno(e),a=FS.getStream(n);return a?getPreloadedImageData(a.path,t,r):0}_emscripten_get_preloaded_image_data_from_FILE.sig="pppp";var wget={wgetRequests:{},nextWgetRequestHandle:0,getNextWgetRequestHandle(){var e=wget.nextWgetRequestHandle;return wget.nextWgetRequestHandle++,e}},FS_mkdirTree=(e,t)=>FS.mkdirTree(e,t),FS_unlink=e=>FS.unlink(e),_emscripten_async_wget=function(e,t,r,n){e>>>=0,t>>>=0,r>>>=0,n>>>=0;var a=UTF8ToString(e),l=UTF8ToString(t);l=PATH_FS.resolve(l);function c(_){_&&callUserCallback(()=>{var d=stackSave();getWasmTableEntry(_)(stringToUTF8OnStack(l)),stackRestore(d)})}var u=PATH.dirname(l);FS_createPreloadedFile(u,PATH.basename(l),a,!0,!0,()=>c(r),()=>c(n),!1,!1,()=>{try{FS_unlink(l)}catch(_){}FS_mkdirTree(u)})};_emscripten_async_wget.sig="vpppp";var _emscripten_async_wget_data=function(e,t,r,n){e>>>=0,t>>>=0,r>>>=0,n>>>=0,asyncLoad(UTF8ToString(e),a=>{callUserCallback(()=>{var l=_malloc(a.length);HEAPU8.set(a,l>>>0),getWasmTableEntry(r)(t,l,a.length),_free(l)})},()=>{n&&callUserCallback(()=>{getWasmTableEntry(n)(t)})},!0)};_emscripten_async_wget_data.sig="vpppp";var _emscripten_async_wget2=function(e,t,r,n,a,l,c,u){e>>>=0,t>>>=0,r>>>=0,n>>>=0,a>>>=0,l>>>=0,c>>>=0,u>>>=0;var _=UTF8ToString(e),d=UTF8ToString(t);d=PATH_FS.resolve(d);var f=UTF8ToString(r),p=UTF8ToString(n),m=d.lastIndexOf("/"),g=new XMLHttpRequest;g.open(f,_,!0),g.responseType="arraybuffer";var h=wget.getNextWgetRequestHandle(),b=PATH.dirname(d);return g.onload=y=>{if(g.status>=200&&g.status<300){try{FS.unlink(d)}catch(F){}if(FS.mkdirTree(b),FS.createDataFile(d.substr(0,m),d.substr(m+1),new Uint8Array(g.response),!0,!0,!1),l){var L=stackSave();getWasmTableEntry(l)(h,a,stringToUTF8OnStack(d)),stackRestore(L)}}else c&&getWasmTableEntry(c)(h,a,g.status);delete wget.wgetRequests[h]},g.onerror=y=>{c&&getWasmTableEntry(c)(h,a,g.status),delete wget.wgetRequests[h]},g.onprogress=y=>{if(y.lengthComputable||y.lengthComputable===void 0&&y.total!=0){var L=y.loaded/y.total*100;u&&getWasmTableEntry(u)(h,a,L)}},g.onabort=y=>{delete wget.wgetRequests[h]},f=="POST"?(g.setRequestHeader("Content-type","application/x-www-form-urlencoded"),g.send(p)):g.send(null),wget.wgetRequests[h]=g,h};_emscripten_async_wget2.sig="ipppppppp";function _emscripten_async_wget2_data(e,t,r,n,a,l,c,u){e>>>=0,t>>>=0,r>>>=0,n>>>=0,l>>>=0,c>>>=0,u>>>=0;var _=UTF8ToString(e),d=UTF8ToString(t),f=UTF8ToString(r),p=new XMLHttpRequest;p.open(d,_,!0),p.responseType="arraybuffer";var m=wget.getNextWgetRequestHandle();function g(){if(c){var h=stackSave(),b=0;p.statusText&&(b=stringToUTF8OnStack(p.statusText)),getWasmTableEntry(c)(m,n,p.status,b),stackRestore(h)}}return p.onload=h=>{if(p.status>=200&&p.status<300||p.status===0&&_.substr(0,4).toLowerCase()!="http"){var b=new Uint8Array(p.response),y=_malloc(b.length);HEAPU8.set(b,y>>>0),l&&getWasmTableEntry(l)(m,n,y,b.length),a&&_free(y)}else g();delete wget.wgetRequests[m]},p.onerror=h=>{g(),delete wget.wgetRequests[m]},p.onprogress=h=>{u&&getWasmTableEntry(u)(m,n,h.loaded,h.lengthComputable||h.lengthComputable===void 0?h.total:0)},p.onabort=h=>{delete wget.wgetRequests[m]},d=="POST"?(p.setRequestHeader("Content-type","application/x-www-form-urlencoded"),p.send(f)):p.send(null),wget.wgetRequests[m]=p,m}_emscripten_async_wget2_data.sig="ippppippp";var _emscripten_async_wget2_abort=e=>{var t=wget.wgetRequests[e];t==null||t.abort()};_emscripten_async_wget2_abort.sig="vi";function ___asctime_r(e,t){e>>>=0,t>>>=0;var r={tm_sec:HEAP32[e>>>2>>>0],tm_min:HEAP32[e+4>>>2>>>0],tm_hour:HEAP32[e+8>>>2>>>0],tm_mday:HEAP32[e+12>>>2>>>0],tm_mon:HEAP32[e+16>>>2>>>0],tm_year:HEAP32[e+20>>>2>>>0],tm_wday:HEAP32[e+24>>>2>>>0]},n=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],l=n[r.tm_wday]+" "+a[r.tm_mon]+(r.tm_mday<10?" ":" ")+r.tm_mday+(r.tm_hour<10?" 0":" ")+r.tm_hour+(r.tm_min<10?":0":":")+r.tm_min+(r.tm_sec<10?":0":":")+r.tm_sec+" "+(1900+r.tm_year)+"\n";return stringToUTF8(l,t,26),t}___asctime_r.sig="ppp";function _strptime_l(e,t,r,n){return e>>>=0,t>>>=0,r>>>=0,n>>>=0,_strptime(e,t,r)}_strptime_l.sig="ppppp";function ___syscall_shutdown(e,t){try{return getSocketFromFD(e),-52}catch(r){if(typeof FS>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}Module.___syscall_shutdown=___syscall_shutdown,___syscall_shutdown.sig="iiiiiii";function __dlsym_catchup_js(e,t){e>>>=0;var r=LDSO.loadedLibsByHandle[e],n=r.exports,a=Object.keys(n)[t],l=n[a],c=addFunction(l,l.sig);return c}__dlsym_catchup_js.sig="ppi";var FS_createPath=FS.createPath,FS_createDevice=FS.createDevice,FS_readFile=FS.readFile,FS_createLazyFile=FS.createLazyFile,_setNetworkCallback=(e,t,r)=>{function n(a){try{if(e==="error"){var l=stackSave(),c=stringToUTF8OnStack(a[2]);getWasmTableEntry(r)(a[0],a[1],c,t),stackRestore(l)}else getWasmTableEntry(r)(a,t)}catch(u){if(!(u instanceof ExitStatus))throw u&&typeof u=="object"&&u.stack&&err("exception thrown: "+[u,u.stack]),u}}Module.websocket.on(e,r?n:null)};function _emscripten_set_socket_error_callback(e,t){e>>>=0,t>>>=0,_setNetworkCallback("error",e,t)}_emscripten_set_socket_error_callback.sig="vpp";function _emscripten_set_socket_open_callback(e,t){e>>>=0,t>>>=0,_setNetworkCallback("open",e,t)}_emscripten_set_socket_open_callback.sig="vpp";function _emscripten_set_socket_listen_callback(e,t){e>>>=0,t>>>=0,_setNetworkCallback("listen",e,t)}_emscripten_set_socket_listen_callback.sig="vpp";function _emscripten_set_socket_connection_callback(e,t){e>>>=0,t>>>=0,_setNetworkCallback("connection",e,t)}_emscripten_set_socket_connection_callback.sig="vpp";function _emscripten_set_socket_message_callback(e,t){e>>>=0,t>>>=0,_setNetworkCallback("message",e,t)}_emscripten_set_socket_message_callback.sig="vpp";function _emscripten_set_socket_close_callback(e,t){e>>>=0,t>>>=0,_setNetworkCallback("close",e,t)}_emscripten_set_socket_close_callback.sig="vpp";function _emscripten_webgl_enable_ANGLE_instanced_arrays(e){return e>>>=0,webgl_enable_ANGLE_instanced_arrays(GL.contexts[e].GLctx)}_emscripten_webgl_enable_ANGLE_instanced_arrays.sig="ip";function _emscripten_webgl_enable_OES_vertex_array_object(e){return e>>>=0,webgl_enable_OES_vertex_array_object(GL.contexts[e].GLctx)}_emscripten_webgl_enable_OES_vertex_array_object.sig="ip";function _emscripten_webgl_enable_WEBGL_draw_buffers(e){return e>>>=0,webgl_enable_WEBGL_draw_buffers(GL.contexts[e].GLctx)}_emscripten_webgl_enable_WEBGL_draw_buffers.sig="ip";function _emscripten_webgl_enable_WEBGL_multi_draw(e){return e>>>=0,webgl_enable_WEBGL_multi_draw(GL.contexts[e].GLctx)}_emscripten_webgl_enable_WEBGL_multi_draw.sig="ip";function _emscripten_webgl_enable_EXT_polygon_offset_clamp(e){return e>>>=0,webgl_enable_EXT_polygon_offset_clamp(GL.contexts[e].GLctx)}_emscripten_webgl_enable_EXT_polygon_offset_clamp.sig="ip";function _emscripten_webgl_enable_EXT_clip_control(e){return e>>>=0,webgl_enable_EXT_clip_control(GL.contexts[e].GLctx)}_emscripten_webgl_enable_EXT_clip_control.sig="ip";function _emscripten_webgl_enable_WEBGL_polygon_mode(e){return e>>>=0,webgl_enable_WEBGL_polygon_mode(GL.contexts[e].GLctx)}_emscripten_webgl_enable_WEBGL_polygon_mode.sig="ip";function _glVertexPointer(e,t,r,n){throw n>>>=0,"Legacy GL function (glVertexPointer) called. If you want legacy GL emulation, you need to compile with -sLEGACY_GL_EMULATION to enable legacy GL emulation."}_glVertexPointer.sig="viiip";var _glMatrixMode=()=>{throw"Legacy GL function (glMatrixMode) called. If you want legacy GL emulation, you need to compile with -sLEGACY_GL_EMULATION to enable legacy GL emulation."};_glMatrixMode.sig="vi";var _glBegin=()=>{throw"Legacy GL function (glBegin) called. If you want legacy GL emulation, you need to compile with -sLEGACY_GL_EMULATION to enable legacy GL emulation."};_glBegin.sig="vi";var _glLoadIdentity=()=>{throw"Legacy GL function (glLoadIdentity) called. If you want legacy GL emulation, you need to compile with -sLEGACY_GL_EMULATION to enable legacy GL emulation."};_glLoadIdentity.sig="v";var _glVertexAttribDivisorNV=_glVertexAttribDivisor,_glDrawArraysInstancedNV=_glDrawArraysInstanced,_glDrawElementsInstancedNV=_glDrawElementsInstanced,_glVertexAttribDivisorEXT=_glVertexAttribDivisor,_glDrawArraysInstancedEXT=_glDrawArraysInstanced,_glDrawElementsInstancedEXT=_glDrawElementsInstanced,_glVertexAttribDivisorARB=_glVertexAttribDivisor,_glDrawArraysInstancedARB=_glDrawArraysInstanced,_glDrawElementsInstancedARB=_glDrawElementsInstanced,_glDrawBuffersEXT=_glDrawBuffers;function _glMultiDrawArraysWEBGL(e,t,r,n){t>>>=0,r>>>=0,GLctx.multiDrawWebgl.multiDrawArraysWEBGL(e,HEAP32,t>>>2,HEAP32,r>>>2,n)}_glMultiDrawArraysWEBGL.sig="vippi";var _glMultiDrawArrays=_glMultiDrawArraysWEBGL;_glMultiDrawArrays.sig="vippi";var _glMultiDrawArraysANGLE=_glMultiDrawArraysWEBGL;function _glMultiDrawArraysInstancedWEBGL(e,t,r,n,a){t>>>=0,r>>>=0,n>>>=0,GLctx.multiDrawWebgl.multiDrawArraysInstancedWEBGL(e,HEAP32,t>>>2,HEAP32,r>>>2,HEAP32,n>>>2,a)}_glMultiDrawArraysInstancedWEBGL.sig="vipppi";var _glMultiDrawArraysInstancedANGLE=_glMultiDrawArraysInstancedWEBGL;function _glMultiDrawElementsWEBGL(e,t,r,n,a){t>>>=0,n>>>=0,GLctx.multiDrawWebgl.multiDrawElementsWEBGL(e,HEAP32,t>>>2,r,HEAP32,n>>>2,a)}_glMultiDrawElementsWEBGL.sig="vipipi";var _glMultiDrawElements=_glMultiDrawElementsWEBGL;_glMultiDrawElements.sig="vipipi";var _glMultiDrawElementsANGLE=_glMultiDrawElementsWEBGL;function _glMultiDrawElementsInstancedWEBGL(e,t,r,n,a,l){t>>>=0,n>>>=0,a>>>=0,GLctx.multiDrawWebgl.multiDrawElementsInstancedWEBGL(e,HEAP32,t>>>2,r,HEAP32,n>>>2,HEAP32,a>>>2,l)}_glMultiDrawElementsInstancedWEBGL.sig="vipippi";var _glMultiDrawElementsInstancedANGLE=_glMultiDrawElementsInstancedWEBGL,_glClearDepth=e=>GLctx.clearDepth(e);_glClearDepth.sig="vd";var _glDepthRange=(e,t)=>GLctx.depthRange(e,t);_glDepthRange.sig="vdd";var _emscripten_glGenVertexArrays=_glGenVertexArrays;_emscripten_glGenVertexArrays.sig="vip";var _emscripten_glDeleteVertexArrays=_glDeleteVertexArrays;_emscripten_glDeleteVertexArrays.sig="vip";var _emscripten_glBindVertexArray=_glBindVertexArray;_emscripten_glBindVertexArray.sig="vi";var _emscripten_glIsVertexArray=_glIsVertexArray;_emscripten_glIsVertexArray.sig="ii";var _emscripten_glVertexPointer=_glVertexPointer;_emscripten_glVertexPointer.sig="viiip";var _emscripten_glMatrixMode=_glMatrixMode;_emscripten_glMatrixMode.sig="vi";var _emscripten_glBegin=_glBegin;_emscripten_glBegin.sig="vi";var _emscripten_glLoadIdentity=_glLoadIdentity;_emscripten_glLoadIdentity.sig="v";var _emscripten_glVertexAttribDivisor=_glVertexAttribDivisor;_emscripten_glVertexAttribDivisor.sig="vii";var _emscripten_glDrawArraysInstanced=_glDrawArraysInstanced;_emscripten_glDrawArraysInstanced.sig="viiii";var _emscripten_glDrawElementsInstanced=_glDrawElementsInstanced;_emscripten_glDrawElementsInstanced.sig="viiipi";var _emscripten_glVertexAttribDivisorNV=_glVertexAttribDivisorNV,_emscripten_glDrawArraysInstancedNV=_glDrawArraysInstancedNV,_emscripten_glDrawElementsInstancedNV=_glDrawElementsInstancedNV,_emscripten_glVertexAttribDivisorEXT=_glVertexAttribDivisorEXT,_emscripten_glDrawArraysInstancedEXT=_glDrawArraysInstancedEXT,_emscripten_glDrawElementsInstancedEXT=_glDrawElementsInstancedEXT,_emscripten_glVertexAttribDivisorARB=_glVertexAttribDivisorARB,_emscripten_glDrawArraysInstancedARB=_glDrawArraysInstancedARB,_emscripten_glDrawElementsInstancedARB=_glDrawElementsInstancedARB,_emscripten_glDrawBuffers=_glDrawBuffers;_emscripten_glDrawBuffers.sig="vip";var _emscripten_glDrawBuffersEXT=_glDrawBuffersEXT,_emscripten_glMultiDrawArrays=_glMultiDrawArrays;_emscripten_glMultiDrawArrays.sig="vippi";var _emscripten_glMultiDrawArraysANGLE=_glMultiDrawArraysANGLE,_emscripten_glMultiDrawArraysWEBGL=_glMultiDrawArraysWEBGL,_emscripten_glMultiDrawArraysInstancedANGLE=_glMultiDrawArraysInstancedANGLE,_emscripten_glMultiDrawArraysInstancedWEBGL=_glMultiDrawArraysInstancedWEBGL,_emscripten_glMultiDrawElements=_glMultiDrawElements;_emscripten_glMultiDrawElements.sig="vipipi";var _emscripten_glMultiDrawElementsANGLE=_glMultiDrawElementsANGLE,_emscripten_glMultiDrawElementsWEBGL=_glMultiDrawElementsWEBGL,_emscripten_glMultiDrawElementsInstancedANGLE=_glMultiDrawElementsInstancedANGLE,_emscripten_glMultiDrawElementsInstancedWEBGL=_glMultiDrawElementsInstancedWEBGL,_emscripten_glClearDepth=_glClearDepth;_emscripten_glClearDepth.sig="vd";var _emscripten_glDepthRange=_glDepthRange;_emscripten_glDepthRange.sig="vdd";var writeGLArray=(e,t,r,n)=>{var a=e.length,l=r>>2;for(var u=0;u>>0]=e[u];return a},webglPowerPreferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(e,t){e>>>=0,t>>>=0;var r=t>>>2,n=HEAP32[r+2>>>0],a={alpha:!!HEAP8[t+0>>>0],depth:!!HEAP8[t+1>>>0],stencil:!!HEAP8[t+2>>>0],antialias:!!HEAP8[t+3>>>0],premultipliedAlpha:!!HEAP8[t+4>>>0],preserveDrawingBuffer:!!HEAP8[t+5>>>0],powerPreference:webglPowerPreferences[n],failIfMajorPerformanceCaveat:!!HEAP8[t+12>>>0],majorVersion:HEAP32[r+4>>>0],minorVersion:HEAP32[r+5>>>0],enableExtensionsByDefault:HEAP8[t+24>>>0],explicitSwapControl:HEAP8[t+25>>>0],proxyContextToMainThread:HEAP32[r+7>>>0],renderViaOffscreenBackBuffer:HEAP8[t+32>>>0]},l=findCanvasEventTarget(e);if(!l||a.explicitSwapControl)return 0;var c=GL.createContext(l,a);return c}_emscripten_webgl_do_create_context.sig="ppp";var _emscripten_webgl_create_context=_emscripten_webgl_do_create_context;_emscripten_webgl_create_context.sig="ppp";function _emscripten_webgl_do_get_current_context(){return GL.currentContext?GL.currentContext.handle:0}_emscripten_webgl_do_get_current_context.sig="p";var _emscripten_webgl_get_current_context=_emscripten_webgl_do_get_current_context;_emscripten_webgl_get_current_context.sig="p";var _emscripten_webgl_do_commit_frame=()=>!GL.currentContext||!GL.currentContext.GLctx||!GL.currentContext.attributes.explicitSwapControl?-3:0;_emscripten_webgl_do_commit_frame.sig="i";var _emscripten_webgl_commit_frame=_emscripten_webgl_do_commit_frame;_emscripten_webgl_commit_frame.sig="i";function _emscripten_webgl_make_context_current(e){e>>>=0;var t=GL.makeContextCurrent(e);return t?0:-5}_emscripten_webgl_make_context_current.sig="ip";function _emscripten_webgl_get_drawing_buffer_size(e,t,r){e>>>=0,t>>>=0,r>>>=0;var n=GL.getContext(e);return!n||!n.GLctx||!t||!r?-5:(HEAP32[t>>>2>>>0]=n.GLctx.drawingBufferWidth,HEAP32[r>>>2>>>0]=n.GLctx.drawingBufferHeight,0)}_emscripten_webgl_get_drawing_buffer_size.sig="ippp";function _emscripten_webgl_get_context_attributes(e,t){if(e>>>=0,t>>>=0,!t)return-5;if(e=GL.contexts[e],!e)return-3;var r=e.GLctx;if(!r)return-3;r=r.getContextAttributes(),HEAP8[t>>>0]=r.alpha,HEAP8[t+1>>>0]=r.depth,HEAP8[t+2>>>0]=r.stencil,HEAP8[t+3>>>0]=r.antialias,HEAP8[t+4>>>0]=r.premultipliedAlpha,HEAP8[t+5>>>0]=r.preserveDrawingBuffer;var n=r.powerPreference&&webglPowerPreferences.indexOf(r.powerPreference);return HEAP32[t+8>>>2>>>0]=n,HEAP8[t+12>>>0]=r.failIfMajorPerformanceCaveat,HEAP32[t+16>>>2>>>0]=e.version,HEAP32[t+20>>>2>>>0]=0,HEAP8[t+24>>>0]=e.attributes.enableExtensionsByDefault,0}_emscripten_webgl_get_context_attributes.sig="ipp";function _emscripten_webgl_destroy_context(e){e>>>=0,GL.currentContext==e&&(GL.currentContext=0),GL.deleteContext(e)}_emscripten_webgl_destroy_context.sig="ip";function _emscripten_webgl_enable_extension(e,t){e>>>=0,t>>>=0;var r=GL.getContext(e),n=UTF8ToString(t);n.startsWith("GL_")&&(n=n.substr(3)),n=="ANGLE_instanced_arrays"&&webgl_enable_ANGLE_instanced_arrays(GLctx),n=="OES_vertex_array_object"&&webgl_enable_OES_vertex_array_object(GLctx),n=="WEBGL_draw_buffers"&&webgl_enable_WEBGL_draw_buffers(GLctx),n=="WEBGL_multi_draw"&&webgl_enable_WEBGL_multi_draw(GLctx),n=="EXT_polygon_offset_clamp"&&webgl_enable_EXT_polygon_offset_clamp(GLctx),n=="EXT_clip_control"&&webgl_enable_EXT_clip_control(GLctx),n=="WEBGL_polygon_mode"&&webgl_enable_WEBGL_polygon_mode(GLctx);var a=r.GLctx.getExtension(n);return!!a}_emscripten_webgl_enable_extension.sig="ipp";var _emscripten_supports_offscreencanvas=()=>0;_emscripten_supports_offscreencanvas.sig="i";var registerWebGlEventCallback=(e,t,r,n,a,l,c)=>{var u=(d=event)=>{getWasmTableEntry(n)(a,0,t)&&d.preventDefault()},_={target:findEventTarget(e),eventTypeString:l,callbackfunc:n,handlerFunc:u,useCapture:r};JSEvents.registerOrRemoveHandler(_)};function _emscripten_set_webglcontextlost_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerWebGlEventCallback(e,t,r,n,31,"webglcontextlost",a),0}_emscripten_set_webglcontextlost_callback_on_thread.sig="ippipp";function _emscripten_set_webglcontextrestored_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerWebGlEventCallback(e,t,r,n,32,"webglcontextrestored",a),0}_emscripten_set_webglcontextrestored_callback_on_thread.sig="ippipp";function _emscripten_is_webgl_context_lost(e){return e>>>=0,!GL.contexts[e]||GL.contexts[e].GLctx.isContextLost()}_emscripten_is_webgl_context_lost.sig="ip";function _emscripten_webgl_get_supported_extensions(){return stringToNewUTF8(GLctx.getSupportedExtensions().join(" "))}_emscripten_webgl_get_supported_extensions.sig="p";var _emscripten_webgl_get_program_parameter_d=(e,t)=>GLctx.getProgramParameter(GL.programs[e],t);_emscripten_webgl_get_program_parameter_d.sig="dii";function _emscripten_webgl_get_program_info_log_utf8(e){return stringToNewUTF8(GLctx.getProgramInfoLog(GL.programs[e]))}_emscripten_webgl_get_program_info_log_utf8.sig="pi";var _emscripten_webgl_get_shader_parameter_d=(e,t)=>GLctx.getShaderParameter(GL.shaders[e],t);_emscripten_webgl_get_shader_parameter_d.sig="dii";function _emscripten_webgl_get_shader_info_log_utf8(e){return stringToNewUTF8(GLctx.getShaderInfoLog(GL.shaders[e]))}_emscripten_webgl_get_shader_info_log_utf8.sig="pi";function _emscripten_webgl_get_shader_source_utf8(e){return stringToNewUTF8(GLctx.getShaderSource(GL.shaders[e]))}_emscripten_webgl_get_shader_source_utf8.sig="pi";var _emscripten_webgl_get_vertex_attrib_d=(e,t)=>GLctx.getVertexAttrib(e,t);_emscripten_webgl_get_vertex_attrib_d.sig="dii";var _emscripten_webgl_get_vertex_attrib_o=(e,t)=>{var r=GLctx.getVertexAttrib(e,t);return r==null?void 0:r.name};_emscripten_webgl_get_vertex_attrib_o.sig="iii";function _emscripten_webgl_get_vertex_attrib_v(e,t,r,n,a){return r>>>=0,writeGLArray(GLctx.getVertexAttrib(e,t),r,n,a)}_emscripten_webgl_get_vertex_attrib_v.sig="iiipii";var _emscripten_webgl_get_uniform_d=(e,t)=>GLctx.getUniform(GL.programs[e],webglGetUniformLocation(t));_emscripten_webgl_get_uniform_d.sig="dii";function _emscripten_webgl_get_uniform_v(e,t,r,n,a){return r>>>=0,writeGLArray(GLctx.getUniform(GL.programs[e],webglGetUniformLocation(t)),r,n,a)}_emscripten_webgl_get_uniform_v.sig="iiipii";function _emscripten_webgl_get_parameter_v(e,t,r,n){return t>>>=0,writeGLArray(GLctx.getParameter(e),t,r,n)}_emscripten_webgl_get_parameter_v.sig="iipii";var _emscripten_webgl_get_parameter_d=e=>GLctx.getParameter(e);_emscripten_webgl_get_parameter_d.sig="di";var _emscripten_webgl_get_parameter_o=e=>{var t=GLctx.getParameter(e);return t==null?void 0:t.name};_emscripten_webgl_get_parameter_o.sig="ii";function _emscripten_webgl_get_parameter_utf8(e){return stringToNewUTF8(GLctx.getParameter(e))}_emscripten_webgl_get_parameter_utf8.sig="pi";function _emscripten_webgl_get_parameter_i64v(e,t){return t>>>=0,writeI53ToI64(t,GLctx.getParameter(e))}_emscripten_webgl_get_parameter_i64v.sig="vip";var _glutPostRedisplay=()=>{GLUT.displayFunc&&!GLUT.requestedAnimationFrame&&(GLUT.requestedAnimationFrame=!0,MainLoop.requestAnimationFrame(()=>{GLUT.requestedAnimationFrame=!1,MainLoop.runIter(()=>getWasmTableEntry(GLUT.displayFunc)())}))};_glutPostRedisplay.sig="v";var GLUT={initTime:null,idleFunc:null,displayFunc:null,keyboardFunc:null,keyboardUpFunc:null,specialFunc:null,specialUpFunc:null,reshapeFunc:null,motionFunc:null,passiveMotionFunc:null,mouseFunc:null,buttons:0,modifiers:0,initWindowWidth:256,initWindowHeight:256,initDisplayMode:18,windowX:0,windowY:0,windowWidth:0,windowHeight:0,requestedAnimationFrame:!1,saveModifiers:e=>{GLUT.modifiers=0,e.shiftKey&&(GLUT.modifiers+=1),e.ctrlKey&&(GLUT.modifiers+=2),e.altKey&&(GLUT.modifiers+=4)},onMousemove:e=>{var t=Browser.mouseX,r=Browser.mouseY;Browser.calculateMouseEvent(e);var n=Browser.mouseX,a=Browser.mouseY;n==t&&a==r||(GLUT.buttons==0&&e.target==Module.canvas&&GLUT.passiveMotionFunc?(e.preventDefault(),GLUT.saveModifiers(e),getWasmTableEntry(GLUT.passiveMotionFunc)(t,r)):GLUT.buttons!=0&&GLUT.motionFunc&&(e.preventDefault(),GLUT.saveModifiers(e),getWasmTableEntry(GLUT.motionFunc)(t,r)))},getSpecialKey:e=>{var t=null;switch(e){case 8:t=120;break;case 46:t=111;break;case 112:t=1;break;case 113:t=2;break;case 114:t=3;break;case 115:t=4;break;case 116:t=5;break;case 117:t=6;break;case 118:t=7;break;case 119:t=8;break;case 120:t=9;break;case 121:t=10;break;case 122:t=11;break;case 123:t=12;break;case 37:t=100;break;case 38:t=101;break;case 39:t=102;break;case 40:t=103;break;case 33:t=104;break;case 34:t=105;break;case 36:t=106;break;case 35:t=107;break;case 45:t=108;break;case 16:case 5:t=112;break;case 6:t=113;break;case 17:case 3:t=114;break;case 4:t=115;break;case 18:case 2:t=116;break;case 1:t=117;break}return t},getASCIIKey:e=>{if(e.ctrlKey||e.altKey||e.metaKey)return null;var t=e.keyCode;if(48<=t&&t<=57)return t;if(65<=t&&t<=90)return e.shiftKey?t:t+32;if(96<=t&&t<=105)return t-48;if(106<=t&&t<=111)return t-106+42;switch(t){case 9:case 13:case 27:case 32:case 61:return t}var r=e.shiftKey;switch(t){case 186:return r?58:59;case 187:return r?43:61;case 188:return r?60:44;case 189:return r?95:45;case 190:return r?62:46;case 191:return r?63:47;case 219:return r?123:91;case 220:return r?124:47;case 221:return r?125:93;case 222:return r?34:39}return null},onKeydown:e=>{if(GLUT.specialFunc||GLUT.keyboardFunc){var t=GLUT.getSpecialKey(e.keyCode);t!==null?GLUT.specialFunc&&(e.preventDefault(),GLUT.saveModifiers(e),getWasmTableEntry(GLUT.specialFunc)(t,Browser.mouseX,Browser.mouseY)):(t=GLUT.getASCIIKey(e),t!==null&&GLUT.keyboardFunc&&(e.preventDefault(),GLUT.saveModifiers(e),getWasmTableEntry(GLUT.keyboardFunc)(t,Browser.mouseX,Browser.mouseY)))}},onKeyup:e=>{if(GLUT.specialUpFunc||GLUT.keyboardUpFunc){var t=GLUT.getSpecialKey(e.keyCode);t!==null?GLUT.specialUpFunc&&(e.preventDefault(),GLUT.saveModifiers(e),getWasmTableEntry(GLUT.specialUpFunc)(t,Browser.mouseX,Browser.mouseY)):(t=GLUT.getASCIIKey(e),t!==null&&GLUT.keyboardUpFunc&&(e.preventDefault(),GLUT.saveModifiers(e),getWasmTableEntry(GLUT.keyboardUpFunc)(t,Browser.mouseX,Browser.mouseY)))}},touchHandler:e=>{if(e.target==Module.canvas){var t=e.changedTouches,r=t[0],n="";switch(e.type){case"touchstart":n="mousedown";break;case"touchmove":n="mousemove";break;case"touchend":n="mouseup";break;default:return}var a=document.createEvent("MouseEvent");a.initMouseEvent(n,!0,!0,window,1,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),r.target.dispatchEvent(a),e.preventDefault()}},onMouseButtonDown:e=>{if(Browser.calculateMouseEvent(e),GLUT.buttons|=1<{Browser.calculateMouseEvent(e),GLUT.buttons&=~(1<{Browser.calculateMouseEvent(e);var t=window.event||e,r=-Browser.getMouseWheelDelta(e);r=r==0?0:r>0?Math.max(r,1):Math.min(r,-1);var n=3;r<0&&(n=4),GLUT.mouseFunc&&(e.preventDefault(),GLUT.saveModifiers(e),getWasmTableEntry(GLUT.mouseFunc)(n,0,Browser.mouseX,Browser.mouseY))},onFullscreenEventChange:e=>{var t,r;document.fullscreen||document.fullScreen||document.mozFullScreen||document.webkitIsFullScreen?(t=screen.width,r=screen.height):(t=GLUT.windowWidth,r=GLUT.windowHeight,document.removeEventListener("fullscreenchange",GLUT.onFullscreenEventChange,!0),document.removeEventListener("mozfullscreenchange",GLUT.onFullscreenEventChange,!0),document.removeEventListener("webkitfullscreenchange",GLUT.onFullscreenEventChange,!0)),Browser.setCanvasSize(t,r,!0),GLUT.reshapeFunc&&getWasmTableEntry(GLUT.reshapeFunc)(t,r),_glutPostRedisplay()}},_glutGetModifiers=()=>GLUT.modifiers;_glutGetModifiers.sig="i";function _glutInit(e,t){e>>>=0,t>>>=0,GLUT.initTime=Date.now();var r="ontouchstart"in document.documentElement;r&&(window.addEventListener("touchmove",GLUT.touchHandler,!0),window.addEventListener("touchstart",GLUT.touchHandler,!0),window.addEventListener("touchend",GLUT.touchHandler,!0)),window.addEventListener("keydown",GLUT.onKeydown,!0),window.addEventListener("keyup",GLUT.onKeyup,!0),window.addEventListener("mousemove",GLUT.onMousemove,!0),window.addEventListener("mousedown",GLUT.onMouseButtonDown,!0),window.addEventListener("mouseup",GLUT.onMouseButtonUp,!0),window.addEventListener("mousewheel",GLUT.onMouseWheel,!0),window.addEventListener("DOMMouseScroll",GLUT.onMouseWheel,!0),Browser.resizeListeners.push((n,a)=>{GLUT.reshapeFunc&&getWasmTableEntry(GLUT.reshapeFunc)(n,a)}),__ATEXIT__.push(()=>{r&&(window.removeEventListener("touchmove",GLUT.touchHandler,!0),window.removeEventListener("touchstart",GLUT.touchHandler,!0),window.removeEventListener("touchend",GLUT.touchHandler,!0)),window.removeEventListener("keydown",GLUT.onKeydown,!0),window.removeEventListener("keyup",GLUT.onKeyup,!0),window.removeEventListener("mousemove",GLUT.onMousemove,!0),window.removeEventListener("mousedown",GLUT.onMouseButtonDown,!0),window.removeEventListener("mouseup",GLUT.onMouseButtonUp,!0),window.removeEventListener("mousewheel",GLUT.onMouseWheel,!0),window.removeEventListener("DOMMouseScroll",GLUT.onMouseWheel,!0),Module.canvas.width=Module.canvas.height=1})}_glutInit.sig="vpp";var _glutInitWindowSize=(e,t)=>{Browser.setCanvasSize(GLUT.initWindowWidth=e,GLUT.initWindowHeight=t)};_glutInitWindowSize.sig="vii";var _glutInitWindowPosition=(e,t)=>{};_glutInitWindowPosition.sig="vii";var _glutGet=e=>{switch(e){case 100:return 0;case 101:return 0;case 102:return Module.canvas.width;case 103:return Module.canvas.height;case 200:return Module.canvas.width;case 201:return Module.canvas.height;case 500:return 0;case 501:return 0;case 502:return GLUT.initWindowWidth;case 503:return GLUT.initWindowHeight;case 700:var t=Date.now();return t-GLUT.initTime;case 105:return Module.ctx.getContextAttributes().stencil?8:0;case 106:return Module.ctx.getContextAttributes().depth?8:0;case 110:return Module.ctx.getContextAttributes().alpha?8:0;case 120:return Module.ctx.getContextAttributes().antialias?1:0;default:throw"glutGet("+e+") not implemented yet"}};_glutGet.sig="ii";function _glutIdleFunc(e){e>>>=0;function t(){GLUT.idleFunc&&(getWasmTableEntry(GLUT.idleFunc)(),safeSetTimeout(t,4))}GLUT.idleFunc||safeSetTimeout(t,0),GLUT.idleFunc=e}_glutIdleFunc.sig="vp";var _glutTimerFunc=function(e,t,r){return t>>>=0,safeSetTimeout(()=>getWasmTableEntry(t)(r),e)};_glutTimerFunc.sig="vipi";function _glutDisplayFunc(e){e>>>=0,GLUT.displayFunc=e}_glutDisplayFunc.sig="vp";function _glutKeyboardFunc(e){e>>>=0,GLUT.keyboardFunc=e}_glutKeyboardFunc.sig="vp";function _glutKeyboardUpFunc(e){e>>>=0,GLUT.keyboardUpFunc=e}_glutKeyboardUpFunc.sig="vp";function _glutSpecialFunc(e){e>>>=0,GLUT.specialFunc=e}_glutSpecialFunc.sig="vp";function _glutSpecialUpFunc(e){e>>>=0,GLUT.specialUpFunc=e}_glutSpecialUpFunc.sig="vp";function _glutReshapeFunc(e){e>>>=0,GLUT.reshapeFunc=e}_glutReshapeFunc.sig="vp";function _glutMotionFunc(e){e>>>=0,GLUT.motionFunc=e}_glutMotionFunc.sig="vp";function _glutPassiveMotionFunc(e){e>>>=0,GLUT.passiveMotionFunc=e}_glutPassiveMotionFunc.sig="vp";function _glutMouseFunc(e){e>>>=0,GLUT.mouseFunc=e}_glutMouseFunc.sig="vp";var _glutSetCursor=e=>{var t="auto";switch(e){case 0:break;case 1:break;case 2:t="pointer";break;case 3:break;case 4:t="help";break;case 5:break;case 6:break;case 7:t="wait";break;case 8:t="text";break;case 9:case 102:t="crosshair";break;case 10:t="ns-resize";break;case 11:t="ew-resize";break;case 12:t="n-resize";break;case 13:t="s-resize";break;case 14:t="w-resize";break;case 15:t="e-resize";break;case 16:t="nw-resize";break;case 17:t="ne-resize";break;case 18:t="se-resize";break;case 19:t="sw-resize";break;case 100:break;case 101:t="none";break;default:throw"glutSetCursor: Unknown cursor type: "+e}Module.canvas.style.cursor=t};_glutSetCursor.sig="vi";function _glutCreateWindow(e){e>>>=0;var t={antialias:(GLUT.initDisplayMode&128)!=0,depth:(GLUT.initDisplayMode&16)!=0,stencil:(GLUT.initDisplayMode&32)!=0,alpha:(GLUT.initDisplayMode&8)!=0};return Module.ctx=Browser.createContext(Module.canvas,!0,!0,t),Module.ctx?1:0}_glutCreateWindow.sig="ip";var _glutDestroyWindow=e=>(delete Module.ctx,1);_glutDestroyWindow.sig="vi";var _glutReshapeWindow=(e,t)=>{Browser.exitFullscreen(),Browser.setCanvasSize(e,t,!0),GLUT.reshapeFunc&&getWasmTableEntry(GLUT.reshapeFunc)(e,t),_glutPostRedisplay()};_glutReshapeWindow.sig="vii";var _glutPositionWindow=(e,t)=>{Browser.exitFullscreen(),_glutPostRedisplay()};_glutPositionWindow.sig="vii";var _glutFullScreen=()=>{GLUT.windowX=0,GLUT.windowY=0,GLUT.windowWidth=Module.canvas.width,GLUT.windowHeight=Module.canvas.height,document.addEventListener("fullscreenchange",GLUT.onFullscreenEventChange,!0),document.addEventListener("mozfullscreenchange",GLUT.onFullscreenEventChange,!0),document.addEventListener("webkitfullscreenchange",GLUT.onFullscreenEventChange,!0),Browser.requestFullscreen(!1,!1)};_glutFullScreen.sig="v";var _glutInitDisplayMode=e=>GLUT.initDisplayMode=e;_glutInitDisplayMode.sig="vi";var _glutSwapBuffers=()=>{};_glutSwapBuffers.sig="v";var _glutMainLoop=()=>{throw _glutReshapeWindow(Module.canvas.width,Module.canvas.height),_glutPostRedisplay(),"unwind"};_glutMainLoop.sig="v";function _XOpenDisplay(e){return e>>>=0,1}_XOpenDisplay.sig="pp";function _XCreateWindow(e,t,r,n,a,l,c,u,_,d,f,p){return e>>>=0,t>>>=0,d>>>=0,f>>>=0,p>>>=0,Browser.setCanvasSize(a,l),2}_XCreateWindow.sig="pppiiiiiiippp";function _XChangeWindowAttributes(e,t,r,n){e>>>=0,t>>>=0,r>>>=0,n>>>=0}_XChangeWindowAttributes.sig="ipppp";function _XSetWMHints(e,t,r){e>>>=0,t>>>=0,r>>>=0}_XSetWMHints.sig="ippp";function _XMapWindow(e,t){e>>>=0,t>>>=0}_XMapWindow.sig="ipp";function _XStoreName(e,t,r){e>>>=0,t>>>=0,r>>>=0}_XStoreName.sig="ippp";function _XInternAtom(e,t,r){return e>>>=0,t>>>=0,0}_XInternAtom.sig="pppi";function _XSendEvent(e,t,r,n,a){e>>>=0,t>>>=0,n>>>=0,a>>>=0}_XSendEvent.sig="ippipp";function _XPending(e){return e>>>=0,0}_XPending.sig="ip";var EGL={errorCode:12288,defaultDisplayInitialized:!1,currentContext:0,currentReadSurface:0,currentDrawSurface:0,contextAttributes:{alpha:!1,depth:!1,stencil:!1,antialias:!1},stringCache:{},setErrorCode(e){EGL.errorCode=e},chooseConfig(e,t,r,n,a){if(e!=62e3)return EGL.setErrorCode(12296),0;if(t)for(;;){var l=HEAP32[t>>>2>>>0];if(l==12321){var c=HEAP32[t+4>>>2>>>0];EGL.contextAttributes.alpha=c>0}else if(l==12325){var u=HEAP32[t+4>>>2>>>0];EGL.contextAttributes.depth=u>0}else if(l==12326){var _=HEAP32[t+4>>>2>>>0];EGL.contextAttributes.stencil=_>0}else if(l==12337){var d=HEAP32[t+4>>>2>>>0];EGL.contextAttributes.antialias=d>0}else if(l==12338){var d=HEAP32[t+4>>>2>>>0];EGL.contextAttributes.antialias=d==1}else if(l==12544){var f=HEAP32[t+4>>>2>>>0];EGL.contextAttributes.lowLatency=f!=12547}else if(l==12344)break;t+=8}return(!r||!n)&&!a?(EGL.setErrorCode(12300),0):(a&&(HEAP32[a>>>2>>>0]=1),r&&n>0&&(HEAPU32[r>>>2>>>0]=62002),EGL.setErrorCode(12288),1)}};function _eglGetDisplay(e){return e>>>=0,EGL.setErrorCode(12288),e!=0&&e!=1?0:62e3}_eglGetDisplay.sig="pp";function _eglInitialize(e,t,r){return e>>>=0,t>>>=0,r>>>=0,e!=62e3?(EGL.setErrorCode(12296),0):(t&&(HEAP32[t>>>2>>>0]=1),r&&(HEAP32[r>>>2>>>0]=4),EGL.defaultDisplayInitialized=!0,EGL.setErrorCode(12288),1)}_eglInitialize.sig="ippp";function _eglTerminate(e){return e>>>=0,e!=62e3?(EGL.setErrorCode(12296),0):(EGL.currentContext=0,EGL.currentReadSurface=0,EGL.currentDrawSurface=0,EGL.defaultDisplayInitialized=!1,EGL.setErrorCode(12288),1)}_eglTerminate.sig="ip";function _eglGetConfigs(e,t,r,n){return e>>>=0,t>>>=0,n>>>=0,EGL.chooseConfig(e,0,t,r,n)}_eglGetConfigs.sig="ippip";function _eglChooseConfig(e,t,r,n,a){return e>>>=0,t>>>=0,r>>>=0,a>>>=0,EGL.chooseConfig(e,t,r,n,a)}_eglChooseConfig.sig="ipppip";function _eglGetConfigAttrib(e,t,r,n){if(e>>>=0,t>>>=0,n>>>=0,e!=62e3)return EGL.setErrorCode(12296),0;if(t!=62002)return EGL.setErrorCode(12293),0;if(!n)return EGL.setErrorCode(12300),0;switch(EGL.setErrorCode(12288),r){case 12320:return HEAP32[n>>>2>>>0]=EGL.contextAttributes.alpha?32:24,1;case 12321:return HEAP32[n>>>2>>>0]=EGL.contextAttributes.alpha?8:0,1;case 12322:return HEAP32[n>>>2>>>0]=8,1;case 12323:return HEAP32[n>>>2>>>0]=8,1;case 12324:return HEAP32[n>>>2>>>0]=8,1;case 12325:return HEAP32[n>>>2>>>0]=EGL.contextAttributes.depth?24:0,1;case 12326:return HEAP32[n>>>2>>>0]=EGL.contextAttributes.stencil?8:0,1;case 12327:return HEAP32[n>>>2>>>0]=12344,1;case 12328:return HEAP32[n>>>2>>>0]=62002,1;case 12329:return HEAP32[n>>>2>>>0]=0,1;case 12330:return HEAP32[n>>>2>>>0]=4096,1;case 12331:return HEAP32[n>>>2>>>0]=16777216,1;case 12332:return HEAP32[n>>>2>>>0]=4096,1;case 12333:return HEAP32[n>>>2>>>0]=0,1;case 12334:return HEAP32[n>>>2>>>0]=0,1;case 12335:return HEAP32[n>>>2>>>0]=12344,1;case 12337:return HEAP32[n>>>2>>>0]=EGL.contextAttributes.antialias?4:0,1;case 12338:return HEAP32[n>>>2>>>0]=EGL.contextAttributes.antialias?1:0,1;case 12339:return HEAP32[n>>>2>>>0]=4,1;case 12340:return HEAP32[n>>>2>>>0]=12344,1;case 12341:case 12342:case 12343:return HEAP32[n>>>2>>>0]=-1,1;case 12345:case 12346:return HEAP32[n>>>2>>>0]=0,1;case 12347:return HEAP32[n>>>2>>>0]=0,1;case 12348:return HEAP32[n>>>2>>>0]=1,1;case 12349:case 12350:return HEAP32[n>>>2>>>0]=0,1;case 12351:return HEAP32[n>>>2>>>0]=12430,1;case 12352:return HEAP32[n>>>2>>>0]=4,1;case 12354:return HEAP32[n>>>2>>>0]=0,1;default:return EGL.setErrorCode(12292),0}}_eglGetConfigAttrib.sig="ippip";function _eglCreateWindowSurface(e,t,r,n){return e>>>=0,t>>>=0,n>>>=0,e!=62e3?(EGL.setErrorCode(12296),0):t!=62002?(EGL.setErrorCode(12293),0):(EGL.setErrorCode(12288),62006)}_eglCreateWindowSurface.sig="pppip";function _eglDestroySurface(e,t){return e>>>=0,t>>>=0,e!=62e3?(EGL.setErrorCode(12296),0):t!=62006?(EGL.setErrorCode(12301),1):(EGL.currentReadSurface==t&&(EGL.currentReadSurface=0),EGL.currentDrawSurface==t&&(EGL.currentDrawSurface=0),EGL.setErrorCode(12288),1)}_eglDestroySurface.sig="ipp";function _eglCreateContext(e,t,r,n){if(e>>>=0,t>>>=0,r>>>=0,n>>>=0,e!=62e3)return EGL.setErrorCode(12296),0;for(var a=1;;){var l=HEAP32[n>>>2>>>0];if(l==12440)a=HEAP32[n+4>>>2>>>0];else{if(l==12344)break;return EGL.setErrorCode(12292),0}n+=8}return a!=2?(EGL.setErrorCode(12293),0):(EGL.contextAttributes.majorVersion=a-1,EGL.contextAttributes.minorVersion=0,EGL.context=GL.createContext(Module.canvas,EGL.contextAttributes),EGL.context!=0?(EGL.setErrorCode(12288),GL.makeContextCurrent(EGL.context),Browser.useWebGL=!0,Browser.moduleContextCreatedCallbacks.forEach(c=>c()),GL.makeContextCurrent(null),62004):(EGL.setErrorCode(12297),0))}_eglCreateContext.sig="ppppp";function _eglDestroyContext(e,t){return e>>>=0,t>>>=0,e!=62e3?(EGL.setErrorCode(12296),0):t!=62004?(EGL.setErrorCode(12294),0):(GL.deleteContext(EGL.context),EGL.setErrorCode(12288),EGL.currentContext==t&&(EGL.currentContext=0),1)}_eglDestroyContext.sig="ipp";function _eglQuerySurface(e,t,r,n){if(e>>>=0,t>>>=0,n>>>=0,e!=62e3)return EGL.setErrorCode(12296),0;if(t!=62006)return EGL.setErrorCode(12301),0;if(!n)return EGL.setErrorCode(12300),0;switch(EGL.setErrorCode(12288),r){case 12328:return HEAP32[n>>>2>>>0]=62002,1;case 12376:return 1;case 12375:return HEAP32[n>>>2>>>0]=Module.canvas.width,1;case 12374:return HEAP32[n>>>2>>>0]=Module.canvas.height,1;case 12432:return HEAP32[n>>>2>>>0]=-1,1;case 12433:return HEAP32[n>>>2>>>0]=-1,1;case 12434:return HEAP32[n>>>2>>>0]=-1,1;case 12422:return HEAP32[n>>>2>>>0]=12420,1;case 12441:return HEAP32[n>>>2>>>0]=12442,1;case 12435:return HEAP32[n>>>2>>>0]=12437,1;case 12416:case 12417:case 12418:case 12419:return 1;default:return EGL.setErrorCode(12292),0}}_eglQuerySurface.sig="ippip";function _eglQueryContext(e,t,r,n){if(e>>>=0,t>>>=0,n>>>=0,e!=62e3)return EGL.setErrorCode(12296),0;if(t!=62004)return EGL.setErrorCode(12294),0;if(!n)return EGL.setErrorCode(12300),0;switch(EGL.setErrorCode(12288),r){case 12328:return HEAP32[n>>>2>>>0]=62002,1;case 12439:return HEAP32[n>>>2>>>0]=12448,1;case 12440:return HEAP32[n>>>2>>>0]=EGL.contextAttributes.majorVersion+1,1;case 12422:return HEAP32[n>>>2>>>0]=12420,1;default:return EGL.setErrorCode(12292),0}}_eglQueryContext.sig="ippip";var _eglGetError=()=>EGL.errorCode;_eglGetError.sig="i";function _eglQueryString(e,t){if(e>>>=0,e!=62e3)return EGL.setErrorCode(12296),0;if(EGL.setErrorCode(12288),EGL.stringCache[t])return EGL.stringCache[t];var r;switch(t){case 12371:r=stringToNewUTF8("Emscripten");break;case 12372:r=stringToNewUTF8("1.4 Emscripten EGL");break;case 12373:r=stringToNewUTF8("");break;case 12429:r=stringToNewUTF8("OpenGL_ES");break;default:return EGL.setErrorCode(12300),0}return EGL.stringCache[t]=r,r}_eglQueryString.sig="ppi";var _eglBindAPI=e=>e==12448?(EGL.setErrorCode(12288),1):(EGL.setErrorCode(12300),0);_eglBindAPI.sig="ii";var _eglQueryAPI=()=>(EGL.setErrorCode(12288),12448);_eglQueryAPI.sig="i";var _eglWaitClient=()=>(EGL.setErrorCode(12288),1);_eglWaitClient.sig="i";var _eglWaitNative=e=>(EGL.setErrorCode(12288),1);_eglWaitNative.sig="ii";var _eglWaitGL=_eglWaitClient;_eglWaitGL.sig="i";function _eglSwapInterval(e,t){return e>>>=0,e!=62e3?(EGL.setErrorCode(12296),0):(t==0?_emscripten_set_main_loop_timing(0,0):_emscripten_set_main_loop_timing(1,t),EGL.setErrorCode(12288),1)}_eglSwapInterval.sig="ipi";function _eglMakeCurrent(e,t,r,n){return e>>>=0,t>>>=0,r>>>=0,n>>>=0,e!=62e3?(EGL.setErrorCode(12296),0):n!=0&&n!=62004?(EGL.setErrorCode(12294),0):r!=0&&r!=62006||t!=0&&t!=62006?(EGL.setErrorCode(12301),0):(GL.makeContextCurrent(n?EGL.context:null),EGL.currentContext=n,EGL.currentDrawSurface=t,EGL.currentReadSurface=r,EGL.setErrorCode(12288),1)}_eglMakeCurrent.sig="ipppp";function _eglGetCurrentContext(){return EGL.currentContext}_eglGetCurrentContext.sig="p";function _eglGetCurrentSurface(e){return e==12378?EGL.currentReadSurface:e==12377?EGL.currentDrawSurface:(EGL.setErrorCode(12300),0)}_eglGetCurrentSurface.sig="pi";function _eglGetCurrentDisplay(){return EGL.currentContext?62e3:0}_eglGetCurrentDisplay.sig="p";function _eglSwapBuffers(e,t){if(e>>>=0,t>>>=0,!EGL.defaultDisplayInitialized)EGL.setErrorCode(12289);else if(!Module.ctx)EGL.setErrorCode(12290);else if(Module.ctx.isContextLost())EGL.setErrorCode(12302);else return EGL.setErrorCode(12288),1;return 0}_eglSwapBuffers.sig="ipp";var _eglReleaseThread=()=>(EGL.currentContext=0,EGL.currentReadSurface=0,EGL.currentDrawSurface=0,EGL.setErrorCode(12288),1);_eglReleaseThread.sig="i";function _uuid_clear(e){return e>>>=0,zeroMemory(e,16)}_uuid_clear.sig="vp";function _uuid_compare(e,t){return e>>>=0,t>>>=0,_memcmp(e,t,16)}_uuid_compare.sig="ipp";function _uuid_copy(e,t){return e>>>=0,t>>>=0,_memcpy(e,t,16)}_uuid_copy.sig="vpp";function _uuid_generate(e){e>>>=0;var t=null;if(ENVIRONMENT_IS_NODE)try{var r=xn("crypto").randomBytes;t=r(16)}catch(c){}else ENVIRONMENT_IS_WEB&&typeof window.crypto<"u"&&typeof window.crypto.getRandomValues<"u"&&(t=new Uint8Array(16),window.crypto.getRandomValues(t));if(!t){t=new Array(16);for(var n=new Date().getTime(),a=0;a<16;a++){var l=(n+Math.random()*256)%256|0;n=n/256|0,t[a]=l}}t[6]=t[6]&15|64,t[8]=t[8]&63|128,writeArrayToMemory(t,e)}_uuid_generate.sig="vp";function _uuid_is_null(e){e>>>=0;for(var t=0;t<4;t++,e=e+4|0){var r=HEAP32[e>>>2>>>0];if(r)return 0}return 1}_uuid_is_null.sig="ip";function _uuid_parse(e,t){if(e>>>=0,t>>>=0,e=UTF8ToString(e),e.length===36){var r=0,n=new Array(16);return e.toLowerCase().replace(/[0-9a-f]{2}/g,function(a){r<16&&(n[r++]=parseInt(a,16))}),r<16?-1:(writeArrayToMemory(n,t),0)}return-1}_uuid_parse.sig="ipp";function _uuid_unparse(e,t,r){e>>>=0,t>>>=0;var n=0,a="xxxx-xx-xx-xx-xxxxxx".replace(/[x]/g,function(l){var c=r?HEAPU8[e+n>>>0].toString(16).toUpperCase():HEAPU8[e+n>>>0].toString(16);return c=c.length===1?"0"+c:c,n++,c});stringToUTF8(a,t,37)}_uuid_unparse.sig="vpp";function _uuid_unparse_lower(e,t){e>>>=0,t>>>=0,_uuid_unparse(e,t)}_uuid_unparse_lower.sig="vpp";function _uuid_unparse_upper(e,t){e>>>=0,t>>>=0,_uuid_unparse(e,t,!0)}_uuid_unparse_upper.sig="vpp";function _uuid_type(e){return e>>>=0,4}_uuid_type.sig="ip";function _uuid_variant(e){return e>>>=0,1}_uuid_variant.sig="ip";var GLEW={isLinaroFork:1,extensions:null,error:{0:null,1:null,2:null,3:null,4:null,5:null,6:null,7:null,8:null},version:{1:null,2:null,3:null,4:null},errorStringConstantFromCode(e){if(GLEW.isLinaroFork)switch(e){case 4:return"OpenGL ES lib expected, found OpenGL lib";case 5:return"OpenGL lib expected, found OpenGL ES lib";case 6:return"Missing EGL version";case 7:return"EGL 1.1 and up are supported";default:break}switch(e){case 0:return"No error";case 1:return"Missing GL version";case 2:return"GL 1.1 and up are supported";case 3:return"GLX 1.2 and up are supported";default:return null}},errorString(e){if(!GLEW.error[e]){var t=GLEW.errorStringConstantFromCode(e);t||(t="Unknown error",e=8),GLEW.error[e]=stringToNewUTF8(t)}return GLEW.error[e]},versionStringConstantFromCode(e){switch(e){case 1:return"1.10.0";case 2:return"1";case 3:return"10";case 4:return"0";default:return null}},versionString(e){if(!GLEW.version[e]){var t=GLEW.versionStringConstantFromCode(e);if(!t)return 0;GLEW.version[e]=stringToNewUTF8(t)}return GLEW.version[e]},extensionIsSupported(e){return GLEW.extensions||(GLEW.extensions=webglGetExtensions()),GLEW.extensions.includes(e)?1:GLEW.extensions.includes("GL_"+e)}},_glewInit=()=>0;_glewInit.sig="i";function _glewIsSupported(e){e>>>=0;for(var t=UTF8ToString(e).split(" "),r=0;r>>=0,GLEW.extensionIsSupported(UTF8ToString(e))}_glewGetExtension.sig="ip";function _glewGetErrorString(e){return GLEW.errorString(e)}_glewGetErrorString.sig="pi";function _glewGetString(e){return GLEW.versionString(e)}_glewGetString.sig="pi";var IDBStore={indexedDB(){if(typeof indexedDB<"u")return indexedDB;var e=null;return typeof window=="object"&&(e=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB),assert(e,"IDBStore used, but indexedDB not supported"),e},DB_VERSION:22,DB_STORE_NAME:"FILE_DATA",dbs:{},blobs:[0],getDB(e,t){var r=IDBStore.dbs[e];if(r)return t(null,r);var n;try{n=IDBStore.indexedDB().open(e,IDBStore.DB_VERSION)}catch(a){return t(a)}n.onupgradeneeded=a=>{var l=a.target.result,c=a.target.transaction,u;l.objectStoreNames.contains(IDBStore.DB_STORE_NAME)?u=c.objectStore(IDBStore.DB_STORE_NAME):u=l.createObjectStore(IDBStore.DB_STORE_NAME)},n.onsuccess=()=>{r=n.result,IDBStore.dbs[e]=r,t(null,r)},n.onerror=function(a){t(a.target.error||"unknown error"),a.preventDefault()}},getStore(e,t,r){IDBStore.getDB(e,(n,a)=>{if(n)return r(n);var l=a.transaction([IDBStore.DB_STORE_NAME],t);l.onerror=u=>{r(u.target.error||"unknown error"),u.preventDefault()};var c=l.objectStore(IDBStore.DB_STORE_NAME);r(null,c)})},getFile(e,t,r){IDBStore.getStore(e,"readonly",(n,a)=>{if(n)return r(n);var l=a.get(t);l.onsuccess=c=>{var u=c.target.result;return u?r(null,u):r("file ".concat(t," not found"))},l.onerror=r})},setFile(e,t,r,n){IDBStore.getStore(e,"readwrite",(a,l)=>{if(a)return n(a);var c=l.put(r,t);c.onsuccess=u=>n(),c.onerror=n})},deleteFile(e,t,r){IDBStore.getStore(e,"readwrite",(n,a)=>{if(n)return r(n);var l=a.delete(t);l.onsuccess=c=>r(),l.onerror=r})},existsFile(e,t,r){IDBStore.getStore(e,"readonly",(n,a)=>{if(n)return r(n);var l=a.count(t);l.onsuccess=c=>r(null,c.target.result>0),l.onerror=r})},clearStore(e,t){IDBStore.getStore(e,"readwrite",(r,n)=>{if(r)return t(r);var a=n.clear();a.onsuccess=l=>t(),a.onerror=t})}},_emscripten_idb_async_load=function(e,t,r,n,a){e>>>=0,t>>>=0,r>>>=0,n>>>=0,a>>>=0,IDBStore.getFile(UTF8ToString(e),UTF8ToString(t),(l,c)=>{callUserCallback(()=>{if(l){a&&getWasmTableEntry(a)(r);return}var u=_malloc(c.length);HEAPU8.set(c,u>>>0),getWasmTableEntry(n)(r,u,c.length),_free(u)})})};_emscripten_idb_async_load.sig="vppppp";var _emscripten_idb_async_store=function(e,t,r,n,a,l,c){e>>>=0,t>>>=0,r>>>=0,a>>>=0,l>>>=0,c>>>=0,IDBStore.setFile(UTF8ToString(e),UTF8ToString(t),new Uint8Array(HEAPU8.subarray(r>>>0,r+n>>>0)),u=>{callUserCallback(()=>{if(u){c&&getWasmTableEntry(c)(a);return}l&&getWasmTableEntry(l)(a)})})};_emscripten_idb_async_store.sig="vpppippp";var _emscripten_idb_async_delete=function(e,t,r,n,a){e>>>=0,t>>>=0,r>>>=0,n>>>=0,a>>>=0,IDBStore.deleteFile(UTF8ToString(e),UTF8ToString(t),l=>{callUserCallback(()=>{if(l){a&&getWasmTableEntry(a)(r);return}n&&getWasmTableEntry(n)(r)})})};_emscripten_idb_async_delete.sig="vppppp";var _emscripten_idb_async_exists=function(e,t,r,n,a){e>>>=0,t>>>=0,r>>>=0,n>>>=0,a>>>=0,IDBStore.existsFile(UTF8ToString(e),UTF8ToString(t),(l,c)=>{callUserCallback(()=>{if(l){a&&getWasmTableEntry(a)(r);return}n&&getWasmTableEntry(n)(r,c)})})};_emscripten_idb_async_exists.sig="vppppp";var _emscripten_idb_async_clear=function(e,t,r,n){e>>>=0,t>>>=0,r>>>=0,n>>>=0,IDBStore.clearStore(UTF8ToString(e),a=>{callUserCallback(()=>{if(a){n&&getWasmTableEntry(n)(t);return}r&&getWasmTableEntry(r)(t)})})};_emscripten_idb_async_clear.sig="vpppp";function _emscripten_idb_load(e,t,r,n,a){throw e>>>=0,t>>>=0,r>>>=0,n>>>=0,a>>>=0,"Please compile your program with async support in order to use synchronous operations like emscripten_idb_load, etc."}_emscripten_idb_load.sig="vppppp";function _emscripten_idb_store(e,t,r,n,a){throw e>>>=0,t>>>=0,r>>>=0,a>>>=0,"Please compile your program with async support in order to use synchronous operations like emscripten_idb_store, etc."}_emscripten_idb_store.sig="vpppip";function _emscripten_idb_delete(e,t,r){throw e>>>=0,t>>>=0,r>>>=0,"Please compile your program with async support in order to use synchronous operations like emscripten_idb_delete, etc."}_emscripten_idb_delete.sig="vppp";function _emscripten_idb_exists(e,t,r,n){throw e>>>=0,t>>>=0,r>>>=0,n>>>=0,"Please compile your program with async support in order to use synchronous operations like emscripten_idb_exists, etc."}_emscripten_idb_exists.sig="vpppp";function _emscripten_idb_clear(e,t){throw e>>>=0,t>>>=0,"Please compile your program with async support in order to use synchronous operations like emscripten_idb_clear, etc."}_emscripten_idb_clear.sig="vpp";var runAndAbortIfError=e=>{try{return e()}catch(t){abort(t)}},_emscripten_sleep=()=>{throw"Please compile your program with async support in order to use asynchronous operations like emscripten_sleep"};_emscripten_sleep.sig="vi";function _emscripten_wget(e,t){throw e>>>=0,t>>>=0,"Please compile your program with async support in order to use asynchronous operations like emscripten_wget"}Module._emscripten_wget=_emscripten_wget,_emscripten_wget.sig="ipp";function _emscripten_scan_registers(e){throw e>>>=0,"Please compile your program with async support in order to use asynchronous operations like emscripten_scan_registers"}_emscripten_scan_registers.sig="vp";function _emscripten_fiber_swap(e,t){throw e>>>=0,t>>>=0,"Please compile your program with async support in order to use asynchronous operations like emscripten_fiber_swap"}_emscripten_fiber_swap.sig="vpp";var _SDL_GetTicks=()=>Date.now()-SDL.startTime|0;_SDL_GetTicks.sig="i";function _SDL_LockSurface(e){e>>>=0;var t=SDL.surfaces[e];if(t.locked++,t.locked>1||(t.buffer||(t.buffer=_malloc(t.width*t.height*4),HEAPU32[e+20>>>2>>>0]=t.buffer),HEAPU32[e+20>>>2>>>0]=t.buffer,e==SDL.screen&&Module.screenIsReadOnly&&t.image))return 0;if(SDL.defaults.discardOnLock){if(t.image||(t.image=t.ctx.createImageData(t.width,t.height)),!SDL.defaults.opaqueFrontBuffer)return}else t.image=t.ctx.getImageData(0,0,t.width,t.height);if(e==SDL.screen&&SDL.defaults.opaqueFrontBuffer)for(var r=t.image.data,n=r.length,a=0;a>>0)}return 0}_SDL_LockSurface.sig="ip";var SDL={defaults:{width:320,height:200,copyOnLock:!0,discardOnLock:!1,opaqueFrontBuffer:!0},version:null,surfaces:{},canvasPool:[],events:[],fonts:[null],audios:[null],rwops:[null],music:{audio:null,volume:1},mixerFrequency:22050,mixerFormat:32784,mixerNumChannels:2,mixerChunkSize:1024,channelMinimumNumber:0,GL:!1,glAttributes:{0:3,1:3,2:2,3:0,4:0,5:1,6:16,7:0,8:0,9:0,10:0,11:0,12:0,13:0,14:0,15:1,16:0,17:0,18:0},keyboardState:null,keyboardMap:{},canRequestFullscreen:!1,isRequestingFullscreen:!1,textInput:!1,unicode:!1,ttfContext:null,audio:null,startTime:null,initFlags:0,buttonState:0,modState:0,DOMButtons:[0,0,0],DOMEventToSDLEvent:{},TOUCH_DEFAULT_ID:0,eventHandler:null,eventHandlerContext:null,eventHandlerTemp:0,keyCodes:{16:1249,17:1248,18:1250,20:1081,33:1099,34:1102,35:1101,36:1098,37:1104,38:1106,39:1103,40:1105,44:316,45:1097,46:127,91:1251,93:1125,96:1122,97:1113,98:1114,99:1115,100:1116,101:1117,102:1118,103:1119,104:1120,105:1121,106:1109,107:1111,109:1110,110:1123,111:1108,112:1082,113:1083,114:1084,115:1085,116:1086,117:1087,118:1088,119:1089,120:1090,121:1091,122:1092,123:1093,124:1128,125:1129,126:1130,127:1131,128:1132,129:1133,130:1134,131:1135,132:1136,133:1137,134:1138,135:1139,144:1107,160:94,161:33,162:34,163:35,164:36,165:37,166:38,167:95,168:40,169:41,170:42,171:43,172:124,173:45,174:123,175:125,176:126,181:127,182:129,183:128,188:44,190:46,191:47,192:96,219:91,220:92,221:93,222:39,224:1251},scanCodes:{8:42,9:43,13:40,27:41,32:44,35:204,39:53,44:54,46:55,47:56,48:39,49:30,50:31,51:32,52:33,53:34,54:35,55:36,56:37,57:38,58:203,59:51,61:46,91:47,92:49,93:48,96:52,97:4,98:5,99:6,100:7,101:8,102:9,103:10,104:11,105:12,106:13,107:14,108:15,109:16,110:17,111:18,112:19,113:20,114:21,115:22,116:23,117:24,118:25,119:26,120:27,121:28,122:29,127:76,305:224,308:226,316:70},loadRect(e){return{x:HEAP32[e>>>2>>>0],y:HEAP32[e+4>>>2>>>0],w:HEAP32[e+8>>>2>>>0],h:HEAP32[e+12>>>2>>>0]}},updateRect(e,t){HEAP32[e>>>2>>>0]=t.x,HEAP32[e+4>>>2>>>0]=t.y,HEAP32[e+8>>>2>>>0]=t.w,HEAP32[e+12>>>2>>>0]=t.h},intersectionOfRects(e,t){var r=Math.max(e.x,t.x),n=Math.max(e.y,t.y),a=Math.min(e.x+e.w,t.x+t.w),l=Math.min(e.y+e.h,t.y+t.h);return{x:r,y:n,w:Math.max(r,a)-r,h:Math.max(n,l)-n}},checkPixelFormat(e){},loadColorToCSSRGB(e){var t=HEAP32[e>>>2>>>0];return"rgb("+(t&255)+","+(t>>8&255)+","+(t>>16&255)+")"},loadColorToCSSRGBA(e){var t=HEAP32[e>>>2>>>0];return"rgba("+(t&255)+","+(t>>8&255)+","+(t>>16&255)+","+(t>>24&255)/255+")"},translateColorToCSSRGBA:e=>"rgba("+(e&255)+","+(e>>8&255)+","+(e>>16&255)+","+(e>>>24)/255+")",translateRGBAToCSSRGBA:(e,t,r,n)=>"rgba("+(e&255)+","+(t&255)+","+(r&255)+","+(n&255)/255+")",translateRGBAToColor:(e,t,r,n)=>e|t<<8|r<<16|n<<24,makeSurface(e,t,r,n,a,l,c,u,_){var d=r&1,f=r&2097152,p=r&67108864,m=_malloc(60),g=_malloc(44),h=f?1:4,b=0;!d&&!p&&(b=_malloc(e*t*4)),HEAP32[m>>>2>>>0]=r,HEAPU32[m+4>>>2>>>0]=g,HEAP32[m+8>>>2>>>0]=e,HEAP32[m+12>>>2>>>0]=t,HEAP32[m+16>>>2>>>0]=e*h,HEAPU32[m+20>>>2>>>0]=b,HEAP32[m+36>>>2>>>0]=0,HEAP32[m+40>>>2>>>0]=0,HEAP32[m+44>>>2>>>0]=Module.canvas.width,HEAP32[m+48>>>2>>>0]=Module.canvas.height,HEAP32[m+56>>>2>>>0]=1,HEAP32[g>>>2>>>0]=-2042224636,HEAP32[g+4>>>2>>>0]=0,HEAP8[g+8>>>0]=h*8,HEAP8[g+9>>>0]=h,HEAP32[g+12>>>2>>>0]=l||255,HEAP32[g+16>>>2>>>0]=c||65280,HEAP32[g+20>>>2>>>0]=u||16711680,HEAP32[g+24>>>2>>>0]=_||4278190080,SDL.GL=SDL.GL||p;var y;n?y=Module.canvas:(SDL.canvasPool.length>0?y=SDL.canvasPool.pop():y=document.createElement("canvas"),y.width=e,y.height=t);var L={antialias:SDL.glAttributes[13]!=0&&SDL.glAttributes[14]>1,depth:SDL.glAttributes[6]>0,stencil:SDL.glAttributes[7]>0,alpha:SDL.glAttributes[3]>0},F=Browser.createContext(y,p,n,L);return SDL.surfaces[m]={width:e,height:t,canvas:y,ctx:F,surf:m,buffer:b,pixelFormat:g,alpha:255,flags:r,locked:0,usePageCanvas:n,source:a,isFlagSet:I=>r&I},m},copyIndexedColorData(e,t,r,n,a){if(e.colors){var l=Module.canvas.width,c=Module.canvas.height,u=t||0,_=r||0,d=(n||l-u)+u,f=(a||c-_)+_,p=e.buffer;e.image.data32||(e.image.data32=new Uint32Array(e.image.data.buffer));for(var m=e.image.data32,g=e.colors32,h=_;h>>0]]}},freeSurface(e){var t=e+56,r=HEAP32[t>>>2>>>0];if(r>1){HEAP32[t>>>2>>>0]=r-1;return}var n=SDL.surfaces[e];!n.usePageCanvas&&n.canvas&&SDL.canvasPool.push(n.canvas),n.buffer&&_free(n.buffer),_free(n.pixelFormat),_free(e),SDL.surfaces[e]=null,e===SDL.screen&&(SDL.screen=null)},blitSurface(e,t,r,n,a){var l=SDL.surfaces[e],c=SDL.surfaces[r],u,_;if(t?u=SDL.loadRect(t):u={x:0,y:0,w:l.width,h:l.height},n?_=SDL.loadRect(n):_={x:0,y:0,w:l.width,h:l.height},c.clipRect){var d=!a||u.w===0?1:u.w/_.w,f=!a||u.h===0?1:u.h/_.h;_=SDL.intersectionOfRects(c.clipRect,_),u.w=_.w*d,u.h=_.h*f,n&&SDL.updateRect(n,_)}var p,m;if(a?(p=_.w,m=_.h):(p=u.w,m=u.h),u.w===0||u.h===0||p===0||m===0)return 0;var g=c.ctx.globalAlpha;return c.ctx.globalAlpha=l.alpha/255,c.ctx.drawImage(l.canvas,u.x,u.y,u.w,u.h,_.x,_.y,p,m),c.ctx.globalAlpha=g,r!=SDL.screen&&(warnOnce("WARNING: copying canvas data to memory for compatibility"),_SDL_LockSurface(r),c.locked--),0},downFingers:{},savedKeydown:null,receiveEvent(e){function t(){for(var f in SDL.keyboardMap)SDL.events.push({type:"keyup",keyCode:SDL.keyboardMap[f]})}switch(e.type){case"touchstart":case"touchmove":{e.preventDefault();var r=[];if(e.type==="touchstart")for(var n=0;n0?Math.max(_,1):Math.min(_,-1);var d=_>0?3:4;SDL.events.push({type:"mousedown",button:d,pageX:e.pageX,pageY:e.pageY}),SDL.events.push({type:"mouseup",button:d,pageX:e.pageX,pageY:e.pageY}),SDL.events.push({type:"wheel",deltaX:0,deltaY:_}),e.preventDefault();break;case"mousemove":if(SDL.DOMButtons[0]===1&&SDL.events.push({type:"touchmove",touch:{identifier:0,deviceID:-1,pageX:e.pageX,pageY:e.pageY}}),Browser.pointerLock&&("mozMovementX"in e&&(e.movementX=e.mozMovementX,e.movementY=e.mozMovementY),e.movementX==0&&e.movementY==0)){e.preventDefault();return}case"keydown":case"keyup":case"keypress":case"mousedown":case"mouseup":if((e.type!=="keydown"||!SDL.unicode&&!SDL.textInput||e.keyCode===8||e.keyCode===9)&&e.preventDefault(),e.type=="mousedown")SDL.DOMButtons[e.button]=1,SDL.events.push({type:"touchstart",touch:{identifier:0,deviceID:-1,pageX:e.pageX,pageY:e.pageY}});else if(e.type=="mouseup"){if(!SDL.DOMButtons[e.button])return;SDL.events.push({type:"touchend",touch:{identifier:0,deviceID:-1,pageX:e.pageX,pageY:e.pageY}}),SDL.DOMButtons[e.button]=0}e.type==="keydown"||e.type==="mousedown"?SDL.canRequestFullscreen=!0:(e.type==="keyup"||e.type==="mouseup")&&(SDL.isRequestingFullscreen&&(Module.requestFullscreen(!0,!0),SDL.isRequestingFullscreen=!1),SDL.canRequestFullscreen=!1),e.type==="keypress"&&SDL.savedKeydown?(SDL.savedKeydown.keypressCharCode=e.charCode,SDL.savedKeydown=null):e.type==="keydown"&&(SDL.savedKeydown=e),(e.type!=="keypress"||SDL.textInput)&&SDL.events.push(e);break;case"mouseout":for(var n=0;n<3;n++)SDL.DOMButtons[n]&&(SDL.events.push({type:"mouseup",button:n,pageX:e.pageX,pageY:e.pageY}),SDL.DOMButtons[n]=0);e.preventDefault();break;case"focus":SDL.events.push(e),e.preventDefault();break;case"blur":SDL.events.push(e),t(),e.preventDefault();break;case"visibilitychange":SDL.events.push({type:"visibilitychange",visible:!document.hidden}),t(),e.preventDefault();break;case"unload":MainLoop.runner&&(SDL.events.push(e),MainLoop.runner());return;case"resize":SDL.events.push(e),e.preventDefault&&e.preventDefault();break}SDL.events.length>=1e4&&(err("SDL event queue full, dropping events"),SDL.events=SDL.events.slice(0,1e4)),SDL.flushEventsToHandler()},lookupKeyCodeForEvent(e){var t=e.keyCode;return t>=65&&t<=90?t+=32:(t=SDL.keyCodes[e.keyCode]||e.keyCode,e.location===2&&t>=1248&&t<=1251&&(t+=4)),t},handleEvent(e){if(!e.handled)switch(e.handled=!0,e.type){case"touchstart":case"touchend":case"touchmove":{Browser.calculateMouseEvent(e);break}case"keydown":case"keyup":{var t=e.type==="keydown",r=SDL.lookupKeyCodeForEvent(e);HEAP8[SDL.keyboardState+r>>>0]=t,SDL.modState=(HEAP8[SDL.keyboardState+1248>>>0]?64:0)|(HEAP8[SDL.keyboardState+1249>>>0]?1:0)|(HEAP8[SDL.keyboardState+1250>>>0]?256:0)|(HEAP8[SDL.keyboardState+1252>>>0]?128:0)|(HEAP8[SDL.keyboardState+1253>>>0]?2:0)|(HEAP8[SDL.keyboardState+1254>>>0]?512:0),t?SDL.keyboardMap[r]=e.keyCode:delete SDL.keyboardMap[r];break}case"mousedown":case"mouseup":e.type=="mousedown"?SDL.buttonState|=1<0;)if(SDL.makeCEvent(SDL.events.shift(),e)!==!1)return 1;return 0}return SDL.events.length>0},makeCEvent(e,t){if(typeof e=="number"){_memcpy(t,e,28),_free(e);return}switch(SDL.handleEvent(e),e.type){case"keydown":case"keyup":{var r=e.type==="keydown",n=SDL.lookupKeyCodeForEvent(e),a;n>=1024?a=n-1024:a=SDL.scanCodes[n]||n,HEAP32[t>>>2>>>0]=SDL.DOMEventToSDLEvent[e.type],HEAP8[t+8>>>0]=r?1:0,HEAP8[t+9>>>0]=0,HEAP32[t+12>>>2>>>0]=a,HEAP32[t+16>>>2>>>0]=n,HEAP16[t+20>>>1>>>0]=SDL.modState,HEAP32[t+24>>>2>>>0]=e.keypressCharCode||n;break}case"keypress":{HEAP32[t>>>2>>>0]=SDL.DOMEventToSDLEvent[e.type];for(var l=intArrayFromString(String.fromCharCode(e.charCode)),c=0;c>>0]=l[c];break}case"mousedown":case"mouseup":case"mousemove":{if(e.type!="mousemove"){var r=e.type==="mousedown";HEAP32[t>>>2>>>0]=SDL.DOMEventToSDLEvent[e.type],HEAP32[t+4>>>2>>>0]=0,HEAP32[t+8>>>2>>>0]=0,HEAP32[t+12>>>2>>>0]=0,HEAP8[t+16>>>0]=e.button+1,HEAP8[t+17>>>0]=r?1:0,HEAP32[t+20>>>2>>>0]=Browser.mouseX,HEAP32[t+24>>>2>>>0]=Browser.mouseY}else HEAP32[t>>>2>>>0]=SDL.DOMEventToSDLEvent[e.type],HEAP32[t+4>>>2>>>0]=0,HEAP32[t+8>>>2>>>0]=0,HEAP32[t+12>>>2>>>0]=0,HEAP32[t+16>>>2>>>0]=SDL.buttonState,HEAP32[t+20>>>2>>>0]=Browser.mouseX,HEAP32[t+24>>>2>>>0]=Browser.mouseY,HEAP32[t+28>>>2>>>0]=Browser.mouseMovementX,HEAP32[t+32>>>2>>>0]=Browser.mouseMovementY;break}case"wheel":{HEAP32[t>>>2>>>0]=SDL.DOMEventToSDLEvent[e.type],HEAP32[t+16>>>2>>>0]=e.deltaX,HEAP32[t+20>>>2>>>0]=e.deltaY;break}case"touchstart":case"touchend":case"touchmove":{var u=e.touch;if(!Browser.touches[u.identifier])break;var _=Module.canvas.width,d=Module.canvas.height,f=Browser.touches[u.identifier].x/_,p=Browser.touches[u.identifier].y/d,m=Browser.lastTouches[u.identifier].x/_,g=Browser.lastTouches[u.identifier].y/d,h=f-m,b=p-g;if(u.deviceID===void 0&&(u.deviceID=SDL.TOUCH_DEFAULT_ID),h===0&&b===0&&e.type==="touchmove")return!1;HEAP32[t>>>2>>>0]=SDL.DOMEventToSDLEvent[e.type],HEAP32[t+4>>>2>>>0]=_SDL_GetTicks(),tempI64=[u.deviceID>>>0,(tempDouble=u.deviceID,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[t+8>>>2>>>0]=tempI64[0],HEAP32[t+12>>>2>>>0]=tempI64[1],tempI64=[u.identifier>>>0,(tempDouble=u.identifier,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[t+16>>>2>>>0]=tempI64[0],HEAP32[t+20>>>2>>>0]=tempI64[1],HEAPF32[t+24>>>2>>>0]=f,HEAPF32[t+28>>>2>>>0]=p,HEAPF32[t+32>>>2>>>0]=h,HEAPF32[t+36>>>2>>>0]=b,u.force!==void 0?HEAPF32[t+40>>>2>>>0]=u.force:HEAPF32[t+40>>>2>>>0]=e.type=="touchend"?0:1;break}case"unload":{HEAP32[t>>>2>>>0]=SDL.DOMEventToSDLEvent[e.type];break}case"resize":{HEAP32[t>>>2>>>0]=SDL.DOMEventToSDLEvent[e.type],HEAP32[t+4>>>2>>>0]=e.w,HEAP32[t+8>>>2>>>0]=e.h;break}case"joystick_button_up":case"joystick_button_down":{var y=e.type==="joystick_button_up"?0:1;HEAP32[t>>>2>>>0]=SDL.DOMEventToSDLEvent[e.type],HEAP8[t+4>>>0]=e.index,HEAP8[t+5>>>0]=e.button,HEAP8[t+6>>>0]=y;break}case"joystick_axis_motion":{HEAP32[t>>>2>>>0]=SDL.DOMEventToSDLEvent[e.type],HEAP8[t+4>>>0]=e.index,HEAP8[t+5>>>0]=e.axis,HEAP32[t+8>>>2>>>0]=SDL.joystickAxisValueConversion(e.value);break}case"focus":{var L=12;HEAP32[t>>>2>>>0]=SDL.DOMEventToSDLEvent[e.type],HEAP32[t+4>>>2>>>0]=0,HEAP8[t+8>>>0]=L;break}case"blur":{var F=13;HEAP32[t>>>2>>>0]=SDL.DOMEventToSDLEvent[e.type],HEAP32[t+4>>>2>>>0]=0,HEAP8[t+8>>>0]=F;break}case"visibilitychange":{var I=1,T=2,S=e.visible?I:T;HEAP32[t>>>2>>>0]=SDL.DOMEventToSDLEvent[e.type],HEAP32[t+4>>>2>>>0]=0,HEAP8[t+8>>>0]=S;break}default:throw"Unhandled SDL event: "+e.type}},makeFontString(e,t){return t.charAt(0)!="'"&&t.charAt(0)!='"'&&(t='"'+t+'"'),e+"px "+t+", serif"},estimateTextWidth(e,t){var r=e.size,n=SDL.makeFontString(r,e.name),a=SDL.ttfContext;a.font=n;var l=a.measureText(t).width|0;return l},allocateChannels(e){if(!(SDL.numChannels&&SDL.numChannels>=e&&e!=0)){SDL.numChannels=e,SDL.channels=[];for(var t=0;t{e.paused||SDL.playWebAudio(e)});return}e.webAudioNode=SDL.audioContext.createBufferSource(),e.webAudioNode.buffer=t.decodedBuffer,e.webAudioNode.loop=e.loop,e.webAudioNode.onended=e.onended,e.webAudioPannerNode=SDL.audioContext.createPanner(),e.webAudioPannerNode.setPosition(0,0,-.5),e.webAudioPannerNode.panningModel="equalpower",e.webAudioGainNode=SDL.audioContext.createGain(),e.webAudioGainNode.gain.value=e.volume,e.webAudioNode.connect(e.webAudioPannerNode),e.webAudioPannerNode.connect(e.webAudioGainNode),e.webAudioGainNode.connect(SDL.audioContext.destination),e.webAudioNode.start(0,e.currentPosition),e.startTime=SDL.audioContext.currentTime-e.currentPosition}catch(r){err("playWebAudio failed: ".concat(r))}},pauseWebAudio(e){if(e){if(e.webAudioNode)try{e.currentPosition=(SDL.audioContext.currentTime-e.startTime)%e.resource.webAudio.decodedBuffer.duration,e.webAudioNode.onended=void 0,e.webAudioNode.stop(0),e.webAudioNode=void 0}catch(t){err("pauseWebAudio failed: ".concat(t))}e.paused=!0}},openAudioContext(){SDL.audioContext||(typeof AudioContext<"u"?SDL.audioContext=new AudioContext:typeof webkitAudioContext<"u"&&(SDL.audioContext=new webkitAudioContext))},webAudioAvailable:()=>!!SDL.audioContext,fillWebAudioBufferFromHeap(e,t,r){for(var n=SDL.audio,a=n.channels,l=0;l>>1>>>0]/32768;else if(n.format==8)for(var u=0;u>>0];c[u]=(_>=0?_-128:_+128)/128}else if(n.format==33056)for(var u=0;u>>2>>>0];else throw"Invalid SDL audio format "+n.format+"!"}},joystickEventState:1,lastJoystickState:{},joystickNamePool:{},recordJoystickState(e,t){for(var r=new Array(t.buttons.length),n=0;n0},queryJoysticks(){for(var e in SDL.lastJoystickState){var t=SDL.getGamepad(e-1),r=SDL.lastJoystickState[e];if(typeof t>"u"||t===null)return;if(typeof t.timestamp!="number"||t.timestamp!=r.timestamp||!t.timestamp){var n;for(n=0;ne&&e>=0?t[e]:null}};function _SDL_Linked_Version(){return SDL.version===null&&(SDL.version=_malloc(3),HEAP8[SDL.version>>>0]=1,HEAP8[SDL.version+1>>>0]=3,HEAP8[SDL.version+2>>>0]=0),SDL.version}_SDL_Linked_Version.sig="p";var _SDL_Init=e=>{if(SDL.startTime=Date.now(),SDL.initFlags=e,!Module.doNotCaptureKeyboard){var t=Module.keyboardListeningElement||document;t.addEventListener("keydown",SDL.receiveEvent),t.addEventListener("keyup",SDL.receiveEvent),t.addEventListener("keypress",SDL.receiveEvent),window.addEventListener("focus",SDL.receiveEvent),window.addEventListener("blur",SDL.receiveEvent),document.addEventListener("visibilitychange",SDL.receiveEvent)}return window.addEventListener("unload",SDL.receiveEvent),SDL.keyboardState=_calloc(65536,1),SDL.DOMEventToSDLEvent.keydown=768,SDL.DOMEventToSDLEvent.keyup=769,SDL.DOMEventToSDLEvent.keypress=771,SDL.DOMEventToSDLEvent.mousedown=1025,SDL.DOMEventToSDLEvent.mouseup=1026,SDL.DOMEventToSDLEvent.mousemove=1024,SDL.DOMEventToSDLEvent.wheel=1027,SDL.DOMEventToSDLEvent.touchstart=1792,SDL.DOMEventToSDLEvent.touchend=1793,SDL.DOMEventToSDLEvent.touchmove=1794,SDL.DOMEventToSDLEvent.unload=256,SDL.DOMEventToSDLEvent.resize=28673,SDL.DOMEventToSDLEvent.visibilitychange=512,SDL.DOMEventToSDLEvent.focus=512,SDL.DOMEventToSDLEvent.blur=512,SDL.DOMEventToSDLEvent.joystick_axis_motion=1536,SDL.DOMEventToSDLEvent.joystick_button_down=1539,SDL.DOMEventToSDLEvent.joystick_button_up=1540,0};_SDL_Init.sig="ii";var _SDL_WasInit=e=>(SDL.startTime===null&&_SDL_Init(0),1);_SDL_WasInit.sig="ii";function _SDL_GetVideoInfo(){var e=_calloc(20,1);return HEAP32[e+12>>>2>>>0]=Module.canvas.width,HEAP32[e+16>>>2>>>0]=Module.canvas.height,e}_SDL_GetVideoInfo.sig="p";function _SDL_ListModes(e,t){return e>>>=0,-1}_SDL_ListModes.sig="ppi";var _SDL_VideoModeOK=(e,t,r,n)=>r;_SDL_VideoModeOK.sig="iiiii";function _SDL_VideoDriverName(e,t){if(e>>>=0,SDL.startTime===null)return 0;var r=[101,109,115,99,114,105,112,116,101,110,95,115,100,108,95,100,114,105,118,101,114],n=0,a=r.length;for(t<=a&&(a=t-1);n>>0]=l,n++}return HEAP8[e+n>>>0]=0,e}_SDL_VideoDriverName.sig="ppi";var _SDL_AudioDriverName=_SDL_VideoDriverName;_SDL_AudioDriverName.sig="ppi";var _SDL_SetVideoMode=function(e,t,r,n){["touchstart","touchend","touchmove","mousedown","mouseup","mousemove","mousewheel","wheel","mouseout","DOMMouseScroll"].forEach(l=>Module.canvas.addEventListener(l,SDL.receiveEvent,!0));var a=Module.canvas;return e==0&&t==0&&(e=a.width,t=a.height),SDL.addedResizeListener||(SDL.addedResizeListener=!0,Browser.resizeListeners.push((l,c)=>{SDL.settingVideoMode||SDL.receiveEvent({type:"resize",w:l,h:c})})),SDL.settingVideoMode=!0,Browser.setCanvasSize(e,t),SDL.settingVideoMode=!1,SDL.screen&&(SDL.freeSurface(SDL.screen),assert(!SDL.screen)),SDL.GL&&(n=n|67108864),SDL.screen=SDL.makeSurface(e,t,n,!0,"screen"),SDL.screen};_SDL_SetVideoMode.sig="piiii";function _SDL_GetVideoSurface(){return SDL.screen}_SDL_GetVideoSurface.sig="p";var _SDL_AudioQuit=()=>{for(var e=0;eout("SDL_VideoQuit called (and ignored)");_SDL_VideoQuit.sig="v";var _SDL_QuitSubSystem=e=>out("SDL_QuitSubSystem called (and ignored)");_SDL_QuitSubSystem.sig="vi";var _SDL_Quit=()=>{_SDL_AudioQuit(),out("SDL_Quit called (and ignored)")};_SDL_Quit.sig="v";function _SDL_UnlockSurface(e){e>>>=0,assert(!SDL.GL);var t=SDL.surfaces[e];if(!(!t.locked||--t.locked>0)){if(t.isFlagSet(2097152))SDL.copyIndexedColorData(t);else if(t.colors)for(var g=Module.canvas.width,h=Module.canvas.height,b=t.buffer,r=t.image.data,y=t.colors,L=0;L>>0]*4,T=F+I*4;r[T]=y[_],r[T+1]=y[_+1],r[T+2]=y[_+2]}b+=g*3}else{var r=t.image.data,n=t.buffer;assert(n%4==0,"Invalid buffer offset: "+n);var a=n>>>2,l=0,c=e==SDL.screen,u;if(typeof CanvasPixelArray<"u"&&r instanceof CanvasPixelArray)for(u=r.length;l>>0];r[l]=_&255,r[l+1]=_>>8&255,r[l+2]=_>>16&255,r[l+3]=c?255:_>>24&255,a++,l+=4}else{var d=new Uint32Array(r.buffer);if(c&&SDL.defaults.opaqueFrontBuffer){u=d.length,d.set(HEAP32.subarray(a>>>0,a+u>>>0));var f=new Uint8Array(r.buffer),p=3,m=p+4*u;if(u%8==0)for(;p>>0,a+d.length>>>0))}}t.ctx.putImageData(t.image,0,0)}}_SDL_UnlockSurface.sig="vp";function _SDL_Flip(e){e>>>=0}_SDL_Flip.sig="ip";function _SDL_UpdateRect(e,t,r,n,a){e>>>=0}_SDL_UpdateRect.sig="vpiiii";function _SDL_UpdateRects(e,t,r){e>>>=0,r>>>=0}_SDL_UpdateRects.sig="vpip";var _SDL_Delay=e=>{ENVIRONMENT_IS_WORKER||abort("SDL_Delay called on the main thread! Potential infinite loop, quitting. (consider building with async support like ASYNCIFY)");for(var t=Date.now();Date.now()-t>>=0,t>>>=0,e&&_emscripten_set_window_title(e),t&&(t=UTF8ToString(t))}_SDL_WM_SetCaption.sig="vpp";var _SDL_EnableKeyRepeat=(e,t)=>{};_SDL_EnableKeyRepeat.sig="iii";function _SDL_GetKeyboardState(e){return e>>>=0,e&&(HEAP32[e>>>2>>>0]=65536),SDL.keyboardState}_SDL_GetKeyboardState.sig="pp";var _SDL_GetKeyState=()=>_SDL_GetKeyboardState(0);function _SDL_GetKeyName(e){return SDL.keyName||(SDL.keyName=stringToNewUTF8("unknown key")),SDL.keyName}_SDL_GetKeyName.sig="pi";var _SDL_GetModState=()=>SDL.modState;_SDL_GetModState.sig="i";function _SDL_GetMouseState(e,t){return e>>>=0,t>>>=0,e&&(HEAP32[e>>>2>>>0]=Browser.mouseX),t&&(HEAP32[t>>>2>>>0]=Browser.mouseY),SDL.buttonState}_SDL_GetMouseState.sig="ipp";var _SDL_WarpMouse=(e,t)=>{};_SDL_WarpMouse.sig="vii";var _SDL_ShowCursor=e=>{switch(e){case 0:return Browser.isFullscreen?(Module.canvas.requestPointerLock(),0):1;case 1:return Module.canvas.exitPointerLock(),1;case-1:return!Browser.pointerLock;default:err("SDL_ShowCursor called with unknown toggle parameter value: ".concat(e));break}};_SDL_ShowCursor.sig="ii";function _SDL_GetError(){return SDL.errorMessage||(SDL.errorMessage=stringToNewUTF8("unknown SDL-emscripten error")),SDL.errorMessage}_SDL_GetError.sig="p";function _SDL_SetError(e,t){e>>>=0,t>>>=0}_SDL_SetError.sig="vpp";function _SDL_CreateRGBSurface(e,t,r,n,a,l,c,u){return SDL.makeSurface(t,r,e,!1,"CreateRGBSurface",a,l,c,u)}_SDL_CreateRGBSurface.sig="piiiiiiii";function _SDL_CreateRGBSurfaceFrom(e,t,r,n,a,l,c,u,_){e>>>=0;var d=SDL.makeSurface(t,r,0,!1,"CreateRGBSurfaceFrom",l,c,u,_);if(n!==32)return err("TODO: Partially unimplemented SDL_CreateRGBSurfaceFrom called!"),d;for(var f=SDL.surfaces[d],p=f.ctx.createImageData(t,r),m=t*4,g=0;g>>0];return f.ctx.putImageData(p,0,0),d}_SDL_CreateRGBSurfaceFrom.sig="ppiiiiiiii";function _SDL_ConvertSurface(e,t,r){e>>>=0,t>>>=0,t&&SDL.checkPixelFormat(t);var n=SDL.surfaces[e],a=SDL.makeSurface(n.width,n.height,n.flags,!1,"copy:"+n.source),l=SDL.surfaces[a];return l.ctx.globalCompositeOperation="copy",l.ctx.drawImage(n.canvas,0,0),l.ctx.globalCompositeOperation=n.ctx.globalCompositeOperation,a}_SDL_ConvertSurface.sig="pppi";function _SDL_DisplayFormatAlpha(e){return e>>>=0,_SDL_ConvertSurface(e,0,0)}_SDL_DisplayFormatAlpha.sig="pp";function _SDL_FreeSurface(e){e>>>=0,e&&SDL.freeSurface(e)}_SDL_FreeSurface.sig="vp";function _SDL_UpperBlit(e,t,r,n){return e>>>=0,t>>>=0,r>>>=0,n>>>=0,SDL.blitSurface(e,t,r,n,!1)}_SDL_UpperBlit.sig="ipppp";function _SDL_UpperBlitScaled(e,t,r,n){return e>>>=0,t>>>=0,r>>>=0,n>>>=0,SDL.blitSurface(e,t,r,n,!0)}_SDL_UpperBlitScaled.sig="ipppp";var _SDL_LowerBlit=_SDL_UpperBlit;_SDL_LowerBlit.sig="ipppp";var _SDL_LowerBlitScaled=_SDL_UpperBlitScaled;_SDL_LowerBlitScaled.sig="ipppp";function _SDL_GetClipRect(e,t){e>>>=0,t>>>=0,assert(t);var r=SDL.surfaces[e],n=r.clipRect||{x:0,y:0,w:r.width,h:r.height};SDL.updateRect(t,n)}_SDL_GetClipRect.sig="vpp";function _SDL_SetClipRect(e,t){e>>>=0,t>>>=0;var r=SDL.surfaces[e];t?r.clipRect=SDL.intersectionOfRects({x:0,y:0,w:r.width,h:r.height},SDL.loadRect(t)):delete r.clipRect}_SDL_SetClipRect.sig="ipp";function _SDL_FillRect(e,t,r){e>>>=0,t>>>=0;var n=SDL.surfaces[e];assert(!n.locked),n.isFlagSet(2097152)&&(r=n.colors32[r]);var a=t?SDL.loadRect(t):{x:0,y:0,w:n.width,h:n.height};return n.clipRect&&(a=SDL.intersectionOfRects(n.clipRect,a),t&&SDL.updateRect(t,a)),n.ctx.save(),n.ctx.fillStyle=SDL.translateColorToCSSRGBA(r),n.ctx.fillRect(a.x,a.y,a.w,a.h),n.ctx.restore(),0}_SDL_FillRect.sig="ippi";function _zoomSurface(e,t,r,n){e>>>=0;var a=SDL.surfaces[e],l=a.width*t,c=a.height*r,u=SDL.makeSurface(Math.abs(l),Math.abs(c),a.flags,!1,"zoomSurface"),_=SDL.surfaces[u];return t>=0&&r>=0?_.ctx.drawImage(a.canvas,0,0,l,c):(_.ctx.save(),_.ctx.scale(t<0?-1:1,r<0?-1:1),_.ctx.drawImage(a.canvas,l<0?l:0,c<0?c:0,Math.abs(l),Math.abs(c)),_.ctx.restore()),u}_zoomSurface.sig="ppddi";function _rotozoomSurface(e,t,r,n){if(e>>>=0,t%360===0)return _zoomSurface(e,r,r,n);var a=SDL.surfaces[e],l=a.width*r,c=a.height*r,u=Math.ceil(Math.sqrt(Math.pow(l,2)+Math.pow(c,2))),_=SDL.makeSurface(u,u,a.flags,!1,"rotozoomSurface"),d=SDL.surfaces[_];return d.ctx.translate(u/2,u/2),d.ctx.rotate(-t*Math.PI/180),d.ctx.drawImage(a.canvas,-l/2,-c/2,l,c),_}_rotozoomSurface.sig="ppddi";function _SDL_SetAlpha(e,t,r){e>>>=0;var n=SDL.surfaces[e];n.alpha=r,t&65536||(n.alpha=255)}_SDL_SetAlpha.sig="ipii";function _SDL_SetColorKey(e,t,r){return e>>>=0,warnOnce("SDL_SetColorKey is a no-op for performance reasons"),0}_SDL_SetColorKey.sig="ipii";function _SDL_PollEvent(e){return e>>>=0,SDL.pollEvent(e)}_SDL_PollEvent.sig="ip";function _SDL_PushEvent(e){e>>>=0;var t=_malloc(28);return _memcpy(t,e,28),SDL.events.push(t),0}_SDL_PushEvent.sig="ip";function _SDL_PeepEvents(e,t,r,n,a){switch(e>>>=0,r){case 2:{assert(t==1);for(var l=0,c=0;lSDL.events.forEach(SDL.handleEvent);_SDL_PumpEvents.sig="v";function _emscripten_SDL_SetEventHandler(e,t){e>>>=0,t>>>=0,SDL.eventHandler=e,SDL.eventHandlerContext=t,SDL.eventHandlerTemp||(SDL.eventHandlerTemp=_malloc(28))}_emscripten_SDL_SetEventHandler.sig="vpp";function _SDL_SetColors(e,t,r,n){e>>>=0,t>>>=0;var a=SDL.surfaces[e];if(!a.colors){var l=new ArrayBuffer(1024);a.colors=new Uint8Array(l),a.colors32=new Uint32Array(l)}for(var c=0;c>>0],a.colors[u+1]=HEAPU8[t+(c*4+1)>>>0],a.colors[u+2]=HEAPU8[t+(c*4+2)>>>0],a.colors[u+3]=255}return 1}_SDL_SetColors.sig="ippii";function _SDL_SetPalette(e,t,r,n,a){return e>>>=0,r>>>=0,_SDL_SetColors(e,r,n,a)}_SDL_SetPalette.sig="ipipii";function _SDL_MapRGB(e,t,r,n){return e>>>=0,SDL.checkPixelFormat(e),t&255|(r&255)<<8|(n&255)<<16|4278190080}_SDL_MapRGB.sig="ipiii";function _SDL_MapRGBA(e,t,r,n,a){return e>>>=0,SDL.checkPixelFormat(e),t&255|(r&255)<<8|(n&255)<<16|(a&255)<<24}_SDL_MapRGBA.sig="ipiiii";function _SDL_GetRGB(e,t,r,n,a){t>>>=0,r>>>=0,n>>>=0,a>>>=0,SDL.checkPixelFormat(t),r&&(HEAP8[r>>>0]=e&255),n&&(HEAP8[n>>>0]=e>>8&255),a&&(HEAP8[a>>>0]=e>>16&255)}_SDL_GetRGB.sig="vipppp";function _SDL_GetRGBA(e,t,r,n,a,l){t>>>=0,r>>>=0,n>>>=0,a>>>=0,l>>>=0,SDL.checkPixelFormat(t),r&&(HEAP8[r>>>0]=e&255),n&&(HEAP8[n>>>0]=e>>8&255),a&&(HEAP8[a>>>0]=e>>16&255),l&&(HEAP8[l>>>0]=e>>24&255)}_SDL_GetRGBA.sig="vippppp";var _SDL_GetAppState=()=>{var e=0;return Browser.pointerLock&&(e|=1),document.hasFocus()&&(e|=2),e|=4,e};_SDL_GetAppState.sig="i";var _SDL_WM_GrabInput=()=>{};_SDL_WM_GrabInput.sig="ii";function _SDL_WM_ToggleFullScreen(e){return e>>>=0,Browser.exitFullscreen()?1:SDL.canRequestFullscreen?(SDL.isRequestingFullscreen=!0,1):0}_SDL_WM_ToggleFullScreen.sig="ip";var _IMG_Init=e=>e;_IMG_Init.sig="ii";function _SDL_FreeRW(e){for(e>>>=0,SDL.rwops[e]=null;SDL.rwops.length>0&&SDL.rwops[SDL.rwops.length-1]===null;)SDL.rwops.pop()}_SDL_FreeRW.sig="vp";var _IMG_Load_RW=function(e,t){e>>>=0;var r=stackSave();try{var n=()=>{stackRestore(r),c&&t&&_SDL_FreeRW(e)},a=T=>{var S=n;n=()=>{S(),T()}},l=(T,S)=>{var x=stackAlloc(4),E=stackAlloc(4),w=stackAlloc(4),P=Module["_"+T](...S,x,E,w,0);return P?(a(()=>Module._stbi_image_free(P)),{rawData:!0,data:P,width:HEAP32[x>>>2>>>0],height:HEAP32[E>>>2>>>0],size:HEAP32[x>>>2>>>0]*HEAP32[E>>>2>>>0]*HEAP32[w>>>2>>>0],bpp:HEAP32[w>>>2>>>0]}):null},c=SDL.rwops[e];if(c===void 0)return 0;var u,_=c.filename;if(_===void 0)return warnOnce("Only file names that have been preloaded are supported for IMG_Load_RW. Consider using STB_IMAGE=1 if you want synchronous image decoding (see settings.js), or package files with --use-preload-plugins"),0;if(!u)if(_=PATH_FS.resolve(_),u=preloadedImages[_],u)Module.freePreloadedMediaOnUse&&(preloadedImages[_]=null);else return u===null&&err("Trying to reuse preloaded image, but freePreloadedMediaOnUse is set!"),warnOnce("Cannot find preloaded image "+_),warnOnce("Cannot find preloaded image "+_+". Consider using STB_IMAGE=1 if you want synchronous image decoding (see settings.js), or package files with --use-preload-plugins"),0;var d=SDL.makeSurface(u.width,u.height,0,!1,"load:"+_),f=SDL.surfaces[d];if(f.ctx.globalCompositeOperation="copy",!u.rawData)f.ctx.drawImage(u,0,0,u.width,u.height,0,0,u.width,u.height);else{var p=f.ctx.getImageData(0,0,f.width,f.height);if(u.bpp==4)p.data.set(HEAPU8.subarray(u.data>>>0,u.data+u.size>>>0));else if(u.bpp==3)for(var m=u.size/3,g=p.data,h=u.data,b=0,y=0;y>>0],g[b++]=HEAPU8[h++>>>0],g[b++]=HEAPU8[h++>>>0],g[b++]=255;else if(u.bpp==2)for(var m=u.size,g=p.data,h=u.data,b=0,y=0;y>>0],F=HEAPU8[h++>>>0];g[b++]=L,g[b++]=L,g[b++]=L,g[b++]=F}else if(u.bpp==1)for(var m=u.size,g=p.data,h=u.data,b=0,y=0;y>>0];g[b++]=I,g[b++]=I,g[b++]=I,g[b++]=255}else return err("cannot handle bpp ".concat(u.bpp)),0;f.ctx.putImageData(p,0,0)}return f.ctx.globalCompositeOperation="source-over",_SDL_LockSurface(d),f.locked--,SDL.GL&&(f.canvas=f.ctx=null),d}finally{n()}};_IMG_Load_RW.sig="ppi";var _SDL_LoadBMP_RW=_IMG_Load_RW;_SDL_LoadBMP_RW.sig="ppi";function _SDL_RWFromFile(e,t){e>>>=0,t>>>=0;var r=SDL.rwops.length,n=UTF8ToString(e);return SDL.rwops.push({filename:n,mimetype:Browser.getMimetype(n)}),r}_SDL_RWFromFile.sig="ppp";function _IMG_Load(e){e>>>=0;var t=_SDL_RWFromFile(e,0),r=_IMG_Load_RW(t,1);return r}_IMG_Load.sig="pp";var _IMG_Quit=()=>out("IMG_Quit called (and ignored)");_IMG_Quit.sig="v";function _SDL_OpenAudio(e,t){e>>>=0,t>>>=0;try{if(SDL.audio={freq:HEAPU32[e>>>2>>>0],format:HEAPU16[e+4>>>1>>>0],channels:HEAPU8[e+6>>>0],samples:HEAPU16[e+8>>>1>>>0],callback:HEAPU32[e+16>>>2>>>0],userdata:HEAPU32[e+20>>>2>>>0],paused:!0,timer:null},SDL.audio.format==8)SDL.audio.silence=128;else if(SDL.audio.format==32784)SDL.audio.silence=0;else if(SDL.audio.format==33056)SDL.audio.silence=0;else throw"Invalid SDL audio format "+SDL.audio.format+"!";if(SDL.audio.freq<=0)throw"Unsupported sound frequency "+SDL.audio.freq+"!";if(SDL.audio.freq<=22050)SDL.audio.freq=22050;else if(SDL.audio.freq<=32e3)SDL.audio.freq=32e3;else if(SDL.audio.freq<=44100)SDL.audio.freq=44100;else if(SDL.audio.freq<=48e3)SDL.audio.freq=48e3;else if(SDL.audio.freq<=96e3)SDL.audio.freq=96e3;else throw"Unsupported sound frequency ".concat(SDL.audio.freq,"!");if(SDL.audio.channels==0)SDL.audio.channels=1;else{if(SDL.audio.channels<0||SDL.audio.channels>32)throw"Unsupported number of audio channels for SDL audio: ".concat(SDL.audio.channels,"!");SDL.audio.channels!=1&&SDL.audio.channels!=2&&out("Warning: Using untested number of audio channels ".concat(SDL.audio.channels))}if(SDL.audio.samples<128||SDL.audio.samples>524288)throw"Unsupported audio callback buffer size ".concat(SDL.audio.samples,"!");if(SDL.audio.samples&SDL.audio.samples-1)throw"Audio callback buffer size ".concat(SDL.audio.samples," must be a power-of-two!");var r=SDL.audio.samples*SDL.audio.channels;if(SDL.audio.format==8)SDL.audio.bytesPerSample=1;else if(SDL.audio.format==32784)SDL.audio.bytesPerSample=2;else if(SDL.audio.format==33056)SDL.audio.bytesPerSample=4;else throw"Invalid SDL audio format ".concat(SDL.audio.format,"!");if(SDL.audio.bufferSize=r*SDL.audio.bytesPerSample,SDL.audio.bufferDurationSecs=SDL.audio.bufferSize/SDL.audio.bytesPerSample/SDL.audio.channels/SDL.audio.freq,SDL.audio.bufferingDelay=.05,SDL.audio.buffer=_malloc(SDL.audio.bufferSize),SDL.audio.numSimultaneouslyQueuedBuffers=Module.SDL_numSimultaneouslyQueuedBuffers||5,SDL.audio.queueNewAudioData=()=>{if(SDL.audio)for(var n=0;n=SDL.audio.bufferingDelay+SDL.audio.bufferDurationSecs*SDL.audio.numSimultaneouslyQueuedBuffers)return;getWasmTableEntry(SDL.audio.callback)(SDL.audio.userdata,SDL.audio.buffer,SDL.audio.bufferSize),SDL.audio.pushAudio(SDL.audio.buffer,SDL.audio.bufferSize)}},SDL.audio.caller=()=>{if(SDL.audio){--SDL.audio.numAudioTimersPending,SDL.audio.queueNewAudioData();var n=SDL.audio.nextPlayTime-SDL.audioContext.currentTime,a=SDL.audio.bufferDurationSecs/2;SDL.audio.numAudioTimersPending{try{if(SDL.audio.paused)return;var l=a/SDL.audio.bytesPerSample,c=l/SDL.audio.channels;if(c!=SDL.audio.samples)throw"Received mismatching audio buffer size!";var u=SDL.audioContext.createBufferSource(),_=SDL.audioContext.createBuffer(SDL.audio.channels,c,SDL.audio.freq);u.connect(SDL.audioContext.destination),SDL.fillWebAudioBufferFromHeap(n,c,_),u.buffer=_;var d=SDL.audioContext.currentTime,f=Math.max(d+SDL.audio.bufferingDelay,SDL.audio.nextPlayTime);typeof u.start<"u"?u.start(f):typeof u.noteOn<"u"&&u.noteOn(f),SDL.audio.nextPlayTime=f+SDL.audio.bufferDurationSecs}catch(p){err("Web Audio API error playing back audio: ".concat(p.toString()))}},t&&(HEAP32[t>>>2>>>0]=SDL.audio.freq,HEAP16[t+4>>>1>>>0]=SDL.audio.format,HEAP8[t+6>>>0]=SDL.audio.channels,HEAP8[t+7>>>0]=SDL.audio.silence,HEAP16[t+8>>>1>>>0]=SDL.audio.samples,HEAPU32[t+16>>>2>>>0]=SDL.audio.callback,HEAPU32[t+20>>>2>>>0]=SDL.audio.userdata),SDL.allocateChannels(32)}catch(n){err('Initializing SDL audio threw an exception: "'.concat(n.toString(),'"! Continuing without audio')),SDL.audio=null,SDL.allocateChannels(0),t&&(HEAP32[t>>>2>>>0]=0,HEAP16[t+4>>>1>>>0]=0,HEAP8[t+6>>>0]=0,HEAP8[t+7>>>0]=0,HEAP16[t+8>>>1>>>0]=0,HEAPU32[t+16>>>2>>>0]=0,HEAPU32[t+20>>>2>>>0]=0)}return SDL.audio?0:-1}_SDL_OpenAudio.sig="ipp";var _SDL_PauseAudio=e=>{SDL.audio&&(e?SDL.audio.timer!==void 0&&(clearTimeout(SDL.audio.timer),SDL.audio.numAudioTimersPending=0,SDL.audio.timer=void 0):SDL.audio.timer||(SDL.audio.numAudioTimersPending=1,SDL.audio.timer=safeSetTimeout(SDL.audio.caller,1)),SDL.audio.paused=e)};_SDL_PauseAudio.sig="vi";var _SDL_CloseAudio=()=>{SDL.audio&&(SDL.audio.callbackRemover&&(SDL.audio.callbackRemover(),SDL.audio.callbackRemover=null),_SDL_PauseAudio(1),_free(SDL.audio.buffer),SDL.audio=null,SDL.allocateChannels(0))};_SDL_CloseAudio.sig="v";var _SDL_LockAudio=()=>{};_SDL_LockAudio.sig="v";var _SDL_UnlockAudio=()=>{};_SDL_UnlockAudio.sig="v";function _SDL_CreateMutex(){return 0}_SDL_CreateMutex.sig="p";function _SDL_mutexP(e){return e>>>=0,0}_SDL_mutexP.sig="ip";function _SDL_mutexV(e){return e>>>=0,0}_SDL_mutexV.sig="ip";function _SDL_DestroyMutex(e){e>>>=0}_SDL_DestroyMutex.sig="vp";function _SDL_CreateCond(){return 0}_SDL_CreateCond.sig="p";function _SDL_CondSignal(e){e>>>=0}_SDL_CondSignal.sig="ip";function _SDL_CondWait(e,t){e>>>=0,t>>>=0}_SDL_CondWait.sig="ipp";function _SDL_DestroyCond(e){e>>>=0}_SDL_DestroyCond.sig="vp";var _SDL_StartTextInput=()=>{SDL.textInput=!0};_SDL_StartTextInput.sig="v";var _SDL_StopTextInput=()=>{SDL.textInput=!1};_SDL_StopTextInput.sig="v";var _Mix_Init=e=>e?8:0;_Mix_Init.sig="ii";var _Mix_Quit=()=>{};_Mix_Quit.sig="v";var _Mix_OpenAudio=(e,t,r,n)=>(SDL.openAudioContext(),autoResumeAudioContext(SDL.audioContext),SDL.allocateChannels(32),SDL.mixerFrequency=e,SDL.mixerFormat=t,SDL.mixerNumChannels=r,SDL.mixerChunkSize=n,0);_Mix_OpenAudio.sig="iiiii";var _Mix_CloseAudio=_SDL_CloseAudio;_Mix_CloseAudio.sig="v";var _Mix_AllocateChannels=e=>(SDL.allocateChannels(e),e);_Mix_AllocateChannels.sig="ii";function _Mix_ChannelFinished(e){e>>>=0,SDL.channelFinished=e}_Mix_ChannelFinished.sig="vp";var _Mix_Volume=(e,t)=>{if(e==-1){for(var r=0;r(t/=255,r/=255,SDL.setPannerPosition(SDL.channels[e],r-t,0,.1),1);_Mix_SetPanning.sig="iiii";function _Mix_LoadWAV_RW(e,t){e>>>=0;var r=SDL.rwops[e];if(r===void 0)return 0;var n="",a,l,c;if(r.filename!==void 0){n=PATH_FS.resolve(r.filename);var u=preloadedAudios[n];if(!u){u===null&&err("Trying to reuse preloaded audio, but freePreloadedMediaOnUse is set!"),Module.noAudioDecoding||warnOnce("Cannot find preloaded audio "+n);try{c=FS.readFile(n)}catch(h){return err("Couldn't find file for: ".concat(n)),0}}Module.freePreloadedMediaOnUse&&(preloadedAudios[n]=null),a=u}else if(r.bytes!==void 0)SDL.webAudioAvailable()?c=HEAPU8.buffer.slice(r.bytes,r.bytes+r.count):c=HEAPU8.subarray(r.bytes>>>0,r.bytes+r.count>>>0);else return 0;var _=c&&(c.buffer||c),d=Module.SDL_canPlayWithWebAudio===void 0||Module.SDL_canPlayWithWebAudio(n,_);if(c!==void 0&&SDL.webAudioAvailable()&&d){a=void 0,l={},l.onDecodeComplete=[];var f=h=>{l.decodedBuffer=h,l.onDecodeComplete.forEach(b=>b()),l.onDecodeComplete=void 0};SDL.audioContext.decodeAudioData(_,f)}else if(a===void 0&&c){var p=new Blob([c],{type:r.mimetype}),m=URL.createObjectURL(p);a=new Audio,a.src=m,a.mozAudioChannelType="content"}var g=SDL.audios.length;return SDL.audios.push({source:n,audio:a,webAudio:l}),g}_Mix_LoadWAV_RW.sig="ppi";function _Mix_LoadWAV(e){e>>>=0;var t=_SDL_RWFromFile(e,0),r=_Mix_LoadWAV_RW(t,0);return _SDL_FreeRW(t),r}_Mix_LoadWAV.sig="pp";function _Mix_QuickLoad_RAW(e,t){e>>>=0;for(var r,n,a=t>>1,l=new Float32Array(a),c=0;c>>1>>>0]/32768;SDL.webAudioAvailable()?(n={},n.decodedBuffer=l):(r=new Audio,r.mozAudioChannelType="content",r.numChannels=SDL.mixerNumChannels,r.frequency=SDL.mixerFrequency);var u=SDL.audios.length;return SDL.audios.push({source:"",audio:r,webAudio:n,buffer:l}),u}_Mix_QuickLoad_RAW.sig="ppi";function _Mix_FreeChunk(e){e>>>=0,SDL.audios[e]=null}_Mix_FreeChunk.sig="vp";var _Mix_ReserveChannels=e=>{SDL.channelMinimumNumber=e};_Mix_ReserveChannels.sig="ii";function _Mix_PlayChannelTimed(e,t,r,n){t>>>=0,assert(n==-1);var a=SDL.audios[t];if(!a||!a.audio&&!a.webAudio)return-1;if(e==-1){for(var l=SDL.channelMinimumNumber;l0;_Mix_FadingChannel.sig="ii";var _Mix_HaltChannel=e=>{function t(n){var a=SDL.channels[n];a.audio&&(a.audio.pause(),a.audio=null),SDL.channelFinished&&getWasmTableEntry(SDL.channelFinished)(n)}if(e!=-1)t(e);else for(var r=0;r{var e=SDL.music.audio;return e&&(e.src=e.src,e.currentPosition=0,e.pause()),SDL.music.audio=null,SDL.hookMusicFinished&&getWasmTableEntry(SDL.hookMusicFinished)(),0};_Mix_HaltMusic.sig="i";function _Mix_HookMusicFinished(e){e>>>=0,SDL.hookMusicFinished=e,SDL.music.audio&&(SDL.music.audio.onended=_Mix_HaltMusic)}_Mix_HookMusicFinished.sig="vp";var _Mix_VolumeMusic=e=>SDL.setGetVolume(SDL.music,e);_Mix_VolumeMusic.sig="ii";function _Mix_LoadMUS_RW(e){return e>>>=0,_Mix_LoadWAV_RW(e,0)}_Mix_LoadMUS_RW.sig="pp";function _Mix_LoadMUS(e){e>>>=0;var t=_SDL_RWFromFile(e,0),r=_Mix_LoadMUS_RW(t);return _SDL_FreeRW(t),r}_Mix_LoadMUS.sig="pp";var _Mix_FreeMusic=_Mix_FreeChunk;_Mix_FreeMusic.sig="vp";function _Mix_PlayMusic(e,t){e>>>=0,SDL.music.audio&&(SDL.music.audio.paused||err("Music is already playing. ".concat(SDL.music.source)),SDL.music.audio.pause());var r=SDL.audios[e],n;return r.webAudio?(n={},n.resource=r,n.paused=!1,n.currentPosition=0,n.play=function(){SDL.playWebAudio(this)},n.pause=function(){SDL.pauseWebAudio(this)}):r.audio&&(n=r.audio),n.onended=function(){SDL.music.audio==this&&_Mix_HaltMusic()},n.loop=t!=0&&t!=1,n.volume=SDL.music.volume,SDL.music.audio=n,n.play(),0}_Mix_PlayMusic.sig="ipi";var _Mix_PauseMusic=()=>{var e=SDL.music.audio;e==null||e.pause()};_Mix_PauseMusic.sig="v";var _Mix_ResumeMusic=()=>{var e=SDL.music.audio;e==null||e.play()};_Mix_ResumeMusic.sig="v";var _Mix_FadeInMusicPos=_Mix_PlayMusic;_Mix_FadeInMusicPos.sig="ipiid";var _Mix_FadeOutMusic=_Mix_HaltMusic;_Mix_FadeOutMusic.sig="ii";var _Mix_PlayingMusic=()=>SDL.music.audio&&!SDL.music.audio.paused?1:0;_Mix_PlayingMusic.sig="i";var _Mix_Playing=e=>{if(e===-1){for(var t=0,r=0;r{if(e===-1){for(var t=0;t{var a;if(e===-1){for(var t=0,r=0;r{var e;return(e=SDL.music.audio)!=null&&e.paused?1:0};_Mix_PausedMusic.sig="i";var _Mix_Resume=e=>{if(e===-1){for(var t=0;t{try{var e=new OffscreenCanvas(0,0);if(SDL.ttfContext=e.getContext("2d"),typeof SDL.ttfContext.measureText!="function")throw"bad context"}catch(r){var t=document.createElement("canvas");SDL.ttfContext=t.getContext("2d")}return 0};_TTF_Init.sig="i";function _TTF_OpenFont(e,t){e>>>=0,e=PATH.normalize(UTF8ToString(e));var r=SDL.fonts.length;return SDL.fonts.push({name:e,size:t}),r}_TTF_OpenFont.sig="ppi";function _TTF_CloseFont(e){e>>>=0,SDL.fonts[e]=null}_TTF_CloseFont.sig="vp";function _TTF_RenderText_Solid(e,t,r){e>>>=0,t>>>=0,r>>>=0,t=UTF8ToString(t)||" ";var n=SDL.fonts[e],a=SDL.estimateTextWidth(n,t),l=n.size;r=SDL.loadColorToCSSRGB(r);var c=SDL.makeFontString(l,n.name),u=SDL.makeSurface(a,l,0,!1,"text:"+t),_=SDL.surfaces[u];return _.ctx.save(),_.ctx.fillStyle=r,_.ctx.font=c,_.ctx.textBaseline="bottom",_.ctx.fillText(t,0,l|0),_.ctx.restore(),u}_TTF_RenderText_Solid.sig="pppp";var _TTF_RenderText_Blended=_TTF_RenderText_Solid;_TTF_RenderText_Blended.sig="pppp";var _TTF_RenderText_Shaded=_TTF_RenderText_Solid;_TTF_RenderText_Shaded.sig="ppppp";var _TTF_RenderUTF8_Solid=_TTF_RenderText_Solid;_TTF_RenderUTF8_Solid.sig="pppp";function _TTF_SizeText(e,t,r,n){e>>>=0,t>>>=0,r>>>=0,n>>>=0;var a=SDL.fonts[e];return r&&(HEAP32[r>>>2>>>0]=SDL.estimateTextWidth(a,UTF8ToString(t))),n&&(HEAP32[n>>>2>>>0]=a.size),0}_TTF_SizeText.sig="ipppp";var _TTF_SizeUTF8=_TTF_SizeText;_TTF_SizeUTF8.sig="ipppp";function _TTF_GlyphMetrics(e,t,r,n,a,l,c){e>>>=0,r>>>=0,n>>>=0,a>>>=0,l>>>=0,c>>>=0;var u=SDL.fonts[e],_=SDL.estimateTextWidth(u,String.fromCharCode(t));c&&(HEAP32[c>>>2>>>0]=_),r&&(HEAP32[r>>>2>>>0]=0),n&&(HEAP32[n>>>2>>>0]=_),a&&(HEAP32[a>>>2>>>0]=0),l&&(HEAP32[l>>>2>>>0]=u.size)}_TTF_GlyphMetrics.sig="ipippppp";function _TTF_FontAscent(e){e>>>=0;var t=SDL.fonts[e];return t.size*.98|0}_TTF_FontAscent.sig="ip";function _TTF_FontDescent(e){e>>>=0;var t=SDL.fonts[e];return t.size*.02|0}_TTF_FontDescent.sig="ip";function _TTF_FontHeight(e){e>>>=0;var t=SDL.fonts[e];return t.size}_TTF_FontHeight.sig="ip";var _TTF_FontLineSkip=_TTF_FontHeight;_TTF_FontLineSkip.sig="ip";var _TTF_Quit=()=>out("TTF_Quit called (and ignored)");_TTF_Quit.sig="v";var SDL_gfx={drawRectangle:(e,t,r,n,a,l,c)=>{t=t<<16>>16,r=r<<16>>16,n=n<<16>>16,a=a<<16>>16;var u=SDL.surfaces[e];assert(!u.locked);var _=t{t=t<<16>>16,r=r<<16>>16,n=n<<16>>16,a=a<<16>>16;var c=SDL.surfaces[e];assert(!c.locked),c.ctx.save(),c.ctx.strokeStyle=l,c.ctx.beginPath(),c.ctx.moveTo(t,r),c.ctx.lineTo(n,a),c.ctx.stroke(),c.ctx.restore()},drawEllipse:(e,t,r,n,a,l,c)=>{t=t<<16>>16,r=r<<16>>16,n=n<<16>>16,a=a<<16>>16;var u=SDL.surfaces[e];assert(!u.locked),u.ctx.save(),u.ctx.beginPath(),u.ctx.translate(t,r),u.ctx.scale(n,a),u.ctx.arc(0,0,1,0,2*Math.PI),u.ctx.restore(),u.ctx.save(),u.ctx[l+"Style"]=c,u.ctx[l](),u.ctx.restore()},translateColorToCSSRGBA:e=>"rgba(".concat(e>>>24,",").concat(e>>16&255,",").concat(e>>8&255,",").concat(e&255,")")};function _boxColor(e,t,r,n,a,l){return e>>>=0,SDL_gfx.drawRectangle(e,t,r,n,a,"fill",SDL_gfx.translateColorToCSSRGBA(l))}_boxColor.sig="ipiiiii";function _boxRGBA(e,t,r,n,a,l,c,u,_){return e>>>=0,SDL_gfx.drawRectangle(e,t,r,n,a,"fill",SDL.translateRGBAToCSSRGBA(l,c,u,_))}_boxRGBA.sig="ipiiiiiiii";function _rectangleColor(e,t,r,n,a,l){return e>>>=0,SDL_gfx.drawRectangle(e,t,r,n,a,"stroke",SDL_gfx.translateColorToCSSRGBA(l))}_rectangleColor.sig="ipiiiii";function _rectangleRGBA(e,t,r,n,a,l,c,u,_){return e>>>=0,SDL_gfx.drawRectangle(e,t,r,n,a,"stroke",SDL.translateRGBAToCSSRGBA(l,c,u,_))}_rectangleRGBA.sig="ipiiiiiiii";function _ellipseColor(e,t,r,n,a,l){return e>>>=0,SDL_gfx.drawEllipse(e,t,r,n,a,"stroke",SDL_gfx.translateColorToCSSRGBA(l))}_ellipseColor.sig="ipiiiii";function _ellipseRGBA(e,t,r,n,a,l,c,u,_){return e>>>=0,SDL_gfx.drawEllipse(e,t,r,n,a,"stroke",SDL.translateRGBAToCSSRGBA(l,c,u,_))}_ellipseRGBA.sig="ipiiiiiiii";function _filledEllipseColor(e,t,r,n,a,l){return e>>>=0,SDL_gfx.drawEllipse(e,t,r,n,a,"fill",SDL_gfx.translateColorToCSSRGBA(l))}_filledEllipseColor.sig="ipiiiii";function _filledEllipseRGBA(e,t,r,n,a,l,c,u,_){return e>>>=0,SDL_gfx.drawEllipse(e,t,r,n,a,"fill",SDL.translateRGBAToCSSRGBA(l,c,u,_))}_filledEllipseRGBA.sig="ipiiiiiiii";function _lineColor(e,t,r,n,a,l){return e>>>=0,SDL_gfx.drawLine(e,t,r,n,a,SDL_gfx.translateColorToCSSRGBA(l))}_lineColor.sig="ipiiiii";function _lineRGBA(e,t,r,n,a,l,c,u,_){return e>>>=0,SDL_gfx.drawLine(e,t,r,n,a,SDL.translateRGBAToCSSRGBA(l,c,u,_))}_lineRGBA.sig="ipiiiiiiii";function _pixelRGBA(e,t,r,n,a,l,c){return e>>>=0,_boxRGBA(e,t,r,t,r,n,a,l,c)}_pixelRGBA.sig="ipiiiiii";var _SDL_GL_SetAttribute=(e,t)=>{e in SDL.glAttributes||abort("Unknown SDL GL attribute ("+e+"). Please check if your SDL version is supported."),SDL.glAttributes[e]=t};_SDL_GL_SetAttribute.sig="iii";function _SDL_GL_GetAttribute(e,t){return t>>>=0,e in SDL.glAttributes||abort("Unknown SDL GL attribute ("+e+"). Please check if your SDL version is supported."),t&&(HEAP32[t>>>2>>>0]=SDL.glAttributes[e]),0}_SDL_GL_GetAttribute.sig="iip";var _SDL_GL_SwapBuffers=()=>{var e;(e=Browser.doSwapBuffers)==null||e.call(Browser)};_SDL_GL_SwapBuffers.sig="v";function _SDL_GL_ExtensionSupported(e){return e>>>=0,Module.ctx.getExtension(e)|0}_SDL_GL_ExtensionSupported.sig="ip";function _SDL_DestroyWindow(e){e>>>=0}_SDL_DestroyWindow.sig="vp";function _SDL_DestroyRenderer(e){e>>>=0}_SDL_DestroyRenderer.sig="vp";function _SDL_GetWindowFlags(e){return e>>>=0,Browser.isFullscreen?1:0}_SDL_GetWindowFlags.sig="ip";function _SDL_GL_SwapWindow(e){e>>>=0}_SDL_GL_SwapWindow.sig="vp";function _SDL_GL_MakeCurrent(e,t){e>>>=0,t>>>=0}_SDL_GL_MakeCurrent.sig="ipp";function _SDL_GL_DeleteContext(e){e>>>=0}_SDL_GL_DeleteContext.sig="vp";var _SDL_GL_GetSwapInterval=()=>MainLoop.timingMode==1?MainLoop.timingValue:0;_SDL_GL_GetSwapInterval.sig="i";var _SDL_GL_SetSwapInterval=e=>{_emscripten_set_main_loop_timing(1,e)};_SDL_GL_SetSwapInterval.sig="ii";function _SDL_SetWindowTitle(e,t){e>>>=0,t>>>=0,t&&(document.title=UTF8ToString(t))}_SDL_SetWindowTitle.sig="vpp";function _SDL_GetWindowSize(e,t,r){e>>>=0,t>>>=0,r>>>=0;var n=Module.canvas.width,a=Module.canvas.height;t&&(HEAP32[t>>>2>>>0]=n),r&&(HEAP32[r>>>2>>>0]=a)}_SDL_GetWindowSize.sig="vppp";function _SDL_LogSetOutputFunction(e,t){e>>>=0,t>>>=0}_SDL_LogSetOutputFunction.sig="vpp";function _SDL_SetWindowFullscreen(e,t){return e>>>=0,Browser.isFullscreen?(Module.canvas.exitFullscreen(),1):0}_SDL_SetWindowFullscreen.sig="ipi";var _SDL_ClearError=()=>{};_SDL_ClearError.sig="v";var _SDL_SetGamma=(e,t,r)=>-1;_SDL_SetGamma.sig="ifff";function _SDL_SetGammaRamp(e,t,r){return e>>>=0,t>>>=0,r>>>=0,-1}_SDL_SetGammaRamp.sig="ippp";var _SDL_NumJoysticks=()=>{for(var e=0,t=SDL.getGamepads(),r=0;rSDL.lastJoystickState.hasOwnProperty(e+1)?1:0;_SDL_JoystickOpened.sig="ii";function _SDL_JoystickIndex(e){return e>>>=0,e-1}_SDL_JoystickIndex.sig="ip";function _SDL_JoystickNumAxes(e){e>>>=0;var t=SDL.getGamepad(e-1);return t?t.axes.length:0}_SDL_JoystickNumAxes.sig="ip";function _SDL_JoystickNumBalls(e){return e>>>=0,0}_SDL_JoystickNumBalls.sig="ip";function _SDL_JoystickNumHats(e){return e>>>=0,0}_SDL_JoystickNumHats.sig="ip";function _SDL_JoystickNumButtons(e){e>>>=0;var t=SDL.getGamepad(e-1);return t?t.buttons.length:0}_SDL_JoystickNumButtons.sig="ip";var _SDL_JoystickUpdate=()=>SDL.queryJoysticks();_SDL_JoystickUpdate.sig="v";var _SDL_JoystickEventState=e=>e<0?SDL.joystickEventState:SDL.joystickEventState=e;_SDL_JoystickEventState.sig="ii";function _SDL_JoystickGetAxis(e,t){e>>>=0;var r=SDL.getGamepad(e-1);return r&&r.axes.length>t?SDL.joystickAxisValueConversion(r.axes[t]):0}_SDL_JoystickGetAxis.sig="ipi";function _SDL_JoystickGetHat(e,t){return e>>>=0,0}_SDL_JoystickGetHat.sig="ipi";function _SDL_JoystickGetBall(e,t,r,n){return e>>>=0,r>>>=0,n>>>=0,-1}_SDL_JoystickGetBall.sig="ipipp";function _SDL_JoystickGetButton(e,t){e>>>=0;var r=SDL.getGamepad(e-1);return r&&r.buttons.length>t&&SDL.getJoystickButtonState(r.buttons[t])?1:0}_SDL_JoystickGetButton.sig="ipi";function _SDL_JoystickClose(e){e>>>=0,delete SDL.lastJoystickState[e]}_SDL_JoystickClose.sig="vp";var _SDL_InitSubSystem=e=>0;_SDL_InitSubSystem.sig="ii";function _SDL_RWFromConstMem(e,t){e>>>=0;var r=SDL.rwops.length;return SDL.rwops.push({bytes:e,count:t}),r}_SDL_RWFromConstMem.sig="ppi";var _SDL_RWFromMem=_SDL_RWFromConstMem;_SDL_RWFromMem.sig="ppi";var _SDL_GetNumAudioDrivers=()=>1;_SDL_GetNumAudioDrivers.sig="i";function _SDL_GetCurrentAudioDriver(){return stringToNewUTF8("Emscripten Audio")}_SDL_GetCurrentAudioDriver.sig="p";var _SDL_GetScancodeFromKey=e=>SDL.scanCodes[e];_SDL_GetScancodeFromKey.sig="ii";function _SDL_GetAudioDriver(e){return _SDL_GetCurrentAudioDriver()}_SDL_GetAudioDriver.sig="pi";var _SDL_EnableUNICODE=e=>{var t=SDL.unicode||0;return SDL.unicode=e,t};_SDL_EnableUNICODE.sig="ii";var _SDL_AddTimer=function(e,t,r){return t>>>=0,r>>>=0,safeSetTimeout(()=>getWasmTableEntry(t)(e,r),e)};_SDL_AddTimer.sig="iipp";var _SDL_RemoveTimer=e=>(clearTimeout(e),!0);_SDL_RemoveTimer.sig="ii";function _SDL_CreateThread(e,t,r,n){throw e>>>=0,t>>>=0,"SDL threads cannot be supported in the web platform because they assume shared state. See emscripten_create_worker etc. for a message-passing concurrency model that does let you run code in another thread."}_SDL_CreateThread.sig="ppp";function _SDL_WaitThread(e,t){throw e>>>=0,t>>>=0,"SDL_WaitThread"}_SDL_WaitThread.sig="vpp";function _SDL_GetThreadID(e){throw e>>>=0,"SDL_GetThreadID"}_SDL_GetThreadID.sig="pp";function _SDL_ThreadID(){return 0}_SDL_ThreadID.sig="p";function _SDL_AllocRW(){throw"SDL_AllocRW: TODO"}_SDL_AllocRW.sig="p";function _SDL_CondBroadcast(e){throw e>>>=0,"SDL_CondBroadcast: TODO"}_SDL_CondBroadcast.sig="ip";function _SDL_CondWaitTimeout(e,t,r){throw e>>>=0,t>>>=0,"SDL_CondWaitTimeout: TODO"}_SDL_CondWaitTimeout.sig="ippi";var _SDL_WM_IconifyWindow=()=>{throw"SDL_WM_IconifyWindow TODO"};_SDL_WM_IconifyWindow.sig="i";function _Mix_SetPostMix(e,t){return e>>>=0,t>>>=0,warnOnce("Mix_SetPostMix: TODO")}_Mix_SetPostMix.sig="vpp";function _Mix_VolumeChunk(e,t){throw e>>>=0,"Mix_VolumeChunk: TODO"}_Mix_VolumeChunk.sig="ipi";var _Mix_SetPosition=(e,t,r)=>{throw"Mix_SetPosition: TODO"};_Mix_SetPosition.sig="iiii";function _Mix_QuerySpec(e,t,r){throw e>>>=0,t>>>=0,r>>>=0,"Mix_QuerySpec: TODO"}_Mix_QuerySpec.sig="ippp";function _Mix_FadeInChannelTimed(e,t,r,n,a){throw t>>>=0,"Mix_FadeInChannelTimed"}_Mix_FadeInChannelTimed.sig="iipiii";var _Mix_FadeOutChannel=()=>{throw"Mix_FadeOutChannel"};_Mix_FadeOutChannel.sig="iii";function _Mix_Linked_Version(){throw"Mix_Linked_Version: TODO"}_Mix_Linked_Version.sig="p";function _SDL_SaveBMP_RW(e,t,r){throw e>>>=0,t>>>=0,"SDL_SaveBMP_RW: TODO"}_SDL_SaveBMP_RW.sig="ippi";function _SDL_WM_SetIcon(e,t){e>>>=0,t>>>=0}_SDL_WM_SetIcon.sig="vpp";var _SDL_HasRDTSC=()=>0;_SDL_HasRDTSC.sig="i";var _SDL_HasMMX=()=>0;_SDL_HasMMX.sig="i";var _SDL_HasMMXExt=()=>0;_SDL_HasMMXExt.sig="i";var _SDL_Has3DNow=()=>0;_SDL_Has3DNow.sig="i";var _SDL_Has3DNowExt=()=>0;_SDL_Has3DNowExt.sig="i";var _SDL_HasSSE=()=>0;_SDL_HasSSE.sig="i";var _SDL_HasSSE2=()=>0;_SDL_HasSSE2.sig="i";var _SDL_HasAltiVec=()=>0;_SDL_HasAltiVec.sig="i";var ALLOC_NORMAL=0,ALLOC_STACK=1,allocate=(e,t)=>{var r;return t==ALLOC_STACK?r=stackAlloc(e.length):r=_malloc(e.length),!e.subarray&&!e.slice&&(e=new Uint8Array(e)),HEAPU8.set(e,r>>>0),r},writeStringToMemory=(e,t,r)=>{warnOnce("writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead!");var n,a;r&&(a=t+lengthBytesUTF8(e),n=HEAP8[a>>>0]),stringToUTF8(e,t,1/0),r&&(HEAP8[a>>>0]=n)},writeAsciiToMemory=(e,t,r)=>{for(var n=0;n>>0]=e.charCodeAt(n);r||(HEAP8[t>>>0]=0)},allocateUTF8=stringToNewUTF8,allocateUTF8OnStack=stringToUTF8OnStack,setErrNo=e=>(HEAP32[___errno_location()>>>2>>>0]=e,e),demangle=e=>(demangle.recursionGuard=(demangle.recursionGuard|0)+1,demangle.recursionGuard>1?e:withStackSave(()=>{try{var t=e;t.startsWith("__Z")&&(t=t.substr(1));var r=stringToUTF8OnStack(t),n=stackAlloc(4),a=___cxa_demangle(r,0,0,n);if(HEAP32[n>>>2>>>0]===0&&a)return UTF8ToString(a)}catch(l){}finally{_free(a),demangle.recursionGuard<2&&--demangle.recursionGuard}return e}));function stackTrace(){var e=jsStackTrace();return Module.extraStackTrace&&(e+="\n"+Module.extraStackTrace()),e}var print=out,printErr=err,_emscripten_is_main_browser_thread=()=>!ENVIRONMENT_IS_WORKER,tupleRegistrations={},structRegistrations={},getTypeName=e=>{var t=___getTypeName(e),r=readLatin1String(t);return _free(t),r},getFunctionName=e=>{e=e.trim();let t=e.indexOf("(");return t!==-1?e.substr(0,t):e},getFunctionArgsName=e=>{e=e.trim();let t=e.indexOf("(")+1;return t!==0?e.substr(t,e.length-t-1).replaceAll(" ","").split(",").filter(r=>r.length):[]},heap32VectorToArray=(e,t)=>{for(var r=[],n=0;n>>2>>>0]);return r},requireRegisteredType=(e,t)=>{var r=registeredTypes[e];return r===void 0&&throwBindingError("".concat(t," has unknown type ").concat(getTypeName(e))),r};function usesDestructorStack(e){for(var t=1;tr){var l=t==r?t:"".concat(t," to ").concat(r);a("function ".concat(n," called with ").concat(e," arguments, expected ").concat(l))}}function getRequiredArgCount(e){for(var t=e.length-2,r=e.length-1;r>=2&&e[r].optional;--r)t--;return t}function createJsInvoker(e,t,r,n){var a=usesDestructorStack(e),l=e.length-2,c=[],u=["fn"];t&&u.push("thisWired");for(var _=0;_Object.defineProperty(t,"name",{value:e}),extendError=(e,t)=>{var r=createNamedFunction(t,function(n){this.name=t,this.message=n;var a=new Error(n).stack;a!==void 0&&(this.stack=this.toString()+"\n"+a.replace(/^Error(:[^\n]*)?\n/,""))});return r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return this.message===void 0?this.name:"".concat(this.name,": ").concat(this.message)},r},UnboundTypeError,PureVirtualError,EmValOptionalType=Object.assign({optional:!0},EmValType),registeredInstances={},getInheritedInstanceCount=()=>Object.keys(registeredInstances).length,getLiveInheritedInstances=()=>{var e=[];for(var t in registeredInstances)registeredInstances.hasOwnProperty(t)&&e.push(registeredInstances[t]);return e},deletionQueue=[],flushPendingDeletes=()=>{for(;deletionQueue.length;){var e=deletionQueue.pop();e.$$.deleteScheduled=!1,e.delete()}},delayFunction,setDelayFunction=e=>{delayFunction=e,deletionQueue.length&&delayFunction&&delayFunction(flushPendingDeletes)},init_embind=()=>{Module.getInheritedInstanceCount=getInheritedInstanceCount,Module.getLiveInheritedInstances=getLiveInheritedInstances,Module.flushPendingDeletes=flushPendingDeletes,Module.setDelayFunction=setDelayFunction},throwUnboundTypeError=(e,t)=>{var r=[],n={};function a(l){if(!n[l]&&!registeredTypes[l]){if(typeDependencies[l]){typeDependencies[l].forEach(a);return}r.push(l),n[l]=!0}}throw t.forEach(a),new UnboundTypeError("".concat(e,": ")+r.map(getTypeName).join([", "]))},ensureOverloadTable=(e,t,r)=>{if(e[t].overloadTable===void 0){var n=e[t];e[t]=function(...a){return e[t].overloadTable.hasOwnProperty(a.length)||throwBindingError("Function '".concat(r,"' called with an invalid number of arguments (").concat(a.length,") - expects one of (").concat(e[t].overloadTable,")!")),e[t].overloadTable[a.length].apply(this,a)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}},exposePublicSymbol=(e,t,r)=>{Module.hasOwnProperty(e)?((r===void 0||Module[e].overloadTable!==void 0&&Module[e].overloadTable[r]!==void 0)&&throwBindingError("Cannot register public name '".concat(e,"' twice")),ensureOverloadTable(Module,e,e),Module.hasOwnProperty(r)&&throwBindingError("Cannot register multiple overloads of a function with the same number of arguments (".concat(r,")!")),Module[e].overloadTable[r]=t):(Module[e]=t,r!==void 0&&(Module[e].numArguments=r))},replacePublicSymbol=(e,t,r)=>{Module.hasOwnProperty(e)||throwInternalError("Replacing nonexistent public symbol"),Module[e].overloadTable!==void 0&&r!==void 0?Module[e].overloadTable[r]=t:(Module[e]=t,Module[e].argCount=r)},getBasestPointer=(e,t)=>{for(t===void 0&&throwBindingError("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t},registerInheritedInstance=(e,t,r)=>{t=getBasestPointer(e,t),registeredInstances.hasOwnProperty(t)?throwBindingError("Tried to register registered instance: ".concat(t)):registeredInstances[t]=r},unregisterInheritedInstance=(e,t)=>{t=getBasestPointer(e,t),registeredInstances.hasOwnProperty(t)?delete registeredInstances[t]:throwBindingError("Tried to unregister unregistered instance: ".concat(t))},getInheritedInstance=(e,t)=>(t=getBasestPointer(e,t),registeredInstances[t]),registeredPointers={},enumReadValueFromPointer=(e,t,r)=>{switch(t){case 1:return r?function(n){return this.fromWireType(HEAP8[n>>>0])}:function(n){return this.fromWireType(HEAPU8[n>>>0])};case 2:return r?function(n){return this.fromWireType(HEAP16[n>>>1>>>0])}:function(n){return this.fromWireType(HEAPU16[n>>>1>>>0])};case 4:return r?function(n){return this.fromWireType(HEAP32[n>>>2>>>0])}:function(n){return this.fromWireType(HEAPU32[n>>>2>>>0])};default:throw new TypeError("invalid integer width (".concat(t,"): ").concat(e))}};function __embind_register_user_type(e,t){e>>>=0,t>>>=0,__embind_register_emval(e)}__embind_register_user_type.sig="vpp";function __embind_register_optional(e,t){e>>>=0,t>>>=0,registerType(e,EmValOptionalType)}__embind_register_optional.sig="vpp";var runDestructors=e=>{for(;e.length;){var t=e.pop(),r=e.pop();r(t)}};function newFunc(e,t){if(!(e instanceof Function))throw new TypeError("new_ called with constructor type ".concat(typeof e," which is not a function"));var r=createNamedFunction(e.name||"unknownFunctionName",function(){});r.prototype=e.prototype;var n=new r,a=e.apply(n,t);return a instanceof Object?a:n}function craftInvokerFunction(e,t,r,n,a,l){var c=t.length;c<2&&throwBindingError("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var u=t[1]!==null&&r!==null,_=usesDestructorStack(t),d=t[0].name!=="void",f=c-2,p=[e,throwBindingError,n,a,runDestructors,t[0],t[1]],m=0;m{e=readLatin1String(e);function r(){return e.includes("j")||e.includes("p")?getDynCaller(e,t):getWasmTableEntry(t)}var n=r();return typeof n!="function"&&throwBindingError("unknown function pointer with signature ".concat(e,": ").concat(t)),n};function __embind_register_function(e,t,r,n,a,l,c,u){e>>>=0,r>>>=0,n>>>=0,a>>>=0,l>>>=0;var _=heap32VectorToArray(t,r);e=readLatin1String(e),e=getFunctionName(e),a=embind__requireFunction(n,a),exposePublicSymbol(e,function(){throwUnboundTypeError("Cannot call ".concat(e," due to unbound types"),_)},t-1),whenDependentTypesAreResolved([],_,d=>{var f=[d[0],null].concat(d.slice(1));return replacePublicSymbol(e,craftInvokerFunction(e,f,null,a,l,c),t-1),[]})}__embind_register_function.sig="vpippppii";function __embind_register_value_array(e,t,r,n,a,l){e>>>=0,t>>>=0,r>>>=0,n>>>=0,a>>>=0,l>>>=0,tupleRegistrations[e]={name:readLatin1String(t),rawConstructor:embind__requireFunction(r,n),rawDestructor:embind__requireFunction(a,l),elements:[]}}__embind_register_value_array.sig="vpppppp";function __embind_register_value_array_element(e,t,r,n,a,l,c,u,_){e>>>=0,t>>>=0,r>>>=0,n>>>=0,a>>>=0,l>>>=0,c>>>=0,u>>>=0,_>>>=0,tupleRegistrations[e].elements.push({getterReturnType:t,getter:embind__requireFunction(r,n),getterContext:a,setterArgumentType:l,setter:embind__requireFunction(c,u),setterContext:_})}__embind_register_value_array_element.sig="vppppppppp";var __embind_finalize_value_array=function(e){e>>>=0;var t=tupleRegistrations[e];delete tupleRegistrations[e];var r=t.elements,n=r.length,a=r.map(u=>u.getterReturnType).concat(r.map(u=>u.setterArgumentType)),l=t.rawConstructor,c=t.rawDestructor;whenDependentTypesAreResolved([e],a,u=>(r.forEach((_,d)=>{var f=u[d],p=_.getter,m=_.getterContext,g=u[d+n],h=_.setter,b=_.setterContext;_.read=y=>f.fromWireType(p(m,y)),_.write=(y,L)=>{var F=[];h(b,y,g.toWireType(F,L)),runDestructors(F)}}),[{name:t.name,fromWireType:_=>{for(var d=new Array(n),f=0;f{if(n!==d.length)throw new TypeError("Incorrect number of tuple elements for ".concat(t.name,": expected=").concat(n,", actual=").concat(d.length));for(var f=l(),p=0;p>>=0,t>>>=0,r>>>=0,n>>>=0,a>>>=0,l>>>=0,structRegistrations[e]={name:readLatin1String(t),rawConstructor:embind__requireFunction(r,n),rawDestructor:embind__requireFunction(a,l),fields:[]}}__embind_register_value_object.sig="vpppppp";function __embind_register_value_object_field(e,t,r,n,a,l,c,u,_,d){e>>>=0,t>>>=0,r>>>=0,n>>>=0,a>>>=0,l>>>=0,c>>>=0,u>>>=0,_>>>=0,d>>>=0,structRegistrations[e].fields.push({fieldName:readLatin1String(t),getterReturnType:r,getter:embind__requireFunction(n,a),getterContext:l,setterArgumentType:c,setter:embind__requireFunction(u,_),setterContext:d})}__embind_register_value_object_field.sig="vpppppppppp";var __embind_finalize_value_object=function(e){e>>>=0;var t=structRegistrations[e];delete structRegistrations[e];var r=t.rawConstructor,n=t.rawDestructor,a=t.fields,l=a.map(c=>c.getterReturnType).concat(a.map(c=>c.setterArgumentType));whenDependentTypesAreResolved([e],l,c=>{var u={};return a.forEach((_,d)=>{var f=_.fieldName,p=c[d],m=_.getter,g=_.getterContext,h=c[d+a.length],b=_.setter,y=_.setterContext;u[f]={read:L=>p.fromWireType(m(g,L)),write:(L,F)=>{var I=[];b(y,L,h.toWireType(I,F)),runDestructors(I)}}}),[{name:t.name,fromWireType:_=>{var d={};for(var f in u)d[f]=u[f].read(_);return n(_),d},toWireType:(_,d)=>{for(var f in u)if(!(f in d))throw new TypeError('Missing field: "'.concat(f,'"'));var p=r();for(f in u)u[f].write(p,d[f]);return _!==null&&_.push(n,p),p},argPackAdvance:GenericWireTypeSize,readValueFromPointer:readPointer,destructorFunction:n}]})};__embind_finalize_value_object.sig="vp";var upcastPointer=(e,t,r)=>{for(;t!==r;)t.upcast||throwBindingError("Expected null or instance of ".concat(r.name,", got an instance of ").concat(t.name)),e=t.upcast(e),t=t.baseClass;return e};function genericPointerToWireType(e,t){var r;if(t===null)return this.isReference&&throwBindingError("null is not a valid ".concat(this.name)),this.isSmartPointer?(r=this.rawConstructor(),e!==null&&e.push(this.rawDestructor,r),r):0;(!t||!t.$$)&&throwBindingError('Cannot pass "'.concat(embindRepr(t),'" as a ').concat(this.name)),t.$$.ptr||throwBindingError("Cannot pass deleted object as a pointer of type ".concat(this.name)),!this.isConst&&t.$$.ptrType.isConst&&throwBindingError("Cannot convert argument of type ".concat(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name," to parameter type ").concat(this.name));var n=t.$$.ptrType.registeredClass;if(r=upcastPointer(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(t.$$.smartPtr===void 0&&throwBindingError("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:throwBindingError("Cannot convert argument of type ".concat(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name," to parameter type ").concat(this.name));break;case 1:r=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)r=t.$$.smartPtr;else{var a=t.clone();r=this.rawShare(r,Emval.toHandle(()=>a.delete())),e!==null&&e.push(this.rawDestructor,r)}break;default:throwBindingError("Unsupporting sharing policy")}return r}function constNoSmartPtrRawPointerToWireType(e,t){if(t===null)return this.isReference&&throwBindingError("null is not a valid ".concat(this.name)),0;t.$$||throwBindingError('Cannot pass "'.concat(embindRepr(t),'" as a ').concat(this.name)),t.$$.ptr||throwBindingError("Cannot pass deleted object as a pointer of type ".concat(this.name));var r=t.$$.ptrType.registeredClass,n=upcastPointer(t.$$.ptr,r,this.registeredClass);return n}function nonConstNoSmartPtrRawPointerToWireType(e,t){if(t===null)return this.isReference&&throwBindingError("null is not a valid ".concat(this.name)),0;t.$$||throwBindingError('Cannot pass "'.concat(embindRepr(t),'" as a ').concat(this.name)),t.$$.ptr||throwBindingError("Cannot pass deleted object as a pointer of type ".concat(this.name)),t.$$.ptrType.isConst&&throwBindingError("Cannot convert argument of type ".concat(t.$$.ptrType.name," to parameter type ").concat(this.name));var r=t.$$.ptrType.registeredClass,n=upcastPointer(t.$$.ptr,r,this.registeredClass);return n}function RegisteredPointer(e,t,r,n,a,l,c,u,_,d,f){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=a,this.pointeeType=l,this.sharingPolicy=c,this.rawGetPointee=u,this.rawConstructor=_,this.rawShare=d,this.rawDestructor=f,!a&&t.baseClass===void 0?n?(this.toWireType=constNoSmartPtrRawPointerToWireType,this.destructorFunction=null):(this.toWireType=nonConstNoSmartPtrRawPointerToWireType,this.destructorFunction=null):this.toWireType=genericPointerToWireType}var downcastPointer=(e,t,r)=>{if(t===r)return e;if(r.baseClass===void 0)return null;var n=downcastPointer(e,t,r.baseClass);return n===null?null:r.downcast(n)},finalizationRegistry=!1,detachFinalizer=e=>{},runDestructor=e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)},releaseClassHandle=e=>{e.count.value-=1;var t=e.count.value===0;t&&runDestructor(e)},attachFinalizer=e=>typeof FinalizationRegistry>"u"?(attachFinalizer=t=>t,e):(finalizationRegistry=new FinalizationRegistry(t=>{releaseClassHandle(t.$$)}),attachFinalizer=t=>{var r=t.$$,n=!!r.smartPtr;if(n){var a={$$:r};finalizationRegistry.register(t,a,t)}return t},detachFinalizer=t=>finalizationRegistry.unregister(t),attachFinalizer(e)),makeClassHandle=(e,t)=>{(!t.ptrType||!t.ptr)&&throwInternalError("makeClassHandle requires ptr and ptrType");var r=!!t.smartPtrType,n=!!t.smartPtr;return r!==n&&throwInternalError("Both smartPtrType and smartPtr must be specified"),t.count={value:1},attachFinalizer(Object.create(e,{$$:{value:t,writable:!0}}))};function RegisteredPointer_fromWireType(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=getInheritedInstance(this.registeredClass,t);if(r!==void 0){if(r.$$.count.value===0)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var n=r.clone();return this.destructor(e),n}function a(){return this.isSmartPointer?makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var l=this.registeredClass.getActualType(t),c=registeredPointers[l];if(!c)return a.call(this);var u;this.isConst?u=c.constPointerType:u=c.pointerType;var _=downcastPointer(t,this.registeredClass,u.registeredClass);return _===null?a.call(this):this.isSmartPointer?makeClassHandle(u.registeredClass.instancePrototype,{ptrType:u,ptr:_,smartPtrType:this,smartPtr:e}):makeClassHandle(u.registeredClass.instancePrototype,{ptrType:u,ptr:_})}var init_RegisteredPointer=()=>{Object.assign(RegisteredPointer.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){var t;(t=this.rawDestructor)==null||t.call(this,e)},argPackAdvance:GenericWireTypeSize,readValueFromPointer:readPointer,fromWireType:RegisteredPointer_fromWireType})},detachFinalizer_deps=["$finalizationRegistry"];function ClassHandle(){}var shallowCopyInternalPointer=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),throwInstanceAlreadyDeleted=e=>{function t(r){return r.$$.ptrType.registeredClass.name}throwBindingError(t(e)+" instance already deleted")},init_ClassHandle=()=>{Object.assign(ClassHandle.prototype,{isAliasOf(e){if(!(this instanceof ClassHandle)||!(e instanceof ClassHandle))return!1;var t=this.$$.ptrType.registeredClass,r=this.$$.ptr;e.$$=e.$$;for(var n=e.$$.ptrType.registeredClass,a=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;n.baseClass;)a=n.upcast(a),n=n.baseClass;return t===n&&r===a},clone(){if(this.$$.ptr||throwInstanceAlreadyDeleted(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=attachFinalizer(Object.create(Object.getPrototypeOf(this),{$$:{value:shallowCopyInternalPointer(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e},delete(){this.$$.ptr||throwInstanceAlreadyDeleted(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&throwBindingError("Object already scheduled for deletion"),detachFinalizer(this),releaseClassHandle(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||throwInstanceAlreadyDeleted(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&throwBindingError("Object already scheduled for deletion"),deletionQueue.push(this),deletionQueue.length===1&&delayFunction&&delayFunction(flushPendingDeletes),this.$$.deleteScheduled=!0,this}})};function RegisteredClass(e,t,r,n,a,l,c,u){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=a,this.getActualType=l,this.upcast=c,this.downcast=u,this.pureVirtualFunctions=[]}var char_0=48,char_9=57,makeLegalFunctionName=e=>{if(e===void 0)return"_unknown";e=e.replace(/[^a-zA-Z0-9_]/g,"$");var t=e.charCodeAt(0);return t>=char_0&&t<=char_9?"_".concat(e):e};function __embind_register_class(e,t,r,n,a,l,c,u,_,d,f,p,m){e>>>=0,t>>>=0,r>>>=0,n>>>=0,a>>>=0,l>>>=0,c>>>=0,u>>>=0,_>>>=0,d>>>=0,f>>>=0,p>>>=0,m>>>=0,f=readLatin1String(f),l=embind__requireFunction(a,l),u&&(u=embind__requireFunction(c,u)),d&&(d=embind__requireFunction(_,d)),m=embind__requireFunction(p,m);var g=makeLegalFunctionName(f);exposePublicSymbol(g,function(){throwUnboundTypeError("Cannot construct ".concat(f," due to unbound types"),[n])}),whenDependentTypesAreResolved([e,t,r],n?[n]:[],h=>{var E,w;h=h[0];var b,y;n?(b=h.registeredClass,y=b.instancePrototype):y=ClassHandle.prototype;var L=createNamedFunction(f,function(...P){if(Object.getPrototypeOf(this)!==F)throw new BindingError("Use 'new' to construct "+f);if(I.constructor_body===void 0)throw new BindingError(f+" has no accessible constructor");var A=I.constructor_body[P.length];if(A===void 0)throw new BindingError("Tried to invoke ctor of ".concat(f," with invalid number of parameters (").concat(P.length,") - expected (").concat(Object.keys(I.constructor_body).toString(),") parameters instead!"));return A.apply(this,P)}),F=Object.create(y,{constructor:{value:L}});L.prototype=F;var I=new RegisteredClass(f,L,F,m,b,l,u,d);I.baseClass&&((w=(E=I.baseClass).__derivedClasses)!=null||(E.__derivedClasses=[]),I.baseClass.__derivedClasses.push(I));var T=new RegisteredPointer(f,I,!0,!1,!1),S=new RegisteredPointer(f+"*",I,!1,!1,!1),x=new RegisteredPointer(f+" const*",I,!1,!0,!1);return registeredPointers[e]={pointerType:S,constPointerType:x},replacePublicSymbol(g,L),[T,S,x]})}__embind_register_class.sig="vppppppppppppp";var __embind_register_class_constructor=function(e,t,r,n,a,l){e>>>=0,r>>>=0,n>>>=0,a>>>=0,l>>>=0;var c=heap32VectorToArray(t,r);a=embind__requireFunction(n,a);var u=[l],_=[];whenDependentTypesAreResolved([],[e],d=>{d=d[0];var f="constructor ".concat(d.name);if(d.registeredClass.constructor_body===void 0&&(d.registeredClass.constructor_body=[]),d.registeredClass.constructor_body[t-1]!==void 0)throw new BindingError("Cannot register multiple constructors with identical number of parameters (".concat(t-1,") for class '").concat(d.name,"'! Overload resolution is currently only performed using the parameter count, not actual type info!"));return d.registeredClass.constructor_body[t-1]=()=>{throwUnboundTypeError("Cannot construct ".concat(d.name," due to unbound types"),c)},whenDependentTypesAreResolved([],c,p=>(p.splice(1,0,null),d.registeredClass.constructor_body[t-1]=craftInvokerFunction(f,p,null,a,l),[])),[]})};__embind_register_class_constructor.sig="vpipppp";var validateThis=(e,t,r)=>(e instanceof Object||throwBindingError("".concat(r,' with invalid "this": ').concat(e)),e instanceof t.registeredClass.constructor||throwBindingError("".concat(r,' incompatible with "this" of type ').concat(e.constructor.name)),e.$$.ptr||throwBindingError("cannot call emscripten binding method ".concat(r," on deleted object")),upcastPointer(e.$$.ptr,e.$$.ptrType.registeredClass,t.registeredClass)),__embind_register_class_function=function(e,t,r,n,a,l,c,u,_,d){e>>>=0,t>>>=0,n>>>=0,a>>>=0,l>>>=0,c>>>=0;var f=heap32VectorToArray(r,n);t=readLatin1String(t),t=getFunctionName(t),l=embind__requireFunction(a,l),whenDependentTypesAreResolved([],[e],p=>{p=p[0];var m="".concat(p.name,".").concat(t);t.startsWith("@@")&&(t=Symbol[t.substring(2)]),u&&p.registeredClass.pureVirtualFunctions.push(t);function g(){throwUnboundTypeError("Cannot call ".concat(m," due to unbound types"),f)}var h=p.registeredClass.instancePrototype,b=h[t];return b===void 0||b.overloadTable===void 0&&b.className!==p.name&&b.argCount===r-2?(g.argCount=r-2,g.className=p.name,h[t]=g):(ensureOverloadTable(h,t,m),h[t].overloadTable[r-2]=g),whenDependentTypesAreResolved([],f,y=>{var L=craftInvokerFunction(m,y,p,l,c,_);return h[t].overloadTable===void 0?(L.argCount=r-2,h[t]=L):h[t].overloadTable[r-2]=L,[]}),[]})};__embind_register_class_function.sig="vppippppiii";var __embind_register_class_property=function(e,t,r,n,a,l,c,u,_,d){e>>>=0,t>>>=0,r>>>=0,n>>>=0,a>>>=0,l>>>=0,c>>>=0,u>>>=0,_>>>=0,d>>>=0,t=readLatin1String(t),a=embind__requireFunction(n,a),whenDependentTypesAreResolved([],[e],f=>{f=f[0];var p="".concat(f.name,".").concat(t),m={get(){throwUnboundTypeError("Cannot access ".concat(p," due to unbound types"),[r,c])},enumerable:!0,configurable:!0};return _?m.set=()=>throwUnboundTypeError("Cannot access ".concat(p," due to unbound types"),[r,c]):m.set=g=>throwBindingError(p+" is a read-only property"),Object.defineProperty(f.registeredClass.instancePrototype,t,m),whenDependentTypesAreResolved([],_?[r,c]:[r],g=>{var h=g[0],b={get(){var L=validateThis(this,f,p+" getter");return h.fromWireType(a(l,L))},enumerable:!0};if(_){_=embind__requireFunction(u,_);var y=g[1];b.set=function(L){var F=validateThis(this,f,p+" setter"),I=[];_(d,F,y.toWireType(I,L)),runDestructors(I)}}return Object.defineProperty(f.registeredClass.instancePrototype,t,b),[]}),[]})};__embind_register_class_property.sig="vpppppppppp";var __embind_register_class_class_function=function(e,t,r,n,a,l,c,u,_){e>>>=0,t>>>=0,n>>>=0,a>>>=0,l>>>=0,c>>>=0;var d=heap32VectorToArray(r,n);t=readLatin1String(t),t=getFunctionName(t),l=embind__requireFunction(a,l),whenDependentTypesAreResolved([],[e],f=>{f=f[0];var p="".concat(f.name,".").concat(t);function m(){throwUnboundTypeError("Cannot call ".concat(p," due to unbound types"),d)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]);var g=f.registeredClass.constructor;return g[t]===void 0?(m.argCount=r-1,g[t]=m):(ensureOverloadTable(g,t,p),g[t].overloadTable[r-1]=m),whenDependentTypesAreResolved([],d,h=>{var b=[h[0],null].concat(h.slice(1)),y=craftInvokerFunction(p,b,null,l,c,u);if(g[t].overloadTable===void 0?(y.argCount=r-1,g[t]=y):g[t].overloadTable[r-1]=y,f.registeredClass.__derivedClasses)for(let L of f.registeredClass.__derivedClasses)L.constructor.hasOwnProperty(t)||(L.constructor[t]=y);return[]}),[]})};__embind_register_class_class_function.sig="vppippppii";var __embind_register_class_class_property=function(e,t,r,n,a,l,c,u){e>>>=0,t>>>=0,r>>>=0,n>>>=0,a>>>=0,l>>>=0,c>>>=0,u>>>=0,t=readLatin1String(t),l=embind__requireFunction(a,l),whenDependentTypesAreResolved([],[e],_=>{_=_[0];var d="".concat(_.name,".").concat(t),f={get(){throwUnboundTypeError("Cannot access ".concat(d," due to unbound types"),[r])},enumerable:!0,configurable:!0};return u?f.set=()=>{throwUnboundTypeError("Cannot access ".concat(d," due to unbound types"),[r])}:f.set=p=>{throwBindingError("".concat(d," is a read-only property"))},Object.defineProperty(_.registeredClass.constructor,t,f),whenDependentTypesAreResolved([],[r],p=>{p=p[0];var m={get(){return p.fromWireType(l(n))},enumerable:!0};return u&&(u=embind__requireFunction(c,u),m.set=g=>{var h=[];u(n,p.toWireType(h,g)),runDestructors(h)}),Object.defineProperty(_.registeredClass.constructor,t,m),[]}),[]})};__embind_register_class_class_property.sig="vpppppppp";function __embind_create_inheriting_constructor(e,t,r){e>>>=0,t>>>=0,r>>>=0,e=readLatin1String(e),t=requireRegisteredType(t,"wrapper"),r=Emval.toValue(r);var n=t.registeredClass,a=n.instancePrototype,l=n.baseClass,c=l.instancePrototype,u=n.baseClass.constructor,_=createNamedFunction(e,function(...d){n.baseClass.pureVirtualFunctions.forEach((function(f){if(this[f]===c[f])throw new PureVirtualError("Pure virtual function ".concat(f," must be implemented in JavaScript"))}).bind(this)),Object.defineProperty(this,"__parent",{value:a}),this.__construct(...d)});return a.__construct=function(...f){this===a&&throwBindingError("Pass correct 'this' to __construct");var p=u.implement(this,...f);detachFinalizer(p);var m=p.$$;p.notifyOnDestruction(),m.preservePointerOnDelete=!0,Object.defineProperties(this,{$$:{value:m}}),attachFinalizer(this),registerInheritedInstance(n,m.ptr,this)},a.__destruct=function(){this===a&&throwBindingError("Pass correct 'this' to __destruct"),detachFinalizer(this),unregisterInheritedInstance(n,this.$$.ptr)},_.prototype=Object.create(a),Object.assign(_.prototype,r),Emval.toHandle(_)}__embind_create_inheriting_constructor.sig="pppp";var __embind_register_smart_ptr=function(e,t,r,n,a,l,c,u,_,d,f,p){e>>>=0,t>>>=0,r>>>=0,a>>>=0,l>>>=0,c>>>=0,u>>>=0,_>>>=0,d>>>=0,f>>>=0,p>>>=0,r=readLatin1String(r),l=embind__requireFunction(a,l),u=embind__requireFunction(c,u),d=embind__requireFunction(_,d),p=embind__requireFunction(f,p),whenDependentTypesAreResolved([e],[t],m=>{m=m[0];var g=new RegisteredPointer(r,m.registeredClass,!1,!1,!0,m,n,l,u,d,p);return[g]})};__embind_register_smart_ptr.sig="vpppipppppppp";function __embind_register_enum(e,t,r,n){e>>>=0,t>>>=0,r>>>=0,t=readLatin1String(t);function a(){}a.values={},registerType(e,{name:t,constructor:a,fromWireType:function(l){return this.constructor.values[l]},toWireType:(l,c)=>c.value,argPackAdvance:GenericWireTypeSize,readValueFromPointer:enumReadValueFromPointer(t,r,n),destructorFunction:null}),exposePublicSymbol(t,a)}__embind_register_enum.sig="vpppi";function __embind_register_enum_value(e,t,r){e>>>=0,t>>>=0;var n=requireRegisteredType(e,"enum");t=readLatin1String(t);var a=n.constructor,l=Object.create(n.constructor.prototype,{value:{value:r},constructor:{value:createNamedFunction("".concat(n.name,"_").concat(t),function(){})}});a.values[r]=l,a[t]=l}__embind_register_enum_value.sig="vppi";var __embind_register_constant=function(e,t,r){e>>>=0,t>>>=0,e=readLatin1String(e),whenDependentTypesAreResolved([],[t],n=>(n=n[0],Module[e]=n.fromWireType(r),[]))};__embind_register_constant.sig="vppd";var emval_symbols={};function __emval_register_symbol(e){e>>>=0,emval_symbols[e]=readLatin1String(e)}__emval_register_symbol.sig="vp";var getStringOrSymbol=e=>{var t=emval_symbols[e];return t===void 0?readLatin1String(e):t};function __emval_incref(e){e>>>=0,e>9&&(emval_handles[e+1]+=1)}__emval_incref.sig="vp";function __emval_run_destructors(e){e>>>=0;var t=Emval.toValue(e);runDestructors(t),__emval_decref(e)}__emval_run_destructors.sig="vp";function __emval_new_array(){return Emval.toHandle([])}__emval_new_array.sig="p";function __emval_new_array_from_memory_view(e){e>>>=0,e=Emval.toValue(e);for(var t=new Array(e.length),r=0;r>>=0,Emval.toHandle(getStringOrSymbol(e))}__emval_new_cstring.sig="pp";function __emval_new_u8string(e){return e>>>=0,Emval.toHandle(UTF8ToString(e))}__emval_new_u8string.sig="pp";function __emval_new_u16string(e){return e>>>=0,Emval.toHandle(UTF16ToString(e))}__emval_new_u16string.sig="pp";function __emval_take_value(e,t){e>>>=0,t>>>=0,e=requireRegisteredType(e,"_emval_take_value");var r=e.readValueFromPointer(t);return Emval.toHandle(r)}__emval_take_value.sig="ppp";var emval_get_global=()=>typeof globalThis=="object"?globalThis:function(){return Function}()("return this")();function __emval_get_global(e){return e>>>=0,e===0?Emval.toHandle(emval_get_global()):(e=getStringOrSymbol(e),Emval.toHandle(emval_get_global()[e]))}__emval_get_global.sig="pp";function __emval_get_module_property(e){return e>>>=0,e=getStringOrSymbol(e),Emval.toHandle(Module[e])}__emval_get_module_property.sig="pp";function __emval_get_property(e,t){return e>>>=0,t>>>=0,e=Emval.toValue(e),t=Emval.toValue(t),Emval.toHandle(e[t])}__emval_get_property.sig="ppp";function __emval_set_property(e,t,r){e>>>=0,t>>>=0,r>>>=0,e=Emval.toValue(e),t=Emval.toValue(t),r=Emval.toValue(r),e[t]=r}__emval_set_property.sig="vppp";var emval_returnValue=(e,t,r)=>{var n=[],a=e.toWireType(n,r);return n.length&&(HEAPU32[t>>>2>>>0]=Emval.toHandle(n)),a};function __emval_as(e,t,r){return e>>>=0,t>>>=0,r>>>=0,e=Emval.toValue(e),t=requireRegisteredType(t,"emval::as"),emval_returnValue(t,r,e)}__emval_as.sig="dppp";function __emval_as_int64(e,t){return e>>>=0,t>>>=0,e=Emval.toValue(e),t=requireRegisteredType(t,"emval::as"),t.toWireType(null,e)}__emval_as_int64.sig="ipp";function __emval_as_uint64(e,t){return e>>>=0,t>>>=0,e=Emval.toValue(e),t=requireRegisteredType(t,"emval::as"),t.toWireType(null,e)}__emval_as_uint64.sig="ipp";function __emval_equals(e,t){return e>>>=0,t>>>=0,e=Emval.toValue(e),t=Emval.toValue(t),e==t}__emval_equals.sig="ipp";function __emval_strictly_equals(e,t){return e>>>=0,t>>>=0,e=Emval.toValue(e),t=Emval.toValue(t),e===t}__emval_strictly_equals.sig="ipp";function __emval_greater_than(e,t){return e>>>=0,t>>>=0,e=Emval.toValue(e),t=Emval.toValue(t),e>t}__emval_greater_than.sig="ipp";function __emval_less_than(e,t){return e>>>=0,t>>>=0,e=Emval.toValue(e),t=Emval.toValue(t),e>>=0,e=Emval.toValue(e),!e}__emval_not.sig="ip";var emval_methodCallers=[];function __emval_call(e,t,r,n){return e>>>=0,t>>>=0,r>>>=0,n>>>=0,e=emval_methodCallers[e],t=Emval.toValue(t),e(null,t,r,n)}__emval_call.sig="dpppp";var emval_lookupTypes=(e,t)=>{for(var r=new Array(e),n=0;n>>2>>>0],"parameter "+n);return r},emval_addMethodCaller=e=>{var t=emval_methodCallers.length;return emval_methodCallers.push(e),t},reflectConstruct=Reflect.construct;function __emval_get_method_caller(e,t,r){t>>>=0;var n=emval_lookupTypes(e,t),a=n.shift();e--;var l="return function (obj, func, destructorsRef, args) {\n",c=0,u=[];r===0&&u.push("obj");for(var _=["retType"],d=[a],f=0;fh.name).join(", "),") => ").concat(a.name,">");return emval_addMethodCaller(createNamedFunction(g,m))}__emval_get_method_caller.sig="pipi";function __emval_call_method(e,t,r,n,a){return e>>>=0,t>>>=0,r>>>=0,n>>>=0,a>>>=0,e=emval_methodCallers[e],t=Emval.toValue(t),r=getStringOrSymbol(r),e(t,t[r],n,a)}__emval_call_method.sig="dppppp";function __emval_typeof(e){return e>>>=0,e=Emval.toValue(e),Emval.toHandle(typeof e)}__emval_typeof.sig="pp";function __emval_instanceof(e,t){return e>>>=0,t>>>=0,e=Emval.toValue(e),t=Emval.toValue(t),e instanceof t}__emval_instanceof.sig="ipp";function __emval_is_number(e){return e>>>=0,e=Emval.toValue(e),typeof e=="number"}__emval_is_number.sig="ip";function __emval_is_string(e){return e>>>=0,e=Emval.toValue(e),typeof e=="string"}__emval_is_string.sig="ip";function __emval_in(e,t){return e>>>=0,t>>>=0,e=Emval.toValue(e),t=Emval.toValue(t),e in t}__emval_in.sig="ipp";function __emval_delete(e,t){return e>>>=0,t>>>=0,e=Emval.toValue(e),t=Emval.toValue(t),delete e[t]}__emval_delete.sig="ipp";function __emval_throw(e){throw e>>>=0,e=Emval.toValue(e),e}__emval_throw.sig="ip";function __emval_iter_begin(e){return e>>>=0,e=Emval.toValue(e),Emval.toHandle(e[Symbol.iterator]())}__emval_iter_begin.sig="pp";function __emval_iter_next(e){e>>>=0,e=Emval.toValue(e);var t=e.next();return t.done?0:Emval.toHandle(t.value)}__emval_iter_next.sig="pp";var __emval_coro_suspend=function(e,t){e>>>=0,t>>>=0,Emval.toValue(e).then(r=>{__emval_coro_resume(t,Emval.toHandle(r))})};__emval_coro_suspend.sig="vpp";var __emval_coro_make_promise=function(e,t){return e>>>=0,t>>>=0,Emval.toHandle(new Promise((r,n)=>{let a=()=>{try{___cxa_rethrow()}catch(l){n(l)}};HEAPU32[e>>>2>>>0]=Emval.toHandle(r),HEAPU32[t>>>2>>>0]=Emval.toHandle(a)}))};__emval_coro_make_promise.sig="ppp";function _duckdb_web_fs_file_sync(e){return globalThis.DUCKDB_RUNTIME.syncFile(Module,e)}_duckdb_web_fs_file_sync.sig="vi";function _duckdb_web_fs_file_remove(e,t){return globalThis.DUCKDB_RUNTIME.removeFile(Module,e,t)}registerWasmPlugin(),FS.createPreloadedFile=FS_createPreloadedFile,FS.staticInit(),embind_init_charCodes(),BindingError=Module.BindingError=class extends Error{constructor(t){super(t),this.name="BindingError"}},InternalError=Module.InternalError=class extends Error{constructor(t){super(t),this.name="InternalError"}},init_emval(),Module.requestAnimationFrame=MainLoop.requestAnimationFrame,Module.pauseMainLoop=MainLoop.pause,Module.resumeMainLoop=MainLoop.resume,MainLoop.init();for(var i=0;i<32;++i)tempFixedLengthArray.push(new Array(i));for(var miniTempWebGLFloatBuffersStorage=new Float32Array(288),i=0;i<=288;++i)miniTempWebGLFloatBuffers[i]=miniTempWebGLFloatBuffersStorage.subarray(0,i);for(var miniTempWebGLIntBuffersStorage=new Int32Array(288),i=0;i<=288;++i)miniTempWebGLIntBuffers[i]=miniTempWebGLIntBuffersStorage.subarray(0,i);var emSetImmediate,emClearImmediate;if(typeof setImmediate<"u")emSetImmediate=setImmediateWrapped,emClearImmediate=clearImmediateWrapped;else if(typeof addEventListener=="function"){var __setImmediate_id_counter=0,__setImmediate_queue=[],__setImmediate_message_id="_si",__setImmediate_cb=e=>{e.data===__setImmediate_message_id&&(e.stopPropagation(),__setImmediate_queue.shift()(),++__setImmediate_id_counter)};addEventListener("message",__setImmediate_cb,!0),emSetImmediate=e=>(postMessage(__setImmediate_message_id,"*"),__setImmediate_id_counter+__setImmediate_queue.push(e)-1),emClearImmediate=e=>{var t=e-__setImmediate_id_counter;t>=0&&t<__setImmediate_queue.length&&(__setImmediate_queue[t]=()=>{})}}Module.requestFullscreen=Browser.requestFullscreen,Module.setCanvasSize=Browser.setCanvasSize,Module.getUserMedia=Browser.getUserMedia,Module.createContext=Browser.createContext;var preloadedImages={},preloadedAudios={};registerPostMainLoop(()=>{var e,t;return(t=(e=SDL.audio)==null?void 0:e.queueNewAudioData)==null?void 0:t.call(e)}),UnboundTypeError=Module.UnboundTypeError=extendError(Error,"UnboundTypeError"),PureVirtualError=Module.PureVirtualError=extendError(Error,"PureVirtualError"),init_embind(),init_RegisteredPointer(),init_ClassHandle();var wasmImports={IMG_Init:_IMG_Init,IMG_Load:_IMG_Load,IMG_Load_RW:_IMG_Load_RW,IMG_Quit:_IMG_Quit,Mix_AllocateChannels:_Mix_AllocateChannels,Mix_ChannelFinished:_Mix_ChannelFinished,Mix_CloseAudio:_Mix_CloseAudio,Mix_FadeInChannelTimed:_Mix_FadeInChannelTimed,Mix_FadeInMusicPos:_Mix_FadeInMusicPos,Mix_FadeOutChannel:_Mix_FadeOutChannel,Mix_FadeOutMusic:_Mix_FadeOutMusic,Mix_FadingChannel:_Mix_FadingChannel,Mix_FreeChunk:_Mix_FreeChunk,Mix_FreeMusic:_Mix_FreeMusic,Mix_HaltChannel:_Mix_HaltChannel,Mix_HaltMusic:_Mix_HaltMusic,Mix_HookMusicFinished:_Mix_HookMusicFinished,Mix_Init:_Mix_Init,Mix_Linked_Version:_Mix_Linked_Version,Mix_LoadMUS:_Mix_LoadMUS,Mix_LoadMUS_RW:_Mix_LoadMUS_RW,Mix_LoadWAV:_Mix_LoadWAV,Mix_LoadWAV_RW:_Mix_LoadWAV_RW,Mix_OpenAudio:_Mix_OpenAudio,Mix_Pause:_Mix_Pause,Mix_PauseMusic:_Mix_PauseMusic,Mix_Paused:_Mix_Paused,Mix_PausedMusic:_Mix_PausedMusic,Mix_PlayChannelTimed:_Mix_PlayChannelTimed,Mix_PlayMusic:_Mix_PlayMusic,Mix_Playing:_Mix_Playing,Mix_PlayingMusic:_Mix_PlayingMusic,Mix_QuerySpec:_Mix_QuerySpec,Mix_QuickLoad_RAW:_Mix_QuickLoad_RAW,Mix_Quit:_Mix_Quit,Mix_ReserveChannels:_Mix_ReserveChannels,Mix_Resume:_Mix_Resume,Mix_ResumeMusic:_Mix_ResumeMusic,Mix_SetPanning:_Mix_SetPanning,Mix_SetPosition:_Mix_SetPosition,Mix_SetPostMix:_Mix_SetPostMix,Mix_Volume:_Mix_Volume,Mix_VolumeChunk:_Mix_VolumeChunk,Mix_VolumeMusic:_Mix_VolumeMusic,SDL_AddTimer:_SDL_AddTimer,SDL_AllocRW:_SDL_AllocRW,SDL_AudioDriverName:_SDL_AudioDriverName,SDL_AudioQuit:_SDL_AudioQuit,SDL_ClearError:_SDL_ClearError,SDL_CloseAudio:_SDL_CloseAudio,SDL_CondBroadcast:_SDL_CondBroadcast,SDL_CondSignal:_SDL_CondSignal,SDL_CondWait:_SDL_CondWait,SDL_CondWaitTimeout:_SDL_CondWaitTimeout,SDL_ConvertSurface:_SDL_ConvertSurface,SDL_CreateCond:_SDL_CreateCond,SDL_CreateMutex:_SDL_CreateMutex,SDL_CreateRGBSurface:_SDL_CreateRGBSurface,SDL_CreateRGBSurfaceFrom:_SDL_CreateRGBSurfaceFrom,SDL_CreateThread:_SDL_CreateThread,SDL_Delay:_SDL_Delay,SDL_DestroyCond:_SDL_DestroyCond,SDL_DestroyMutex:_SDL_DestroyMutex,SDL_DestroyRenderer:_SDL_DestroyRenderer,SDL_DestroyWindow:_SDL_DestroyWindow,SDL_DisplayFormatAlpha:_SDL_DisplayFormatAlpha,SDL_EnableKeyRepeat:_SDL_EnableKeyRepeat,SDL_EnableUNICODE:_SDL_EnableUNICODE,SDL_FillRect:_SDL_FillRect,SDL_Flip:_SDL_Flip,SDL_FreeRW:_SDL_FreeRW,SDL_FreeSurface:_SDL_FreeSurface,SDL_GL_DeleteContext:_SDL_GL_DeleteContext,SDL_GL_ExtensionSupported:_SDL_GL_ExtensionSupported,SDL_GL_GetAttribute:_SDL_GL_GetAttribute,SDL_GL_GetSwapInterval:_SDL_GL_GetSwapInterval,SDL_GL_MakeCurrent:_SDL_GL_MakeCurrent,SDL_GL_SetAttribute:_SDL_GL_SetAttribute,SDL_GL_SetSwapInterval:_SDL_GL_SetSwapInterval,SDL_GL_SwapBuffers:_SDL_GL_SwapBuffers,SDL_GL_SwapWindow:_SDL_GL_SwapWindow,SDL_GetAppState:_SDL_GetAppState,SDL_GetAudioDriver:_SDL_GetAudioDriver,SDL_GetClipRect:_SDL_GetClipRect,SDL_GetCurrentAudioDriver:_SDL_GetCurrentAudioDriver,SDL_GetError:_SDL_GetError,SDL_GetKeyName:_SDL_GetKeyName,SDL_GetKeyState:_SDL_GetKeyState,SDL_GetKeyboardState:_SDL_GetKeyboardState,SDL_GetModState:_SDL_GetModState,SDL_GetMouseState:_SDL_GetMouseState,SDL_GetNumAudioDrivers:_SDL_GetNumAudioDrivers,SDL_GetRGB:_SDL_GetRGB,SDL_GetRGBA:_SDL_GetRGBA,SDL_GetScancodeFromKey:_SDL_GetScancodeFromKey,SDL_GetThreadID:_SDL_GetThreadID,SDL_GetTicks:_SDL_GetTicks,SDL_GetVideoInfo:_SDL_GetVideoInfo,SDL_GetVideoSurface:_SDL_GetVideoSurface,SDL_GetWindowFlags:_SDL_GetWindowFlags,SDL_GetWindowSize:_SDL_GetWindowSize,SDL_Has3DNow:_SDL_Has3DNow,SDL_Has3DNowExt:_SDL_Has3DNowExt,SDL_HasAltiVec:_SDL_HasAltiVec,SDL_HasMMX:_SDL_HasMMX,SDL_HasMMXExt:_SDL_HasMMXExt,SDL_HasRDTSC:_SDL_HasRDTSC,SDL_HasSSE:_SDL_HasSSE,SDL_HasSSE2:_SDL_HasSSE2,SDL_Init:_SDL_Init,SDL_InitSubSystem:_SDL_InitSubSystem,SDL_JoystickClose:_SDL_JoystickClose,SDL_JoystickEventState:_SDL_JoystickEventState,SDL_JoystickGetAxis:_SDL_JoystickGetAxis,SDL_JoystickGetBall:_SDL_JoystickGetBall,SDL_JoystickGetButton:_SDL_JoystickGetButton,SDL_JoystickGetHat:_SDL_JoystickGetHat,SDL_JoystickIndex:_SDL_JoystickIndex,SDL_JoystickName:_SDL_JoystickName,SDL_JoystickNumAxes:_SDL_JoystickNumAxes,SDL_JoystickNumBalls:_SDL_JoystickNumBalls,SDL_JoystickNumButtons:_SDL_JoystickNumButtons,SDL_JoystickNumHats:_SDL_JoystickNumHats,SDL_JoystickOpen:_SDL_JoystickOpen,SDL_JoystickOpened:_SDL_JoystickOpened,SDL_JoystickUpdate:_SDL_JoystickUpdate,SDL_Linked_Version:_SDL_Linked_Version,SDL_ListModes:_SDL_ListModes,SDL_LoadBMP_RW:_SDL_LoadBMP_RW,SDL_LockAudio:_SDL_LockAudio,SDL_LockSurface:_SDL_LockSurface,SDL_LogSetOutputFunction:_SDL_LogSetOutputFunction,SDL_LowerBlit:_SDL_LowerBlit,SDL_LowerBlitScaled:_SDL_LowerBlitScaled,SDL_MapRGB:_SDL_MapRGB,SDL_MapRGBA:_SDL_MapRGBA,SDL_NumJoysticks:_SDL_NumJoysticks,SDL_OpenAudio:_SDL_OpenAudio,SDL_PauseAudio:_SDL_PauseAudio,SDL_PeepEvents:_SDL_PeepEvents,SDL_PollEvent:_SDL_PollEvent,SDL_PumpEvents:_SDL_PumpEvents,SDL_PushEvent:_SDL_PushEvent,SDL_Quit:_SDL_Quit,SDL_QuitSubSystem:_SDL_QuitSubSystem,SDL_RWFromConstMem:_SDL_RWFromConstMem,SDL_RWFromFile:_SDL_RWFromFile,SDL_RWFromMem:_SDL_RWFromMem,SDL_RemoveTimer:_SDL_RemoveTimer,SDL_SaveBMP_RW:_SDL_SaveBMP_RW,SDL_SetAlpha:_SDL_SetAlpha,SDL_SetClipRect:_SDL_SetClipRect,SDL_SetColorKey:_SDL_SetColorKey,SDL_SetColors:_SDL_SetColors,SDL_SetError:_SDL_SetError,SDL_SetGamma:_SDL_SetGamma,SDL_SetGammaRamp:_SDL_SetGammaRamp,SDL_SetPalette:_SDL_SetPalette,SDL_SetVideoMode:_SDL_SetVideoMode,SDL_SetWindowFullscreen:_SDL_SetWindowFullscreen,SDL_SetWindowTitle:_SDL_SetWindowTitle,SDL_ShowCursor:_SDL_ShowCursor,SDL_StartTextInput:_SDL_StartTextInput,SDL_StopTextInput:_SDL_StopTextInput,SDL_ThreadID:_SDL_ThreadID,SDL_UnlockAudio:_SDL_UnlockAudio,SDL_UnlockSurface:_SDL_UnlockSurface,SDL_UpdateRect:_SDL_UpdateRect,SDL_UpdateRects:_SDL_UpdateRects,SDL_UpperBlit:_SDL_UpperBlit,SDL_UpperBlitScaled:_SDL_UpperBlitScaled,SDL_VideoDriverName:_SDL_VideoDriverName,SDL_VideoModeOK:_SDL_VideoModeOK,SDL_VideoQuit:_SDL_VideoQuit,SDL_WM_GrabInput:_SDL_WM_GrabInput,SDL_WM_IconifyWindow:_SDL_WM_IconifyWindow,SDL_WM_SetCaption:_SDL_WM_SetCaption,SDL_WM_SetIcon:_SDL_WM_SetIcon,SDL_WM_ToggleFullScreen:_SDL_WM_ToggleFullScreen,SDL_WaitThread:_SDL_WaitThread,SDL_WarpMouse:_SDL_WarpMouse,SDL_WasInit:_SDL_WasInit,SDL_mutexP:_SDL_mutexP,SDL_mutexV:_SDL_mutexV,TTF_CloseFont:_TTF_CloseFont,TTF_FontAscent:_TTF_FontAscent,TTF_FontDescent:_TTF_FontDescent,TTF_FontHeight:_TTF_FontHeight,TTF_FontLineSkip:_TTF_FontLineSkip,TTF_GlyphMetrics:_TTF_GlyphMetrics,TTF_Init:_TTF_Init,TTF_OpenFont:_TTF_OpenFont,TTF_Quit:_TTF_Quit,TTF_RenderText_Blended:_TTF_RenderText_Blended,TTF_RenderText_Shaded:_TTF_RenderText_Shaded,TTF_RenderText_Solid:_TTF_RenderText_Solid,TTF_RenderUTF8_Solid:_TTF_RenderUTF8_Solid,TTF_SizeText:_TTF_SizeText,TTF_SizeUTF8:_TTF_SizeUTF8,XChangeWindowAttributes:_XChangeWindowAttributes,XCreateWindow:_XCreateWindow,XInternAtom:_XInternAtom,XMapWindow:_XMapWindow,XOpenDisplay:_XOpenDisplay,XPending:_XPending,XSendEvent:_XSendEvent,XSetWMHints:_XSetWMHints,XStoreName:_XStoreName,_Unwind_Backtrace:__Unwind_Backtrace,_Unwind_FindEnclosingFunction:__Unwind_FindEnclosingFunction,_Unwind_GetIPInfo:__Unwind_GetIPInfo,_ZN18duckdb_skiplistlib9skip_list19_throw_exceeds_sizeEm:__ZN18duckdb_skiplistlib9skip_list19_throw_exceeds_sizeEm,__asctime_r:___asctime_r,__assert_fail:___assert_fail,__c_longjmp:___c_longjmp,__call_sighandler:___call_sighandler,__cpp_exception:___cpp_exception,__global_base:___global_base,__heap_base:___heap_base,__indirect_function_table:wasmTable,__memory_base:___memory_base,__stack_high:___stack_high,__stack_low:___stack_low,__stack_pointer:___stack_pointer,__syscall__newselect:___syscall__newselect,__syscall_accept4:___syscall_accept4,__syscall_bind:___syscall_bind,__syscall_chdir:___syscall_chdir,__syscall_chmod:___syscall_chmod,__syscall_connect:___syscall_connect,__syscall_dup:___syscall_dup,__syscall_dup3:___syscall_dup3,__syscall_faccessat:___syscall_faccessat,__syscall_fadvise64:___syscall_fadvise64,__syscall_fallocate:___syscall_fallocate,__syscall_fchdir:___syscall_fchdir,__syscall_fchmod:___syscall_fchmod,__syscall_fchmodat2:___syscall_fchmodat2,__syscall_fchown32:___syscall_fchown32,__syscall_fchownat:___syscall_fchownat,__syscall_fcntl64:___syscall_fcntl64,__syscall_fdatasync:___syscall_fdatasync,__syscall_fstat64:___syscall_fstat64,__syscall_fstatfs64:___syscall_fstatfs64,__syscall_ftruncate64:___syscall_ftruncate64,__syscall_getcwd:___syscall_getcwd,__syscall_getdents64:___syscall_getdents64,__syscall_getpeername:___syscall_getpeername,__syscall_getsockname:___syscall_getsockname,__syscall_getsockopt:___syscall_getsockopt,__syscall_ioctl:___syscall_ioctl,__syscall_listen:___syscall_listen,__syscall_lstat64:___syscall_lstat64,__syscall_mkdirat:___syscall_mkdirat,__syscall_mknodat:___syscall_mknodat,__syscall_newfstatat:___syscall_newfstatat,__syscall_openat:___syscall_openat,__syscall_pipe:___syscall_pipe,__syscall_poll:___syscall_poll,__syscall_readlinkat:___syscall_readlinkat,__syscall_recvfrom:___syscall_recvfrom,__syscall_recvmsg:___syscall_recvmsg,__syscall_renameat:___syscall_renameat,__syscall_rmdir:___syscall_rmdir,__syscall_sendmsg:___syscall_sendmsg,__syscall_sendto:___syscall_sendto,__syscall_socket:___syscall_socket,__syscall_stat64:___syscall_stat64,__syscall_statfs64:___syscall_statfs64,__syscall_symlink:___syscall_symlink,__syscall_symlinkat:___syscall_symlinkat,__syscall_truncate64:___syscall_truncate64,__syscall_unlinkat:___syscall_unlinkat,__syscall_utimensat:___syscall_utimensat,__table_base:___table_base,_abort_js:__abort_js,_dlopen_js:__dlopen_js,_dlsym_catchup_js:__dlsym_catchup_js,_dlsym_js:__dlsym_js,_embind_create_inheriting_constructor:__embind_create_inheriting_constructor,_embind_finalize_value_array:__embind_finalize_value_array,_embind_finalize_value_object:__embind_finalize_value_object,_embind_register_bigint:__embind_register_bigint,_embind_register_bool:__embind_register_bool,_embind_register_class:__embind_register_class,_embind_register_class_class_function:__embind_register_class_class_function,_embind_register_class_class_property:__embind_register_class_class_property,_embind_register_class_constructor:__embind_register_class_constructor,_embind_register_class_function:__embind_register_class_function,_embind_register_class_property:__embind_register_class_property,_embind_register_constant:__embind_register_constant,_embind_register_emval:__embind_register_emval,_embind_register_enum:__embind_register_enum,_embind_register_enum_value:__embind_register_enum_value,_embind_register_float:__embind_register_float,_embind_register_function:__embind_register_function,_embind_register_integer:__embind_register_integer,_embind_register_memory_view:__embind_register_memory_view,_embind_register_optional:__embind_register_optional,_embind_register_smart_ptr:__embind_register_smart_ptr,_embind_register_std_string:__embind_register_std_string,_embind_register_std_wstring:__embind_register_std_wstring,_embind_register_user_type:__embind_register_user_type,_embind_register_value_array:__embind_register_value_array,_embind_register_value_array_element:__embind_register_value_array_element,_embind_register_value_object:__embind_register_value_object,_embind_register_value_object_field:__embind_register_value_object_field,_embind_register_void:__embind_register_void,_emscripten_dlopen_js:__emscripten_dlopen_js,_emscripten_fs_load_embedded_files:__emscripten_fs_load_embedded_files,_emscripten_get_now_is_monotonic:__emscripten_get_now_is_monotonic,_emscripten_get_progname:__emscripten_get_progname,_emscripten_lookup_name:__emscripten_lookup_name,_emscripten_memcpy_js:__emscripten_memcpy_js,_emscripten_push_main_loop_blocker:__emscripten_push_main_loop_blocker,_emscripten_push_uncounted_main_loop_blocker:__emscripten_push_uncounted_main_loop_blocker,_emscripten_runtime_keepalive_clear:__emscripten_runtime_keepalive_clear,_emscripten_set_offscreencanvas_size:__emscripten_set_offscreencanvas_size,_emscripten_system:__emscripten_system,_emval_as:__emval_as,_emval_as_int64:__emval_as_int64,_emval_as_uint64:__emval_as_uint64,_emval_call:__emval_call,_emval_call_method:__emval_call_method,_emval_coro_make_promise:__emval_coro_make_promise,_emval_coro_suspend:__emval_coro_suspend,_emval_decref:__emval_decref,_emval_delete:__emval_delete,_emval_equals:__emval_equals,_emval_get_global:__emval_get_global,_emval_get_method_caller:__emval_get_method_caller,_emval_get_module_property:__emval_get_module_property,_emval_get_property:__emval_get_property,_emval_greater_than:__emval_greater_than,_emval_in:__emval_in,_emval_incref:__emval_incref,_emval_instanceof:__emval_instanceof,_emval_is_number:__emval_is_number,_emval_is_string:__emval_is_string,_emval_iter_begin:__emval_iter_begin,_emval_iter_next:__emval_iter_next,_emval_less_than:__emval_less_than,_emval_new_array:__emval_new_array,_emval_new_array_from_memory_view:__emval_new_array_from_memory_view,_emval_new_cstring:__emval_new_cstring,_emval_new_object:__emval_new_object,_emval_new_u16string:__emval_new_u16string,_emval_new_u8string:__emval_new_u8string,_emval_not:__emval_not,_emval_register_symbol:__emval_register_symbol,_emval_run_destructors:__emval_run_destructors,_emval_set_property:__emval_set_property,_emval_strictly_equals:__emval_strictly_equals,_emval_take_value:__emval_take_value,_emval_throw:__emval_throw,_emval_typeof:__emval_typeof,_glGetActiveAttribOrUniform:__glGetActiveAttribOrUniform,_gmtime_js:__gmtime_js,_localtime_js:__localtime_js,_mktime_js:__mktime_js,_mmap_js:__mmap_js,_msync_js:__msync_js,_munmap_js:__munmap_js,_setitimer_js:__setitimer_js,_timegm_js:__timegm_js,_tzset_js:__tzset_js,alBuffer3f:_alBuffer3f,alBuffer3i:_alBuffer3i,alBufferData:_alBufferData,alBufferf:_alBufferf,alBufferfv:_alBufferfv,alBufferi:_alBufferi,alBufferiv:_alBufferiv,alDeleteBuffers:_alDeleteBuffers,alDeleteSources:_alDeleteSources,alDisable:_alDisable,alDistanceModel:_alDistanceModel,alDopplerFactor:_alDopplerFactor,alDopplerVelocity:_alDopplerVelocity,alEnable:_alEnable,alGenBuffers:_alGenBuffers,alGenSources:_alGenSources,alGetBoolean:_alGetBoolean,alGetBooleanv:_alGetBooleanv,alGetBuffer3f:_alGetBuffer3f,alGetBuffer3i:_alGetBuffer3i,alGetBufferf:_alGetBufferf,alGetBufferfv:_alGetBufferfv,alGetBufferi:_alGetBufferi,alGetBufferiv:_alGetBufferiv,alGetDouble:_alGetDouble,alGetDoublev:_alGetDoublev,alGetEnumValue:_alGetEnumValue,alGetError:_alGetError,alGetFloat:_alGetFloat,alGetFloatv:_alGetFloatv,alGetInteger:_alGetInteger,alGetIntegerv:_alGetIntegerv,alGetListener3f:_alGetListener3f,alGetListener3i:_alGetListener3i,alGetListenerf:_alGetListenerf,alGetListenerfv:_alGetListenerfv,alGetListeneri:_alGetListeneri,alGetListeneriv:_alGetListeneriv,alGetSource3f:_alGetSource3f,alGetSource3i:_alGetSource3i,alGetSourcef:_alGetSourcef,alGetSourcefv:_alGetSourcefv,alGetSourcei:_alGetSourcei,alGetSourceiv:_alGetSourceiv,alGetString:_alGetString,alIsBuffer:_alIsBuffer,alIsEnabled:_alIsEnabled,alIsExtensionPresent:_alIsExtensionPresent,alIsSource:_alIsSource,alListener3f:_alListener3f,alListener3i:_alListener3i,alListenerf:_alListenerf,alListenerfv:_alListenerfv,alListeneri:_alListeneri,alListeneriv:_alListeneriv,alSource3f:_alSource3f,alSource3i:_alSource3i,alSourcePause:_alSourcePause,alSourcePausev:_alSourcePausev,alSourcePlay:_alSourcePlay,alSourcePlayv:_alSourcePlayv,alSourceQueueBuffers:_alSourceQueueBuffers,alSourceRewind:_alSourceRewind,alSourceRewindv:_alSourceRewindv,alSourceStop:_alSourceStop,alSourceStopv:_alSourceStopv,alSourceUnqueueBuffers:_alSourceUnqueueBuffers,alSourcef:_alSourcef,alSourcefv:_alSourcefv,alSourcei:_alSourcei,alSourceiv:_alSourceiv,alSpeedOfSound:_alSpeedOfSound,alcCaptureCloseDevice:_alcCaptureCloseDevice,alcCaptureOpenDevice:_alcCaptureOpenDevice,alcCaptureSamples:_alcCaptureSamples,alcCaptureStart:_alcCaptureStart,alcCaptureStop:_alcCaptureStop,alcCloseDevice:_alcCloseDevice,alcCreateContext:_alcCreateContext,alcDestroyContext:_alcDestroyContext,alcGetContextsDevice:_alcGetContextsDevice,alcGetCurrentContext:_alcGetCurrentContext,alcGetEnumValue:_alcGetEnumValue,alcGetError:_alcGetError,alcGetIntegerv:_alcGetIntegerv,alcGetString:_alcGetString,alcIsExtensionPresent:_alcIsExtensionPresent,alcMakeContextCurrent:_alcMakeContextCurrent,alcOpenDevice:_alcOpenDevice,alcProcessContext:_alcProcessContext,alcSuspendContext:_alcSuspendContext,boxColor:_boxColor,boxRGBA:_boxRGBA,clock_res_get:_clock_res_get,clock_time_get:_clock_time_get,duckdb_web_fs_directory_create:_duckdb_web_fs_directory_create,duckdb_web_fs_directory_exists:_duckdb_web_fs_directory_exists,duckdb_web_fs_directory_list_files:_duckdb_web_fs_directory_list_files,duckdb_web_fs_directory_remove:_duckdb_web_fs_directory_remove,duckdb_web_fs_file_close:_duckdb_web_fs_file_close,duckdb_web_fs_file_exists:_duckdb_web_fs_file_exists,duckdb_web_fs_file_get_last_modified_time:_duckdb_web_fs_file_get_last_modified_time,duckdb_web_fs_file_move:_duckdb_web_fs_file_move,duckdb_web_fs_file_open:_duckdb_web_fs_file_open,duckdb_web_fs_file_read:_duckdb_web_fs_file_read,duckdb_web_fs_file_remove:_duckdb_web_fs_file_remove,duckdb_web_fs_file_sync:_duckdb_web_fs_file_sync,duckdb_web_fs_file_truncate:_duckdb_web_fs_file_truncate,duckdb_web_fs_file_write:_duckdb_web_fs_file_write,duckdb_web_fs_get_default_data_protocol:_duckdb_web_fs_get_default_data_protocol,duckdb_web_fs_glob:_duckdb_web_fs_glob,duckdb_web_test_platform_feature:_duckdb_web_test_platform_feature,duckdb_web_udf_scalar_call:_duckdb_web_udf_scalar_call,eglBindAPI:_eglBindAPI,eglChooseConfig:_eglChooseConfig,eglCreateContext:_eglCreateContext,eglCreateWindowSurface:_eglCreateWindowSurface,eglDestroyContext:_eglDestroyContext,eglDestroySurface:_eglDestroySurface,eglGetConfigAttrib:_eglGetConfigAttrib,eglGetConfigs:_eglGetConfigs,eglGetCurrentContext:_eglGetCurrentContext,eglGetCurrentDisplay:_eglGetCurrentDisplay,eglGetCurrentSurface:_eglGetCurrentSurface,eglGetDisplay:_eglGetDisplay,eglGetError:_eglGetError,eglInitialize:_eglInitialize,eglMakeCurrent:_eglMakeCurrent,eglQueryAPI:_eglQueryAPI,eglQueryContext:_eglQueryContext,eglQueryString:_eglQueryString,eglQuerySurface:_eglQuerySurface,eglReleaseThread:_eglReleaseThread,eglSwapBuffers:_eglSwapBuffers,eglSwapInterval:_eglSwapInterval,eglTerminate:_eglTerminate,eglWaitClient:_eglWaitClient,eglWaitGL:_eglWaitGL,eglWaitNative:_eglWaitNative,ellipseColor:_ellipseColor,ellipseRGBA:_ellipseRGBA,emscripten_SDL_SetEventHandler:_emscripten_SDL_SetEventHandler,emscripten_alcDevicePauseSOFT:_emscripten_alcDevicePauseSOFT,emscripten_alcDeviceResumeSOFT:_emscripten_alcDeviceResumeSOFT,emscripten_alcGetStringiSOFT:_emscripten_alcGetStringiSOFT,emscripten_alcResetDeviceSOFT:_emscripten_alcResetDeviceSOFT,emscripten_asm_const_async_on_main_thread:_emscripten_asm_const_async_on_main_thread,emscripten_asm_const_double:_emscripten_asm_const_double,emscripten_asm_const_double_sync_on_main_thread:_emscripten_asm_const_double_sync_on_main_thread,emscripten_asm_const_int:_emscripten_asm_const_int,emscripten_asm_const_int_sync_on_main_thread:_emscripten_asm_const_int_sync_on_main_thread,emscripten_asm_const_ptr:_emscripten_asm_const_ptr,emscripten_asm_const_ptr_sync_on_main_thread:_emscripten_asm_const_ptr_sync_on_main_thread,emscripten_async_call:_emscripten_async_call,emscripten_async_load_script:_emscripten_async_load_script,emscripten_async_run_script:_emscripten_async_run_script,emscripten_async_wget:_emscripten_async_wget,emscripten_async_wget2:_emscripten_async_wget2,emscripten_async_wget2_abort:_emscripten_async_wget2_abort,emscripten_async_wget2_data:_emscripten_async_wget2_data,emscripten_async_wget_data:_emscripten_async_wget_data,emscripten_call_worker:_emscripten_call_worker,emscripten_cancel_animation_frame:_emscripten_cancel_animation_frame,emscripten_cancel_main_loop:_emscripten_cancel_main_loop,emscripten_clear_immediate:_emscripten_clear_immediate,emscripten_clear_interval:_emscripten_clear_interval,emscripten_clear_timeout:_emscripten_clear_timeout,emscripten_console_error:_emscripten_console_error,emscripten_console_log:_emscripten_console_log,emscripten_console_trace:_emscripten_console_trace,emscripten_console_warn:_emscripten_console_warn,emscripten_create_worker:_emscripten_create_worker,emscripten_date_now:_emscripten_date_now,emscripten_debugger:_emscripten_debugger,emscripten_destroy_worker:_emscripten_destroy_worker,emscripten_enter_soft_fullscreen:_emscripten_enter_soft_fullscreen,emscripten_err:_emscripten_err,emscripten_errn:_emscripten_errn,emscripten_exit_fullscreen:_emscripten_exit_fullscreen,emscripten_exit_pointerlock:_emscripten_exit_pointerlock,emscripten_exit_soft_fullscreen:_emscripten_exit_soft_fullscreen,emscripten_exit_with_live_runtime:_emscripten_exit_with_live_runtime,emscripten_fiber_swap:_emscripten_fiber_swap,emscripten_force_exit:_emscripten_force_exit,emscripten_get_battery_status:_emscripten_get_battery_status,emscripten_get_callstack:_emscripten_get_callstack,emscripten_get_canvas_element_size:_emscripten_get_canvas_element_size,emscripten_get_canvas_size:_emscripten_get_canvas_size,emscripten_get_compiler_setting:_emscripten_get_compiler_setting,emscripten_get_device_pixel_ratio:_emscripten_get_device_pixel_ratio,emscripten_get_devicemotion_status:_emscripten_get_devicemotion_status,emscripten_get_deviceorientation_status:_emscripten_get_deviceorientation_status,emscripten_get_element_css_size:_emscripten_get_element_css_size,emscripten_get_fullscreen_status:_emscripten_get_fullscreen_status,emscripten_get_gamepad_status:_emscripten_get_gamepad_status,emscripten_get_heap_max:_emscripten_get_heap_max,emscripten_get_main_loop_timing:_emscripten_get_main_loop_timing,emscripten_get_mouse_status:_emscripten_get_mouse_status,emscripten_get_now:_emscripten_get_now,emscripten_get_now_res:_emscripten_get_now_res,emscripten_get_num_gamepads:_emscripten_get_num_gamepads,emscripten_get_orientation_status:_emscripten_get_orientation_status,emscripten_get_pointerlock_status:_emscripten_get_pointerlock_status,emscripten_get_preloaded_image_data:_emscripten_get_preloaded_image_data,emscripten_get_preloaded_image_data_from_FILE:_emscripten_get_preloaded_image_data_from_FILE,emscripten_get_screen_size:_emscripten_get_screen_size,emscripten_get_visibility_status:_emscripten_get_visibility_status,emscripten_get_window_title:_emscripten_get_window_title,emscripten_get_worker_queue_size:_emscripten_get_worker_queue_size,emscripten_glActiveTexture:_emscripten_glActiveTexture,emscripten_glAttachShader:_emscripten_glAttachShader,emscripten_glBegin:_emscripten_glBegin,emscripten_glBeginQueryEXT:_emscripten_glBeginQueryEXT,emscripten_glBindAttribLocation:_emscripten_glBindAttribLocation,emscripten_glBindBuffer:_emscripten_glBindBuffer,emscripten_glBindFramebuffer:_emscripten_glBindFramebuffer,emscripten_glBindRenderbuffer:_emscripten_glBindRenderbuffer,emscripten_glBindTexture:_emscripten_glBindTexture,emscripten_glBindVertexArray:_emscripten_glBindVertexArray,emscripten_glBindVertexArrayOES:_emscripten_glBindVertexArrayOES,emscripten_glBlendColor:_emscripten_glBlendColor,emscripten_glBlendEquation:_emscripten_glBlendEquation,emscripten_glBlendEquationSeparate:_emscripten_glBlendEquationSeparate,emscripten_glBlendFunc:_emscripten_glBlendFunc,emscripten_glBlendFuncSeparate:_emscripten_glBlendFuncSeparate,emscripten_glBufferData:_emscripten_glBufferData,emscripten_glBufferSubData:_emscripten_glBufferSubData,emscripten_glCheckFramebufferStatus:_emscripten_glCheckFramebufferStatus,emscripten_glClear:_emscripten_glClear,emscripten_glClearColor:_emscripten_glClearColor,emscripten_glClearDepth:_emscripten_glClearDepth,emscripten_glClearDepthf:_emscripten_glClearDepthf,emscripten_glClearStencil:_emscripten_glClearStencil,emscripten_glClipControlEXT:_emscripten_glClipControlEXT,emscripten_glColorMask:_emscripten_glColorMask,emscripten_glCompileShader:_emscripten_glCompileShader,emscripten_glCompressedTexImage2D:_emscripten_glCompressedTexImage2D,emscripten_glCompressedTexSubImage2D:_emscripten_glCompressedTexSubImage2D,emscripten_glCopyTexImage2D:_emscripten_glCopyTexImage2D,emscripten_glCopyTexSubImage2D:_emscripten_glCopyTexSubImage2D,emscripten_glCreateProgram:_emscripten_glCreateProgram,emscripten_glCreateShader:_emscripten_glCreateShader,emscripten_glCullFace:_emscripten_glCullFace,emscripten_glDeleteBuffers:_emscripten_glDeleteBuffers,emscripten_glDeleteFramebuffers:_emscripten_glDeleteFramebuffers,emscripten_glDeleteProgram:_emscripten_glDeleteProgram,emscripten_glDeleteQueriesEXT:_emscripten_glDeleteQueriesEXT,emscripten_glDeleteRenderbuffers:_emscripten_glDeleteRenderbuffers,emscripten_glDeleteShader:_emscripten_glDeleteShader,emscripten_glDeleteTextures:_emscripten_glDeleteTextures,emscripten_glDeleteVertexArrays:_emscripten_glDeleteVertexArrays,emscripten_glDeleteVertexArraysOES:_emscripten_glDeleteVertexArraysOES,emscripten_glDepthFunc:_emscripten_glDepthFunc,emscripten_glDepthMask:_emscripten_glDepthMask,emscripten_glDepthRange:_emscripten_glDepthRange,emscripten_glDepthRangef:_emscripten_glDepthRangef,emscripten_glDetachShader:_emscripten_glDetachShader,emscripten_glDisable:_emscripten_glDisable,emscripten_glDisableVertexAttribArray:_emscripten_glDisableVertexAttribArray,emscripten_glDrawArrays:_emscripten_glDrawArrays,emscripten_glDrawArraysInstanced:_emscripten_glDrawArraysInstanced,emscripten_glDrawArraysInstancedANGLE:_emscripten_glDrawArraysInstancedANGLE,emscripten_glDrawArraysInstancedARB:_emscripten_glDrawArraysInstancedARB,emscripten_glDrawArraysInstancedEXT:_emscripten_glDrawArraysInstancedEXT,emscripten_glDrawArraysInstancedNV:_emscripten_glDrawArraysInstancedNV,emscripten_glDrawBuffers:_emscripten_glDrawBuffers,emscripten_glDrawBuffersEXT:_emscripten_glDrawBuffersEXT,emscripten_glDrawBuffersWEBGL:_emscripten_glDrawBuffersWEBGL,emscripten_glDrawElements:_emscripten_glDrawElements,emscripten_glDrawElementsInstanced:_emscripten_glDrawElementsInstanced,emscripten_glDrawElementsInstancedANGLE:_emscripten_glDrawElementsInstancedANGLE,emscripten_glDrawElementsInstancedARB:_emscripten_glDrawElementsInstancedARB,emscripten_glDrawElementsInstancedEXT:_emscripten_glDrawElementsInstancedEXT,emscripten_glDrawElementsInstancedNV:_emscripten_glDrawElementsInstancedNV,emscripten_glEnable:_emscripten_glEnable,emscripten_glEnableVertexAttribArray:_emscripten_glEnableVertexAttribArray,emscripten_glEndQueryEXT:_emscripten_glEndQueryEXT,emscripten_glFinish:_emscripten_glFinish,emscripten_glFlush:_emscripten_glFlush,emscripten_glFramebufferRenderbuffer:_emscripten_glFramebufferRenderbuffer,emscripten_glFramebufferTexture2D:_emscripten_glFramebufferTexture2D,emscripten_glFrontFace:_emscripten_glFrontFace,emscripten_glGenBuffers:_emscripten_glGenBuffers,emscripten_glGenFramebuffers:_emscripten_glGenFramebuffers,emscripten_glGenQueriesEXT:_emscripten_glGenQueriesEXT,emscripten_glGenRenderbuffers:_emscripten_glGenRenderbuffers,emscripten_glGenTextures:_emscripten_glGenTextures,emscripten_glGenVertexArrays:_emscripten_glGenVertexArrays,emscripten_glGenVertexArraysOES:_emscripten_glGenVertexArraysOES,emscripten_glGenerateMipmap:_emscripten_glGenerateMipmap,emscripten_glGetActiveAttrib:_emscripten_glGetActiveAttrib,emscripten_glGetActiveUniform:_emscripten_glGetActiveUniform,emscripten_glGetAttachedShaders:_emscripten_glGetAttachedShaders,emscripten_glGetAttribLocation:_emscripten_glGetAttribLocation,emscripten_glGetBooleanv:_emscripten_glGetBooleanv,emscripten_glGetBufferParameteriv:_emscripten_glGetBufferParameteriv,emscripten_glGetError:_emscripten_glGetError,emscripten_glGetFloatv:_emscripten_glGetFloatv,emscripten_glGetFramebufferAttachmentParameteriv:_emscripten_glGetFramebufferAttachmentParameteriv,emscripten_glGetIntegerv:_emscripten_glGetIntegerv,emscripten_glGetProgramInfoLog:_emscripten_glGetProgramInfoLog,emscripten_glGetProgramiv:_emscripten_glGetProgramiv,emscripten_glGetQueryObjecti64vEXT:_emscripten_glGetQueryObjecti64vEXT,emscripten_glGetQueryObjectivEXT:_emscripten_glGetQueryObjectivEXT,emscripten_glGetQueryObjectui64vEXT:_emscripten_glGetQueryObjectui64vEXT,emscripten_glGetQueryObjectuivEXT:_emscripten_glGetQueryObjectuivEXT,emscripten_glGetQueryivEXT:_emscripten_glGetQueryivEXT,emscripten_glGetRenderbufferParameteriv:_emscripten_glGetRenderbufferParameteriv,emscripten_glGetShaderInfoLog:_emscripten_glGetShaderInfoLog,emscripten_glGetShaderPrecisionFormat:_emscripten_glGetShaderPrecisionFormat,emscripten_glGetShaderSource:_emscripten_glGetShaderSource,emscripten_glGetShaderiv:_emscripten_glGetShaderiv,emscripten_glGetString:_emscripten_glGetString,emscripten_glGetTexParameterfv:_emscripten_glGetTexParameterfv,emscripten_glGetTexParameteriv:_emscripten_glGetTexParameteriv,emscripten_glGetUniformLocation:_emscripten_glGetUniformLocation,emscripten_glGetUniformfv:_emscripten_glGetUniformfv,emscripten_glGetUniformiv:_emscripten_glGetUniformiv,emscripten_glGetVertexAttribPointerv:_emscripten_glGetVertexAttribPointerv,emscripten_glGetVertexAttribfv:_emscripten_glGetVertexAttribfv,emscripten_glGetVertexAttribiv:_emscripten_glGetVertexAttribiv,emscripten_glHint:_emscripten_glHint,emscripten_glIsBuffer:_emscripten_glIsBuffer,emscripten_glIsEnabled:_emscripten_glIsEnabled,emscripten_glIsFramebuffer:_emscripten_glIsFramebuffer,emscripten_glIsProgram:_emscripten_glIsProgram,emscripten_glIsQueryEXT:_emscripten_glIsQueryEXT,emscripten_glIsRenderbuffer:_emscripten_glIsRenderbuffer,emscripten_glIsShader:_emscripten_glIsShader,emscripten_glIsTexture:_emscripten_glIsTexture,emscripten_glIsVertexArray:_emscripten_glIsVertexArray,emscripten_glIsVertexArrayOES:_emscripten_glIsVertexArrayOES,emscripten_glLineWidth:_emscripten_glLineWidth,emscripten_glLinkProgram:_emscripten_glLinkProgram,emscripten_glLoadIdentity:_emscripten_glLoadIdentity,emscripten_glMatrixMode:_emscripten_glMatrixMode,emscripten_glMultiDrawArrays:_emscripten_glMultiDrawArrays,emscripten_glMultiDrawArraysANGLE:_emscripten_glMultiDrawArraysANGLE,emscripten_glMultiDrawArraysInstancedANGLE:_emscripten_glMultiDrawArraysInstancedANGLE,emscripten_glMultiDrawArraysInstancedWEBGL:_emscripten_glMultiDrawArraysInstancedWEBGL,emscripten_glMultiDrawArraysWEBGL:_emscripten_glMultiDrawArraysWEBGL,emscripten_glMultiDrawElements:_emscripten_glMultiDrawElements,emscripten_glMultiDrawElementsANGLE:_emscripten_glMultiDrawElementsANGLE,emscripten_glMultiDrawElementsInstancedANGLE:_emscripten_glMultiDrawElementsInstancedANGLE,emscripten_glMultiDrawElementsInstancedWEBGL:_emscripten_glMultiDrawElementsInstancedWEBGL,emscripten_glMultiDrawElementsWEBGL:_emscripten_glMultiDrawElementsWEBGL,emscripten_glPixelStorei:_emscripten_glPixelStorei,emscripten_glPolygonModeWEBGL:_emscripten_glPolygonModeWEBGL,emscripten_glPolygonOffset:_emscripten_glPolygonOffset,emscripten_glPolygonOffsetClampEXT:_emscripten_glPolygonOffsetClampEXT,emscripten_glQueryCounterEXT:_emscripten_glQueryCounterEXT,emscripten_glReadPixels:_emscripten_glReadPixels,emscripten_glReleaseShaderCompiler:_emscripten_glReleaseShaderCompiler,emscripten_glRenderbufferStorage:_emscripten_glRenderbufferStorage,emscripten_glSampleCoverage:_emscripten_glSampleCoverage,emscripten_glScissor:_emscripten_glScissor,emscripten_glShaderBinary:_emscripten_glShaderBinary,emscripten_glShaderSource:_emscripten_glShaderSource,emscripten_glStencilFunc:_emscripten_glStencilFunc,emscripten_glStencilFuncSeparate:_emscripten_glStencilFuncSeparate,emscripten_glStencilMask:_emscripten_glStencilMask,emscripten_glStencilMaskSeparate:_emscripten_glStencilMaskSeparate,emscripten_glStencilOp:_emscripten_glStencilOp,emscripten_glStencilOpSeparate:_emscripten_glStencilOpSeparate,emscripten_glTexImage2D:_emscripten_glTexImage2D,emscripten_glTexParameterf:_emscripten_glTexParameterf,emscripten_glTexParameterfv:_emscripten_glTexParameterfv,emscripten_glTexParameteri:_emscripten_glTexParameteri,emscripten_glTexParameteriv:_emscripten_glTexParameteriv,emscripten_glTexSubImage2D:_emscripten_glTexSubImage2D,emscripten_glUniform1f:_emscripten_glUniform1f,emscripten_glUniform1fv:_emscripten_glUniform1fv,emscripten_glUniform1i:_emscripten_glUniform1i,emscripten_glUniform1iv:_emscripten_glUniform1iv,emscripten_glUniform2f:_emscripten_glUniform2f,emscripten_glUniform2fv:_emscripten_glUniform2fv,emscripten_glUniform2i:_emscripten_glUniform2i,emscripten_glUniform2iv:_emscripten_glUniform2iv,emscripten_glUniform3f:_emscripten_glUniform3f,emscripten_glUniform3fv:_emscripten_glUniform3fv,emscripten_glUniform3i:_emscripten_glUniform3i,emscripten_glUniform3iv:_emscripten_glUniform3iv,emscripten_glUniform4f:_emscripten_glUniform4f,emscripten_glUniform4fv:_emscripten_glUniform4fv,emscripten_glUniform4i:_emscripten_glUniform4i,emscripten_glUniform4iv:_emscripten_glUniform4iv,emscripten_glUniformMatrix2fv:_emscripten_glUniformMatrix2fv,emscripten_glUniformMatrix3fv:_emscripten_glUniformMatrix3fv,emscripten_glUniformMatrix4fv:_emscripten_glUniformMatrix4fv,emscripten_glUseProgram:_emscripten_glUseProgram,emscripten_glValidateProgram:_emscripten_glValidateProgram,emscripten_glVertexAttrib1f:_emscripten_glVertexAttrib1f,emscripten_glVertexAttrib1fv:_emscripten_glVertexAttrib1fv,emscripten_glVertexAttrib2f:_emscripten_glVertexAttrib2f,emscripten_glVertexAttrib2fv:_emscripten_glVertexAttrib2fv,emscripten_glVertexAttrib3f:_emscripten_glVertexAttrib3f,emscripten_glVertexAttrib3fv:_emscripten_glVertexAttrib3fv,emscripten_glVertexAttrib4f:_emscripten_glVertexAttrib4f,emscripten_glVertexAttrib4fv:_emscripten_glVertexAttrib4fv,emscripten_glVertexAttribDivisor:_emscripten_glVertexAttribDivisor,emscripten_glVertexAttribDivisorANGLE:_emscripten_glVertexAttribDivisorANGLE,emscripten_glVertexAttribDivisorARB:_emscripten_glVertexAttribDivisorARB,emscripten_glVertexAttribDivisorEXT:_emscripten_glVertexAttribDivisorEXT,emscripten_glVertexAttribDivisorNV:_emscripten_glVertexAttribDivisorNV,emscripten_glVertexAttribPointer:_emscripten_glVertexAttribPointer,emscripten_glVertexPointer:_emscripten_glVertexPointer,emscripten_glViewport:_emscripten_glViewport,emscripten_has_asyncify:_emscripten_has_asyncify,emscripten_hide_mouse:_emscripten_hide_mouse,emscripten_html5_remove_all_event_listeners:_emscripten_html5_remove_all_event_listeners,emscripten_idb_async_clear:_emscripten_idb_async_clear,emscripten_idb_async_delete:_emscripten_idb_async_delete,emscripten_idb_async_exists:_emscripten_idb_async_exists,emscripten_idb_async_load:_emscripten_idb_async_load,emscripten_idb_async_store:_emscripten_idb_async_store,emscripten_idb_clear:_emscripten_idb_clear,emscripten_idb_delete:_emscripten_idb_delete,emscripten_idb_exists:_emscripten_idb_exists,emscripten_idb_load:_emscripten_idb_load,emscripten_idb_store:_emscripten_idb_store,emscripten_is_main_browser_thread:_emscripten_is_main_browser_thread,emscripten_is_webgl_context_lost:_emscripten_is_webgl_context_lost,emscripten_lock_orientation:_emscripten_lock_orientation,emscripten_log:_emscripten_log,emscripten_math_acos:_emscripten_math_acos,emscripten_math_acosh:_emscripten_math_acosh,emscripten_math_asin:_emscripten_math_asin,emscripten_math_asinh:_emscripten_math_asinh,emscripten_math_atan:_emscripten_math_atan,emscripten_math_atan2:_emscripten_math_atan2,emscripten_math_atanh:_emscripten_math_atanh,emscripten_math_cbrt:_emscripten_math_cbrt,emscripten_math_cos:_emscripten_math_cos,emscripten_math_cosh:_emscripten_math_cosh,emscripten_math_exp:_emscripten_math_exp,emscripten_math_expm1:_emscripten_math_expm1,emscripten_math_fmod:_emscripten_math_fmod,emscripten_math_hypot:_emscripten_math_hypot,emscripten_math_log:_emscripten_math_log,emscripten_math_log10:_emscripten_math_log10,emscripten_math_log1p:_emscripten_math_log1p,emscripten_math_log2:_emscripten_math_log2,emscripten_math_pow:_emscripten_math_pow,emscripten_math_random:_emscripten_math_random,emscripten_math_round:_emscripten_math_round,emscripten_math_sign:_emscripten_math_sign,emscripten_math_sin:_emscripten_math_sin,emscripten_math_sinh:_emscripten_math_sinh,emscripten_math_sqrt:_emscripten_math_sqrt,emscripten_math_tan:_emscripten_math_tan,emscripten_math_tanh:_emscripten_math_tanh,emscripten_notify_memory_growth:_emscripten_notify_memory_growth,emscripten_out:_emscripten_out,emscripten_outn:_emscripten_outn,emscripten_pause_main_loop:_emscripten_pause_main_loop,emscripten_pc_get_column:_emscripten_pc_get_column,emscripten_pc_get_file:_emscripten_pc_get_file,emscripten_pc_get_function:_emscripten_pc_get_function,emscripten_pc_get_line:_emscripten_pc_get_line,emscripten_performance_now:_emscripten_performance_now,emscripten_print_double:_emscripten_print_double,emscripten_promise_all:_emscripten_promise_all,emscripten_promise_all_settled:_emscripten_promise_all_settled,emscripten_promise_any:_emscripten_promise_any,emscripten_promise_await:_emscripten_promise_await,emscripten_promise_create:_emscripten_promise_create,emscripten_promise_destroy:_emscripten_promise_destroy,emscripten_promise_race:_emscripten_promise_race,emscripten_promise_resolve:_emscripten_promise_resolve,emscripten_promise_then:_emscripten_promise_then,emscripten_random:_emscripten_random,emscripten_request_animation_frame:_emscripten_request_animation_frame,emscripten_request_animation_frame_loop:_emscripten_request_animation_frame_loop,emscripten_request_fullscreen:_emscripten_request_fullscreen,emscripten_request_fullscreen_strategy:_emscripten_request_fullscreen_strategy,emscripten_request_pointerlock:_emscripten_request_pointerlock,emscripten_resize_heap:_emscripten_resize_heap,emscripten_resume_main_loop:_emscripten_resume_main_loop,emscripten_return_address:_emscripten_return_address,emscripten_run_preload_plugins:_emscripten_run_preload_plugins,emscripten_run_preload_plugins_data:_emscripten_run_preload_plugins_data,emscripten_run_script:_emscripten_run_script,emscripten_run_script_int:_emscripten_run_script_int,emscripten_run_script_string:_emscripten_run_script_string,emscripten_runtime_keepalive_check:_emscripten_runtime_keepalive_check,emscripten_runtime_keepalive_pop:_emscripten_runtime_keepalive_pop,emscripten_runtime_keepalive_push:_emscripten_runtime_keepalive_push,emscripten_sample_gamepad_data:_emscripten_sample_gamepad_data,emscripten_scan_registers:_emscripten_scan_registers,emscripten_set_batterychargingchange_callback_on_thread:_emscripten_set_batterychargingchange_callback_on_thread,emscripten_set_batterylevelchange_callback_on_thread:_emscripten_set_batterylevelchange_callback_on_thread,emscripten_set_beforeunload_callback_on_thread:_emscripten_set_beforeunload_callback_on_thread,emscripten_set_blur_callback_on_thread:_emscripten_set_blur_callback_on_thread,emscripten_set_canvas_element_size:_emscripten_set_canvas_element_size,emscripten_set_canvas_size:_emscripten_set_canvas_size,emscripten_set_click_callback_on_thread:_emscripten_set_click_callback_on_thread,emscripten_set_dblclick_callback_on_thread:_emscripten_set_dblclick_callback_on_thread,emscripten_set_devicemotion_callback_on_thread:_emscripten_set_devicemotion_callback_on_thread,emscripten_set_deviceorientation_callback_on_thread:_emscripten_set_deviceorientation_callback_on_thread,emscripten_set_element_css_size:_emscripten_set_element_css_size,emscripten_set_focus_callback_on_thread:_emscripten_set_focus_callback_on_thread,emscripten_set_focusin_callback_on_thread:_emscripten_set_focusin_callback_on_thread,emscripten_set_focusout_callback_on_thread:_emscripten_set_focusout_callback_on_thread,emscripten_set_fullscreenchange_callback_on_thread:_emscripten_set_fullscreenchange_callback_on_thread,emscripten_set_gamepadconnected_callback_on_thread:_emscripten_set_gamepadconnected_callback_on_thread,emscripten_set_gamepaddisconnected_callback_on_thread:_emscripten_set_gamepaddisconnected_callback_on_thread,emscripten_set_immediate:_emscripten_set_immediate,emscripten_set_immediate_loop:_emscripten_set_immediate_loop,emscripten_set_interval:_emscripten_set_interval,emscripten_set_keydown_callback_on_thread:_emscripten_set_keydown_callback_on_thread,emscripten_set_keypress_callback_on_thread:_emscripten_set_keypress_callback_on_thread,emscripten_set_keyup_callback_on_thread:_emscripten_set_keyup_callback_on_thread,emscripten_set_main_loop:_emscripten_set_main_loop,emscripten_set_main_loop_arg:_emscripten_set_main_loop_arg,emscripten_set_main_loop_expected_blockers:_emscripten_set_main_loop_expected_blockers,emscripten_set_main_loop_timing:_emscripten_set_main_loop_timing,emscripten_set_mousedown_callback_on_thread:_emscripten_set_mousedown_callback_on_thread,emscripten_set_mouseenter_callback_on_thread:_emscripten_set_mouseenter_callback_on_thread,emscripten_set_mouseleave_callback_on_thread:_emscripten_set_mouseleave_callback_on_thread,emscripten_set_mousemove_callback_on_thread:_emscripten_set_mousemove_callback_on_thread,emscripten_set_mouseout_callback_on_thread:_emscripten_set_mouseout_callback_on_thread,emscripten_set_mouseover_callback_on_thread:_emscripten_set_mouseover_callback_on_thread,emscripten_set_mouseup_callback_on_thread:_emscripten_set_mouseup_callback_on_thread,emscripten_set_orientationchange_callback_on_thread:_emscripten_set_orientationchange_callback_on_thread,emscripten_set_pointerlockchange_callback_on_thread:_emscripten_set_pointerlockchange_callback_on_thread,emscripten_set_pointerlockerror_callback_on_thread:_emscripten_set_pointerlockerror_callback_on_thread,emscripten_set_resize_callback_on_thread:_emscripten_set_resize_callback_on_thread,emscripten_set_scroll_callback_on_thread:_emscripten_set_scroll_callback_on_thread,emscripten_set_socket_close_callback:_emscripten_set_socket_close_callback,emscripten_set_socket_connection_callback:_emscripten_set_socket_connection_callback,emscripten_set_socket_error_callback:_emscripten_set_socket_error_callback,emscripten_set_socket_listen_callback:_emscripten_set_socket_listen_callback,emscripten_set_socket_message_callback:_emscripten_set_socket_message_callback,emscripten_set_socket_open_callback:_emscripten_set_socket_open_callback,emscripten_set_timeout:_emscripten_set_timeout,emscripten_set_timeout_loop:_emscripten_set_timeout_loop,emscripten_set_touchcancel_callback_on_thread:_emscripten_set_touchcancel_callback_on_thread,emscripten_set_touchend_callback_on_thread:_emscripten_set_touchend_callback_on_thread,emscripten_set_touchmove_callback_on_thread:_emscripten_set_touchmove_callback_on_thread,emscripten_set_touchstart_callback_on_thread:_emscripten_set_touchstart_callback_on_thread,emscripten_set_visibilitychange_callback_on_thread:_emscripten_set_visibilitychange_callback_on_thread,emscripten_set_webglcontextlost_callback_on_thread:_emscripten_set_webglcontextlost_callback_on_thread,emscripten_set_webglcontextrestored_callback_on_thread:_emscripten_set_webglcontextrestored_callback_on_thread,emscripten_set_wheel_callback_on_thread:_emscripten_set_wheel_callback_on_thread,emscripten_set_window_title:_emscripten_set_window_title,emscripten_sleep:_emscripten_sleep,emscripten_stack_snapshot:_emscripten_stack_snapshot,emscripten_stack_unwind_buffer:_emscripten_stack_unwind_buffer,emscripten_supports_offscreencanvas:_emscripten_supports_offscreencanvas,emscripten_throw_number:_emscripten_throw_number,emscripten_throw_string:_emscripten_throw_string,emscripten_unlock_orientation:_emscripten_unlock_orientation,emscripten_unwind_to_js_event_loop:_emscripten_unwind_to_js_event_loop,emscripten_vibrate:_emscripten_vibrate,emscripten_vibrate_pattern:_emscripten_vibrate_pattern,emscripten_webgl_commit_frame:_emscripten_webgl_commit_frame,emscripten_webgl_create_context:_emscripten_webgl_create_context,emscripten_webgl_destroy_context:_emscripten_webgl_destroy_context,emscripten_webgl_do_commit_frame:_emscripten_webgl_do_commit_frame,emscripten_webgl_do_create_context:_emscripten_webgl_do_create_context,emscripten_webgl_do_get_current_context:_emscripten_webgl_do_get_current_context,emscripten_webgl_enable_ANGLE_instanced_arrays:_emscripten_webgl_enable_ANGLE_instanced_arrays,emscripten_webgl_enable_EXT_clip_control:_emscripten_webgl_enable_EXT_clip_control,emscripten_webgl_enable_EXT_polygon_offset_clamp:_emscripten_webgl_enable_EXT_polygon_offset_clamp,emscripten_webgl_enable_OES_vertex_array_object:_emscripten_webgl_enable_OES_vertex_array_object,emscripten_webgl_enable_WEBGL_draw_buffers:_emscripten_webgl_enable_WEBGL_draw_buffers,emscripten_webgl_enable_WEBGL_multi_draw:_emscripten_webgl_enable_WEBGL_multi_draw,emscripten_webgl_enable_WEBGL_polygon_mode:_emscripten_webgl_enable_WEBGL_polygon_mode,emscripten_webgl_enable_extension:_emscripten_webgl_enable_extension,emscripten_webgl_get_context_attributes:_emscripten_webgl_get_context_attributes,emscripten_webgl_get_current_context:_emscripten_webgl_get_current_context,emscripten_webgl_get_drawing_buffer_size:_emscripten_webgl_get_drawing_buffer_size,emscripten_webgl_get_parameter_d:_emscripten_webgl_get_parameter_d,emscripten_webgl_get_parameter_i64v:_emscripten_webgl_get_parameter_i64v,emscripten_webgl_get_parameter_o:_emscripten_webgl_get_parameter_o,emscripten_webgl_get_parameter_utf8:_emscripten_webgl_get_parameter_utf8,emscripten_webgl_get_parameter_v:_emscripten_webgl_get_parameter_v,emscripten_webgl_get_program_info_log_utf8:_emscripten_webgl_get_program_info_log_utf8,emscripten_webgl_get_program_parameter_d:_emscripten_webgl_get_program_parameter_d,emscripten_webgl_get_shader_info_log_utf8:_emscripten_webgl_get_shader_info_log_utf8,emscripten_webgl_get_shader_parameter_d:_emscripten_webgl_get_shader_parameter_d,emscripten_webgl_get_shader_source_utf8:_emscripten_webgl_get_shader_source_utf8,emscripten_webgl_get_supported_extensions:_emscripten_webgl_get_supported_extensions,emscripten_webgl_get_uniform_d:_emscripten_webgl_get_uniform_d,emscripten_webgl_get_uniform_v:_emscripten_webgl_get_uniform_v,emscripten_webgl_get_vertex_attrib_d:_emscripten_webgl_get_vertex_attrib_d,emscripten_webgl_get_vertex_attrib_o:_emscripten_webgl_get_vertex_attrib_o,emscripten_webgl_get_vertex_attrib_v:_emscripten_webgl_get_vertex_attrib_v,emscripten_webgl_make_context_current:_emscripten_webgl_make_context_current,emscripten_wget_data:_emscripten_wget_data,endprotoent:_endprotoent,environ_get:_environ_get,environ_sizes_get:_environ_sizes_get,exit:_exit,fd_close:_fd_close,fd_fdstat_get:_fd_fdstat_get,fd_pread:_fd_pread,fd_pwrite:_fd_pwrite,fd_read:_fd_read,fd_seek:_fd_seek,fd_sync:_fd_sync,fd_write:_fd_write,filledEllipseColor:_filledEllipseColor,filledEllipseRGBA:_filledEllipseRGBA,getaddrinfo:_getaddrinfo,getentropy:_getentropy,getnameinfo:_getnameinfo,getprotobyname:_getprotobyname,getprotobynumber:_getprotobynumber,getprotoent:_getprotoent,glActiveTexture:_glActiveTexture,glAttachShader:_glAttachShader,glBegin:_glBegin,glBeginQueryEXT:_glBeginQueryEXT,glBindAttribLocation:_glBindAttribLocation,glBindBuffer:_glBindBuffer,glBindFramebuffer:_glBindFramebuffer,glBindRenderbuffer:_glBindRenderbuffer,glBindTexture:_glBindTexture,glBindVertexArray:_glBindVertexArray,glBindVertexArrayOES:_glBindVertexArrayOES,glBlendColor:_glBlendColor,glBlendEquation:_glBlendEquation,glBlendEquationSeparate:_glBlendEquationSeparate,glBlendFunc:_glBlendFunc,glBlendFuncSeparate:_glBlendFuncSeparate,glBufferData:_glBufferData,glBufferSubData:_glBufferSubData,glCheckFramebufferStatus:_glCheckFramebufferStatus,glClear:_glClear,glClearColor:_glClearColor,glClearDepth:_glClearDepth,glClearDepthf:_glClearDepthf,glClearStencil:_glClearStencil,glClipControlEXT:_glClipControlEXT,glColorMask:_glColorMask,glCompileShader:_glCompileShader,glCompressedTexImage2D:_glCompressedTexImage2D,glCompressedTexSubImage2D:_glCompressedTexSubImage2D,glCopyTexImage2D:_glCopyTexImage2D,glCopyTexSubImage2D:_glCopyTexSubImage2D,glCreateProgram:_glCreateProgram,glCreateShader:_glCreateShader,glCullFace:_glCullFace,glDeleteBuffers:_glDeleteBuffers,glDeleteFramebuffers:_glDeleteFramebuffers,glDeleteProgram:_glDeleteProgram,glDeleteQueriesEXT:_glDeleteQueriesEXT,glDeleteRenderbuffers:_glDeleteRenderbuffers,glDeleteShader:_glDeleteShader,glDeleteTextures:_glDeleteTextures,glDeleteVertexArrays:_glDeleteVertexArrays,glDeleteVertexArraysOES:_glDeleteVertexArraysOES,glDepthFunc:_glDepthFunc,glDepthMask:_glDepthMask,glDepthRange:_glDepthRange,glDepthRangef:_glDepthRangef,glDetachShader:_glDetachShader,glDisable:_glDisable,glDisableVertexAttribArray:_glDisableVertexAttribArray,glDrawArrays:_glDrawArrays,glDrawArraysInstanced:_glDrawArraysInstanced,glDrawArraysInstancedANGLE:_glDrawArraysInstancedANGLE,glDrawArraysInstancedARB:_glDrawArraysInstancedARB,glDrawArraysInstancedEXT:_glDrawArraysInstancedEXT,glDrawArraysInstancedNV:_glDrawArraysInstancedNV,glDrawBuffers:_glDrawBuffers,glDrawBuffersEXT:_glDrawBuffersEXT,glDrawBuffersWEBGL:_glDrawBuffersWEBGL,glDrawElements:_glDrawElements,glDrawElementsInstanced:_glDrawElementsInstanced,glDrawElementsInstancedANGLE:_glDrawElementsInstancedANGLE,glDrawElementsInstancedARB:_glDrawElementsInstancedARB,glDrawElementsInstancedEXT:_glDrawElementsInstancedEXT,glDrawElementsInstancedNV:_glDrawElementsInstancedNV,glEnable:_glEnable,glEnableVertexAttribArray:_glEnableVertexAttribArray,glEndQueryEXT:_glEndQueryEXT,glFinish:_glFinish,glFlush:_glFlush,glFramebufferRenderbuffer:_glFramebufferRenderbuffer,glFramebufferTexture2D:_glFramebufferTexture2D,glFrontFace:_glFrontFace,glGenBuffers:_glGenBuffers,glGenFramebuffers:_glGenFramebuffers,glGenQueriesEXT:_glGenQueriesEXT,glGenRenderbuffers:_glGenRenderbuffers,glGenTextures:_glGenTextures,glGenVertexArrays:_glGenVertexArrays,glGenVertexArraysOES:_glGenVertexArraysOES,glGenerateMipmap:_glGenerateMipmap,glGetActiveAttrib:_glGetActiveAttrib,glGetActiveUniform:_glGetActiveUniform,glGetAttachedShaders:_glGetAttachedShaders,glGetAttribLocation:_glGetAttribLocation,glGetBooleanv:_glGetBooleanv,glGetBufferParameteriv:_glGetBufferParameteriv,glGetError:_glGetError,glGetFloatv:_glGetFloatv,glGetFramebufferAttachmentParameteriv:_glGetFramebufferAttachmentParameteriv,glGetIntegerv:_glGetIntegerv,glGetProgramInfoLog:_glGetProgramInfoLog,glGetProgramiv:_glGetProgramiv,glGetQueryObjecti64vEXT:_glGetQueryObjecti64vEXT,glGetQueryObjectivEXT:_glGetQueryObjectivEXT,glGetQueryObjectui64vEXT:_glGetQueryObjectui64vEXT,glGetQueryObjectuivEXT:_glGetQueryObjectuivEXT,glGetQueryivEXT:_glGetQueryivEXT,glGetRenderbufferParameteriv:_glGetRenderbufferParameteriv,glGetShaderInfoLog:_glGetShaderInfoLog,glGetShaderPrecisionFormat:_glGetShaderPrecisionFormat,glGetShaderSource:_glGetShaderSource,glGetShaderiv:_glGetShaderiv,glGetString:_glGetString,glGetTexParameterfv:_glGetTexParameterfv,glGetTexParameteriv:_glGetTexParameteriv,glGetUniformLocation:_glGetUniformLocation,glGetUniformfv:_glGetUniformfv,glGetUniformiv:_glGetUniformiv,glGetVertexAttribPointerv:_glGetVertexAttribPointerv,glGetVertexAttribfv:_glGetVertexAttribfv,glGetVertexAttribiv:_glGetVertexAttribiv,glHint:_glHint,glIsBuffer:_glIsBuffer,glIsEnabled:_glIsEnabled,glIsFramebuffer:_glIsFramebuffer,glIsProgram:_glIsProgram,glIsQueryEXT:_glIsQueryEXT,glIsRenderbuffer:_glIsRenderbuffer,glIsShader:_glIsShader,glIsTexture:_glIsTexture,glIsVertexArray:_glIsVertexArray,glIsVertexArrayOES:_glIsVertexArrayOES,glLineWidth:_glLineWidth,glLinkProgram:_glLinkProgram,glLoadIdentity:_glLoadIdentity,glMatrixMode:_glMatrixMode,glMultiDrawArrays:_glMultiDrawArrays,glMultiDrawArraysANGLE:_glMultiDrawArraysANGLE,glMultiDrawArraysInstancedANGLE:_glMultiDrawArraysInstancedANGLE,glMultiDrawArraysInstancedWEBGL:_glMultiDrawArraysInstancedWEBGL,glMultiDrawArraysWEBGL:_glMultiDrawArraysWEBGL,glMultiDrawElements:_glMultiDrawElements,glMultiDrawElementsANGLE:_glMultiDrawElementsANGLE,glMultiDrawElementsInstancedANGLE:_glMultiDrawElementsInstancedANGLE,glMultiDrawElementsInstancedWEBGL:_glMultiDrawElementsInstancedWEBGL,glMultiDrawElementsWEBGL:_glMultiDrawElementsWEBGL,glPixelStorei:_glPixelStorei,glPolygonModeWEBGL:_glPolygonModeWEBGL,glPolygonOffset:_glPolygonOffset,glPolygonOffsetClampEXT:_glPolygonOffsetClampEXT,glQueryCounterEXT:_glQueryCounterEXT,glReadPixels:_glReadPixels,glReleaseShaderCompiler:_glReleaseShaderCompiler,glRenderbufferStorage:_glRenderbufferStorage,glSampleCoverage:_glSampleCoverage,glScissor:_glScissor,glShaderBinary:_glShaderBinary,glShaderSource:_glShaderSource,glStencilFunc:_glStencilFunc,glStencilFuncSeparate:_glStencilFuncSeparate,glStencilMask:_glStencilMask,glStencilMaskSeparate:_glStencilMaskSeparate,glStencilOp:_glStencilOp,glStencilOpSeparate:_glStencilOpSeparate,glTexImage2D:_glTexImage2D,glTexParameterf:_glTexParameterf,glTexParameterfv:_glTexParameterfv,glTexParameteri:_glTexParameteri,glTexParameteriv:_glTexParameteriv,glTexSubImage2D:_glTexSubImage2D,glUniform1f:_glUniform1f,glUniform1fv:_glUniform1fv,glUniform1i:_glUniform1i,glUniform1iv:_glUniform1iv,glUniform2f:_glUniform2f,glUniform2fv:_glUniform2fv,glUniform2i:_glUniform2i,glUniform2iv:_glUniform2iv,glUniform3f:_glUniform3f,glUniform3fv:_glUniform3fv,glUniform3i:_glUniform3i,glUniform3iv:_glUniform3iv,glUniform4f:_glUniform4f,glUniform4fv:_glUniform4fv,glUniform4i:_glUniform4i,glUniform4iv:_glUniform4iv,glUniformMatrix2fv:_glUniformMatrix2fv,glUniformMatrix3fv:_glUniformMatrix3fv,glUniformMatrix4fv:_glUniformMatrix4fv,glUseProgram:_glUseProgram,glValidateProgram:_glValidateProgram,glVertexAttrib1f:_glVertexAttrib1f,glVertexAttrib1fv:_glVertexAttrib1fv,glVertexAttrib2f:_glVertexAttrib2f,glVertexAttrib2fv:_glVertexAttrib2fv,glVertexAttrib3f:_glVertexAttrib3f,glVertexAttrib3fv:_glVertexAttrib3fv,glVertexAttrib4f:_glVertexAttrib4f,glVertexAttrib4fv:_glVertexAttrib4fv,glVertexAttribDivisor:_glVertexAttribDivisor,glVertexAttribDivisorANGLE:_glVertexAttribDivisorANGLE,glVertexAttribDivisorARB:_glVertexAttribDivisorARB,glVertexAttribDivisorEXT:_glVertexAttribDivisorEXT,glVertexAttribDivisorNV:_glVertexAttribDivisorNV,glVertexAttribPointer:_glVertexAttribPointer,glVertexPointer:_glVertexPointer,glViewport:_glViewport,glewGetErrorString:_glewGetErrorString,glewGetExtension:_glewGetExtension,glewGetString:_glewGetString,glewInit:_glewInit,glewIsSupported:_glewIsSupported,glutCreateWindow:_glutCreateWindow,glutDestroyWindow:_glutDestroyWindow,glutDisplayFunc:_glutDisplayFunc,glutFullScreen:_glutFullScreen,glutGet:_glutGet,glutGetModifiers:_glutGetModifiers,glutIdleFunc:_glutIdleFunc,glutInit:_glutInit,glutInitDisplayMode:_glutInitDisplayMode,glutInitWindowPosition:_glutInitWindowPosition,glutInitWindowSize:_glutInitWindowSize,glutKeyboardFunc:_glutKeyboardFunc,glutKeyboardUpFunc:_glutKeyboardUpFunc,glutMainLoop:_glutMainLoop,glutMotionFunc:_glutMotionFunc,glutMouseFunc:_glutMouseFunc,glutPassiveMotionFunc:_glutPassiveMotionFunc,glutPositionWindow:_glutPositionWindow,glutPostRedisplay:_glutPostRedisplay,glutReshapeFunc:_glutReshapeFunc,glutReshapeWindow:_glutReshapeWindow,glutSetCursor:_glutSetCursor,glutSpecialFunc:_glutSpecialFunc,glutSpecialUpFunc:_glutSpecialUpFunc,glutSwapBuffers:_glutSwapBuffers,glutTimerFunc:_glutTimerFunc,lineColor:_lineColor,lineRGBA:_lineRGBA,memory:wasmMemory,pixelRGBA:_pixelRGBA,proc_exit:_proc_exit,pthread_kill:_pthread_kill,random_get:_random_get,rectangleColor:_rectangleColor,rectangleRGBA:_rectangleRGBA,rotozoomSurface:_rotozoomSurface,setNetworkCallback:_setNetworkCallback,setprotoent:_setprotoent,stackAlloc:_stackAlloc,stackRestore:_stackRestore,stackSave:_stackSave,strptime:_strptime,strptime_l:_strptime_l,uuid_clear:_uuid_clear,uuid_compare:_uuid_compare,uuid_copy:_uuid_copy,uuid_generate:_uuid_generate,uuid_is_null:_uuid_is_null,uuid_parse:_uuid_parse,uuid_type:_uuid_type,uuid_unparse:_uuid_unparse,uuid_unparse_lower:_uuid_unparse_lower,uuid_unparse_upper:_uuid_unparse_upper,uuid_variant:_uuid_variant,zoomSurface:_zoomSurface},wasmExports=createWasm(),__emval_coro_resume=(e,t)=>(__emval_coro_resume=wasmExports._emval_coro_resume)(e,t),_main=Module._main=(e,t)=>(_main=Module._main=wasmExports.main)(e,t),_duckdb_web_fs_glob_add_path=Module._duckdb_web_fs_glob_add_path=e=>(_duckdb_web_fs_glob_add_path=Module._duckdb_web_fs_glob_add_path=wasmExports.duckdb_web_fs_glob_add_path)(e),_duckdb_web_clear_response=Module._duckdb_web_clear_response=()=>(_duckdb_web_clear_response=Module._duckdb_web_clear_response=wasmExports.duckdb_web_clear_response)(),_duckdb_web_fail_with=Module._duckdb_web_fail_with=e=>(_duckdb_web_fail_with=Module._duckdb_web_fail_with=wasmExports.duckdb_web_fail_with)(e),_duckdb_web_reset=Module._duckdb_web_reset=e=>(_duckdb_web_reset=Module._duckdb_web_reset=wasmExports.duckdb_web_reset)(e),_duckdb_web_connect=Module._duckdb_web_connect=()=>(_duckdb_web_connect=Module._duckdb_web_connect=wasmExports.duckdb_web_connect)(),_duckdb_web_disconnect=Module._duckdb_web_disconnect=e=>(_duckdb_web_disconnect=Module._duckdb_web_disconnect=wasmExports.duckdb_web_disconnect)(e),_duckdb_web_flush_files=Module._duckdb_web_flush_files=()=>(_duckdb_web_flush_files=Module._duckdb_web_flush_files=wasmExports.duckdb_web_flush_files)(),_duckdb_web_flush_file=Module._duckdb_web_flush_file=e=>(_duckdb_web_flush_file=Module._duckdb_web_flush_file=wasmExports.duckdb_web_flush_file)(e),_duckdb_web_open=Module._duckdb_web_open=(e,t)=>(_duckdb_web_open=Module._duckdb_web_open=wasmExports.duckdb_web_open)(e,t),_duckdb_web_get_global_file_info=Module._duckdb_web_get_global_file_info=(e,t)=>(_duckdb_web_get_global_file_info=Module._duckdb_web_get_global_file_info=wasmExports.duckdb_web_get_global_file_info)(e,t),_duckdb_web_collect_file_stats=Module._duckdb_web_collect_file_stats=(e,t,r)=>(_duckdb_web_collect_file_stats=Module._duckdb_web_collect_file_stats=wasmExports.duckdb_web_collect_file_stats)(e,t,r),_duckdb_web_export_file_stats=Module._duckdb_web_export_file_stats=(e,t)=>(_duckdb_web_export_file_stats=Module._duckdb_web_export_file_stats=wasmExports.duckdb_web_export_file_stats)(e,t),_duckdb_web_fs_drop_file=Module._duckdb_web_fs_drop_file=(e,t)=>(_duckdb_web_fs_drop_file=Module._duckdb_web_fs_drop_file=wasmExports.duckdb_web_fs_drop_file)(e,t),_duckdb_web_fs_drop_files=Module._duckdb_web_fs_drop_files=e=>(_duckdb_web_fs_drop_files=Module._duckdb_web_fs_drop_files=wasmExports.duckdb_web_fs_drop_files)(e),_duckdb_web_fs_glob_file_infos=Module._duckdb_web_fs_glob_file_infos=(e,t)=>(_duckdb_web_fs_glob_file_infos=Module._duckdb_web_fs_glob_file_infos=wasmExports.duckdb_web_fs_glob_file_infos)(e,t),_duckdb_web_fs_get_file_info_by_id=Module._duckdb_web_fs_get_file_info_by_id=(e,t,r)=>(_duckdb_web_fs_get_file_info_by_id=Module._duckdb_web_fs_get_file_info_by_id=wasmExports.duckdb_web_fs_get_file_info_by_id)(e,t,r),_duckdb_web_fs_get_file_info_by_name=Module._duckdb_web_fs_get_file_info_by_name=(e,t,r)=>(_duckdb_web_fs_get_file_info_by_name=Module._duckdb_web_fs_get_file_info_by_name=wasmExports.duckdb_web_fs_get_file_info_by_name)(e,t,r),_duckdb_web_fs_register_file_url=Module._duckdb_web_fs_register_file_url=(e,t,r,n,a)=>(_duckdb_web_fs_register_file_url=Module._duckdb_web_fs_register_file_url=wasmExports.duckdb_web_fs_register_file_url)(e,t,r,n,a),_duckdb_web_fs_register_file_buffer=Module._duckdb_web_fs_register_file_buffer=(e,t,r,n)=>(_duckdb_web_fs_register_file_buffer=Module._duckdb_web_fs_register_file_buffer=wasmExports.duckdb_web_fs_register_file_buffer)(e,t,r,n),_duckdb_web_copy_file_to_buffer=Module._duckdb_web_copy_file_to_buffer=(e,t)=>(_duckdb_web_copy_file_to_buffer=Module._duckdb_web_copy_file_to_buffer=wasmExports.duckdb_web_copy_file_to_buffer)(e,t),_duckdb_web_copy_file_to_path=Module._duckdb_web_copy_file_to_path=(e,t,r)=>(_duckdb_web_copy_file_to_path=Module._duckdb_web_copy_file_to_path=wasmExports.duckdb_web_copy_file_to_path)(e,t,r),_duckdb_web_get_version=Module._duckdb_web_get_version=e=>(_duckdb_web_get_version=Module._duckdb_web_get_version=wasmExports.duckdb_web_get_version)(e),_duckdb_web_get_feature_flags=Module._duckdb_web_get_feature_flags=()=>(_duckdb_web_get_feature_flags=Module._duckdb_web_get_feature_flags=wasmExports.duckdb_web_get_feature_flags)(),_duckdb_web_tokenize=Module._duckdb_web_tokenize=(e,t)=>(_duckdb_web_tokenize=Module._duckdb_web_tokenize=wasmExports.duckdb_web_tokenize)(e,t),_duckdb_web_udf_scalar_create=Module._duckdb_web_udf_scalar_create=(e,t,r)=>(_duckdb_web_udf_scalar_create=Module._duckdb_web_udf_scalar_create=wasmExports.duckdb_web_udf_scalar_create)(e,t,r),_duckdb_web_prepared_create=Module._duckdb_web_prepared_create=(e,t,r)=>(_duckdb_web_prepared_create=Module._duckdb_web_prepared_create=wasmExports.duckdb_web_prepared_create)(e,t,r),_duckdb_web_prepared_close=Module._duckdb_web_prepared_close=(e,t,r)=>(_duckdb_web_prepared_close=Module._duckdb_web_prepared_close=wasmExports.duckdb_web_prepared_close)(e,t,r),_duckdb_web_prepared_run=Module._duckdb_web_prepared_run=(e,t,r,n)=>(_duckdb_web_prepared_run=Module._duckdb_web_prepared_run=wasmExports.duckdb_web_prepared_run)(e,t,r,n),_duckdb_web_prepared_send=Module._duckdb_web_prepared_send=(e,t,r,n)=>(_duckdb_web_prepared_send=Module._duckdb_web_prepared_send=wasmExports.duckdb_web_prepared_send)(e,t,r,n),_duckdb_web_query_run=Module._duckdb_web_query_run=(e,t,r)=>(_duckdb_web_query_run=Module._duckdb_web_query_run=wasmExports.duckdb_web_query_run)(e,t,r),_duckdb_web_query_run_buffer=Module._duckdb_web_query_run_buffer=(e,t,r,n)=>(_duckdb_web_query_run_buffer=Module._duckdb_web_query_run_buffer=wasmExports.duckdb_web_query_run_buffer)(e,t,r,n),_duckdb_web_pending_query_start=Module._duckdb_web_pending_query_start=(e,t,r)=>(_duckdb_web_pending_query_start=Module._duckdb_web_pending_query_start=wasmExports.duckdb_web_pending_query_start)(e,t,r),_duckdb_web_pending_query_poll=Module._duckdb_web_pending_query_poll=(e,t,r)=>(_duckdb_web_pending_query_poll=Module._duckdb_web_pending_query_poll=wasmExports.duckdb_web_pending_query_poll)(e,t,r),_duckdb_web_pending_query_cancel=Module._duckdb_web_pending_query_cancel=(e,t)=>(_duckdb_web_pending_query_cancel=Module._duckdb_web_pending_query_cancel=wasmExports.duckdb_web_pending_query_cancel)(e,t),_duckdb_web_query_fetch_results=Module._duckdb_web_query_fetch_results=(e,t)=>(_duckdb_web_query_fetch_results=Module._duckdb_web_query_fetch_results=wasmExports.duckdb_web_query_fetch_results)(e,t),_duckdb_web_get_tablenames=Module._duckdb_web_get_tablenames=(e,t,r)=>(_duckdb_web_get_tablenames=Module._duckdb_web_get_tablenames=wasmExports.duckdb_web_get_tablenames)(e,t,r),_duckdb_web_insert_arrow_from_ipc_stream=Module._duckdb_web_insert_arrow_from_ipc_stream=(e,t,r,n,a)=>(_duckdb_web_insert_arrow_from_ipc_stream=Module._duckdb_web_insert_arrow_from_ipc_stream=wasmExports.duckdb_web_insert_arrow_from_ipc_stream)(e,t,r,n,a),_duckdb_web_insert_csv_from_path=Module._duckdb_web_insert_csv_from_path=(e,t,r,n)=>(_duckdb_web_insert_csv_from_path=Module._duckdb_web_insert_csv_from_path=wasmExports.duckdb_web_insert_csv_from_path)(e,t,r,n),_duckdb_web_insert_json_from_path=Module._duckdb_web_insert_json_from_path=(e,t,r,n)=>(_duckdb_web_insert_json_from_path=Module._duckdb_web_insert_json_from_path=wasmExports.duckdb_web_insert_json_from_path)(e,t,r,n),___dl_seterr=(e,t)=>(___dl_seterr=wasmExports.__dl_seterr)(e,t),__emscripten_timeout=(e,t)=>(__emscripten_timeout=wasmExports._emscripten_timeout)(e,t),_malloc=Module._malloc=e=>(_malloc=Module._malloc=wasmExports.malloc)(e),_free=Module._free=e=>(_free=Module._free=wasmExports.free)(e),_calloc=Module._calloc=(e,t)=>(_calloc=Module._calloc=wasmExports.calloc)(e,t),_emscripten_builtin_memalign=(e,t)=>(_emscripten_builtin_memalign=wasmExports.emscripten_builtin_memalign)(e,t),__emscripten_tempret_set=e=>(__emscripten_tempret_set=wasmExports._emscripten_tempret_set)(e),__emscripten_tempret_get=()=>(__emscripten_tempret_get=wasmExports._emscripten_tempret_get)(),__emscripten_stack_restore=e=>(__emscripten_stack_restore=wasmExports._emscripten_stack_restore)(e),__emscripten_stack_alloc=e=>(__emscripten_stack_alloc=wasmExports._emscripten_stack_alloc)(e),_emscripten_stack_get_current=()=>(_emscripten_stack_get_current=wasmExports.emscripten_stack_get_current)();function applySignatureConversions(e){e=Object.assign({},e);var t=u=>_=>u(_)>>>0,r=u=>()=>u()>>>0,n=u=>(_,d,f)=>u(_,d,f)>>>0,a=u=>(_,d)=>u(_,d)>>>0,l=u=>_=>u(_)>>>0,c=u=>_=>u(_)>>>0;return e.__getTypeName=t(e.__getTypeName),e.pthread_self=r(e.pthread_self),e.memcpy=n(e.memcpy),e.malloc=t(e.malloc),e.calloc=a(e.calloc),e.__errno_location=r(e.__errno_location),e.strerror=l(e.strerror),e.emscripten_builtin_malloc=t(e.emscripten_builtin_malloc),e.emscripten_stack_get_base=r(e.emscripten_stack_get_base),e.emscripten_stack_get_end=r(e.emscripten_stack_get_end),e.emscripten_builtin_memalign=a(e.emscripten_builtin_memalign),e.emscripten_stack_get_current=r(e.emscripten_stack_get_current),e.emscripten_main_runtime_thread_id=r(e.emscripten_main_runtime_thread_id),e.sbrk=c(e.sbrk),e.memalign=a(e.memalign),e.emscripten_builtin_calloc=a(e.emscripten_builtin_calloc),e._emscripten_stack_alloc=t(e._emscripten_stack_alloc),e.__cxa_get_exception_ptr=t(e.__cxa_get_exception_ptr),e}Module.stackSave=stackSave,Module.stackRestore=stackRestore,Module.stackAlloc=stackAlloc,Module.ccall=ccall;var calledRun;dependenciesFulfilled=function e(){calledRun||run(),calledRun||(dependenciesFulfilled=e)};function callMain(e=[]){var t=resolveGlobalSymbol("main").sym;if(t){e.unshift(thisProgram);var r=e.length,n=stackAlloc((r+1)*4),a=n;e.forEach(c=>{HEAPU32[a>>>2>>>0]=stringToUTF8OnStack(c),a+=4}),HEAPU32[a>>>2>>>0]=0;try{var l=t(r,n);return exitJS(l,!0),l}catch(c){return handleException(c)}}}function run(e=arguments_){if(runDependencies>0||(preRun(),runDependencies>0))return;function t(){var r;calledRun||(calledRun=!0,Module.calledRun=!0,!ABORT&&(initRuntime(),preMain(),readyPromiseResolve(Module),(r=Module.onRuntimeInitialized)==null||r.call(Module),shouldRunNow&&callMain(e),postRun()))}Module.setStatus?(Module.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>Module.setStatus(""),1),t()},1)):t()}if(Module.preInit)for(typeof Module.preInit=="function"&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;return Module.noInitialRun&&(shouldRunNow=!1),run(),moduleRtn=readyPromise,moduleRtn}})();typeof exports=="object"&&typeof module=="object"?module.exports=DuckDB:typeof define=="function"&&define.amd&&define([],()=>DuckDB)});var Gc=fr(()=>{});var Uc=fr(()=>{});var Oc=fr((kS,ga)=>{(function(){"use strict";var o="input is invalid type",e=typeof window=="object",t=e?window:{};t.JS_SHA256_NO_WINDOW&&(e=!1);var r=!e&&typeof self=="object",n=!t.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;n?t=global:r&&(t=self);var a=!t.JS_SHA256_NO_COMMON_JS&&typeof ga=="object"&&ga.exports,l=typeof define=="function"&&define.amd,c=!t.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",u="0123456789abcdef".split(""),_=[-2147483648,8388608,32768,128],d=[24,16,8,0],f=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],p=["hex","array","digest","arrayBuffer"],m=[];(t.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(S){return Object.prototype.toString.call(S)==="[object Array]"}),c&&(t.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(S){return typeof S=="object"&&S.buffer&&S.buffer.constructor===ArrayBuffer});var g=function(S,x){return function(E){return new F(x,!0).update(E)[S]()}},h=function(S){var x=g("hex",S);n&&(x=b(x,S)),x.create=function(){return new F(S)},x.update=function(P){return x.create().update(P)};for(var E=0;E>>2]|=S[P]<>>2]|=w<>>2]|=(192|w>>>6)<>>2]|=(128|w&63)<=57344?(D[A>>>2]|=(224|w>>>12)<>>2]|=(128|w>>>6&63)<>>2]|=(128|w&63)<>>2]|=(240|w>>>18)<>>2]|=(128|w>>>12&63)<>>2]|=(128|w>>>6&63)<>>2]|=(128|w&63)<=64?(this.block=D[16],this.start=A-64,this.hash(),this.hashed=!0):this.start=A}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},F.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var S=this.blocks,x=this.lastByteIndex;S[16]=this.block,S[x>>>2]|=_[x&3],this.block=S[16],x>=56&&(this.hashed||this.hash(),S[0]=this.block,S[16]=S[1]=S[2]=S[3]=S[4]=S[5]=S[6]=S[7]=S[8]=S[9]=S[10]=S[11]=S[12]=S[13]=S[14]=S[15]=0),S[14]=this.hBytes<<3|this.bytes>>>29,S[15]=this.bytes<<3,this.hash()}},F.prototype.hash=function(){var S=this.h0,x=this.h1,E=this.h2,w=this.h3,P=this.h4,A=this.h5,M=this.h6,D=this.h7,C=this.blocks,k,X,Z,oe,Q,ke,Ee,Fe,Zr,Ir,dr;for(k=16;k<64;++k)Q=C[k-15],X=(Q>>>7|Q<<25)^(Q>>>18|Q<<14)^Q>>>3,Q=C[k-2],Z=(Q>>>17|Q<<15)^(Q>>>19|Q<<13)^Q>>>10,C[k]=C[k-16]+X+C[k-7]+Z<<0;for(dr=x&E,k=0;k<64;k+=4)this.first?(this.is224?(Fe=300032,Q=C[0]-1413257819,D=Q-150054599<<0,w=Q+24177077<<0):(Fe=704751109,Q=C[0]-210244248,D=Q-1521486534<<0,w=Q+143694565<<0),this.first=!1):(X=(S>>>2|S<<30)^(S>>>13|S<<19)^(S>>>22|S<<10),Z=(P>>>6|P<<26)^(P>>>11|P<<21)^(P>>>25|P<<7),Fe=S&x,oe=Fe^S&E^dr,Ee=P&A^~P&M,Q=D+Z+Ee+f[k]+C[k],ke=X+oe,D=w+Q<<0,w=Q+ke<<0),X=(w>>>2|w<<30)^(w>>>13|w<<19)^(w>>>22|w<<10),Z=(D>>>6|D<<26)^(D>>>11|D<<21)^(D>>>25|D<<7),Zr=w&S,oe=Zr^w&x^Fe,Ee=D&P^~D&A,Q=M+Z+Ee+f[k+1]+C[k+1],ke=X+oe,M=E+Q<<0,E=Q+ke<<0,X=(E>>>2|E<<30)^(E>>>13|E<<19)^(E>>>22|E<<10),Z=(M>>>6|M<<26)^(M>>>11|M<<21)^(M>>>25|M<<7),Ir=E&w,oe=Ir^E&S^Zr,Ee=M&D^~M&P,Q=A+Z+Ee+f[k+2]+C[k+2],ke=X+oe,A=x+Q<<0,x=Q+ke<<0,X=(x>>>2|x<<30)^(x>>>13|x<<19)^(x>>>22|x<<10),Z=(A>>>6|A<<26)^(A>>>11|A<<21)^(A>>>25|A<<7),dr=x&E,oe=dr^x&w^Ir,Ee=A&M^~A&D,Q=P+Z+Ee+f[k+3]+C[k+3],ke=X+oe,P=S+Q<<0,S=Q+ke<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+S<<0,this.h1=this.h1+x<<0,this.h2=this.h2+E<<0,this.h3=this.h3+w<<0,this.h4=this.h4+P<<0,this.h5=this.h5+A<<0,this.h6=this.h6+M<<0,this.h7=this.h7+D<<0},F.prototype.hex=function(){this.finalize();var S=this.h0,x=this.h1,E=this.h2,w=this.h3,P=this.h4,A=this.h5,M=this.h6,D=this.h7,C=u[S>>>28&15]+u[S>>>24&15]+u[S>>>20&15]+u[S>>>16&15]+u[S>>>12&15]+u[S>>>8&15]+u[S>>>4&15]+u[S&15]+u[x>>>28&15]+u[x>>>24&15]+u[x>>>20&15]+u[x>>>16&15]+u[x>>>12&15]+u[x>>>8&15]+u[x>>>4&15]+u[x&15]+u[E>>>28&15]+u[E>>>24&15]+u[E>>>20&15]+u[E>>>16&15]+u[E>>>12&15]+u[E>>>8&15]+u[E>>>4&15]+u[E&15]+u[w>>>28&15]+u[w>>>24&15]+u[w>>>20&15]+u[w>>>16&15]+u[w>>>12&15]+u[w>>>8&15]+u[w>>>4&15]+u[w&15]+u[P>>>28&15]+u[P>>>24&15]+u[P>>>20&15]+u[P>>>16&15]+u[P>>>12&15]+u[P>>>8&15]+u[P>>>4&15]+u[P&15]+u[A>>>28&15]+u[A>>>24&15]+u[A>>>20&15]+u[A>>>16&15]+u[A>>>12&15]+u[A>>>8&15]+u[A>>>4&15]+u[A&15]+u[M>>>28&15]+u[M>>>24&15]+u[M>>>20&15]+u[M>>>16&15]+u[M>>>12&15]+u[M>>>8&15]+u[M>>>4&15]+u[M&15];return this.is224||(C+=u[D>>>28&15]+u[D>>>24&15]+u[D>>>20&15]+u[D>>>16&15]+u[D>>>12&15]+u[D>>>8&15]+u[D>>>4&15]+u[D&15]),C},F.prototype.toString=F.prototype.hex,F.prototype.digest=function(){this.finalize();var S=this.h0,x=this.h1,E=this.h2,w=this.h3,P=this.h4,A=this.h5,M=this.h6,D=this.h7,C=[S>>>24&255,S>>>16&255,S>>>8&255,S&255,x>>>24&255,x>>>16&255,x>>>8&255,x&255,E>>>24&255,E>>>16&255,E>>>8&255,E&255,w>>>24&255,w>>>16&255,w>>>8&255,w&255,P>>>24&255,P>>>16&255,P>>>8&255,P&255,A>>>24&255,A>>>16&255,A>>>8&255,A&255,M>>>24&255,M>>>16&255,M>>>8&255,M&255];return this.is224||C.push(D>>>24&255,D>>>16&255,D>>>8&255,D&255),C},F.prototype.array=F.prototype.digest,F.prototype.arrayBuffer=function(){this.finalize();var S=new ArrayBuffer(this.is224?28:32),x=new DataView(S);return x.setUint32(0,this.h0),x.setUint32(4,this.h1),x.setUint32(8,this.h2),x.setUint32(12,this.h3),x.setUint32(16,this.h4),x.setUint32(20,this.h5),x.setUint32(24,this.h6),this.is224||x.setUint32(28,this.h7),S};function I(S,x,E){var w,P=typeof S;if(P==="string"){var A=[],M=S.length,D=0,C;for(w=0;w>>6,A[D++]=128|C&63):C<55296||C>=57344?(A[D++]=224|C>>>12,A[D++]=128|C>>>6&63,A[D++]=128|C&63):(C=65536+((C&1023)<<10|S.charCodeAt(++w)&1023),A[D++]=240|C>>>18,A[D++]=128|C>>>12&63,A[D++]=128|C>>>6&63,A[D++]=128|C&63);S=A}else if(P==="object"){if(S===null)throw new Error(o);if(c&&S.constructor===ArrayBuffer)S=new Uint8Array(S);else if(!Array.isArray(S)&&(!c||!ArrayBuffer.isView(S)))throw new Error(o)}else throw new Error(o);S.length>64&&(S=new F(x,!0).update(S).array());var k=[],X=[];for(w=0;w<64;++w){var Z=S[w]||0;k[w]=92^Z,X[w]=54^Z}F.call(this,x,E),this.update(X),this.oKeyPad=k,this.inner=!0,this.sharedMemory=E}I.prototype=new F,I.prototype.finalize=function(){if(F.prototype.finalize.call(this),this.inner){this.inner=!1;var S=this.array();F.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(S),F.prototype.finalize.call(this)}};var T=h();T.sha256=T,T.sha224=h(!0),T.sha256.hmac=L(),T.sha224.hmac=L(!0),a?ga.exports=T:(t.sha256=T.sha256,t.sha224=T.sha224,l&&define(function(){return T}))})()});var Ed={};pr(Ed,{registerWorker:()=>Wc});function Bo(o,e){var t={};for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&e.indexOf(r)<0&&(t[r]=o[r]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(o);n=o.length&&(o=void 0),{value:o&&o[r++],done:!o}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function ee(o){return this instanceof ee?(this.v=o,this):new ee(o)}function Qe(o,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t.apply(o,e||[]),n,a=[];return n={},l("next"),l("throw"),l("return"),n[Symbol.asyncIterator]=function(){return this},n;function l(p){r[p]&&(n[p]=function(m){return new Promise(function(g,h){a.push([p,m,g,h])>1||c(p,m)})})}function c(p,m){try{u(r[p](m))}catch(g){f(a[0][3],g)}}function u(p){p.value instanceof ee?Promise.resolve(p.value.v).then(_,d):f(a[0][2],p)}function _(p){c("next",p)}function d(p){c("throw",p)}function f(p,m){p(m),a.shift(),a.length&&c(a[0][0],a[0][1])}}function en(o){var e,t;return e={},r("next"),r("throw",function(n){throw n}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(n,a){e[n]=o[n]?function(l){return(t=!t)?{value:ee(o[n](l)),done:!1}:a?a(l):l}:a}}function ut(o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=o[Symbol.asyncIterator],t;return e?e.call(o):(o=typeof ko=="function"?ko(o):o[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(a){t[a]=o[a]&&function(l){return new Promise(function(c,u){l=o[a](l),n(c,u,l.done,l.value)})}}function n(a,l,c,u){Promise.resolve(u).then(function(_){a({value:_,done:c})},l)}}var wa={};pr(wa,{compareArrayLike:()=>Ea,joinUint8Arrays:()=>Ye,memcpy:()=>In,rebaseValueOffsets:()=>Gi,toArrayBufferView:()=>re,toArrayBufferViewAsyncIterator:()=>ft,toArrayBufferViewIterator:()=>Pt,toBigInt64Array:()=>Bi,toBigUint64Array:()=>iu,toFloat32Array:()=>su,toFloat32ArrayAsyncIterator:()=>Su,toFloat32ArrayIterator:()=>fu,toFloat64Array:()=>au,toFloat64ArrayAsyncIterator:()=>Eu,toFloat64ArrayIterator:()=>pu,toInt16Array:()=>tu,toInt16ArrayAsyncIterator:()=>hu,toInt16ArrayIterator:()=>cu,toInt32Array:()=>Mr,toInt32ArrayAsyncIterator:()=>vu,toInt32ArrayIterator:()=>uu,toInt8Array:()=>eu,toInt8ArrayAsyncIterator:()=>gu,toInt8ArrayIterator:()=>lu,toUint16Array:()=>ru,toUint16ArrayAsyncIterator:()=>bu,toUint16ArrayIterator:()=>_u,toUint32Array:()=>nu,toUint32ArrayAsyncIterator:()=>yu,toUint32ArrayIterator:()=>du,toUint8Array:()=>j,toUint8ArrayAsyncIterator:()=>Sa,toUint8ArrayIterator:()=>ya,toUint8ClampedArray:()=>ou,toUint8ClampedArrayAsyncIterator:()=>wu,toUint8ClampedArrayIterator:()=>mu});var Yc=new TextDecoder("utf-8"),Tn=o=>Yc.decode(o),Jc=new TextEncoder,Tt=o=>Jc.encode(o);var Kc=o=>typeof o=="number",Go=o=>typeof o=="boolean",Pe=o=>typeof o=="function",He=o=>o!=null&&Object(o)===o,_t=o=>He(o)&&Pe(o.then);var dt=o=>He(o)&&Pe(o[Symbol.iterator]),rt=o=>He(o)&&Pe(o[Symbol.asyncIterator]),Ti=o=>He(o)&&He(o.schema);var Pi=o=>He(o)&&"done"in o&&"value"in o;var Ii=o=>He(o)&&Pe(o.stat)&&Kc(o.fd);var Ci=o=>He(o)&&Pn(o.body),Mi=o=>"_getDOMStream"in o&&"_getNodeStream"in o,Uo=o=>He(o)&&Pe(o.abort)&&Pe(o.getWriter)&&!Mi(o),Pn=o=>He(o)&&Pe(o.cancel)&&Pe(o.getReader)&&!Mi(o),Oo=o=>He(o)&&Pe(o.end)&&Pe(o.write)&&Go(o.writable)&&!Mi(o),ki=o=>He(o)&&Pe(o.read)&&Pe(o.pipe)&&Go(o.readable)&&!Mi(o),Ro=o=>He(o)&&Pe(o.clear)&&Pe(o.bytes)&&Pe(o.position)&&Pe(o.setPosition)&&Pe(o.capacity)&&Pe(o.getBufferIdentifier)&&Pe(o.createLong);var ba=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function Zc(o){let e=o[0]?[o[0]]:[],t,r,n,a;for(let l,c,u=0,_=0,d=o.length;++ud+f.byteLength,0),n,a,l,c=0,u=-1,_=Math.min(e||Number.POSITIVE_INFINITY,r);for(let d=t.length;++ure(Int8Array,o),tu=o=>re(Int16Array,o),Mr=o=>re(Int32Array,o),Bi=o=>re(BigInt64Array,o),j=o=>re(Uint8Array,o),ru=o=>re(Uint16Array,o),nu=o=>re(Uint32Array,o),iu=o=>re(BigUint64Array,o),su=o=>re(Float32Array,o),au=o=>re(Float64Array,o),ou=o=>re(Uint8ClampedArray,o),va=o=>(o.next(),o);function*Pt(o,e){let t=function*(n){yield n},r=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof ba?t(e):dt(e)?e:t(e);return yield*Cr(va(function*(n){let a=null;do a=n.next(yield re(o,a));while(!a.done)}(r[Symbol.iterator]()))),new o}var lu=o=>Pt(Int8Array,o),cu=o=>Pt(Int16Array,o),uu=o=>Pt(Int32Array,o),ya=o=>Pt(Uint8Array,o),_u=o=>Pt(Uint16Array,o),du=o=>Pt(Uint32Array,o),fu=o=>Pt(Float32Array,o),pu=o=>Pt(Float64Array,o),mu=o=>Pt(Uint8ClampedArray,o);function ft(o,e){return Qe(this,arguments,function*(){if(_t(e))return yield ee(yield ee(yield*Cr(en(ut(ft(o,yield ee(e)))))));let r=function(l){return Qe(this,arguments,function*(){yield yield ee(yield ee(l))})},n=function(l){return Qe(this,arguments,function*(){yield ee(yield*Cr(en(ut(va(function*(c){let u=null;do u=c.next(yield u==null?void 0:u.value);while(!u.done)}(l[Symbol.iterator]()))))))})},a=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof ba?r(e):dt(e)?n(e):rt(e)?e:r(e);return yield ee(yield*Cr(en(ut(va(function(l){return Qe(this,arguments,function*(){let c=null;do c=yield ee(l.next(yield yield ee(re(o,c))));while(!c.done)})}(a[Symbol.asyncIterator]())))))),yield ee(new o)})}var gu=o=>ft(Int8Array,o),hu=o=>ft(Int16Array,o),vu=o=>ft(Int32Array,o),Sa=o=>ft(Uint8Array,o),bu=o=>ft(Uint16Array,o),yu=o=>ft(Uint32Array,o),Su=o=>ft(Float32Array,o),Eu=o=>ft(Float64Array,o),wu=o=>ft(Uint8ClampedArray,o);function Gi(o,e,t){if(o!==0){t=t.slice(0,e);for(let r=-1,n=t.length;++r0)do if(o[t]!==e[t])return!1;while(++t(o.next(),o);function*Lu(o){let e,t=!1,r=[],n,a,l,c=0;function u(){return a==="peek"?Ye(r,l)[0]:([n,r,c]=Ye(r,l),n)}({cmd:a,size:l}=(yield null)||{cmd:"read",size:0});let _=ya(o)[Symbol.iterator]();try{do if({done:e,value:n}=Number.isNaN(l-c)?_.next():_.next(l-c),!e&&n.byteLength>0&&(r.push(n),c+=n.byteLength),e||l<=c)do({cmd:a,size:l}=yield u());while(l0&&(n.push(a),u+=a.byteLength),t||c<=u)do({cmd:l,size:c}=yield yield ee(_()));while(c0&&(n.push(j(a)),u+=a.byteLength),t||c<=u)do({cmd:l,size:c}=yield yield ee(_()));while(c{})}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=null}cancel(e){return B(this,void 0,void 0,function*(){let{reader:t,source:r}=this;t&&(yield t.cancel(e).catch(()=>{})),r&&r.locked&&this.releaseLock()})}read(e){return B(this,void 0,void 0,function*(){if(e===0)return{done:this.reader==null,value:new Uint8Array(0)};let t=yield this.reader.read();return!t.done&&(t.value=j(t)),t})}},La=(o,e)=>{let t=n=>r([e,n]),r;return[e,t,new Promise(n=>(r=n)&&o.once(e,t))]};function Fu(o){return Qe(this,arguments,function*(){let t=[],r="error",n=!1,a=null,l,c,u=0,_=[],d;function f(){return l==="peek"?Ye(_,c)[0]:([d,_,u]=Ye(_,c),d)}if({cmd:l,size:c}=(yield yield ee(null))||{cmd:"read",size:0},o.isTTY)return yield yield ee(new Uint8Array(0)),yield ee(null);try{t[0]=La(o,"end"),t[1]=La(o,"error");do{if(t[2]=La(o,"readable"),[r,a]=yield ee(Promise.race(t.map(m=>m[2]))),r==="error")break;if((n=r==="end")||(Number.isFinite(c-u)?(d=j(o.read(c-u)),d.byteLength0&&(_.push(d),u+=d.byteLength)),n||c<=u)do({cmd:l,size:c}=yield yield ee(f()));while(c{for(let[y,L]of m)o.off(y,L);try{let y=o.destroy;y&&y.call(o,g),g=void 0}catch(y){g=y||g}finally{g!=null?b(g):h()}})}})}var ue;(function(o){o[o.V1=0]="V1",o[o.V2=1]="V2",o[o.V3=2]="V3",o[o.V4=3]="V4",o[o.V5=4]="V5"})(ue||(ue={}));var ge;(function(o){o[o.Sparse=0]="Sparse",o[o.Dense=1]="Dense"})(ge||(ge={}));var pe;(function(o){o[o.HALF=0]="HALF",o[o.SINGLE=1]="SINGLE",o[o.DOUBLE=2]="DOUBLE"})(pe||(pe={}));var Ae;(function(o){o[o.DAY=0]="DAY",o[o.MILLISECOND=1]="MILLISECOND"})(Ae||(Ae={}));var U;(function(o){o[o.SECOND=0]="SECOND",o[o.MILLISECOND=1]="MILLISECOND",o[o.MICROSECOND=2]="MICROSECOND",o[o.NANOSECOND=3]="NANOSECOND"})(U||(U={}));var Ie;(function(o){o[o.YEAR_MONTH=0]="YEAR_MONTH",o[o.DAY_TIME=1]="DAY_TIME",o[o.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(Ie||(Ie={}));var It=new Int32Array(2),Oi=new Float32Array(It.buffer),Ri=new Float64Array(It.buffer),tn=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var Cn;(function(o){o[o.UTF8_BYTES=1]="UTF8_BYTES",o[o.UTF16_STRING=2]="UTF16_STRING"})(Cn||(Cn={}));var Je=class o{constructor(e){this.bytes_=e,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(e){return new o(new Uint8Array(e))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(e){this.position_=e}capacity(){return this.bytes_.length}readInt8(e){return this.readUint8(e)<<24>>24}readUint8(e){return this.bytes_[e]}readInt16(e){return this.readUint16(e)<<16>>16}readUint16(e){return this.bytes_[e]|this.bytes_[e+1]<<8}readInt32(e){return this.bytes_[e]|this.bytes_[e+1]<<8|this.bytes_[e+2]<<16|this.bytes_[e+3]<<24}readUint32(e){return this.readInt32(e)>>>0}readInt64(e){return BigInt.asIntN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<>8}writeUint16(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8}writeInt32(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}writeUint32(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}writeInt64(e,t){this.writeInt32(e,Number(BigInt.asIntN(32,t))),this.writeInt32(e+4,Number(BigInt.asIntN(32,t>>BigInt(32))))}writeUint64(e,t){this.writeUint32(e,Number(BigInt.asUintN(32,t))),this.writeUint32(e+4,Number(BigInt.asUintN(32,t>>BigInt(32))))}writeFloat32(e,t){Oi[0]=t,this.writeInt32(e,It[0])}writeFloat64(e,t){Ri[0]=t,this.writeInt32(e,It[tn?0:1]),this.writeInt32(e+4,It[tn?1:0])}getBufferIdentifier(){if(this.bytes_.lengththis.minalign&&(this.minalign=e);let r=~(this.bb.capacity()-this.space+t)+1&e-1;for(;this.space=0&&this.vtable[t]==0;t--);let r=t+1;for(;t>=0;t--)this.addInt16(this.vtable[t]!=0?e-this.vtable[t]:0);let n=2;this.addInt16(e-this.object_start);let a=(r+n)*2;this.addInt16(a);let l=0,c=this.space;e:for(t=0;t=0;l--)this.writeInt8(a.charCodeAt(l))}this.prep(this.minalign,4+n),this.addOffset(e),n&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(e,t){this.finish(e,t,!0)}requiredField(e,t){let r=this.bb.capacity()-e,n=r-this.bb.readInt32(r);if(!(t=0;r--)e.addInt32(t[r]);return e.endVector()}static startTypeIdsVector(e,t){e.startVector(4,t,4)}static endUnion(e){return e.endObject()}static createUnion(e,t,r){return o.startUnion(e),o.addMode(e,t),o.addTypeIds(e,r),o.endUnion(e)}};var Vn=class o{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsUtf8(e,t){return(t||new o).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUtf8(e,t){return e.setPosition(e.position()+4),(t||new o).__init(e.readInt32(e.position())+e.position(),e)}static startUtf8(e){e.startObject(0)}static endUtf8(e){return e.endObject()}static createUtf8(e){return o.startUtf8(e),o.endUtf8(e)}};var he;(function(o){o[o.NONE=0]="NONE",o[o.Null=1]="Null",o[o.Int=2]="Int",o[o.FloatingPoint=3]="FloatingPoint",o[o.Binary=4]="Binary",o[o.Utf8=5]="Utf8",o[o.Bool=6]="Bool",o[o.Decimal=7]="Decimal",o[o.Date=8]="Date",o[o.Time=9]="Time",o[o.Timestamp=10]="Timestamp",o[o.Interval=11]="Interval",o[o.List=12]="List",o[o.Struct_=13]="Struct_",o[o.Union=14]="Union",o[o.FixedSizeBinary=15]="FixedSizeBinary",o[o.FixedSizeList=16]="FixedSizeList",o[o.Map=17]="Map",o[o.Duration=18]="Duration",o[o.LargeBinary=19]="LargeBinary",o[o.LargeUtf8=20]="LargeUtf8",o[o.LargeList=21]="LargeList",o[o.RunEndEncoded=22]="RunEndEncoded"})(he||(he={}));var Re=class o{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsField(e,t){return(t||new o).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsField(e,t){return e.setPosition(e.position()+4),(t||new o).__init(e.readInt32(e.position())+e.position(),e)}name(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}nullable(){let e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}typeType(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readUint8(this.bb_pos+e):he.NONE}type(e){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__union(e,this.bb_pos+t):null}dictionary(e){let t=this.bb.__offset(this.bb_pos,12);return t?(e||new Ct).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}children(e,t){let r=this.bb.__offset(this.bb_pos,14);return r?(t||new o).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+e*4),this.bb):null}childrenLength(){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let r=this.bb.__offset(this.bb_pos,16);return r?(t||new Ce).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.__vector_len(this.bb_pos+e):0}static startField(e){e.startObject(7)}static addName(e,t){e.addFieldOffset(0,t,0)}static addNullable(e,t){e.addFieldInt8(1,+t,0)}static addTypeType(e,t){e.addFieldInt8(2,t,he.NONE)}static addType(e,t){e.addFieldOffset(3,t,0)}static addDictionary(e,t){e.addFieldOffset(4,t,0)}static addChildren(e,t){e.addFieldOffset(5,t,0)}static createChildrenVector(e,t){e.startVector(4,t.length,4);for(let r=t.length-1;r>=0;r--)e.addOffset(t[r]);return e.endVector()}static startChildrenVector(e,t){e.startVector(4,t,4)}static addCustomMetadata(e,t){e.addFieldOffset(6,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let r=t.length-1;r>=0;r--)e.addOffset(t[r]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endField(e){return e.endObject()}};var ze=class o{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSchema(e,t){return(t||new o).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSchema(e,t){return e.setPosition(e.position()+4),(t||new o).__init(e.readInt32(e.position())+e.position(),e)}endianness(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):mr.Little}fields(e,t){let r=this.bb.__offset(this.bb_pos,6);return r?(t||new Re).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+e*4),this.bb):null}fieldsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let r=this.bb.__offset(this.bb_pos,8);return r?(t||new Ce).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}features(e){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb.__vector(this.bb_pos+t)+e*8):BigInt(0)}featuresLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}static startSchema(e){e.startObject(4)}static addEndianness(e,t){e.addFieldInt16(0,t,mr.Little)}static addFields(e,t){e.addFieldOffset(1,t,0)}static createFieldsVector(e,t){e.startVector(4,t.length,4);for(let r=t.length-1;r>=0;r--)e.addOffset(t[r]);return e.endVector()}static startFieldsVector(e,t){e.startVector(4,t,4)}static addCustomMetadata(e,t){e.addFieldOffset(2,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let r=t.length-1;r>=0;r--)e.addOffset(t[r]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static addFeatures(e,t){e.addFieldOffset(3,t,0)}static createFeaturesVector(e,t){e.startVector(8,t.length,8);for(let r=t.length-1;r>=0;r--)e.addInt64(t[r]);return e.endVector()}static startFeaturesVector(e,t){e.startVector(8,t,8)}static endSchema(e){return e.endObject()}static finishSchemaBuffer(e,t){e.finish(t)}static finishSizePrefixedSchemaBuffer(e,t){e.finish(t,void 0,!0)}static createSchema(e,t,r,n,a){return o.startSchema(e),o.addEndianness(e,t),o.addFields(e,r),o.addCustomMetadata(e,n),o.addFeatures(e,a),o.endSchema(e)}};var ie;(function(o){o[o.NONE=0]="NONE",o[o.Schema=1]="Schema",o[o.DictionaryBatch=2]="DictionaryBatch",o[o.RecordBatch=3]="RecordBatch",o[o.Tensor=4]="Tensor",o[o.SparseTensor=5]="SparseTensor"})(ie||(ie={}));var v;(function(o){o[o.NONE=0]="NONE",o[o.Null=1]="Null",o[o.Int=2]="Int",o[o.Float=3]="Float",o[o.Binary=4]="Binary",o[o.Utf8=5]="Utf8",o[o.Bool=6]="Bool",o[o.Decimal=7]="Decimal",o[o.Date=8]="Date",o[o.Time=9]="Time",o[o.Timestamp=10]="Timestamp",o[o.Interval=11]="Interval",o[o.List=12]="List",o[o.Struct=13]="Struct",o[o.Union=14]="Union",o[o.FixedSizeBinary=15]="FixedSizeBinary",o[o.FixedSizeList=16]="FixedSizeList",o[o.Map=17]="Map",o[o.Duration=18]="Duration",o[o.LargeBinary=19]="LargeBinary",o[o.LargeUtf8=20]="LargeUtf8",o[o.Dictionary=-1]="Dictionary",o[o.Int8=-2]="Int8",o[o.Int16=-3]="Int16",o[o.Int32=-4]="Int32",o[o.Int64=-5]="Int64",o[o.Uint8=-6]="Uint8",o[o.Uint16=-7]="Uint16",o[o.Uint32=-8]="Uint32",o[o.Uint64=-9]="Uint64",o[o.Float16=-10]="Float16",o[o.Float32=-11]="Float32",o[o.Float64=-12]="Float64",o[o.DateDay=-13]="DateDay",o[o.DateMillisecond=-14]="DateMillisecond",o[o.TimestampSecond=-15]="TimestampSecond",o[o.TimestampMillisecond=-16]="TimestampMillisecond",o[o.TimestampMicrosecond=-17]="TimestampMicrosecond",o[o.TimestampNanosecond=-18]="TimestampNanosecond",o[o.TimeSecond=-19]="TimeSecond",o[o.TimeMillisecond=-20]="TimeMillisecond",o[o.TimeMicrosecond=-21]="TimeMicrosecond",o[o.TimeNanosecond=-22]="TimeNanosecond",o[o.DenseUnion=-23]="DenseUnion",o[o.SparseUnion=-24]="SparseUnion",o[o.IntervalDayTime=-25]="IntervalDayTime",o[o.IntervalYearMonth=-26]="IntervalYearMonth",o[o.DurationSecond=-27]="DurationSecond",o[o.DurationMillisecond=-28]="DurationMillisecond",o[o.DurationMicrosecond=-29]="DurationMicrosecond",o[o.DurationNanosecond=-30]="DurationNanosecond"})(v||(v={}));var it;(function(o){o[o.OFFSET=0]="OFFSET",o[o.DATA=1]="DATA",o[o.VALIDITY=2]="VALIDITY",o[o.TYPE=3]="TYPE"})(it||(it={}));var ja={};pr(ja,{clampRange:()=>qn,createElementComparator:()=>Dr,wrapIndex:()=>Br});var Da={};pr(Da,{valueToString:()=>ht});function ht(o){if(o===null)return"null";if(o===void 0)return"undefined";switch(typeof o){case"number":return"".concat(o);case"bigint":return"".concat(o);case"string":return'"'.concat(o,'"')}return typeof o[Symbol.toPrimitive]=="function"?o[Symbol.toPrimitive]("string"):ArrayBuffer.isView(o)?o instanceof BigInt64Array||o instanceof BigUint64Array?"[".concat([...o].map(e=>ht(e)),"]"):"[".concat(o,"]"):ArrayBuffer.isView(o)?"[".concat(o,"]"):JSON.stringify(o,(e,t)=>typeof t=="bigint"?"".concat(t):t)}var Pa={};pr(Pa,{BN:()=>jn,bigNumToBigInt:()=>No,bigNumToNumber:()=>Ta,bigNumToString:()=>on,isArrowBigNumSymbol:()=>Ho});function ae(o){if(typeof o=="bigint"&&(oNumber.MAX_SAFE_INTEGER))throw new TypeError("".concat(o," is not safe to convert to a number."));return Number(o)}function Fa(o,e){return ae(o/e)+ae(o%e)/ae(e)}var Ho=Symbol.for("isArrowBigNum");function vt(o,...e){return e.length===0?Object.setPrototypeOf(re(this.TypedArray,o),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(o,...e),this.constructor.prototype)}vt.prototype[Ho]=!0;vt.prototype.toJSON=function(){return'"'.concat(on(this),'"')};vt.prototype.valueOf=function(o){return Ta(this,o)};vt.prototype.toString=function(){return on(this)};vt.prototype[Symbol.toPrimitive]=function(o="default"){switch(o){case"number":return Ta(this);case"string":return on(this);case"default":return No(this)}return on(this)};function sn(...o){return vt.apply(this,o)}function an(...o){return vt.apply(this,o)}function zn(...o){return vt.apply(this,o)}Object.setPrototypeOf(sn.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(an.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(zn.prototype,Object.create(Uint32Array.prototype));Object.assign(sn.prototype,vt.prototype,{constructor:sn,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(an.prototype,vt.prototype,{constructor:an,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(zn.prototype,vt.prototype,{constructor:zn,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});var xu=BigInt(4294967296)*BigInt(4294967296),Tu=xu-BigInt(1);function Ta(o,e){let{buffer:t,byteOffset:r,byteLength:n,signed:a}=o,l=new BigUint64Array(t,r,n/8),c=a&&l.at(-1)&BigInt(1)<=0)return xa(o);e=e.slice();let r=1;for(let a=0;a(o.children=null,o.ArrayType=Array,o.OffsetArrayType=Int32Array,o[Symbol.toStringTag]="DataType"))(G.prototype);var Ne=class extends G{constructor(){super(v.Null)}toString(){return"Null"}};Vo=Symbol.toStringTag;Ne[Vo]=(o=>o[Symbol.toStringTag]="Null")(Ne.prototype);var Me=class extends G{constructor(e,t){super(v.Int),this.isSigned=e,this.bitWidth=t}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw new Error("Unrecognized ".concat(this[Symbol.toStringTag]," type"))}toString(){return"".concat(this.isSigned?"I":"Ui","nt").concat(this.bitWidth)}};zo=Symbol.toStringTag;Me[zo]=(o=>(o.isSigned=null,o.bitWidth=null,o[Symbol.toStringTag]="Int"))(Me.prototype);var Wi=class extends Me{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},Vi=class extends Me{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},kt=class extends Me{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},zi=class extends Me{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},ji=class extends Me{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},$i=class extends Me{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},qi=class extends Me{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},Xi=class extends Me{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(Wi.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(Vi.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(kt.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(zi.prototype,"ArrayType",{value:BigInt64Array});Object.defineProperty(ji.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty($i.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(qi.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(Xi.prototype,"ArrayType",{value:BigUint64Array});var st=class extends G{constructor(e){super(v.Float),this.precision=e}get ArrayType(){switch(this.precision){case pe.HALF:return Uint16Array;case pe.SINGLE:return Float32Array;case pe.DOUBLE:return Float64Array}throw new Error("Unrecognized ".concat(this[Symbol.toStringTag]," type"))}toString(){return"Float".concat(this.precision<<5||16)}};jo=Symbol.toStringTag;st[jo]=(o=>(o.precision=null,o[Symbol.toStringTag]="Float"))(st.prototype);var Qi=class extends st{constructor(){super(pe.HALF)}},Yi=class extends st{constructor(){super(pe.SINGLE)}},Ji=class extends st{constructor(){super(pe.DOUBLE)}};Object.defineProperty(Qi.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(Yi.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(Ji.prototype,"ArrayType",{value:Float64Array});var Vt=class extends G{constructor(){super(v.Binary)}toString(){return"Binary"}};$o=Symbol.toStringTag;Vt[$o]=(o=>(o.ArrayType=Uint8Array,o[Symbol.toStringTag]="Binary"))(Vt.prototype);var zt=class extends G{constructor(){super(v.LargeBinary)}toString(){return"LargeBinary"}};qo=Symbol.toStringTag;zt[qo]=(o=>(o.ArrayType=Uint8Array,o.OffsetArrayType=BigInt64Array,o[Symbol.toStringTag]="LargeBinary"))(zt.prototype);var jt=class extends G{constructor(){super(v.Utf8)}toString(){return"Utf8"}};Xo=Symbol.toStringTag;jt[Xo]=(o=>(o.ArrayType=Uint8Array,o[Symbol.toStringTag]="Utf8"))(jt.prototype);var $t=class extends G{constructor(){super(v.LargeUtf8)}toString(){return"LargeUtf8"}};Qo=Symbol.toStringTag;$t[Qo]=(o=>(o.ArrayType=Uint8Array,o.OffsetArrayType=BigInt64Array,o[Symbol.toStringTag]="LargeUtf8"))($t.prototype);var qt=class extends G{constructor(){super(v.Bool)}toString(){return"Bool"}};Yo=Symbol.toStringTag;qt[Yo]=(o=>(o.ArrayType=Uint8Array,o[Symbol.toStringTag]="Bool"))(qt.prototype);var Xt=class extends G{constructor(e,t,r=128){super(v.Decimal),this.scale=e,this.precision=t,this.bitWidth=r}toString(){return"Decimal[".concat(this.precision,"e").concat(this.scale>0?"+":"").concat(this.scale,"]")}};Jo=Symbol.toStringTag;Xt[Jo]=(o=>(o.scale=null,o.precision=null,o.ArrayType=Uint32Array,o[Symbol.toStringTag]="Decimal"))(Xt.prototype);var Qt=class extends G{constructor(e){super(v.Date),this.unit=e}toString(){return"Date".concat((this.unit+1)*32,"<").concat(Ae[this.unit],">")}get ArrayType(){return this.unit===Ae.DAY?Int32Array:BigInt64Array}};Ko=Symbol.toStringTag;Qt[Ko]=(o=>(o.unit=null,o[Symbol.toStringTag]="Date"))(Qt.prototype);var Yt=class extends G{constructor(e,t){super(v.Time),this.unit=e,this.bitWidth=t}toString(){return"Time".concat(this.bitWidth,"<").concat(U[this.unit],">")}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error("Unrecognized ".concat(this[Symbol.toStringTag]," type"))}};Zo=Symbol.toStringTag;Yt[Zo]=(o=>(o.unit=null,o.bitWidth=null,o[Symbol.toStringTag]="Time"))(Yt.prototype);var Jt=class extends G{constructor(e,t){super(v.Timestamp),this.unit=e,this.timezone=t}toString(){return"Timestamp<".concat(U[this.unit]).concat(this.timezone?", ".concat(this.timezone):"",">")}};el=Symbol.toStringTag;Jt[el]=(o=>(o.unit=null,o.timezone=null,o.ArrayType=BigInt64Array,o[Symbol.toStringTag]="Timestamp"))(Jt.prototype);var Kt=class extends G{constructor(e){super(v.Interval),this.unit=e}toString(){return"Interval<".concat(Ie[this.unit],">")}};tl=Symbol.toStringTag;Kt[tl]=(o=>(o.unit=null,o.ArrayType=Int32Array,o[Symbol.toStringTag]="Interval"))(Kt.prototype);var Zt=class extends G{constructor(e){super(v.Duration),this.unit=e}toString(){return"Duration<".concat(U[this.unit],">")}};rl=Symbol.toStringTag;Zt[rl]=(o=>(o.unit=null,o.ArrayType=BigInt64Array,o[Symbol.toStringTag]="Duration"))(Zt.prototype);var bt=class extends G{constructor(e){super(v.List),this.children=[e]}toString(){return"List<".concat(this.valueType,">")}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};nl=Symbol.toStringTag;bt[nl]=(o=>(o.children=null,o[Symbol.toStringTag]="List"))(bt.prototype);var ve=class extends G{constructor(e){super(v.Struct),this.children=e}toString(){return"Struct<{".concat(this.children.map(e=>"".concat(e.name,":").concat(e.type)).join(", "),"}>")}};il=Symbol.toStringTag;ve[il]=(o=>(o.children=null,o[Symbol.toStringTag]="Struct"))(ve.prototype);var yt=class extends G{constructor(e,t,r){super(v.Union),this.mode=e,this.children=r,this.typeIds=t=Int32Array.from(t),this.typeIdToChildIndex=t.reduce((n,a,l)=>(n[a]=l)&&n||n,Object.create(null))}toString(){return"".concat(this[Symbol.toStringTag],"<").concat(this.children.map(e=>"".concat(e.type)).join(" | "),">")}};sl=Symbol.toStringTag;yt[sl]=(o=>(o.mode=null,o.typeIds=null,o.children=null,o.typeIdToChildIndex=null,o.ArrayType=Int8Array,o[Symbol.toStringTag]="Union"))(yt.prototype);var er=class extends G{constructor(e){super(v.FixedSizeBinary),this.byteWidth=e}toString(){return"FixedSizeBinary[".concat(this.byteWidth,"]")}};al=Symbol.toStringTag;er[al]=(o=>(o.byteWidth=null,o.ArrayType=Uint8Array,o[Symbol.toStringTag]="FixedSizeBinary"))(er.prototype);var St=class extends G{constructor(e,t){super(v.FixedSizeList),this.listSize=e,this.children=[t]}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return"FixedSizeList[".concat(this.listSize,"]<").concat(this.valueType,">")}};ol=Symbol.toStringTag;St[ol]=(o=>(o.children=null,o.listSize=null,o[Symbol.toStringTag]="FixedSizeList"))(St.prototype);var Et=class extends G{constructor(e,t=!1){var r,n,a;if(super(v.Map),this.children=[e],this.keysSorted=t,e&&(e.name="entries",!((r=e==null?void 0:e.type)===null||r===void 0)&&r.children)){let l=(n=e==null?void 0:e.type)===null||n===void 0?void 0:n.children[0];l&&(l.name="key");let c=(a=e==null?void 0:e.type)===null||a===void 0?void 0:a.children[1];c&&(c.name="value")}}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return"Map<{".concat(this.children[0].type.children.map(e=>"".concat(e.name,":").concat(e.type)).join(", "),"}>")}};ll=Symbol.toStringTag;Et[ll]=(o=>(o.children=null,o.keysSorted=null,o[Symbol.toStringTag]="Map_"))(Et.prototype);var Pu=(o=>()=>++o)(-1),Ze=class extends G{constructor(e,t,r,n){super(v.Dictionary),this.indices=t,this.dictionary=e,this.isOrdered=n||!1,this.id=r==null?Pu():ae(r)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return"Dictionary<".concat(this.indices,", ").concat(this.dictionary,">")}};cl=Symbol.toStringTag;Ze[cl]=(o=>(o.id=null,o.indices=null,o.isOrdered=null,o.dictionary=null,o[Symbol.toStringTag]="Dictionary"))(Ze.prototype);function et(o){let e=o;switch(o.typeId){case v.Decimal:return o.bitWidth/32;case v.Interval:return 1+e.unit;case v.FixedSizeList:return e.listSize;case v.FixedSizeBinary:return e.byteWidth;default:return 1}}var R=class{visitMany(e,...t){return e.map((r,n)=>this.visit(r,...t.map(a=>a[n])))}visit(...e){return this.getVisitFn(e[0],!1).apply(this,e)}getVisitFn(e,t=!0){return Iu(this,e,t)}getVisitFnByTypeId(e,t=!0){return ln(this,e,t)}visitNull(e,...t){return null}visitBool(e,...t){return null}visitInt(e,...t){return null}visitFloat(e,...t){return null}visitUtf8(e,...t){return null}visitLargeUtf8(e,...t){return null}visitBinary(e,...t){return null}visitLargeBinary(e,...t){return null}visitFixedSizeBinary(e,...t){return null}visitDate(e,...t){return null}visitTimestamp(e,...t){return null}visitTime(e,...t){return null}visitDecimal(e,...t){return null}visitList(e,...t){return null}visitStruct(e,...t){return null}visitUnion(e,...t){return null}visitDictionary(e,...t){return null}visitInterval(e,...t){return null}visitDuration(e,...t){return null}visitFixedSizeList(e,...t){return null}visitMap(e,...t){return null}};function Iu(o,e,t=!0){return typeof e=="number"?ln(o,e,t):typeof e=="string"&&e in v?ln(o,v[e],t):e&&e instanceof G?ln(o,ul(e),t):e!=null&&e.type&&e.type instanceof G?ln(o,ul(e.type),t):ln(o,v.NONE,t)}function ln(o,e,t=!0){let r=null;switch(e){case v.Null:r=o.visitNull;break;case v.Bool:r=o.visitBool;break;case v.Int:r=o.visitInt;break;case v.Int8:r=o.visitInt8||o.visitInt;break;case v.Int16:r=o.visitInt16||o.visitInt;break;case v.Int32:r=o.visitInt32||o.visitInt;break;case v.Int64:r=o.visitInt64||o.visitInt;break;case v.Uint8:r=o.visitUint8||o.visitInt;break;case v.Uint16:r=o.visitUint16||o.visitInt;break;case v.Uint32:r=o.visitUint32||o.visitInt;break;case v.Uint64:r=o.visitUint64||o.visitInt;break;case v.Float:r=o.visitFloat;break;case v.Float16:r=o.visitFloat16||o.visitFloat;break;case v.Float32:r=o.visitFloat32||o.visitFloat;break;case v.Float64:r=o.visitFloat64||o.visitFloat;break;case v.Utf8:r=o.visitUtf8;break;case v.LargeUtf8:r=o.visitLargeUtf8;break;case v.Binary:r=o.visitBinary;break;case v.LargeBinary:r=o.visitLargeBinary;break;case v.FixedSizeBinary:r=o.visitFixedSizeBinary;break;case v.Date:r=o.visitDate;break;case v.DateDay:r=o.visitDateDay||o.visitDate;break;case v.DateMillisecond:r=o.visitDateMillisecond||o.visitDate;break;case v.Timestamp:r=o.visitTimestamp;break;case v.TimestampSecond:r=o.visitTimestampSecond||o.visitTimestamp;break;case v.TimestampMillisecond:r=o.visitTimestampMillisecond||o.visitTimestamp;break;case v.TimestampMicrosecond:r=o.visitTimestampMicrosecond||o.visitTimestamp;break;case v.TimestampNanosecond:r=o.visitTimestampNanosecond||o.visitTimestamp;break;case v.Time:r=o.visitTime;break;case v.TimeSecond:r=o.visitTimeSecond||o.visitTime;break;case v.TimeMillisecond:r=o.visitTimeMillisecond||o.visitTime;break;case v.TimeMicrosecond:r=o.visitTimeMicrosecond||o.visitTime;break;case v.TimeNanosecond:r=o.visitTimeNanosecond||o.visitTime;break;case v.Decimal:r=o.visitDecimal;break;case v.List:r=o.visitList;break;case v.Struct:r=o.visitStruct;break;case v.Union:r=o.visitUnion;break;case v.DenseUnion:r=o.visitDenseUnion||o.visitUnion;break;case v.SparseUnion:r=o.visitSparseUnion||o.visitUnion;break;case v.Dictionary:r=o.visitDictionary;break;case v.Interval:r=o.visitInterval;break;case v.IntervalDayTime:r=o.visitIntervalDayTime||o.visitInterval;break;case v.IntervalYearMonth:r=o.visitIntervalYearMonth||o.visitInterval;break;case v.Duration:r=o.visitDuration;break;case v.DurationSecond:r=o.visitDurationSecond||o.visitDuration;break;case v.DurationMillisecond:r=o.visitDurationMillisecond||o.visitDuration;break;case v.DurationMicrosecond:r=o.visitDurationMicrosecond||o.visitDuration;break;case v.DurationNanosecond:r=o.visitDurationNanosecond||o.visitDuration;break;case v.FixedSizeList:r=o.visitFixedSizeList;break;case v.Map:r=o.visitMap;break}if(typeof r=="function")return r;if(!t)return()=>null;throw new Error("Unrecognized type '".concat(v[e],"'"))}function ul(o){switch(o.typeId){case v.Null:return v.Null;case v.Int:{let{bitWidth:e,isSigned:t}=o;switch(e){case 8:return t?v.Int8:v.Uint8;case 16:return t?v.Int16:v.Uint16;case 32:return t?v.Int32:v.Uint32;case 64:return t?v.Int64:v.Uint64}return v.Int}case v.Float:switch(o.precision){case pe.HALF:return v.Float16;case pe.SINGLE:return v.Float32;case pe.DOUBLE:return v.Float64}return v.Float;case v.Binary:return v.Binary;case v.LargeBinary:return v.LargeBinary;case v.Utf8:return v.Utf8;case v.LargeUtf8:return v.LargeUtf8;case v.Bool:return v.Bool;case v.Decimal:return v.Decimal;case v.Time:switch(o.unit){case U.SECOND:return v.TimeSecond;case U.MILLISECOND:return v.TimeMillisecond;case U.MICROSECOND:return v.TimeMicrosecond;case U.NANOSECOND:return v.TimeNanosecond}return v.Time;case v.Timestamp:switch(o.unit){case U.SECOND:return v.TimestampSecond;case U.MILLISECOND:return v.TimestampMillisecond;case U.MICROSECOND:return v.TimestampMicrosecond;case U.NANOSECOND:return v.TimestampNanosecond}return v.Timestamp;case v.Date:switch(o.unit){case Ae.DAY:return v.DateDay;case Ae.MILLISECOND:return v.DateMillisecond}return v.Date;case v.Interval:switch(o.unit){case Ie.DAY_TIME:return v.IntervalDayTime;case Ie.YEAR_MONTH:return v.IntervalYearMonth}return v.Interval;case v.Duration:switch(o.unit){case U.SECOND:return v.DurationSecond;case U.MILLISECOND:return v.DurationMillisecond;case U.MICROSECOND:return v.DurationMicrosecond;case U.NANOSECOND:return v.DurationNanosecond}return v.Duration;case v.Map:return v.Map;case v.List:return v.List;case v.Struct:return v.Struct;case v.Union:switch(o.mode){case ge.Dense:return v.DenseUnion;case ge.Sparse:return v.SparseUnion}return v.Union;case v.FixedSizeBinary:return v.FixedSizeBinary;case v.FixedSizeList:return v.FixedSizeList;case v.Dictionary:return v.Dictionary}throw new Error("Unrecognized type '".concat(v[o.typeId],"'"))}R.prototype.visitInt8=null;R.prototype.visitInt16=null;R.prototype.visitInt32=null;R.prototype.visitInt64=null;R.prototype.visitUint8=null;R.prototype.visitUint16=null;R.prototype.visitUint32=null;R.prototype.visitUint64=null;R.prototype.visitFloat16=null;R.prototype.visitFloat32=null;R.prototype.visitFloat64=null;R.prototype.visitDateDay=null;R.prototype.visitDateMillisecond=null;R.prototype.visitTimestampSecond=null;R.prototype.visitTimestampMillisecond=null;R.prototype.visitTimestampMicrosecond=null;R.prototype.visitTimestampNanosecond=null;R.prototype.visitTimeSecond=null;R.prototype.visitTimeMillisecond=null;R.prototype.visitTimeMicrosecond=null;R.prototype.visitTimeNanosecond=null;R.prototype.visitDenseUnion=null;R.prototype.visitSparseUnion=null;R.prototype.visitIntervalDayTime=null;R.prototype.visitIntervalYearMonth=null;R.prototype.visitDuration=null;R.prototype.visitDurationSecond=null;R.prototype.visitDurationMillisecond=null;R.prototype.visitDurationMicrosecond=null;R.prototype.visitDurationNanosecond=null;var Ia={};pr(Ia,{float64ToUint16:()=>$n,uint16ToFloat64:()=>Ki});var _l=new Float64Array(1),cn=new Uint32Array(_l.buffer);function Ki(o){let e=(o&31744)>>10,t=(o&1023)/1024,r=Math.pow(-1,(o&32768)>>15);switch(e){case 31:return r*(t?Number.NaN:1/0);case 0:return r*(t?6103515625e-14*t:0)}return r*Math.pow(2,e-15)*(1+t)}function $n(o){if(o!==o)return 32256;_l[0]=o;let e=(cn[1]&2147483648)>>16&65535,t=cn[1]&2146435072,r=0;return t>=1089470464?cn[0]>0?t=31744:(t=(t&2080374784)>>16,r=(cn[1]&1048575)>>10):t<=1056964608?(r=1048576+(cn[1]&1048575),r=1048576+(r<<(t>>20)-998)>>21,t=0):(t=t-1056964608>>10,r=(cn[1]&1048575)+512>>10),e|t|r&65535}var z=class extends R{};function Y(o){return(e,t,r)=>{if(e.setValid(t,r!=null))return o(e,t,r)}}var Cu=(o,e,t)=>{o[e]=Math.floor(t/864e5)},dl=(o,e,t,r)=>{if(t+1{let n=o+t;r?e[n>>3]|=1<>3]&=~(1<{o[e]=t},Ca=({values:o},e,t)=>{o[e]=t},fl=({values:o},e,t)=>{o[e]=$n(t)},ku=(o,e,t)=>{switch(o.type.precision){case pe.HALF:return fl(o,e,t);case pe.SINGLE:case pe.DOUBLE:return Ca(o,e,t)}},Zi=({values:o},e,t)=>{Cu(o,e,t.valueOf())},es=({values:o},e,t)=>{o[e]=BigInt(t)},Ma=({stride:o,values:e},t,r)=>{e.set(r.subarray(0,o),o*t)},pl=({values:o,valueOffsets:e},t,r)=>dl(o,e,t,r),ml=({values:o,valueOffsets:e},t,r)=>dl(o,e,t,Tt(r)),ka=(o,e,t)=>{o.type.unit===Ae.DAY?Zi(o,e,t):es(o,e,t)},ts=({values:o},e,t)=>{o[e]=BigInt(t/1e3)},rs=({values:o},e,t)=>{o[e]=BigInt(t)},ns=({values:o},e,t)=>{o[e]=BigInt(t*1e3)},is=({values:o},e,t)=>{o[e]=BigInt(t*1e6)},Ba=(o,e,t)=>{switch(o.type.unit){case U.SECOND:return ts(o,e,t);case U.MILLISECOND:return rs(o,e,t);case U.MICROSECOND:return ns(o,e,t);case U.NANOSECOND:return is(o,e,t)}},ss=({values:o},e,t)=>{o[e]=t},as=({values:o},e,t)=>{o[e]=t},os=({values:o},e,t)=>{o[e]=t},ls=({values:o},e,t)=>{o[e]=t},Ga=(o,e,t)=>{switch(o.type.unit){case U.SECOND:return ss(o,e,t);case U.MILLISECOND:return as(o,e,t);case U.MICROSECOND:return os(o,e,t);case U.NANOSECOND:return ls(o,e,t)}},Ua=({values:o,stride:e},t,r)=>{o.set(r.subarray(0,e),e*t)},Bu=(o,e,t)=>{let r=o.children[0],n=o.valueOffsets,a=Ge.getVisitFn(r);if(Array.isArray(t))for(let l=-1,c=n[e],u=n[e+1];c{let r=o.children[0],{valueOffsets:n}=o,a=Ge.getVisitFn(r),{[e]:l,[e+1]:c}=n,u=t instanceof Map?t.entries():Object.entries(t);for(let _ of u)if(a(r,l,_),++l>=c)break},Uu=(o,e)=>(t,r,n,a)=>r&&t(r,o,e[a]),Ou=(o,e)=>(t,r,n,a)=>r&&t(r,o,e.get(a)),Ru=(o,e)=>(t,r,n,a)=>r&&t(r,o,e.get(n.name)),Hu=(o,e)=>(t,r,n,a)=>r&&t(r,o,e[n.name]),Nu=(o,e,t)=>{let r=o.type.children.map(a=>Ge.getVisitFn(a.type)),n=t instanceof Map?Ru(e,t):t instanceof se?Ou(e,t):Array.isArray(t)?Uu(e,t):Hu(e,t);o.type.children.forEach((a,l)=>n(r[l],o.children[l],a,l))},Wu=(o,e,t)=>{o.type.mode===ge.Dense?gl(o,e,t):hl(o,e,t)},gl=(o,e,t)=>{let r=o.type.typeIdToChildIndex[o.typeIds[e]],n=o.children[r];Ge.visit(n,o.valueOffsets[e],t)},hl=(o,e,t)=>{let r=o.type.typeIdToChildIndex[o.typeIds[e]],n=o.children[r];Ge.visit(n,e,t)},Vu=(o,e,t)=>{var r;(r=o.dictionary)===null||r===void 0||r.set(o.values[e],t)},Oa=(o,e,t)=>{o.type.unit===Ie.DAY_TIME?cs(o,e,t):us(o,e,t)},cs=({values:o},e,t)=>{o.set(t.subarray(0,2),2*e)},us=({values:o},e,t)=>{o[e]=t[0]*12+t[1]%12},_s=({values:o},e,t)=>{o[e]=t},ds=({values:o},e,t)=>{o[e]=t},ps=({values:o},e,t)=>{o[e]=t},ms=({values:o},e,t)=>{o[e]=t},Ra=(o,e,t)=>{switch(o.type.unit){case U.SECOND:return _s(o,e,t);case U.MILLISECOND:return ds(o,e,t);case U.MICROSECOND:return ps(o,e,t);case U.NANOSECOND:return ms(o,e,t)}},zu=(o,e,t)=>{let{stride:r}=o,n=o.children[0],a=Ge.getVisitFn(n);if(Array.isArray(t))for(let l=-1,c=e*r;++l"".concat(ht(e),": ").concat(ht(t))).join(", "),"}")}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new Ha(this[wt],this[un])}},Ha=class{constructor(e,t){this.childIndex=0,this.children=e.children,this.rowIndex=t,this.childFields=e.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){let e=this.childIndex;return et.name)}has(e,t){return e[wt].type.children.findIndex(r=>r.name===t)!==-1}getOwnPropertyDescriptor(e,t){if(e[wt].type.children.findIndex(r=>r.name===t)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let r=e[wt].type.children.findIndex(n=>n.name===t);if(r!==-1){let n=xe.visit(e[wt].children[r],e[un]);return Reflect.set(e,t,n),n}}set(e,t,r){let n=e[wt].type.children.findIndex(a=>a.name===t);return n!==-1?(Ge.visit(e[wt].children[n],e[un],r),Reflect.set(e,t,r)):Reflect.has(e,t)||typeof t=="symbol"?Reflect.set(e,t,r):!1}};var H=class extends R{};function $(o){return(e,t)=>e.getValid(t)?o(e,t):null}var ju=(o,e)=>864e5*o[e],$u=(o,e)=>null,vl=(o,e,t)=>{if(t+1>=e.length)return null;let r=ae(e[t]),n=ae(e[t+1]);return o.subarray(r,n)},qu=({offset:o,values:e},t)=>{let r=o+t;return(e[r>>3]&1<ju(o,e),yl=({values:o},e)=>ae(o[e]),Lr=({stride:o,values:e},t)=>e[o*t],Xu=({stride:o,values:e},t)=>Ki(e[o*t]),Sl=({values:o},e)=>o[e],Qu=({stride:o,values:e},t)=>e.subarray(o*t,o*(t+1)),El=({values:o,valueOffsets:e},t)=>vl(o,e,t),wl=({values:o,valueOffsets:e},t)=>{let r=vl(o,e,t);return r!==null?Tn(r):null},Yu=({values:o},e)=>o[e],Ju=({type:o,values:e},t)=>o.precision!==pe.HALF?e[t]:Ki(e[t]),Ku=(o,e)=>o.type.unit===Ae.DAY?bl(o,e):yl(o,e),Ll=({values:o},e)=>1e3*ae(o[e]),Al=({values:o},e)=>ae(o[e]),Dl=({values:o},e)=>Fa(o[e],BigInt(1e3)),Fl=({values:o},e)=>Fa(o[e],BigInt(1e6)),Zu=(o,e)=>{switch(o.type.unit){case U.SECOND:return Ll(o,e);case U.MILLISECOND:return Al(o,e);case U.MICROSECOND:return Dl(o,e);case U.NANOSECOND:return Fl(o,e)}},xl=({values:o},e)=>o[e],Tl=({values:o},e)=>o[e],Pl=({values:o},e)=>o[e],Il=({values:o},e)=>o[e],e_=(o,e)=>{switch(o.type.unit){case U.SECOND:return xl(o,e);case U.MILLISECOND:return Tl(o,e);case U.MICROSECOND:return Pl(o,e);case U.NANOSECOND:return Il(o,e)}},t_=({values:o,stride:e},t)=>jn.decimal(o.subarray(e*t,e*(t+1))),r_=(o,e)=>{let{valueOffsets:t,stride:r,children:n}=o,{[e*r]:a,[e*r+1]:l}=t,u=n[0].slice(a,l-a);return new se([u])},n_=(o,e)=>{let{valueOffsets:t,children:r}=o,{[e]:n,[e+1]:a}=t,l=r[0];return new Bt(l.slice(n,a-n))},i_=(o,e)=>new wr(o,e),s_=(o,e)=>o.type.mode===ge.Dense?Cl(o,e):Ml(o,e),Cl=(o,e)=>{let t=o.type.typeIdToChildIndex[o.typeIds[e]],r=o.children[t];return xe.visit(r,o.valueOffsets[e])},Ml=(o,e)=>{let t=o.type.typeIdToChildIndex[o.typeIds[e]],r=o.children[t];return xe.visit(r,e)},a_=(o,e)=>{var t;return(t=o.dictionary)===null||t===void 0?void 0:t.get(o.values[e])},o_=(o,e)=>o.type.unit===Ie.DAY_TIME?kl(o,e):Bl(o,e),kl=({values:o},e)=>o.subarray(2*e,2*(e+1)),Bl=({values:o},e)=>{let t=o[e],r=new Int32Array(2);return r[0]=Math.trunc(t/12),r[1]=Math.trunc(t%12),r},Gl=({values:o},e)=>o[e],Ul=({values:o},e)=>o[e],Ol=({values:o},e)=>o[e],Rl=({values:o},e)=>o[e],l_=(o,e)=>{switch(o.type.unit){case U.SECOND:return Gl(o,e);case U.MILLISECOND:return Ul(o,e);case U.MICROSECOND:return Ol(o,e);case U.NANOSECOND:return Rl(o,e)}},c_=(o,e)=>{let{stride:t,children:r}=o,a=r[0].slice(e*t,t);return new se([a])};H.prototype.visitNull=$($u);H.prototype.visitBool=$(qu);H.prototype.visitInt=$(Yu);H.prototype.visitInt8=$(Lr);H.prototype.visitInt16=$(Lr);H.prototype.visitInt32=$(Lr);H.prototype.visitInt64=$(Sl);H.prototype.visitUint8=$(Lr);H.prototype.visitUint16=$(Lr);H.prototype.visitUint32=$(Lr);H.prototype.visitUint64=$(Sl);H.prototype.visitFloat=$(Ju);H.prototype.visitFloat16=$(Xu);H.prototype.visitFloat32=$(Lr);H.prototype.visitFloat64=$(Lr);H.prototype.visitUtf8=$(wl);H.prototype.visitLargeUtf8=$(wl);H.prototype.visitBinary=$(El);H.prototype.visitLargeBinary=$(El);H.prototype.visitFixedSizeBinary=$(Qu);H.prototype.visitDate=$(Ku);H.prototype.visitDateDay=$(bl);H.prototype.visitDateMillisecond=$(yl);H.prototype.visitTimestamp=$(Zu);H.prototype.visitTimestampSecond=$(Ll);H.prototype.visitTimestampMillisecond=$(Al);H.prototype.visitTimestampMicrosecond=$(Dl);H.prototype.visitTimestampNanosecond=$(Fl);H.prototype.visitTime=$(e_);H.prototype.visitTimeSecond=$(xl);H.prototype.visitTimeMillisecond=$(Tl);H.prototype.visitTimeMicrosecond=$(Pl);H.prototype.visitTimeNanosecond=$(Il);H.prototype.visitDecimal=$(t_);H.prototype.visitList=$(r_);H.prototype.visitStruct=$(i_);H.prototype.visitUnion=$(s_);H.prototype.visitDenseUnion=$(Cl);H.prototype.visitSparseUnion=$(Ml);H.prototype.visitDictionary=$(a_);H.prototype.visitInterval=$(o_);H.prototype.visitIntervalDayTime=$(kl);H.prototype.visitIntervalYearMonth=$(Bl);H.prototype.visitDuration=$(l_);H.prototype.visitDurationSecond=$(Gl);H.prototype.visitDurationMillisecond=$(Ul);H.prototype.visitDurationMicrosecond=$(Ol);H.prototype.visitDurationNanosecond=$(Rl);H.prototype.visitFixedSizeList=$(c_);H.prototype.visitMap=$(n_);var xe=new H;var Ar=Symbol.for("keys"),dn=Symbol.for("vals"),_n=Symbol.for("kKeysAsStrings"),Wa=Symbol.for("_kKeysAsStrings"),Bt=class{constructor(e){return this[Ar]=new se([e.children[0]]).memoize(),this[dn]=e.children[1],new Proxy(this,new za)}get[_n](){return this[Wa]||(this[Wa]=Array.from(this[Ar].toArray(),String))}[Symbol.iterator](){return new Va(this[Ar],this[dn])}get size(){return this[Ar].length}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[Ar],t=this[dn],r={};for(let n=-1,a=e.length;++n"".concat(ht(e),": ").concat(ht(t))).join(", "),"}")}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},Va=class{constructor(e,t){this.keys=e,this.vals=t,this.keyIndex=0,this.numKeys=e.length}[Symbol.iterator](){return this}next(){let e=this.keyIndex;return e===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(e),xe.visit(this.vals,e)]})}},za=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[_n]}has(e,t){return e[_n].includes(t)}getOwnPropertyDescriptor(e,t){if(e[_n].indexOf(t)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let r=e[_n].indexOf(t);if(r!==-1){let n=xe.visit(Reflect.get(e,dn),r);return Reflect.set(e,t,n),n}}set(e,t,r){let n=e[_n].indexOf(t);return n!==-1?(Ge.visit(Reflect.get(e,dn),n,r),Reflect.set(e,t,r)):Reflect.has(e,t)?Reflect.set(e,t,r):!1}};Object.defineProperties(Bt.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Ar]:{writable:!0,enumerable:!1,configurable:!1,value:null},[dn]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Wa]:{writable:!0,enumerable:!1,configurable:!1,value:null}});var Hl;function qn(o,e,t,r){let{length:n=0}=o,a=typeof e!="number"?0:e,l=typeof t!="number"?n:t;return a<0&&(a=(a%n+n)%n),l<0&&(l=(l%n+n)%n),ln&&(l=n),r?r(o,a,l):[a,l]}var Br=(o,e)=>o<0?e+o:o,Nl=o=>o!==o;function Dr(o){if(typeof o!=="object"||o===null)return Nl(o)?Nl:t=>t===o;if(o instanceof Date){let t=o.valueOf();return r=>r instanceof Date?r.valueOf()===t:!1}return ArrayBuffer.isView(o)?t=>t?Ea(o,t):!1:o instanceof Map?__(o):Array.isArray(o)?u_(o):o instanceof se?d_(o):f_(o,!0)}function u_(o){let e=[];for(let t=-1,r=o.length;++t!1;let r=[];for(let n=-1,a=t.length;++n{if(!t||typeof t!="object")return!1;switch(t.constructor){case Array:return p_(o,t);case Map:return Wl(o,t,t.keys());case Bt:case wr:case Object:case void 0:return Wl(o,t,e||Object.keys(t))}return t instanceof se?m_(o,t):!1}}function p_(o,e){let t=o.length;if(e.length!==t)return!1;for(let r=-1;++rGr,getBit:()=>Vl,getBool:()=>vs,packBools:()=>Or,popcnt_array:()=>zl,popcnt_bit_range:()=>Xn,popcnt_uint32:()=>hs,setBool:()=>g_,truncateBitmap:()=>Ur});function vs(o,e,t,r){return(t&1<>r}function g_(o,e,t){return t?!!(o[e>>3]|=1<>3]&=~(1<0||t.byteLength>3):Or(new Gr(t,o,e,null,vs)).subarray(0,r)),n}return t}function Or(o){let e=[],t=0,r=0,n=0;for(let l of o)l&&(n|=1<0)&&(e[t++]=n);let a=new Uint8Array(e.length+7&-8);return a.set(e),a}var Gr=class{constructor(e,t,r,n,a){this.bytes=e,this.length=r,this.context=n,this.get=a,this.bit=t%8,this.byteIndex=t>>3,this.byte=e[this.byteIndex++],this.index=0}next(){return this.index>3<<3,n=e+(e%8===0?0:8-e%8);return Xn(o,e,n)+Xn(o,r,t)+zl(o,n>>3,r-n>>3)}function zl(o,e,t){let r=0,n=Math.trunc(e),a=new DataView(o.buffer,o.byteOffset,o.byteLength),l=t===void 0?o.byteLength:n+t;for(;l-n>=4;)r+=hs(a.getUint32(n)),n+=4;for(;l-n>=2;)r+=hs(a.getUint16(n)),n+=2;for(;l-n>=1;)r+=hs(a.getUint8(n)),n+=1;return r}function hs(o){let e=Math.trunc(o);return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),(e+(e>>>4)&252645135)*16843009>>>24}var h_=-1,ce=class o{get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){let{type:e}=this;return G.isSparseUnion(e)?this.children.some(t=>t.nullable):G.isDenseUnion(e)?this.children.some(t=>t.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let e=0,{valueOffsets:t,values:r,nullBitmap:n,typeIds:a}=this;return t&&(e+=t.byteLength),r&&(e+=r.byteLength),n&&(e+=n.byteLength),a&&(e+=a.byteLength),this.children.reduce((l,c)=>l+c.byteLength,e)}get nullCount(){if(G.isUnion(this.type))return this.children.reduce((r,n)=>r+n.nullCount,0);let e=this._nullCount,t;return e<=h_&&(t=this.nullBitmap)&&(this._nullCount=e=t.length===0?0:this.length-Xn(t,this.offset,this.offset+this.length)),e}constructor(e,t,r,n,a,l=[],c){this.type=e,this.children=l,this.dictionary=c,this.offset=Math.floor(Math.max(t||0,0)),this.length=Math.floor(Math.max(r||0,0)),this._nullCount=Math.floor(Math.max(n||0,-1));let u;a instanceof o?(this.stride=a.stride,this.values=a.values,this.typeIds=a.typeIds,this.nullBitmap=a.nullBitmap,this.valueOffsets=a.valueOffsets):(this.stride=et(e),a&&((u=a[0])&&(this.valueOffsets=u),(u=a[1])&&(this.values=u),(u=a[2])&&(this.nullBitmap=u),(u=a[3])&&(this.typeIds=u)))}getValid(e){let{type:t}=this;if(G.isUnion(t)){let r=t,n=this.children[r.typeIdToChildIndex[this.typeIds[e]]],a=r.mode===ge.Dense?this.valueOffsets[e]:e;return n.getValid(a)}if(this.nullable&&this.nullCount>0){let r=this.offset+e;return(this.nullBitmap[r>>3]&1<>3;(!a||a.byteLength<=d)&&(a=new Uint8Array((l+c+63&-64)>>3).fill(255),this.nullCount>0?(a.set(Ur(l,c,this.nullBitmap),0),Object.assign(this,{nullBitmap:a})):Object.assign(this,{nullBitmap:a,_nullCount:0}));let f=a[d];r=(f&_)!==0,a[d]=t?f|_:f&~_}return r!==!!t&&(this._nullCount=this.nullCount+(t?-1:1)),t}clone(e=this.type,t=this.offset,r=this.length,n=this._nullCount,a=this,l=this.children){return new o(e,t,r,n,a,l,this.dictionary)}slice(e,t){let{stride:r,typeId:n,children:a}=this,l=+(this._nullCount===0)-1,c=n===16?r:1,u=this._sliceBuffers(e,t,r,n);return this.clone(this.type,this.offset+e,t,l,u,a.length===0||this.valueOffsets?a:this._sliceChildren(a,c*e,c*t))}_changeLengthAndBackfillNullBitmap(e){if(this.typeId===v.Null)return this.clone(this.type,0,e,0);let{length:t,nullCount:r}=this,n=new Uint8Array((e+63&-64)>>3).fill(255,0,t>>3);n[t>>3]=(1<0&&n.set(Ur(this.offset,t,this.nullBitmap),0);let a=this.buffers;return a[it.VALIDITY]=n,this.clone(this.type,0,e,r+(e-t),a)}_sliceBuffers(e,t,r,n){let a,{buffers:l}=this;return(a=l[it.TYPE])&&(l[it.TYPE]=a.subarray(e,e+t)),(a=l[it.OFFSET])&&(l[it.OFFSET]=a.subarray(e,e+t+1))||(a=l[it.DATA])&&(l[it.DATA]=n===6?a:a.subarray(r*e,r*(e+t))),l}_sliceChildren(e,t,r){return e.map(n=>n.slice(t,r))}};ce.prototype.children=Object.freeze([]);var qa=class o extends R{visit(e){return this.getVisitFn(e.type).call(this,e)}visitNull(e){let{["type"]:t,["offset"]:r=0,["length"]:n=0}=e;return new ce(t,r,n,n)}visitBool(e){let{["type"]:t,["offset"]:r=0}=e,n=j(e.nullBitmap),a=re(t.ArrayType,e.data),{["length"]:l=a.length>>3,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new ce(t,r,l,c,[void 0,a,n])}visitInt(e){let{["type"]:t,["offset"]:r=0}=e,n=j(e.nullBitmap),a=re(t.ArrayType,e.data),{["length"]:l=a.length,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new ce(t,r,l,c,[void 0,a,n])}visitFloat(e){let{["type"]:t,["offset"]:r=0}=e,n=j(e.nullBitmap),a=re(t.ArrayType,e.data),{["length"]:l=a.length,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new ce(t,r,l,c,[void 0,a,n])}visitUtf8(e){let{["type"]:t,["offset"]:r=0}=e,n=j(e.data),a=j(e.nullBitmap),l=Mr(e.valueOffsets),{["length"]:c=l.length-1,["nullCount"]:u=e.nullBitmap?-1:0}=e;return new ce(t,r,c,u,[l,n,a])}visitLargeUtf8(e){let{["type"]:t,["offset"]:r=0}=e,n=j(e.data),a=j(e.nullBitmap),l=Bi(e.valueOffsets),{["length"]:c=l.length-1,["nullCount"]:u=e.nullBitmap?-1:0}=e;return new ce(t,r,c,u,[l,n,a])}visitBinary(e){let{["type"]:t,["offset"]:r=0}=e,n=j(e.data),a=j(e.nullBitmap),l=Mr(e.valueOffsets),{["length"]:c=l.length-1,["nullCount"]:u=e.nullBitmap?-1:0}=e;return new ce(t,r,c,u,[l,n,a])}visitLargeBinary(e){let{["type"]:t,["offset"]:r=0}=e,n=j(e.data),a=j(e.nullBitmap),l=Bi(e.valueOffsets),{["length"]:c=l.length-1,["nullCount"]:u=e.nullBitmap?-1:0}=e;return new ce(t,r,c,u,[l,n,a])}visitFixedSizeBinary(e){let{["type"]:t,["offset"]:r=0}=e,n=j(e.nullBitmap),a=re(t.ArrayType,e.data),{["length"]:l=a.length/et(t),["nullCount"]:c=e.nullBitmap?-1:0}=e;return new ce(t,r,l,c,[void 0,a,n])}visitDate(e){let{["type"]:t,["offset"]:r=0}=e,n=j(e.nullBitmap),a=re(t.ArrayType,e.data),{["length"]:l=a.length/et(t),["nullCount"]:c=e.nullBitmap?-1:0}=e;return new ce(t,r,l,c,[void 0,a,n])}visitTimestamp(e){let{["type"]:t,["offset"]:r=0}=e,n=j(e.nullBitmap),a=re(t.ArrayType,e.data),{["length"]:l=a.length/et(t),["nullCount"]:c=e.nullBitmap?-1:0}=e;return new ce(t,r,l,c,[void 0,a,n])}visitTime(e){let{["type"]:t,["offset"]:r=0}=e,n=j(e.nullBitmap),a=re(t.ArrayType,e.data),{["length"]:l=a.length/et(t),["nullCount"]:c=e.nullBitmap?-1:0}=e;return new ce(t,r,l,c,[void 0,a,n])}visitDecimal(e){let{["type"]:t,["offset"]:r=0}=e,n=j(e.nullBitmap),a=re(t.ArrayType,e.data),{["length"]:l=a.length/et(t),["nullCount"]:c=e.nullBitmap?-1:0}=e;return new ce(t,r,l,c,[void 0,a,n])}visitList(e){let{["type"]:t,["offset"]:r=0,["child"]:n}=e,a=j(e.nullBitmap),l=Mr(e.valueOffsets),{["length"]:c=l.length-1,["nullCount"]:u=e.nullBitmap?-1:0}=e;return new ce(t,r,c,u,[l,void 0,a],[n])}visitStruct(e){let{["type"]:t,["offset"]:r=0,["children"]:n=[]}=e,a=j(e.nullBitmap),{length:l=n.reduce((u,{length:_})=>Math.max(u,_),0),nullCount:c=e.nullBitmap?-1:0}=e;return new ce(t,r,l,c,[void 0,void 0,a],n)}visitUnion(e){let{["type"]:t,["offset"]:r=0,["children"]:n=[]}=e,a=re(t.ArrayType,e.typeIds),{["length"]:l=a.length,["nullCount"]:c=-1}=e;if(G.isSparseUnion(t))return new ce(t,r,l,c,[void 0,void 0,void 0,a],n);let u=Mr(e.valueOffsets);return new ce(t,r,l,c,[u,void 0,void 0,a],n)}visitDictionary(e){let{["type"]:t,["offset"]:r=0}=e,n=j(e.nullBitmap),a=re(t.indices.ArrayType,e.data),{["dictionary"]:l=new se([new o().visit({type:t.dictionary})])}=e,{["length"]:c=a.length,["nullCount"]:u=e.nullBitmap?-1:0}=e;return new ce(t,r,c,u,[void 0,a,n],[],l)}visitInterval(e){let{["type"]:t,["offset"]:r=0}=e,n=j(e.nullBitmap),a=re(t.ArrayType,e.data),{["length"]:l=a.length/et(t),["nullCount"]:c=e.nullBitmap?-1:0}=e;return new ce(t,r,l,c,[void 0,a,n])}visitDuration(e){let{["type"]:t,["offset"]:r=0}=e,n=j(e.nullBitmap),a=re(t.ArrayType,e.data),{["length"]:l=a.length,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new ce(t,r,l,c,[void 0,a,n])}visitFixedSizeList(e){let{["type"]:t,["offset"]:r=0,["child"]:n=new o().visit({type:t.valueType})}=e,a=j(e.nullBitmap),{["length"]:l=n.length/et(t),["nullCount"]:c=e.nullBitmap?-1:0}=e;return new ce(t,r,l,c,[void 0,void 0,a],[n])}visitMap(e){let{["type"]:t,["offset"]:r=0,["child"]:n=new o().visit({type:t.childType})}=e,a=j(e.nullBitmap),l=Mr(e.valueOffsets),{["length"]:c=l.length-1,["nullCount"]:u=e.nullBitmap?-1:0}=e;return new ce(t,r,c,u,[l,void 0,a],[n])}},v_=new qa;function J(o){return v_.visit(o)}var Qn=class{constructor(e=0,t){this.numChunks=e,this.getChunkIterator=t,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndexe.nullable)}function bs(o){return o.reduce((e,t)=>e+t.nullCount,0)}function ys(o){return o.reduce((e,t,r)=>(e[r+1]=e[r]+t.length,e),new Uint32Array(o.length+1))}function Ss(o,e,t,r){let n=[];for(let a=-1,l=o.length;++a=r)break;if(t>=u+_)continue;if(u>=t&&u+_<=r){n.push(c);continue}let d=Math.max(0,t-u),f=Math.min(r-u,_);n.push(c.slice(d,f-d))}return n.length===0&&n.push(o[0].slice(0,0)),n}function Xa(o,e,t,r){let n=0,a=0,l=e.length-1;do{if(n>=l-1)return t0?0:-1}function y_(o,e){let{nullBitmap:t}=o;if(!t||o.nullCount<=0)return-1;let r=0;for(let n of new Gr(t,o.offset+(e||0),o.length,t,vs)){if(!n)return r;++r}return-1}function K(o,e,t){if(e===void 0)return-1;if(e===null)switch(o.typeId){case v.Union:break;case v.Dictionary:break;default:return y_(o,t)}let r=xe.getVisitFn(o),n=Dr(e);for(let a=(t||0)-1,l=o.length;++a{let n=o.data[r];return n.values.subarray(0,n.length)[Symbol.iterator]()});let t=0;return new Qn(o.data.length,r=>{let a=o.data[r].length,l=o.slice(t,t+a);return t+=a,new Qa(l)})}var Qa=class{constructor(e){this.vector=e,this.index=0}next(){return this.indexc.data):e;if(a.length===0||a.some(c=>!(c instanceof ce)))throw new TypeError("Vector constructor expects an Array of Data instances.");let l=(t=a[0])===null||t===void 0?void 0:t.type;switch(a.length){case 0:this._offsets=[0];break;case 1:{let{get:c,set:u,indexOf:_}=Xl[l.typeId],d=a[0];this.isValid=f=>Yn(d,f),this.get=f=>c(d,f),this.set=(f,p)=>u(d,f,p),this.indexOf=f=>_(d,f),this._offsets=[0,d.length];break}default:Object.setPrototypeOf(this,Ql[l.typeId]),this._offsets=ys(a);break}this.data=a,this.type=l,this.stride=et(l),this.numChildren=(n=(r=l.children)===null||r===void 0?void 0:r.length)!==null&&n!==void 0?n:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((e,t)=>e+t.byteLength,0)}get nullable(){return jl(this.data)}get nullCount(){return bs(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return"".concat(this.VectorName,"<").concat(this.type[Symbol.toStringTag],">")}get VectorName(){return"".concat(v[this.type.typeId],"Vector")}isValid(e){return!1}get(e){return null}at(e){return this.get(Br(e,this.length))}set(e,t){}indexOf(e,t){return-1}includes(e,t){return this.indexOf(e,t)>-1}[Symbol.iterator](){return pn.visit(this)}concat(...e){return new o(this.data.concat(e.flatMap(t=>t.data).flat(Number.POSITIVE_INFINITY)))}slice(e,t){return new o(qn(this,e,t,({data:r,_offsets:n},a,l)=>Ss(r,n,a,l)))}toJSON(){return[...this]}toArray(){let{type:e,data:t,length:r,stride:n,ArrayType:a}=this;switch(e.typeId){case v.Int:case v.Float:case v.Decimal:case v.Time:case v.Timestamp:switch(t.length){case 0:return new a;case 1:return t[0].values.subarray(0,r*n);default:return t.reduce((l,{values:c,length:u})=>(l.array.set(c.subarray(0,u*n),l.offset),l.offset+=u*n,l),{array:new a(r*n),offset:0}).array}}return[...this]}toString(){return"[".concat([...this].join(","),"]")}getChild(e){var t;return this.getChildAt((t=this.type.children)===null||t===void 0?void 0:t.findIndex(r=>r.name===e))}getChildAt(e){return e>-1&&et[e])):null}get isMemoized(){return G.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(G.isDictionary(this.type)){let e=new Ls(this.data[0].dictionary),t=this.data.map(r=>{let n=r.clone();return n.dictionary=e,n});return new o(t)}return new Ls(this)}unmemoize(){if(G.isDictionary(this.type)&&this.isMemoized){let e=this.data[0].dictionary.unmemoize(),t=this.data.map(r=>{let n=r.clone();return n.dictionary=e,n});return new o(t)}return this}};ql=Symbol.toStringTag;se[ql]=(o=>{o.type=G.prototype,o.data=[],o.length=0,o.stride=1,o.numChildren=0,o._offsets=new Uint32Array([0]),o[Symbol.isConcatSpreadable]=!0;let e=Object.keys(v).map(t=>v[t]).filter(t=>typeof t=="number"&&t!==v.NONE);for(let t of e){let r=xe.getVisitFnByTypeId(t),n=Ge.getVisitFnByTypeId(t),a=Rr.getVisitFnByTypeId(t);Xl[t]={get:r,set:n,indexOf:a},Ql[t]=Object.create(o,{isValid:{value:fn(Yn)},get:{value:fn(xe.getVisitFnByTypeId(t))},set:{value:Es(Ge.getVisitFnByTypeId(t))},indexOf:{value:ws(Rr.getVisitFnByTypeId(t))}})}return"Vector"})(se.prototype);var Ls=class o extends se{constructor(e){super(e.data);let t=this.get,r=this.set,n=this.slice,a=new Array(this.length);Object.defineProperty(this,"get",{value(l){let c=a[l];if(c!==void 0)return c;let u=t.call(this,l);return a[l]=u,u}}),Object.defineProperty(this,"set",{value(l,c){r.call(this,l,c),a[l]=c}}),Object.defineProperty(this,"slice",{value:(l,c)=>new o(n.call(this,l,c))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new se(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}};function Yl(o){if(!o||o.length<=0)return function(n){return!0};let e="",t=o.filter(r=>r===r);return t.length>0&&(e="\n switch (x) {".concat(t.map(r=>"\n case ".concat(S_(r),":")).join(""),"\n return false;\n }")),o.length!==t.length&&(e="if (x !== x) return false;\n".concat(e)),new Function("x","".concat(e,"\nreturn true;"))}function S_(o){return typeof o!="bigint"?ht(o):"".concat(ht(o),"n")}function Ya(o,e){let t=Math.ceil(o)*e-1;return(t-t%64+64||64)/e}function Jl(o,e=0){return o.length>=e?o.subarray(0,e):In(new o.constructor(e),o,0)}var Lt=class{constructor(e,t=0,r=1){this.length=Math.ceil(t/r),this.buffer=new e(this.length),this.stride=r,this.BYTES_PER_ELEMENT=e.BYTES_PER_ELEMENT,this.ArrayType=e}get byteLength(){return Math.ceil(this.length*this.stride)*this.BYTES_PER_ELEMENT}get reservedLength(){return this.buffer.length/this.stride}get reservedByteLength(){return this.buffer.byteLength}set(e,t){return this}append(e){return this.set(this.length,e)}reserve(e){if(e>0){this.length+=e;let t=this.stride,r=this.length*t,n=this.buffer.length;r>=n&&this._resize(n===0?Ya(r*1,this.BYTES_PER_ELEMENT):Ya(r*2,this.BYTES_PER_ELEMENT))}return this}flush(e=this.length){e=Ya(e*this.stride,this.BYTES_PER_ELEMENT);let t=Jl(this.buffer,e);return this.clear(),t}clear(){return this.length=0,this.buffer=new this.ArrayType,this}_resize(e){return this.buffer=Jl(this.buffer,e)}},rr=class extends Lt{last(){return this.get(this.length-1)}get(e){return this.buffer[e]}set(e,t){return this.reserve(e-this.length+1),this.buffer[e*this.stride]=t,this}},mn=class extends rr{constructor(){super(Uint8Array,0,1/8),this.numValid=0}get numInvalid(){return this.length-this.numValid}get(e){return this.buffer[e>>3]>>e%8&1}set(e,t){let{buffer:r}=this.reserve(e-this.length+1),n=e>>3,a=e%8,l=r[n]>>a&1;return t?l===0&&(r[n]|=1<=0&&n.fill(n[r],r,e),n[e]=n[e-1]+t,this}flush(e=this.length-1){return e>this.length&&this.set(e-1,this.BYTES_PER_ELEMENT>4?BigInt(0):0),super.flush(e+1)}};var Se=class{static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e){throw new Error('"throughDOM" not available in this environment')}constructor({type:e,nullValues:t}){this.length=0,this.finished=!1,this.type=e,this.children=[],this.nullValues=t,this.stride=et(e),this._nulls=new mn,t&&t.length>0&&(this._isValid=Yl(t))}toVector(){return new se([this.flush()])}get ArrayType(){return this.type.ArrayType}get nullCount(){return this._nulls.numInvalid}get numChildren(){return this.children.length}get byteLength(){let e=0,{_offsets:t,_values:r,_nulls:n,_typeIds:a,children:l}=this;return t&&(e+=t.byteLength),r&&(e+=r.byteLength),n&&(e+=n.byteLength),a&&(e+=a.byteLength),l.reduce((c,u)=>c+u.byteLength,e)}get reservedLength(){return this._nulls.reservedLength}get reservedByteLength(){let e=0;return this._offsets&&(e+=this._offsets.reservedByteLength),this._values&&(e+=this._values.reservedByteLength),this._nulls&&(e+=this._nulls.reservedByteLength),this._typeIds&&(e+=this._typeIds.reservedByteLength),this.children.reduce((t,r)=>t+r.reservedByteLength,e)}get valueOffsets(){return this._offsets?this._offsets.buffer:null}get values(){return this._values?this._values.buffer:null}get nullBitmap(){return this._nulls?this._nulls.buffer:null}get typeIds(){return this._typeIds?this._typeIds.buffer:null}append(e){return this.set(this.length,e)}isValid(e){return this._isValid(e)}set(e,t){return this.setValid(e,this.isValid(t))&&this.setValue(e,t),this}setValue(e,t){this._setValue(this,e,t)}setValid(e,t){return this.length=this._nulls.set(e,+t).length,t}addChild(e,t="".concat(this.numChildren)){throw new Error('Cannot append children to non-nested type "'.concat(this.type,'"'))}getChildAt(e){return this.children[e]||null}flush(){let e,t,r,n,{type:a,length:l,nullCount:c,_typeIds:u,_offsets:_,_values:d,_nulls:f}=this;(t=u==null?void 0:u.flush(l))?n=_==null?void 0:_.flush(l):(n=_==null?void 0:_.flush(l))?e=d==null?void 0:d.flush(_.last()):e=d==null?void 0:d.flush(l),c>0&&(r=f==null?void 0:f.flush(l));let p=this.children.map(m=>m.flush());return this.clear(),J({type:a,length:l,nullCount:c,children:p,child:p[0],data:e,typeIds:t,nullBitmap:r,valueOffsets:n})}finish(){this.finished=!0;for(let e of this.children)e.finish();return this}clear(){var e,t,r,n;this.length=0,(e=this._nulls)===null||e===void 0||e.clear(),(t=this._values)===null||t===void 0||t.clear(),(r=this._offsets)===null||r===void 0||r.clear(),(n=this._typeIds)===null||n===void 0||n.clear();for(let a of this.children)a.clear();return this}};Se.prototype.length=1;Se.prototype.stride=1;Se.prototype.children=null;Se.prototype.finished=!1;Se.prototype.nullValues=null;Se.prototype._isValid=()=>!0;var Te=class extends Se{constructor(e){super(e),this._values=new rr(this.ArrayType,0,this.stride)}setValue(e,t){let r=this._values;return r.reserve(e-r.length+1),super.setValue(e,t)}},je=class extends Se{constructor(e){super(e),this._pendingLength=0,this._offsets=new gn(e.type)}setValue(e,t){let r=this._pending||(this._pending=new Map),n=r.get(e);n&&(this._pendingLength-=n.length),this._pendingLength+=t instanceof Bt?t[Ar].length:t.length,r.set(e,t)}setValid(e,t){return super.setValid(e,t)?!0:((this._pending||(this._pending=new Map)).set(e,void 0),!1)}clear(){return this._pendingLength=0,this._pending=void 0,super.clear()}flush(){return this._flush(),super.flush()}finish(){return this._flush(),super.finish()}_flush(){let e=this._pending,t=this._pendingLength;return this._pendingLength=0,this._pending=void 0,e&&e.size>0&&this._flushPending(e,t),this}};var Hr=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}offset(){return this.bb.readInt64(this.bb_pos)}metaDataLength(){return this.bb.readInt32(this.bb_pos+8)}bodyLength(){return this.bb.readInt64(this.bb_pos+16)}static sizeOf(){return 24}static createBlock(e,t,r,n){return e.prep(8,24),e.writeInt64(BigInt(n!=null?n:0)),e.pad(4),e.writeInt32(r),e.writeInt64(BigInt(t!=null?t:0)),e.offset()}};var tt=class o{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFooter(e,t){return(t||new o).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFooter(e,t){return e.setPosition(e.position()+4),(t||new o).__init(e.readInt32(e.position())+e.position(),e)}version(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):ue.V1}schema(e){let t=this.bb.__offset(this.bb_pos,6);return t?(e||new ze).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}dictionaries(e,t){let r=this.bb.__offset(this.bb_pos,8);return r?(t||new Hr).__init(this.bb.__vector(this.bb_pos+r)+e*24,this.bb):null}dictionariesLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}recordBatches(e,t){let r=this.bb.__offset(this.bb_pos,10);return r?(t||new Hr).__init(this.bb.__vector(this.bb_pos+r)+e*24,this.bb):null}recordBatchesLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let r=this.bb.__offset(this.bb_pos,12);return r?(t||new Ce).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startFooter(e){e.startObject(5)}static addVersion(e,t){e.addFieldInt16(0,t,ue.V1)}static addSchema(e,t){e.addFieldOffset(1,t,0)}static addDictionaries(e,t){e.addFieldOffset(2,t,0)}static startDictionariesVector(e,t){e.startVector(24,t,8)}static addRecordBatches(e,t){e.addFieldOffset(3,t,0)}static startRecordBatchesVector(e,t){e.startVector(24,t,8)}static addCustomMetadata(e,t){e.addFieldOffset(4,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let r=t.length-1;r>=0;r--)e.addOffset(t[r]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endFooter(e){return e.endObject()}static finishFooterBuffer(e,t){e.finish(t)}static finishSizePrefixedFooterBuffer(e,t){e.finish(t,void 0,!0)}};var de=class o{constructor(e=[],t,r,n=ue.V5){this.fields=e||[],this.metadata=t||new Map,r||(r=Ja(this.fields)),this.dictionaries=r,this.metadataVersion=n}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(e=>e.name)}toString(){return"Schema<{ ".concat(this.fields.map((e,t)=>"".concat(t,": ").concat(e)).join(", ")," }>")}select(e){let t=new Set(e),r=this.fields.filter(n=>t.has(n.name));return new o(r,this.metadata)}selectAt(e){let t=e.map(r=>this.fields[r]).filter(Boolean);return new o(t,this.metadata)}assign(...e){let t=e[0]instanceof o?e[0]:Array.isArray(e[0])?new o(e[0]):new o(e),r=[...this.fields],n=As(As(new Map,this.metadata),t.metadata),a=t.fields.filter(c=>{let u=r.findIndex(_=>_.name===c.name);return~u?(r[u]=c.clone({metadata:As(As(new Map,r[u].metadata),c.metadata)}))&&!1:!0}),l=Ja(a,new Map);return new o([...r,...a],n,new Map([...this.dictionaries,...l]))}};de.prototype.fields=null;de.prototype.metadata=null;de.prototype.dictionaries=null;var ne=class o{static new(...e){let[t,r,n,a]=e;return e[0]&&typeof e[0]=="object"&&({name:t}=e[0],r===void 0&&(r=e[0].type),n===void 0&&(n=e[0].nullable),a===void 0&&(a=e[0].metadata)),new o("".concat(t),r,n,a)}constructor(e,t,r=!1,n){this.name=e,this.type=t,this.nullable=r,this.metadata=n||new Map}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return"".concat(this.name,": ").concat(this.type)}clone(...e){let[t,r,n,a]=e;return!e[0]||typeof e[0]!="object"?[t=this.name,r=this.type,n=this.nullable,a=this.metadata]=e:{name:t=this.name,type:r=this.type,nullable:n=this.nullable,metadata:a=this.metadata}=e[0],o.new(t,r,n,a)}};ne.prototype.type=null;ne.prototype.name=null;ne.prototype.nullable=null;ne.prototype.metadata=null;function As(o,e){return new Map([...o||new Map,...e||new Map])}function Ja(o,e=new Map){for(let t=-1,r=o.length;++t0&&Ja(a.children,e)}return e}var E_=kr,w_=Je,nr=class{static decode(e){e=new w_(j(e));let t=tt.getRootAsFooter(e),r=de.decode(t.schema(),new Map,t.version());return new Ka(r,t)}static encode(e){let t=new E_,r=de.encode(t,e.schema);tt.startRecordBatchesVector(t,e.numRecordBatches);for(let l of[...e.recordBatches()].slice().reverse())ir.encode(t,l);let n=t.endVector();tt.startDictionariesVector(t,e.numDictionaries);for(let l of[...e.dictionaryBatches()].slice().reverse())ir.encode(t,l);let a=t.endVector();return tt.startFooter(t),tt.addSchema(t,r),tt.addVersion(t,ue.V5),tt.addRecordBatches(t,n),tt.addDictionaries(t,a),tt.finishFooterBuffer(t,tt.endFooter(t)),t.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(e,t=ue.V5,r,n){this.schema=e,this.version=t,r&&(this._recordBatches=r),n&&(this._dictionaryBatches=n)}*recordBatches(){for(let e,t=-1,r=this.numRecordBatches;++t=0&&e=0&&e=0&&e=0&&ethis._closedPromiseResolve=e)}get closed(){return this._closedPromise}cancel(e){return B(this,void 0,void 0,function*(){yield this.return(e)})}write(e){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(e):this.resolvers.shift().resolve({done:!1,value:e}))}abort(e){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:e}:this.resolvers.shift().reject({done:!0,value:e}))}close(){if(this._closedPromiseResolve){let{resolvers:e}=this;for(;e.length>0;)e.shift().resolve(be);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(e){return Be.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,e)}toNodeStream(e){return Be.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,e)}throw(e){return B(this,void 0,void 0,function*(){return yield this.abort(e),be})}return(e){return B(this,void 0,void 0,function*(){return yield this.close(),be})}read(e){return B(this,void 0,void 0,function*(){return(yield this.next(e,"read")).value})}peek(e){return B(this,void 0,void 0,function*(){return(yield this.next(e,"peek")).value})}next(...e){return this._values.length>0?Promise.resolve({done:!1,value:this._values.shift()}):this._error?Promise.reject({done:!0,value:this._error.error}):this._closedPromiseResolve?new Promise((t,r)=>{this.resolvers.push({resolve:t,reject:r})}):Promise.resolve(be)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}};var Gt=class extends Ds{write(e){if((e=j(e)).byteLength>0)return super.write(e)}toString(e=!1){return e?Tn(this.toUint8Array(!0)):this.toUint8Array(!1).then(Tn)}toUint8Array(e=!1){return e?Ye(this._values)[0]:B(this,void 0,void 0,function*(){var t,r,n,a;let l=[],c=0;try{for(var u=!0,_=ut(this),d;d=yield _.next(),t=d.done,!t;u=!0){a=d.value,u=!1;let f=a;l.push(f),c+=f.byteLength}}catch(f){r={error:f}}finally{try{!u&&!t&&(n=_.return)&&(yield n.call(_))}finally{if(r)throw r.error}}return Ye(l,c)[0]})}},Ut=class{constructor(e){e&&(this.source=new Za(Be.fromIterable(e)))}[Symbol.iterator](){return this}next(e){return this.source.next(e)}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}peek(e){return this.source.peek(e)}read(e){return this.source.read(e)}},at=class o{constructor(e){e instanceof o?this.source=e.source:e instanceof Gt?this.source=new sr(Be.fromAsyncIterable(e)):ki(e)?this.source=new sr(Be.fromNodeStream(e)):Pn(e)?this.source=new sr(Be.fromDOMStream(e)):Ci(e)?this.source=new sr(Be.fromDOMStream(e.body)):dt(e)?this.source=new sr(Be.fromIterable(e)):_t(e)?this.source=new sr(Be.fromAsyncIterable(e)):rt(e)&&(this.source=new sr(Be.fromAsyncIterable(e)))}[Symbol.asyncIterator](){return this}next(e){return this.source.next(e)}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}get closed(){return this.source.closed}cancel(e){return this.source.cancel(e)}peek(e){return this.source.peek(e)}read(e){return this.source.read(e)}},Za=class{constructor(e){this.source=e}cancel(e){this.return(e)}peek(e){return this.next(e,"peek").value}read(e){return this.next(e,"read").value}next(e,t="read"){return this.source.next({cmd:t,size:e})}throw(e){return Object.create(this.source.throw&&this.source.throw(e)||be)}return(e){return Object.create(this.source.return&&this.source.return(e)||be)}},sr=class{constructor(e){this.source=e,this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}cancel(e){return B(this,void 0,void 0,function*(){yield this.return(e)})}get closed(){return this._closedPromise}read(e){return B(this,void 0,void 0,function*(){return(yield this.next(e,"read")).value})}peek(e){return B(this,void 0,void 0,function*(){return(yield this.next(e,"peek")).value})}next(e){return B(this,arguments,void 0,function*(t,r="read"){return yield this.source.next({cmd:r,size:t})})}throw(e){return B(this,void 0,void 0,function*(){let t=this.source.throw&&(yield this.source.throw(e))||be;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}return(e){return B(this,void 0,void 0,function*(){let t=this.source.return&&(yield this.source.return(e))||be;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}};var Kn=class extends Ut{constructor(e,t){super(),this.position=0,this.buffer=j(e),this.size=t===void 0?this.buffer.byteLength:t}readInt32(e){let{buffer:t,byteOffset:r}=this.readAt(e,4);return new DataView(t,r).getInt32(0,!0)}seek(e){return this.position=Math.min(e,this.size),eZn,Int128:()=>ei,Int64:()=>ar,Uint64:()=>Le});function hn(o){return o<0&&(o=4294967295+o+1),"0x".concat(o.toString(16))}var vn=8,eo=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],Zn=class{constructor(e){this.buffer=e}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(e){let t=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),r=new Uint32Array([e.buffer[1]>>>16,e.buffer[1]&65535,e.buffer[0]>>>16,e.buffer[0]&65535]),n=t[3]*r[3];this.buffer[0]=n&65535;let a=n>>>16;return n=t[2]*r[3],a+=n,n=t[3]*r[2]>>>0,a+=n,this.buffer[0]+=a<<16,this.buffer[1]=a>>>0>>16,this.buffer[1]+=t[1]*r[3]+t[2]*r[2]+t[3]*r[1],this.buffer[1]+=t[0]*r[3]+t[1]*r[2]+t[2]*r[1]+t[3]*r[0]<<16,this}_plus(e){let t=this.buffer[0]+e.buffer[0]>>>0;this.buffer[1]+=e.buffer[1],t>>0&&++this.buffer[1],this.buffer[0]=t}lessThan(e){return this.buffer[1]>>0,t[2]=this.buffer[2]+e.buffer[2]>>>0,t[1]=this.buffer[1]+e.buffer[1]>>>0,t[0]=this.buffer[0]+e.buffer[0]>>>0,t[0]>>0&&++t[1],t[1]>>0&&++t[2],t[2]>>0&&++t[3],this.buffer[3]=t[3],this.buffer[2]=t[2],this.buffer[1]=t[1],this.buffer[0]=t[0],this}hex(){return"".concat(hn(this.buffer[3])," ").concat(hn(this.buffer[2])," ").concat(hn(this.buffer[1])," ").concat(hn(this.buffer[0]))}static multiply(e,t){return new o(new Uint32Array(e.buffer)).times(t)}static add(e,t){return new o(new Uint32Array(e.buffer)).plus(t)}static from(e,t=new Uint32Array(4)){return o.fromString(typeof e=="string"?e:e.toString(),t)}static fromNumber(e,t=new Uint32Array(4)){return o.fromString(e.toString(),t)}static fromString(e,t=new Uint32Array(4)){let r=e.startsWith("-"),n=e.length,a=new o(t);for(let l=r?1:0;l0&&this.readData(e,r)||new Uint8Array(0)}readOffsets(e,t){return this.readData(e,t)}readTypeIds(e,t){return this.readData(e,t)}readData(e,{length:t,offset:r}=this.nextBufferRange()){return this.bytes.subarray(r,r+t)}readDictionary(e){return this.dictionaries.get(e.id)}},Fs=class extends ti{constructor(e,t,r,n,a){super(new Uint8Array(0),t,r,n,a),this.sources=e}readNullBitmap(e,t,{offset:r}=this.nextBufferRange()){return t<=0?new Uint8Array(0):Or(this.sources[r])}readOffsets(e,{offset:t}=this.nextBufferRange()){return re(Uint8Array,re(e.OffsetArrayType,this.sources[t]))}readTypeIds(e,{offset:t}=this.nextBufferRange()){return re(Uint8Array,re(e.ArrayType,this.sources[t]))}readData(e,{offset:t}=this.nextBufferRange()){let{sources:r}=this;return G.isTimestamp(e)?re(Uint8Array,ar.convertArray(r[t])):(G.isInt(e)||G.isTime(e))&&e.bitWidth===64||G.isDuration(e)?re(Uint8Array,ar.convertArray(r[t])):G.isDate(e)&&e.unit===Ae.MILLISECOND?re(Uint8Array,ar.convertArray(r[t])):G.isDecimal(e)?re(Uint8Array,ei.convertArray(r[t])):G.isBinary(e)||G.isLargeBinary(e)||G.isFixedSizeBinary(e)?L_(r[t]):G.isBool(e)?Or(r[t]):G.isUtf8(e)||G.isLargeUtf8(e)?Tt(r[t].join("")):re(Uint8Array,re(e.ArrayType,r[t].map(n=>+n)))}};function L_(o){let e=o.join(""),t=new Uint8Array(e.length/2);for(let r=0;r>1]=Number.parseInt(e.slice(r,r+2),16);return t}var bn=class extends je{constructor(e){super(e),this._values=new Lt(Uint8Array)}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,t){return super.setValue(e,j(t))}_flushPending(e,t){let r=this._offsets,n=this._values.reserve(t).buffer,a=0;for(let[l,c]of e)if(c===void 0)r.set(l,0);else{let u=c.length;n.set(c,a),r.set(l,u),a+=u}}};var yn=class extends je{constructor(e){super(e),this._values=new Lt(Uint8Array)}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,t){return super.setValue(e,j(t))}_flushPending(e,t){let r=this._offsets,n=this._values.reserve(t).buffer,a=0;for(let[l,c]of e)if(c===void 0)r.set(l,BigInt(0));else{let u=c.length;n.set(c,a),r.set(l,BigInt(u)),a+=u}}};var xs=class extends Se{constructor(e){super(e),this._values=new mn}setValue(e,t){this._values.set(e,+t)}};var Wr=class extends Te{};Wr.prototype._setValue=ka;var ri=class extends Wr{};ri.prototype._setValue=Zi;var ni=class extends Wr{};ni.prototype._setValue=es;var ii=class extends Te{};ii.prototype._setValue=Ua;var Ts=class extends Se{constructor({type:e,nullValues:t,dictionaryHashFunction:r}){super({type:new Ze(e.dictionary,e.indices,e.id,e.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=Vr({type:this.type.indices,nullValues:t}),this.dictionary=Vr({type:this.type.dictionary,nullValues:null}),typeof r=="function"&&(this.valueToKey=r)}get values(){return this.indices.values}get nullCount(){return this.indices.nullCount}get nullBitmap(){return this.indices.nullBitmap}get byteLength(){return this.indices.byteLength+this.dictionary.byteLength}get reservedLength(){return this.indices.reservedLength+this.dictionary.reservedLength}get reservedByteLength(){return this.indices.reservedByteLength+this.dictionary.reservedByteLength}isValid(e){return this.indices.isValid(e)}setValid(e,t){let r=this.indices;return t=r.setValid(e,t),this.length=r.length,t}setValue(e,t){let r=this._keysToIndices,n=this.valueToKey(t),a=r[n];return a===void 0&&(r[n]=a=this._dictionaryOffset+this.dictionary.append(t).length-1),this.indices.setValue(e,a)}flush(){let e=this.type,t=this._dictionary,r=this.dictionary.toVector(),n=this.indices.flush().clone(e);return n.dictionary=t?t.concat(r):r,this.finished||(this._dictionaryOffset+=r.length),this._dictionary=n.dictionary,this.clear(),n}finish(){return this.indices.finish(),this.dictionary.finish(),this._dictionaryOffset=0,this._keysToIndices=Object.create(null),super.finish()}clear(){return this.indices.clear(),this.dictionary.clear(),super.clear()}valueToKey(e){return typeof e=="string"?e:"".concat(e)}};var si=class extends Te{};si.prototype._setValue=Ma;var Ps=class extends Se{setValue(e,t){let[r]=this.children,n=e*this.stride;for(let a=-1,l=t.length;++a0)throw new Error("FixedSizeListBuilder can only have one child.");let r=this.children.push(e);return this.type=new St(this.type.listSize,new ne(t,e.type,!0)),r}};var zr=class extends Te{setValue(e,t){this._values.set(e,t)}},Is=class extends zr{setValue(e,t){super.setValue(e,$n(t))}},Cs=class extends zr{},Ms=class extends zr{};var jr=class extends Te{};jr.prototype._setValue=Oa;var ai=class extends jr{};ai.prototype._setValue=cs;var oi=class extends jr{};oi.prototype._setValue=us;var or=class extends Te{};or.prototype._setValue=Ra;var li=class extends or{};li.prototype._setValue=_s;var ci=class extends or{};ci.prototype._setValue=ds;var ui=class extends or{};ui.prototype._setValue=ps;var _i=class extends or{};_i.prototype._setValue=ms;var ot=class extends Te{setValue(e,t){this._values.set(e,t)}},ks=class extends ot{},Bs=class extends ot{},Gs=class extends ot{},Us=class extends ot{},Os=class extends ot{},Rs=class extends ot{},Hs=class extends ot{},Ns=class extends ot{};var Ws=class extends je{constructor(e){super(e),this._offsets=new gn(e.type)}addChild(e,t="0"){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=e,this.type=new bt(new ne(t,e.type,!0)),this.numChildren-1}_flushPending(e){let t=this._offsets,[r]=this.children;for(let[n,a]of e)if(typeof a>"u")t.set(n,0);else{let l=a,c=l.length,u=t.set(n,c).buffer[n];for(let _=-1;++_0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=e,this.type=new Et(new ne(t,e.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(e){let t=this._offsets,[r]=this.children;for(let[n,a]of e)if(a===void 0)t.set(n,0);else{let{[n]:l,[n+1]:c}=t.set(n,a.size).buffer;for(let u of a.entries())if(r.set(l,u),++l>=c)break}}};var zs=class extends Se{setValue(e,t){}setValid(e,t){return this.length=Math.max(e+1,this.length),t}};var js=class extends Se{setValue(e,t){let{children:r,type:n}=this;switch(Array.isArray(t)||t.constructor){case!0:return n.children.forEach((a,l)=>r[l].set(e,t[l]));case Map:return n.children.forEach((a,l)=>r[l].set(e,t.get(a.name)));default:return n.children.forEach((a,l)=>r[l].set(e,t[a.name]))}}setValid(e,t){return super.setValid(e,t)||this.children.forEach(r=>r.setValid(e,t)),t}addChild(e,t="".concat(this.numChildren)){let r=this.children.push(e);return this.type=new ve([...this.type.children,new ne(t,e.type,!0)]),r}};var lr=class extends Te{};lr.prototype._setValue=Ba;var di=class extends lr{};di.prototype._setValue=ts;var fi=class extends lr{};fi.prototype._setValue=rs;var pi=class extends lr{};pi.prototype._setValue=ns;var mi=class extends lr{};mi.prototype._setValue=is;var cr=class extends Te{};cr.prototype._setValue=Ga;var gi=class extends cr{};gi.prototype._setValue=ss;var hi=class extends cr{};hi.prototype._setValue=as;var vi=class extends cr{};vi.prototype._setValue=os;var bi=class extends cr{};bi.prototype._setValue=ls;var Sn=class extends Se{constructor(e){super(e),this._typeIds=new rr(Int8Array,0,1),typeof e.valueToChildTypeId=="function"&&(this._valueToChildTypeId=e.valueToChildTypeId)}get typeIdToChildIndex(){return this.type.typeIdToChildIndex}append(e,t){return this.set(this.length,e,t)}set(e,t,r){return r===void 0&&(r=this._valueToChildTypeId(this,t,e)),this.setValue(e,t,r),this}setValue(e,t,r){this._typeIds.set(e,r);let n=this.type.typeIdToChildIndex[r],a=this.children[n];a==null||a.set(e,t)}addChild(e,t="".concat(this.children.length)){let r=this.children.push(e),{type:{children:n,mode:a,typeIds:l}}=this,c=[...n,new ne(t,e.type)];return this.type=new yt(a,[...l,r],c),r}_valueToChildTypeId(e,t,r){throw new Error("Cannot map UnionBuilder value to child typeId. Pass the `childTypeId` as the second argument to unionBuilder.append(), or supply a `valueToChildTypeId` function as part of the UnionBuilder constructor options.")}},$s=class extends Sn{},qs=class extends Sn{constructor(e){super(e),this._offsets=new rr(Int32Array)}setValue(e,t,r){let n=this._typeIds.set(e,r).buffer[e],a=this.getChildAt(this.type.typeIdToChildIndex[n]),l=this._offsets.set(e,a.length).buffer[e];a==null||a.set(l,t)}};var yi=class extends je{constructor(e){super(e),this._values=new Lt(Uint8Array)}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,t){return super.setValue(e,Tt(t))}_flushPending(e,t){}};yi.prototype._flushPending=bn.prototype._flushPending;var Si=class extends je{constructor(e){super(e),this._values=new Lt(Uint8Array)}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,t){return super.setValue(e,Tt(t))}_flushPending(e,t){}};Si.prototype._flushPending=yn.prototype._flushPending;var ro=class extends R{visitNull(){return zs}visitBool(){return xs}visitInt(){return ot}visitInt8(){return ks}visitInt16(){return Bs}visitInt32(){return Gs}visitInt64(){return Us}visitUint8(){return Os}visitUint16(){return Rs}visitUint32(){return Hs}visitUint64(){return Ns}visitFloat(){return zr}visitFloat16(){return Is}visitFloat32(){return Cs}visitFloat64(){return Ms}visitUtf8(){return yi}visitLargeUtf8(){return Si}visitBinary(){return bn}visitLargeBinary(){return yn}visitFixedSizeBinary(){return si}visitDate(){return Wr}visitDateDay(){return ri}visitDateMillisecond(){return ni}visitTimestamp(){return lr}visitTimestampSecond(){return di}visitTimestampMillisecond(){return fi}visitTimestampMicrosecond(){return pi}visitTimestampNanosecond(){return mi}visitTime(){return cr}visitTimeSecond(){return gi}visitTimeMillisecond(){return hi}visitTimeMicrosecond(){return vi}visitTimeNanosecond(){return bi}visitDecimal(){return ii}visitList(){return Ws}visitStruct(){return js}visitUnion(){return Sn}visitDenseUnion(){return qs}visitSparseUnion(){return $s}visitDictionary(){return Ts}visitInterval(){return jr}visitIntervalDayTime(){return ai}visitIntervalYearMonth(){return oi}visitDuration(){return or}visitDurationSecond(){return li}visitDurationMillisecond(){return ci}visitDurationMicrosecond(){return ui}visitDurationNanosecond(){return _i}visitFixedSizeList(){return Ps}visitMap(){return Vs}},Kl=new ro;var V=class extends R{compareSchemas(e,t){return e===t||t instanceof e.constructor&&this.compareManyFields(e.fields,t.fields)}compareManyFields(e,t){return e===t||Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((r,n)=>this.compareFields(r,t[n]))}compareFields(e,t){return e===t||t instanceof e.constructor&&e.name===t.name&&e.nullable===t.nullable&&this.visit(e.type,t.type)}};function We(o,e){return e instanceof o.constructor}function $r(o,e){return o===e||We(o,e)}function ur(o,e){return o===e||We(o,e)&&o.bitWidth===e.bitWidth&&o.isSigned===e.isSigned}function Xs(o,e){return o===e||We(o,e)&&o.precision===e.precision}function A_(o,e){return o===e||We(o,e)&&o.byteWidth===e.byteWidth}function no(o,e){return o===e||We(o,e)&&o.unit===e.unit}function Ei(o,e){return o===e||We(o,e)&&o.unit===e.unit&&o.timezone===e.timezone}function wi(o,e){return o===e||We(o,e)&&o.unit===e.unit&&o.bitWidth===e.bitWidth}function D_(o,e){return o===e||We(o,e)&&o.children.length===e.children.length&&Ot.compareManyFields(o.children,e.children)}function F_(o,e){return o===e||We(o,e)&&o.children.length===e.children.length&&Ot.compareManyFields(o.children,e.children)}function io(o,e){return o===e||We(o,e)&&o.mode===e.mode&&o.typeIds.every((t,r)=>t===e.typeIds[r])&&Ot.compareManyFields(o.children,e.children)}function x_(o,e){return o===e||We(o,e)&&o.id===e.id&&o.isOrdered===e.isOrdered&&Ot.visit(o.indices,e.indices)&&Ot.visit(o.dictionary,e.dictionary)}function so(o,e){return o===e||We(o,e)&&o.unit===e.unit}function Li(o,e){return o===e||We(o,e)&&o.unit===e.unit}function T_(o,e){return o===e||We(o,e)&&o.listSize===e.listSize&&o.children.length===e.children.length&&Ot.compareManyFields(o.children,e.children)}function P_(o,e){return o===e||We(o,e)&&o.keysSorted===e.keysSorted&&o.children.length===e.children.length&&Ot.compareManyFields(o.children,e.children)}V.prototype.visitNull=$r;V.prototype.visitBool=$r;V.prototype.visitInt=ur;V.prototype.visitInt8=ur;V.prototype.visitInt16=ur;V.prototype.visitInt32=ur;V.prototype.visitInt64=ur;V.prototype.visitUint8=ur;V.prototype.visitUint16=ur;V.prototype.visitUint32=ur;V.prototype.visitUint64=ur;V.prototype.visitFloat=Xs;V.prototype.visitFloat16=Xs;V.prototype.visitFloat32=Xs;V.prototype.visitFloat64=Xs;V.prototype.visitUtf8=$r;V.prototype.visitLargeUtf8=$r;V.prototype.visitBinary=$r;V.prototype.visitLargeBinary=$r;V.prototype.visitFixedSizeBinary=A_;V.prototype.visitDate=no;V.prototype.visitDateDay=no;V.prototype.visitDateMillisecond=no;V.prototype.visitTimestamp=Ei;V.prototype.visitTimestampSecond=Ei;V.prototype.visitTimestampMillisecond=Ei;V.prototype.visitTimestampMicrosecond=Ei;V.prototype.visitTimestampNanosecond=Ei;V.prototype.visitTime=wi;V.prototype.visitTimeSecond=wi;V.prototype.visitTimeMillisecond=wi;V.prototype.visitTimeMicrosecond=wi;V.prototype.visitTimeNanosecond=wi;V.prototype.visitDecimal=$r;V.prototype.visitList=D_;V.prototype.visitStruct=F_;V.prototype.visitUnion=io;V.prototype.visitDenseUnion=io;V.prototype.visitSparseUnion=io;V.prototype.visitDictionary=x_;V.prototype.visitInterval=so;V.prototype.visitIntervalDayTime=so;V.prototype.visitIntervalYearMonth=so;V.prototype.visitDuration=Li;V.prototype.visitDurationSecond=Li;V.prototype.visitDurationMillisecond=Li;V.prototype.visitDurationMicrosecond=Li;V.prototype.visitDurationNanosecond=Li;V.prototype.visitFixedSizeList=T_;V.prototype.visitMap=P_;var Ot=new V;function qr(o,e){return Ot.compareSchemas(o,e)}function Zl(o,e){return Ot.compareFields(o,e)}function ec(o,e){return Ot.visit(o,e)}function Vr(o){let e=o.type,t=new(Kl.getVisitFn(e)())(o);if(e.children&&e.children.length>0){let r=o.children||[],n={nullValues:o.nullValues},a=Array.isArray(r)?(l,c)=>r[c]||n:({name:l})=>r[l]||n;for(let[l,c]of e.children.entries()){let{type:u}=c,_=a(c,l);t.children.push(Vr(Object.assign(Object.assign({},_),{type:u})))}}return t}function Qs(o,e){return I_(o,e.map(t=>t.data.concat()))}function I_(o,e){let t=[...o.fields],r=[],n={numBatches:e.reduce((f,p)=>Math.max(f,p.length),0)},a=0,l=0,c=-1,u=e.length,_,d=[];for(;n.numBatches-- >0;){for(l=Number.POSITIVE_INFINITY,c=-1;++c0&&(r[a++]=J({type:new ve(t),length:l,nullCount:0,children:d.slice()})))}return[o=o.assign(t),r.map(f=>new De(o,f))]}function C_(o,e,t,r,n){var a;let l=(e+63&-64)>>3;for(let c=-1,u=r.length;++c=e)d===e?t[c]=_:(t[c]=_.slice(0,e),n.numBatches=Math.max(n.numBatches,r[c].unshift(_.slice(e,d-e))));else{let f=o[c];o[c]=f.clone({nullable:!0}),t[c]=(a=_==null?void 0:_._changeLengthAndBackfillNullBitmap(e))!==null&&a!==void 0?a:J({type:f.type,length:e,nullCount:e,nullBitmap:new Uint8Array(l)})}}return t}var tc,Ve=class o{constructor(...e){var t,r;if(e.length===0)return this.batches=[],this.schema=new de([]),this._offsets=[0],this;let n,a;e[0]instanceof de&&(n=e.shift()),e.at(-1)instanceof Uint32Array&&(a=e.pop());let l=u=>{if(u){if(u instanceof De)return[u];if(u instanceof o)return u.batches;if(u instanceof ce){if(u.type instanceof ve)return[new De(new de(u.type.children),u)]}else{if(Array.isArray(u))return u.flatMap(_=>l(_));if(typeof u[Symbol.iterator]=="function")return[...u].flatMap(_=>l(_));if(typeof u=="object"){let _=Object.keys(u),d=_.map(m=>new se([u[m]])),f=n!=null?n:new de(_.map((m,g)=>new ne(String(m),d[g].type,d[g].nullable))),[,p]=Qs(f,d);return p.length===0?[new De(u)]:p}}}return[]},c=e.flatMap(u=>l(u));if(n=(r=n!=null?n:(t=c[0])===null||t===void 0?void 0:t.schema)!==null&&r!==void 0?r:new de([]),!(n instanceof de))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(let u of c){if(!(u instanceof De))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!qr(n,u.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=n,this.batches=c,this._offsets=a!=null?a:ys(this.data)}get data(){return this.batches.map(({data:e})=>e)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.reduce((e,t)=>e+t.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=bs(this.data)),this._nullCount}isValid(e){return!1}get(e){return null}at(e){return this.get(Br(e,this.numRows))}set(e,t){}indexOf(e,t){return-1}[Symbol.iterator](){return this.batches.length>0?pn.visit(new se(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return"[\n ".concat(this.toArray().join(",\n "),"\n]")}concat(...e){let t=this.schema,r=this.data.concat(e.flatMap(({data:n})=>n));return new o(t,r.map(n=>new De(t,n)))}slice(e,t){let r=this.schema;[e,t]=qn({length:this.numRows},e,t);let n=Ss(this.data,this._offsets,e,t);return new o(r,n.map(a=>new De(r,a)))}getChild(e){return this.getChildAt(this.schema.fields.findIndex(t=>t.name===e))}getChildAt(e){if(e>-1&&er.children[e]);if(t.length===0){let{type:r}=this.schema.fields[e],n=J({type:r,length:0,nullCount:0});t.push(n._changeLengthAndBackfillNullBitmap(this.numRows))}return new se(t)}return null}setChild(e,t){var r;return this.setChildAt((r=this.schema.fields)===null||r===void 0?void 0:r.findIndex(n=>n.name===e),t)}setChildAt(e,t){let r=this.schema,n=[...this.batches];if(e>-1&&ethis.getChildAt(_));[a[e],c[e]]=[l,t],[r,n]=Qs(r,c)}return new o(r,n)}select(e){let t=this.schema.fields.reduce((r,n,a)=>r.set(n.name,a),new Map);return this.selectAt(e.map(r=>t.get(r)).filter(r=>r>-1))}selectAt(e){let t=this.schema.selectAt(e),r=this.batches.map(n=>n.selectAt(e));return new o(t,r)}assign(e){let t=this.schema.fields,[r,n]=e.schema.fields.reduce((c,u,_)=>{let[d,f]=c,p=t.findIndex(m=>m.name===u.name);return~p?f[p]=_:d.push(_),c},[[],[]]),a=this.schema.assign(e.schema),l=[...t.map((c,u)=>[u,n[u]]).map(([c,u])=>u===void 0?this.getChildAt(c):e.getChildAt(u)),...r.map(c=>e.getChildAt(c))].filter(Boolean);return new o(...Qs(a,l))}};tc=Symbol.toStringTag;Ve[tc]=(o=>(o.schema=null,o.batches=[],o._offsets=new Uint32Array([0]),o._nullCount=-1,o[Symbol.isConcatSpreadable]=!0,o.isValid=fn(Yn),o.get=fn(xe.getVisitFn(v.Struct)),o.set=Es(Ge.getVisitFn(v.Struct)),o.indexOf=ws(Rr.getVisitFn(v.Struct)),"Table"))(Ve.prototype);var nc,De=class o{constructor(...e){switch(e.length){case 2:{if([this.schema]=e,!(this.schema instanceof de))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=J({nullCount:0,type:new ve(this.schema.fields),children:this.schema.fields.map(t=>J({type:t.type,nullCount:0}))})]=e,!(this.data instanceof ce))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=rc(this.schema,this.data.children);break}case 1:{let[t]=e,{fields:r,children:n,length:a}=Object.keys(t).reduce((u,_,d)=>(u.children[d]=t[_],u.length=Math.max(u.length,t[_].length),u.fields[d]=ne.new({name:_,type:t[_].type,nullable:!0}),u),{length:0,fields:new Array,children:new Array}),l=new de(r),c=J({type:new ve(r),length:a,children:n,nullCount:0});[this.schema,this.data]=rc(l,c.children,a);break}default:throw new TypeError("RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.")}}get dictionaries(){return this._dictionaries||(this._dictionaries=ic(this.schema.fields,this.data.children))}get numCols(){return this.schema.fields.length}get numRows(){return this.data.length}get nullCount(){return this.data.nullCount}isValid(e){return this.data.getValid(e)}get(e){return xe.visit(this.data,e)}at(e){return this.get(Br(e,this.numRows))}set(e,t){return Ge.visit(this.data,e,t)}indexOf(e,t){return Rr.visit(this.data,e,t)}[Symbol.iterator](){return pn.visit(new se([this.data]))}toArray(){return[...this]}concat(...e){return new Ve(this.schema,[this,...e])}slice(e,t){let[r]=new se([this.data]).slice(e,t).data;return new o(this.schema,r)}getChild(e){var t;return this.getChildAt((t=this.schema.fields)===null||t===void 0?void 0:t.findIndex(r=>r.name===e))}getChildAt(e){return e>-1&&en.name===e),t)}setChildAt(e,t){let r=this.schema,n=this.data;if(e>-1&&ec.name===a);~l&&(n[l]=this.data.children[l])}return new o(t,J({type:r,length:this.numRows,children:n}))}selectAt(e){let t=this.schema.selectAt(e),r=e.map(a=>this.data.children[a]).filter(Boolean),n=J({type:new ve(t.fields),length:this.numRows,children:r});return new o(t,n)}};nc=Symbol.toStringTag;De[nc]=(o=>(o._nullCount=-1,o[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(De.prototype);function rc(o,e,t=e.reduce((r,n)=>Math.max(r,n.length),0)){var r;let n=[...o.fields],a=[...e],l=(t+63&-64)>>3;for(let[c,u]of o.fields.entries()){let _=e[c];(!_||_.length!==t)&&(n[c]=u.clone({nullable:!0}),a[c]=(r=_==null?void 0:_._changeLengthAndBackfillNullBitmap(t))!==null&&r!==void 0?r:J({type:u.type,length:t,nullCount:t,nullBitmap:new Uint8Array(l)}))}return[o.assign(n),J({type:new ve(n),length:t,children:a})]}function ic(o,e,t=new Map){var r,n;if(((r=o==null?void 0:o.length)!==null&&r!==void 0?r:0)>0&&(o==null?void 0:o.length)===(e==null?void 0:e.length))for(let a=-1,l=o.length;++aJ({type:n.type})),r=J({type:new ve(e.fields),nullCount:0,children:t});super(e,r)}};var At=class o{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsMessage(e,t){return(t||new o).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMessage(e,t){return e.setPosition(e.position()+4),(t||new o).__init(e.readInt32(e.position())+e.position(),e)}version(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):ue.V1}headerType(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb_pos+e):ie.NONE}header(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__union(e,this.bb_pos+t):null}bodyLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}customMetadata(e,t){let r=this.bb.__offset(this.bb_pos,12);return r?(t||new Ce).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startMessage(e){e.startObject(5)}static addVersion(e,t){e.addFieldInt16(0,t,ue.V1)}static addHeaderType(e,t){e.addFieldInt8(1,t,ie.NONE)}static addHeader(e,t){e.addFieldOffset(2,t,0)}static addBodyLength(e,t){e.addFieldInt64(3,t,BigInt("0"))}static addCustomMetadata(e,t){e.addFieldOffset(4,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let r=t.length-1;r>=0;r--)e.addOffset(t[r]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endMessage(e){return e.endObject()}static finishMessageBuffer(e,t){e.finish(t)}static finishSizePrefixedMessageBuffer(e,t){e.finish(t,void 0,!0)}static createMessage(e,t,r,n,a,l){return o.startMessage(e),o.addVersion(e,t),o.addHeaderType(e,r),o.addHeader(e,n),o.addBodyLength(e,a),o.addCustomMetadata(e,l),o.endMessage(e)}};var ao=class extends R{visit(e,t){return e==null||t==null?void 0:super.visit(e,t)}visitNull(e,t){return Nn.startNull(t),Nn.endNull(t)}visitInt(e,t){return mt.startInt(t),mt.addBitWidth(t,e.bitWidth),mt.addIsSigned(t,e.isSigned),mt.endInt(t)}visitFloat(e,t){return yr.startFloatingPoint(t),yr.addPrecision(t,e.precision),yr.endFloatingPoint(t)}visitBinary(e,t){return Gn.startBinary(t),Gn.endBinary(t)}visitLargeBinary(e,t){return On.startLargeBinary(t),On.endLargeBinary(t)}visitBool(e,t){return Un.startBool(t),Un.endBool(t)}visitUtf8(e,t){return Vn.startUtf8(t),Vn.endUtf8(t)}visitLargeUtf8(e,t){return Rn.startLargeUtf8(t),Rn.endLargeUtf8(t)}visitDecimal(e,t){return Mt.startDecimal(t),Mt.addScale(t,e.scale),Mt.addPrecision(t,e.precision),Mt.addBitWidth(t,e.bitWidth),Mt.endDecimal(t)}visitDate(e,t){return gr.startDate(t),gr.addUnit(t,e.unit),gr.endDate(t)}visitTime(e,t){return Nt.startTime(t),Nt.addUnit(t,e.unit),Nt.addBitWidth(t,e.bitWidth),Nt.endTime(t)}visitTimestamp(e,t){let r=e.timezone&&t.createString(e.timezone)||void 0;return Wt.startTimestamp(t),Wt.addUnit(t,e.unit),r!==void 0&&Wt.addTimezone(t,r),Wt.endTimestamp(t)}visitInterval(e,t){return Sr.startInterval(t),Sr.addUnit(t,e.unit),Sr.endInterval(t)}visitDuration(e,t){return hr.startDuration(t),hr.addUnit(t,e.unit),hr.endDuration(t)}visitList(e,t){return Hn.startList(t),Hn.endList(t)}visitStruct(e,t){return Wn.startStruct_(t),Wn.endStruct_(t)}visitUnion(e,t){gt.startTypeIdsVector(t,e.typeIds.length);let r=gt.createTypeIdsVector(t,e.typeIds);return gt.startUnion(t),gt.addMode(t,e.mode),gt.addTypeIds(t,r),gt.endUnion(t)}visitDictionary(e,t){let r=this.visit(e.indices,t);return Ct.startDictionaryEncoding(t),Ct.addId(t,BigInt(e.id)),Ct.addIsOrdered(t,e.isOrdered),r!==void 0&&Ct.addIndexType(t,r),Ct.endDictionaryEncoding(t)}visitFixedSizeBinary(e,t){return vr.startFixedSizeBinary(t),vr.addByteWidth(t,e.byteWidth),vr.endFixedSizeBinary(t)}visitFixedSizeList(e,t){return br.startFixedSizeList(t),br.addListSize(t,e.listSize),br.endFixedSizeList(t)}visitMap(e,t){return Er.startMap(t),Er.addKeysSorted(t,e.keysSorted),Er.endMap(t)}},Ys=new ao;function lc(o,e=new Map){return new de(k_(o,e),Js(o.metadata),e)}function oo(o){return new Ue(o.count,uc(o.columns),_c(o.columns))}function cc(o){return new qe(oo(o.data),o.id,o.isDelta)}function k_(o,e){return(o.fields||[]).filter(Boolean).map(t=>ne.fromJSON(t,e))}function sc(o,e){return(o.children||[]).filter(Boolean).map(t=>ne.fromJSON(t,e))}function uc(o){return(o||[]).reduce((e,t)=>[...e,new lt(t.count,B_(t.VALIDITY)),...uc(t.children)],[])}function _c(o,e=[]){for(let t=-1,r=(o||[]).length;++te+ +(t===0),0)}function dc(o,e){let t,r,n,a,l,c;return!e||!(a=o.dictionary)?(l=oc(o,sc(o,e)),n=new ne(o.name,l,o.nullable,Js(o.metadata))):e.has(t=a.id)?(r=(r=a.indexType)?ac(r):new kt,c=new Ze(e.get(t),r,t,a.isOrdered),n=new ne(o.name,c,o.nullable,Js(o.metadata))):(r=(r=a.indexType)?ac(r):new kt,e.set(t,l=oc(o,sc(o,e))),c=new Ze(l,r,t,a.isOrdered),n=new ne(o.name,c,o.nullable,Js(o.metadata))),n||null}function Js(o=[]){return new Map(o.map(({key:e,value:t})=>[e,t]))}function ac(o){return new Me(o.isSigned,o.bitWidth)}function oc(o,e){let t=o.type.name;switch(t){case"NONE":return new Ne;case"null":return new Ne;case"binary":return new Vt;case"largebinary":return new zt;case"utf8":return new jt;case"largeutf8":return new $t;case"bool":return new qt;case"list":return new bt((e||[])[0]);case"struct":return new ve(e||[]);case"struct_":return new ve(e||[])}switch(t){case"int":{let r=o.type;return new Me(r.isSigned,r.bitWidth)}case"floatingpoint":{let r=o.type;return new st(pe[r.precision])}case"decimal":{let r=o.type;return new Xt(r.scale,r.precision,r.bitWidth)}case"date":{let r=o.type;return new Qt(Ae[r.unit])}case"time":{let r=o.type;return new Yt(U[r.unit],r.bitWidth)}case"timestamp":{let r=o.type;return new Jt(U[r.unit],r.timezone)}case"interval":{let r=o.type;return new Kt(Ie[r.unit])}case"duration":{let r=o.type;return new Zt(U[r.unit])}case"union":{let r=o.type,[n,...a]=(r.mode+"").toLowerCase(),l=n.toUpperCase()+a.join("");return new yt(ge[l],r.typeIds||[],e||[])}case"fixedsizebinary":{let r=o.type;return new er(r.byteWidth)}case"fixedsizelist":{let r=o.type;return new St(r.listSize,(e||[])[0])}case"map":{let r=o.type;return new Et((e||[])[0],r.keysSorted)}}throw new Error('Unrecognized type: "'.concat(t,'"'))}var G_=kr,U_=Je,Xe=class o{static fromJSON(e,t){let r=new o(0,ue.V5,t);return r._createHeader=O_(e,t),r}static decode(e){e=new U_(j(e));let t=At.getRootAsMessage(e),r=t.bodyLength(),n=t.version(),a=t.headerType(),l=new o(r,n,a);return l._createHeader=R_(t,a),l}static encode(e){let t=new G_,r=-1;return e.isSchema()?r=de.encode(t,e.header()):e.isRecordBatch()?r=Ue.encode(t,e.header()):e.isDictionaryBatch()&&(r=qe.encode(t,e.header())),At.startMessage(t),At.addVersion(t,ue.V5),At.addHeader(t,r),At.addHeaderType(t,e.headerType),At.addBodyLength(t,BigInt(e.bodyLength)),At.finishMessageBuffer(t,At.endMessage(t)),t.asUint8Array()}static from(e,t=0){if(e instanceof de)return new o(0,ue.V5,ie.Schema,e);if(e instanceof Ue)return new o(t,ue.V5,ie.RecordBatch,e);if(e instanceof qe)return new o(t,ue.V5,ie.DictionaryBatch,e);throw new Error("Unrecognized Message header: ".concat(e))}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get bodyLength(){return this._bodyLength}header(){return this._createHeader()}isSchema(){return this.headerType===ie.Schema}isRecordBatch(){return this.headerType===ie.RecordBatch}isDictionaryBatch(){return this.headerType===ie.DictionaryBatch}constructor(e,t,r,n){this._version=t,this._headerType=r,this.body=new Uint8Array(0),n&&(this._createHeader=()=>n),this._bodyLength=ae(e)}},Ue=class{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}constructor(e,t,r){this._nodes=t,this._buffers=r,this._length=ae(e)}},qe=class{get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}constructor(e,t,r=!1){this._data=e,this._isDelta=r,this._id=ae(t)}},$e=class{constructor(e,t){this.offset=ae(e),this.length=ae(t)}},lt=class{constructor(e,t){this.length=ae(e),this.nullCount=ae(t)}};function O_(o,e){return()=>{switch(e){case ie.Schema:return de.fromJSON(o);case ie.RecordBatch:return Ue.fromJSON(o);case ie.DictionaryBatch:return qe.fromJSON(o)}throw new Error("Unrecognized Message type: { name: ".concat(ie[e],", type: ").concat(e," }"))}}function R_(o,e){return()=>{switch(e){case ie.Schema:return de.decode(o.header(new ze),new Map,o.version());case ie.RecordBatch:return Ue.decode(o.header(new Ke),o.version());case ie.DictionaryBatch:return qe.decode(o.header(new Ht),o.version())}throw new Error("Unrecognized Message type: { name: ".concat(ie[e],", type: ").concat(e," }"))}}ne.encode=Y_;ne.decode=X_;ne.fromJSON=dc;de.encode=Q_;de.decode=H_;de.fromJSON=lc;Ue.encode=J_;Ue.decode=N_;Ue.fromJSON=oo;qe.encode=K_;qe.decode=W_;qe.fromJSON=cc;lt.encode=Z_;lt.decode=z_;$e.encode=ed;$e.decode=V_;function H_(o,e=new Map,t=ue.V5){let r=q_(o,e);return new de(r,Ks(o),e,t)}function N_(o,e=ue.V5){if(o.compression()!==null)throw new Error("Record batch compression not implemented");return new Ue(o.length(),j_(o),$_(o,e))}function W_(o,e=ue.V5){return new qe(Ue.decode(o.data(),e),o.id(),o.isDelta())}function V_(o){return new $e(o.offset(),o.length())}function z_(o){return new lt(o.length(),o.nullCount())}function j_(o){let e=[];for(let t,r=-1,n=-1,a=o.nodesLength();++rne.encode(o,a));ze.startFieldsVector(o,t.length);let r=ze.createFieldsVector(o,t),n=e.metadata&&e.metadata.size>0?ze.createCustomMetadataVector(o,[...e.metadata].map(([a,l])=>{let c=o.createString("".concat(a)),u=o.createString("".concat(l));return Ce.startKeyValue(o),Ce.addKey(o,c),Ce.addValue(o,u),Ce.endKeyValue(o)})):-1;return ze.startSchema(o),ze.addFields(o,r),ze.addEndianness(o,td?mr.Little:mr.Big),n!==-1&&ze.addCustomMetadata(o,n),ze.endSchema(o)}function Y_(o,e){let t=-1,r=-1,n=-1,a=e.type,l=e.typeId;G.isDictionary(a)?(l=a.dictionary.typeId,n=Ys.visit(a,o),r=Ys.visit(a.dictionary,o)):r=Ys.visit(a,o);let c=(a.children||[]).map(d=>ne.encode(o,d)),u=Re.createChildrenVector(o,c),_=e.metadata&&e.metadata.size>0?Re.createCustomMetadataVector(o,[...e.metadata].map(([d,f])=>{let p=o.createString("".concat(d)),m=o.createString("".concat(f));return Ce.startKeyValue(o),Ce.addKey(o,p),Ce.addValue(o,m),Ce.endKeyValue(o)})):-1;return e.name&&(t=o.createString(e.name)),Re.startField(o),Re.addType(o,r),Re.addTypeType(o,l),Re.addChildren(o,u),Re.addNullable(o,!!e.nullable),t!==-1&&Re.addName(o,t),n!==-1&&Re.addDictionary(o,n),_!==-1&&Re.addCustomMetadata(o,_),Re.endField(o)}function J_(o,e){let t=e.nodes||[],r=e.buffers||[];Ke.startNodesVector(o,t.length);for(let l of t.slice().reverse())lt.encode(o,l);let n=o.endVector();Ke.startBuffersVector(o,r.length);for(let l of r.slice().reverse())$e.encode(o,l);let a=o.endVector();return Ke.startRecordBatch(o),Ke.addLength(o,BigInt(e.length)),Ke.addNodes(o,n),Ke.addBuffers(o,a),Ke.endRecordBatch(o)}function K_(o,e){let t=Ue.encode(o,e.data);return Ht.startDictionaryBatch(o),Ht.addId(o,BigInt(e.id)),Ht.addIsDelta(o,e.isDelta),Ht.addData(o,t),Ht.endDictionaryBatch(o)}function Z_(o,e){return nn.createFieldNode(o,BigInt(e.length),BigInt(e.nullCount))}function ed(o,e){return rn.createBuffer(o,BigInt(e.offset),BigInt(e.length))}var td=(()=>{let o=new ArrayBuffer(2);return new DataView(o).setInt16(0,256,!0),new Int16Array(o)[0]===256})();var co=o=>"Expected ".concat(ie[o]," Message in stream, but was null or length 0."),uo=o=>"Header pointer of flatbuffer-encoded ".concat(ie[o]," Message is null or length 0."),gc=(o,e)=>"Expected to read ".concat(o," metadata bytes, but only read ").concat(e,"."),hc=(o,e)=>"Expected to read ".concat(o," bytes for message body, but only read ").concat(e,"."),En=class{constructor(e){this.source=e instanceof Ut?e:new Ut(e)}[Symbol.iterator](){return this}next(){let e;return(e=this.readMetadataLength()).done?be:e.value===-1&&(e=this.readMetadataLength()).done?be:(e=this.readMetadata(e.value)).done?be:e}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}readMessage(e){let t;if((t=this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(co(e));return t.value}readMessageBody(e){if(e<=0)return new Uint8Array(0);let t=j(this.source.read(e));if(t.byteLength[...n,...a.VALIDITY&&[a.VALIDITY]||[],...a.TYPE_ID&&[a.TYPE_ID]||[],...a.OFFSET&&[a.OFFSET]||[],...a.DATA&&[a.DATA]||[],...t(a.children)],[])}}readMessage(e){let t;if((t=this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(co(e));return t.value}readSchema(){let e=ie.Schema,t=this.readMessage(e),r=t==null?void 0:t.header();if(!t||!r)throw new Error(uo(e));return r}},Zs=4,lo="ARROW1",wn=new Uint8Array(lo.length);for(let o=0;othis):this}readRecordBatch(e){return this._impl.isFile()?this._impl.readRecordBatch(e):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return Be.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return Be.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e,t){throw new Error('"throughDOM" not available in this environment')}static from(e){return e instanceof o?e:Ti(e)?nd(e):Ii(e)?ad(e):_t(e)?B(this,void 0,void 0,function*(){return yield o.from(yield e)}):Ci(e)||Pn(e)||ki(e)||rt(e)?sd(new at(e)):id(new Ut(e))}static readAll(e){return e instanceof o?e.isSync()?bc(e):yc(e):Ti(e)||ArrayBuffer.isView(e)||dt(e)||Pi(e)?bc(e):yc(e)}},Rt=class extends Oe{constructor(e){super(e),this._impl=e}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return Qe(this,arguments,function*(){yield ee(yield*Cr(en(ut(this[Symbol.iterator]()))))})}},xr=class extends Oe{constructor(e){super(e),this._impl=e}readAll(){return B(this,void 0,void 0,function*(){var e,t,r,n;let a=new Array;try{for(var l=!0,c=ut(this),u;u=yield c.next(),e=u.done,!e;l=!0){n=u.value,l=!1;let _=n;a.push(_)}}catch(_){t={error:_}}finally{try{!l&&!e&&(r=c.return)&&(yield r.call(c))}finally{if(t)throw t.error}}return a})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}},Tr=class extends Rt{constructor(e){super(e),this._impl=e}},Fi=class extends xr{constructor(e){super(e),this._impl=e}},ta=class{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(e=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=e}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(e){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=e,this.dictionaries=new Map,this}_loadRecordBatch(e,t){let r=this._loadVectors(e,t,this.schema.fields),n=J({type:new ve(this.schema.fields),length:e.length,children:r});return new De(this.schema,n)}_loadDictionaryBatch(e,t){let{id:r,isDelta:n}=e,{dictionaries:a,schema:l}=this,c=a.get(r),u=l.dictionaries.get(r),_=this._loadVectors(e.data,t,[u]);return(c&&n?c.concat(new se(_)):new se(_)).memoize()}_loadVectors(e,t,r){return new ti(t,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(r)}},An=class extends ta{constructor(e,t){super(t),this._reader=Ti(e)?new Di(this._handle=e):new En(this._handle=e)}isSync(){return!0}isStream(){return!0}[Symbol.iterator](){return this}cancel(){!this.closed&&(this.closed=!0)&&(this.reset()._reader.return(),this._reader=null,this.dictionaries=null)}open(e){return this.closed||(this.autoDestroy=Sc(this,e),this.schema||(this.schema=this._reader.readSchema())||this.cancel()),this}throw(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(e):be}return(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(e):be}next(){if(this.closed)return be;let e,{_reader:t}=this;for(;e=this._readNextMessageAndValidate();)if(e.isSchema())this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let r=e.header(),n=t.readMessageBody(e.bodyLength);return{done:!1,value:this._loadRecordBatch(r,n)}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let r=e.header(),n=t.readMessageBody(e.bodyLength),a=this._loadDictionaryBatch(r,n);this.dictionaries.set(r.id,a)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Xr(this.schema)}):this.return()}_readNextMessageAndValidate(e){return this._reader.readMessage(e)}},Dn=class extends ta{constructor(e,t){super(t),this._reader=new Ai(this._handle=e)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return B(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(e){return B(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=Sc(this,e),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(e){return B(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(e):be})}return(e){return B(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(e):be})}next(){return B(this,void 0,void 0,function*(){if(this.closed)return be;let e,{_reader:t}=this;for(;e=yield this._readNextMessageAndValidate();)if(e.isSchema())yield this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let r=e.header(),n=yield t.readMessageBody(e.bodyLength);return{done:!1,value:this._loadRecordBatch(r,n)}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let r=e.header(),n=yield t.readMessageBody(e.bodyLength),a=this._loadDictionaryBatch(r,n);this.dictionaries.set(r.id,a)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Xr(this.schema)}):yield this.return()})}_readNextMessageAndValidate(e){return B(this,void 0,void 0,function*(){return yield this._reader.readMessage(e)})}},ra=class extends An{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(e,t){super(e instanceof Kn?e:new Kn(e),t)}isSync(){return!0}isFile(){return!0}open(e){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(let t of this._footer.dictionaryBatches())t&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(e)}readRecordBatch(e){var t;if(this.closed)return null;this._footer||this.open();let r=(t=this._footer)===null||t===void 0?void 0:t.getRecordBatch(e);if(r&&this._handle.seek(r.offset)){let n=this._reader.readMessage(ie.RecordBatch);if(n!=null&&n.isRecordBatch()){let a=n.header(),l=this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(a,l)}}return null}_readDictionaryBatch(e){var t;let r=(t=this._footer)===null||t===void 0?void 0:t.getDictionaryBatch(e);if(r&&this._handle.seek(r.offset)){let n=this._reader.readMessage(ie.DictionaryBatch);if(n!=null&&n.isDictionaryBatch()){let a=n.header(),l=this._reader.readMessageBody(n.bodyLength),c=this._loadDictionaryBatch(a,l);this.dictionaries.set(a.id,c)}}}_readFooter(){let{_handle:e}=this,t=e.size-_o,r=e.readInt32(t),n=e.readAt(t-r,r);return nr.decode(n)}_readNextMessageAndValidate(e){var t;if(this._footer||this.open(),this._footer&&this._recordBatchIndexsuper.open}});return B(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(let r of this._footer.dictionaryBatches())r&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield t.open.call(this,e)})}readRecordBatch(e){return B(this,void 0,void 0,function*(){var t;if(this.closed)return null;this._footer||(yield this.open());let r=(t=this._footer)===null||t===void 0?void 0:t.getRecordBatch(e);if(r&&(yield this._handle.seek(r.offset))){let n=yield this._reader.readMessage(ie.RecordBatch);if(n!=null&&n.isRecordBatch()){let a=n.header(),l=yield this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(a,l)}}return null})}_readDictionaryBatch(e){return B(this,void 0,void 0,function*(){var t;let r=(t=this._footer)===null||t===void 0?void 0:t.getDictionaryBatch(e);if(r&&(yield this._handle.seek(r.offset))){let n=yield this._reader.readMessage(ie.DictionaryBatch);if(n!=null&&n.isDictionaryBatch()){let a=n.header(),l=yield this._reader.readMessageBody(n.bodyLength),c=this._loadDictionaryBatch(a,l);this.dictionaries.set(a.id,c)}}})}_readFooter(){return B(this,void 0,void 0,function*(){let{_handle:e}=this;e._pending&&(yield e._pending);let t=e.size-_o,r=yield e.readInt32(t),n=yield e.readAt(t-r,r);return nr.decode(n)})}_readNextMessageAndValidate(e){return B(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex=4?ea(e)?new Tr(new ra(o.read())):new Rt(new An(o)):new Rt(new An(function*(){}()))}function sd(o){return B(this,void 0,void 0,function*(){let e=yield o.peek(Ln+7&-8);return e&&e.byteLength>=4?ea(e)?new Tr(new ra(yield o.read())):new xr(new Dn(o)):new xr(new Dn(function(){return Qe(this,arguments,function*(){})}()))})}function ad(o){return B(this,void 0,void 0,function*(){let{size:e}=yield o.stat(),t=new Fr(o,e);return e>=vc&&ea(yield t.readAt(0,Ln+7&-8))?new Fi(new fo(t)):new xr(new Dn(t))})}var we=class o extends R{static assemble(...e){let t=n=>n.flatMap(a=>Array.isArray(a)?t(a):a instanceof De?a.data.children:a.data),r=new o;return r.visitMany(t(e)),r}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}visit(e){if(e instanceof se)return this.visitMany(e.data),this;let{type:t}=e;if(!G.isDictionary(t)){let{length:r}=e;if(r>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(G.isUnion(t))this.nodes.push(new lt(r,0));else{let{nullCount:n}=e;G.isNull(t)||Dt.call(this,n<=0?new Uint8Array(0):Ur(e.offset,r,e.nullBitmap)),this.nodes.push(new lt(r,n))}}return super.visit(e)}visitNull(e){return this}visitDictionary(e){return this.visit(e.clone(e.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}};function Dt(o){let e=o.byteLength+7&-8;return this.buffers.push(o),this.bufferRegions.push(new $e(this._byteLength,e)),this._byteLength+=e,this}function od(o){var e;let{type:t,length:r,typeIds:n,valueOffsets:a}=o;if(Dt.call(this,n),t.mode===ge.Sparse)return mo.call(this,o);if(t.mode===ge.Dense){if(o.offset<=0)return Dt.call(this,a),mo.call(this,o);{let l=new Int32Array(r),c=Object.create(null),u=Object.create(null);for(let _,d,f=-1;++f{let f=t.typeIds[d],p=c[f],m=u[f];return _.slice(p,Math.min(r,m))}))}}return this}function ld(o){let e;return o.nullCount>=o.length?Dt.call(this,new Uint8Array(0)):(e=o.values)instanceof Uint8Array?Dt.call(this,Ur(o.offset,o.length,e)):Dt.call(this,Or(o.values))}function _r(o){return Dt.call(this,o.values.subarray(0,o.length*o.stride))}function na(o){let{length:e,values:t,valueOffsets:r}=o,n=ae(r[0]),a=ae(r[e]),l=Math.min(a-n,t.byteLength-n);return Dt.call(this,Gi(-n,e+1,r)),Dt.call(this,t.subarray(n,n+l)),this}function go(o){let{length:e,valueOffsets:t}=o;if(t){let{[0]:r,[e]:n}=t;return Dt.call(this,Gi(-r,e+1,t)),this.visit(o.children[0].slice(r,n-r))}return this.visit(o.children[0])}function mo(o){return this.visitMany(o.type.children.map((e,t)=>o.children[t]).filter(Boolean))[0]}we.prototype.visitBool=ld;we.prototype.visitInt=_r;we.prototype.visitFloat=_r;we.prototype.visitUtf8=na;we.prototype.visitLargeUtf8=na;we.prototype.visitBinary=na;we.prototype.visitLargeBinary=na;we.prototype.visitFixedSizeBinary=_r;we.prototype.visitDate=_r;we.prototype.visitTimestamp=_r;we.prototype.visitTime=_r;we.prototype.visitDecimal=_r;we.prototype.visitList=go;we.prototype.visitStruct=mo;we.prototype.visitUnion=od;we.prototype.visitInterval=_r;we.prototype.visitDuration=_r;we.prototype.visitFixedSizeList=go;we.prototype.visitMap=go;var Qr=class extends Nr{static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e,t){throw new Error('"throughDOM" not available in this environment')}constructor(e){super(),this._position=0,this._started=!1,this._sink=new Gt,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,He(e)||(e={autoDestroy:!0,writeLegacyIpcFormat:!1}),this._autoDestroy=typeof e.autoDestroy=="boolean"?e.autoDestroy:!0,this._writeLegacyIpcFormat=typeof e.writeLegacyIpcFormat=="boolean"?e.writeLegacyIpcFormat:!1}toString(e=!1){return this._sink.toString(e)}toUint8Array(e=!1){return this._sink.toUint8Array(e)}writeAll(e){return _t(e)?e.then(t=>this.writeAll(t)):rt(e)?vo(this,e):ho(this,e)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(e){return this._sink.toDOMStream(e)}toNodeStream(e){return this._sink.toNodeStream(e)}close(){return this.reset()._sink.close()}abort(e){return this.reset()._sink.abort(e)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(e=this._sink,t=null){return e===this._sink||e instanceof Gt?this._sink=e:(this._sink=new Gt,e&&Uo(e)?this.toDOMStream({type:"bytes"}).pipeTo(e):e&&Oo(e)&&this.toNodeStream({objectMode:!1}).pipe(e)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,(!t||!qr(t,this._schema))&&(t==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=t,this._writeSchema(t))),this}write(e){let t=null;if(this._sink){if(e==null)return this.finish()&&void 0;if(e instanceof Ve&&!(t=e.schema))return this.finish()&&void 0;if(e instanceof De&&!(t=e.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(t&&!qr(t,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,t)}e instanceof De?e instanceof Xr||this._writeRecordBatch(e):e instanceof Ve?this.writeAll(e.batches):dt(e)&&this.writeAll(e)}_writeMessage(e,t=8){let r=t-1,n=Xe.encode(e),a=n.byteLength,l=this._writeLegacyIpcFormat?4:8,c=a+l+r&~r,u=c-a-l;return e.headerType===ie.RecordBatch?this._recordBatchBlocks.push(new ir(c,e.bodyLength,this._position)):e.headerType===ie.DictionaryBatch&&this._dictionaryBlocks.push(new ir(c,e.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(c-l)),a>0&&this._write(n),this._writePadding(u)}_write(e){if(this._started){let t=j(e);t&&t.byteLength>0&&(this._sink.write(t),this._position+=t.byteLength)}return this}_writeSchema(e){return this._writeMessage(Xe.from(e))}_writeFooter(e){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(wn)}_writePadding(e){return e>0?this._write(new Uint8Array(e)):this}_writeRecordBatch(e){let{byteLength:t,nodes:r,bufferRegions:n,buffers:a}=we.assemble(e),l=new Ue(e.numRows,r,n),c=Xe.from(l,t);return this._writeDictionaries(e)._writeMessage(c)._writeBodyBuffers(a)}_writeDictionaryBatch(e,t,r=!1){let{byteLength:n,nodes:a,bufferRegions:l,buffers:c}=we.assemble(new se([e])),u=new Ue(e.length,a,l),_=new qe(u,t,r),d=Xe.from(_,n);return this._writeMessage(d)._writeBodyBuffers(c)}_writeBodyBuffers(e){let t,r,n;for(let a=-1,l=e.length;++a0&&(this._write(t),(n=(r+7&-8)-r)>0&&this._writePadding(n));return this}_writeDictionaries(e){var t,r;for(let[n,a]of e.dictionaries){let l=(t=a==null?void 0:a.data)!==null&&t!==void 0?t:[],c=this._seenDictionaries.get(n),u=(r=this._dictionaryDeltaOffsets.get(n))!==null&&r!==void 0?r:0;if(!c||c.data[0]!==l[0])for(let[_,d]of l.entries())this._writeDictionaryBatch(d,n,_>0);else if(ur.writeAll(n)):rt(e)?vo(r,e):ho(r,e)}},Jr=class o extends Qr{static writeAll(e){let t=new o;return _t(e)?e.then(r=>t.writeAll(r)):rt(e)?vo(t,e):ho(t,e)}constructor(){super(),this._autoDestroy=!0}_writeSchema(e){return this._writeMagic()._writePadding(2)}_writeDictionaryBatch(e,t,r=!1){if(!r&&this._seenDictionaries.has(t))throw new Error("The Arrow File format does not support replacement dictionaries. ");return super._writeDictionaryBatch(e,t,r)}_writeFooter(e){let t=nr.encode(new nr(e,ue.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(e)._write(t)._write(Int32Array.of(t.byteLength))._writeMagic()}};function ho(o,e){let t=e;e instanceof Ve&&(t=e.batches,o.reset(void 0,e.schema));for(let r of t)o.write(r);return o.finish()}function vo(o,e){return B(this,void 0,void 0,function*(){var t,r,n,a,l,c,u;try{for(t=!0,r=ut(e);n=yield r.next(),a=n.done,!a;t=!0){u=n.value,t=!1;let _=u;o.write(_)}}catch(_){l={error:_}}finally{try{!t&&!a&&(c=r.return)&&(yield c.call(r))}finally{if(l)throw l.error}}return o.finish()})}function Ec(o,e){if(rt(o))return ud(o,e);if(dt(o))return cd(o,e);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function cd(o,e){let t=null,r=(e==null?void 0:e.type)==="bytes"||!1,n=(e==null?void 0:e.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},e),{start(l){a(l,t||(t=o[Symbol.iterator]()))},pull(l){t?a(l,t):l.close()},cancel(){(t!=null&&t.return&&t.return()||!0)&&(t=null)}}),Object.assign({highWaterMark:r?n:void 0},e));function a(l,c){let u,_=null,d=l.desiredSize||null;for(;!(_=c.next(r?d:null)).done;)if(ArrayBuffer.isView(_.value)&&(u=j(_.value))&&(d!=null&&r&&(d=d-u.byteLength+1),_.value=u),l.enqueue(_.value),d!=null&&--d<=0)return;l.close()}}function ud(o,e){let t=null,r=(e==null?void 0:e.type)==="bytes"||!1,n=(e==null?void 0:e.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},e),{start(l){return B(this,void 0,void 0,function*(){yield a(l,t||(t=o[Symbol.asyncIterator]()))})},pull(l){return B(this,void 0,void 0,function*(){t?yield a(l,t):l.close()})},cancel(){return B(this,void 0,void 0,function*(){(t!=null&&t.return&&(yield t.return())||!0)&&(t=null)})}}),Object.assign({highWaterMark:r?n:void 0},e));function a(l,c){return B(this,void 0,void 0,function*(){let u,_=null,d=l.desiredSize||null;for(;!(_=yield c.next(r?d:null)).done;)if(ArrayBuffer.isView(_.value)&&(u=j(_.value))&&(d!=null&&r&&(d=d-u.byteLength+1),_.value=u),l.enqueue(_.value),d!=null&&--d<=0)return;l.close()})}}function Ac(o){return new bo(o)}var bo=class{constructor(e){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:t,["writableStrategy"]:r,["queueingStrategy"]:n="count"}=e,a=Bo(e,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=Vr(a),this._getSize=n!=="bytes"?wc:Lc;let{["highWaterMark"]:l=n==="bytes"?Math.pow(2,14):1e3}=Object.assign({},t),{["highWaterMark"]:c=n==="bytes"?Math.pow(2,14):1e3}=Object.assign({},r);this.readable=new ReadableStream({cancel:()=>{this._builder.clear()},pull:u=>{this._maybeFlush(this._builder,this._controller=u)},start:u=>{this._maybeFlush(this._builder,this._controller=u)}},{highWaterMark:l,size:n!=="bytes"?wc:Lc}),this.writable=new WritableStream({abort:()=>{this._builder.clear()},write:()=>{this._maybeFlush(this._builder,this._controller)},close:()=>{this._maybeFlush(this._builder.finish(),this._controller)}},{highWaterMark:c,size:u=>this._writeValueAndReturnChunkSize(u)})}_writeValueAndReturnChunkSize(e){let t=this._bufferedSize;return this._bufferedSize=this._getSize(this._builder.append(e)),this._bufferedSize-t}_maybeFlush(e,t){t!=null&&(this._bufferedSize>=t.desiredSize&&++this._numChunks&&this._enqueue(t,e.toVector()),e.finished&&((e.length>0||this._numChunks===0)&&++this._numChunks&&this._enqueue(t,e.toVector()),!this._finished&&(this._finished=!0)&&this._enqueue(t,null)))}_enqueue(e,t){this._bufferedSize=0,this._controller=null,t==null?e.close():e.enqueue(t)}},wc=o=>{var e;return(e=o==null?void 0:o.length)!==null&&e!==void 0?e:0},Lc=o=>{var e;return(e=o==null?void 0:o.byteLength)!==null&&e!==void 0?e:0};function ia(o,e){let t=new Gt,r=null,n=new ReadableStream({cancel(){return B(this,void 0,void 0,function*(){yield t.close()})},start(c){return B(this,void 0,void 0,function*(){yield l(c,r||(r=yield a()))})},pull(c){return B(this,void 0,void 0,function*(){r?yield l(c,r):c.close()})}});return{writable:new WritableStream(t,Object.assign({highWaterMark:Math.pow(2,14)},o)),readable:n};function a(){return B(this,void 0,void 0,function*(){return yield(yield Oe.from(t)).open(e)})}function l(c,u){return B(this,void 0,void 0,function*(){let _=c.desiredSize,d=null;for(;!(d=yield u.next()).done;)if(c.enqueue(d.value),_!=null&&--_<=0)return;c.close()})}}function sa(o,e){let t=new this(o),r=new at(t),n=new ReadableStream({cancel(){return B(this,void 0,void 0,function*(){yield r.cancel()})},pull(l){return B(this,void 0,void 0,function*(){yield a(l)})},start(l){return B(this,void 0,void 0,function*(){yield a(l)})}},Object.assign({highWaterMark:Math.pow(2,14)},e));return{writable:new WritableStream(t,o),readable:n};function a(l){return B(this,void 0,void 0,function*(){let c=null,u=l.desiredSize;for(;c=yield r.read(u||null);)if(l.enqueue(c),u!=null&&(u-=c.byteLength)<=0)return;l.close()})}}function aa(o,e="stream"){return(e==="stream"?Yr:Jr).writeAll(o).toUint8Array(!0)}var pd=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Pa),to),$a),Ia),wa),ja),Da),{compareSchemas:qr,compareFields:Zl,compareTypes:ec});Be.toDOMStream=Ec;Se.throughDOM=Ac;Oe.throughDOM=ia;Tr.throughDOM=ia;Rt.throughDOM=ia;Qr.throughDOM=sa;Jr.throughDOM=sa;Yr.throughDOM=sa;function Fn(o){switch(o.typeId){case v.Binary:return{sqlType:"binary"};case v.Bool:return{sqlType:"bool"};case v.Date:return{sqlType:"date"};case v.DateDay:return{sqlType:"date32[d]"};case v.DateMillisecond:return{sqlType:"date64[ms]"};case v.Decimal:{let e=o;return{sqlType:"decimal",precision:e.precision,scale:e.scale}}case v.Float:return{sqlType:"float"};case v.Float16:return{sqlType:"float16"};case v.Float32:return{sqlType:"float32"};case v.Float64:return{sqlType:"float64"};case v.Int:return{sqlType:"int32"};case v.Int16:return{sqlType:"int16"};case v.Int32:return{sqlType:"int32"};case v.Int64:return{sqlType:"int64"};case v.Uint16:return{sqlType:"uint16"};case v.Uint32:return{sqlType:"uint32"};case v.Uint64:return{sqlType:"uint64"};case v.Uint8:return{sqlType:"uint8"};case v.IntervalDayTime:return{sqlType:"interval[dt]"};case v.IntervalYearMonth:return{sqlType:"interval[m]"};case v.List:return{sqlType:"list",valueType:Fn(o.valueType)};case v.FixedSizeBinary:return{sqlType:"fixedsizebinary",byteWidth:o.byteWidth};case v.Null:return{sqlType:"null"};case v.Utf8:return{sqlType:"utf8"};case v.Struct:return{sqlType:"struct",fields:o.children.map(t=>oa(t.name,t.type))};case v.Map:{let e=o;return{sqlType:"map",keyType:Fn(e.keyType),valueType:Fn(e.valueType)}}case v.Time:return{sqlType:"time[s]"};case v.TimeMicrosecond:return{sqlType:"time[us]"};case v.TimeMillisecond:return{sqlType:"time[ms]"};case v.TimeNanosecond:return{sqlType:"time[ns]"};case v.TimeSecond:return{sqlType:"time[s]"};case v.Timestamp:return{sqlType:"timestamp",timezone:o.timezone||void 0};case v.TimestampSecond:return{sqlType:"timestamp[s]",timezone:o.timezone||void 0};case v.TimestampMicrosecond:return{sqlType:"timestamp[us]",timezone:o.timezone||void 0};case v.TimestampNanosecond:return{sqlType:"timestamp[ns]",timezone:o.timezone||void 0};case v.TimestampMillisecond:return{sqlType:"timestamp[ms]",timezone:o.timezone||void 0}}throw new Error("unsupported arrow type: ".concat(o.toString()))}function oa(o,e){let t=Fn(e);return t.name=o,t}var la=class{constructor(){this._bindings=null;this._nextMessageId=0}log(e){this.postMessage({messageId:this._nextMessageId++,requestId:0,type:"LOG",data:e},[])}sendOK(e){this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"OK",data:null},[])}failWith(e,t){let r={name:t.name,message:t.message,stack:t.stack||void 0};this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"ERROR",data:r},[])}async onMessage(e){switch(e.type){case"PING":this.sendOK(e);return;case"INSTANTIATE":this._bindings!=null&&this.failWith(e,new Error("duckdb already initialized"));try{this._bindings=await this.instantiate(e.data[0],e.data[1],t=>{this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"INSTANTIATE_PROGRESS",data:t},[])}),this.sendOK(e)}catch(t){console.log(t),this._bindings=null,this.failWith(e,t)}return;default:break}if(!this._bindings)return this.failWith(e,new Error("duckdb is not initialized"));try{switch(e.type){case"GET_VERSION":this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"VERSION_STRING",data:this._bindings.getVersion()},[]);break;case"GET_FEATURE_FLAGS":this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"FEATURE_FLAGS",data:this._bindings.getFeatureFlags()},[]);break;case"RESET":this._bindings.reset(),this.sendOK(e);break;case"OPEN":this._bindings.open(e.data),this.sendOK(e);break;case"DROP_FILE":this._bindings.dropFile(e.data),this.sendOK(e);break;case"DROP_FILES":this._bindings.dropFiles(),this.sendOK(e);break;case"FLUSH_FILES":this._bindings.flushFiles(),this.sendOK(e);break;case"CONNECT":{let t=this._bindings.connect();this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"CONNECTION_INFO",data:t.useUnsafe((r,n)=>n)},[]);break}case"DISCONNECT":this._bindings.disconnect(e.data),this.sendOK(e);break;case"CREATE_PREPARED":{let t=this._bindings.createPrepared(e.data[0],e.data[1]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"PREPARED_STATEMENT_ID",data:t},[]);break}case"CLOSE_PREPARED":{this._bindings.closePrepared(e.data[0],e.data[1]),this.sendOK(e);break}case"RUN_PREPARED":{let t=this._bindings.runPrepared(e.data[0],e.data[1],e.data[2]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"QUERY_RESULT",data:t},[t.buffer]);break}case"RUN_QUERY":{let t=this._bindings.runQuery(e.data[0],e.data[1]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"QUERY_RESULT",data:t},[t.buffer]);break}case"SEND_PREPARED":{let t=this._bindings.sendPrepared(e.data[0],e.data[1],e.data[2]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"QUERY_RESULT_HEADER",data:t},[t.buffer]);break}case"START_PENDING_QUERY":{let t=this._bindings.startPendingQuery(e.data[0],e.data[1]),r=[];t&&r.push(t.buffer),this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"QUERY_RESULT_HEADER_OR_NULL",data:t},r);break}case"POLL_PENDING_QUERY":{let t=this._bindings.pollPendingQuery(e.data),r=[];t&&r.push(t.buffer),this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"QUERY_RESULT_HEADER_OR_NULL",data:t},r);break}case"CANCEL_PENDING_QUERY":{let t=this._bindings.cancelPendingQuery(e.data);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"SUCCESS",data:t},[]);break}case"FETCH_QUERY_RESULTS":{let t=this._bindings.fetchQueryResults(e.data);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"QUERY_RESULT_CHUNK",data:t},[t.buffer]);break}case"GET_TABLE_NAMES":{let t=this._bindings.getTableNames(e.data[0],e.data[1]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"TABLE_NAMES",data:t},[]);break}case"GLOB_FILE_INFOS":{let t=this._bindings.globFiles(e.data);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"FILE_INFOS",data:t},[]);break}case"REGISTER_FILE_URL":this._bindings.registerFileURL(e.data[0],e.data[1],e.data[2],e.data[3]),this.sendOK(e);break;case"REGISTER_FILE_BUFFER":this._bindings.registerFileBuffer(e.data[0],e.data[1]),this.sendOK(e);break;case"REGISTER_FILE_HANDLE":this._bindings.registerFileHandle(e.data[0],e.data[1],e.data[2],e.data[3]),this.sendOK(e);break;case"COPY_FILE_TO_PATH":this._bindings.copyFileToPath(e.data[0],e.data[1]),this.sendOK(e);break;case"COPY_FILE_TO_BUFFER":{let t=this._bindings.copyFileToBuffer(e.data);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"FILE_BUFFER",data:t},[]);break}case"COLLECT_FILE_STATISTICS":this._bindings.collectFileStatistics(e.data[0],e.data[1]),this.sendOK(e);break;case"EXPORT_FILE_STATISTICS":{this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"FILE_STATISTICS",data:this._bindings.exportFileStatistics(e.data)},[]);break}case"INSERT_ARROW_FROM_IPC_STREAM":{this._bindings.insertArrowFromIPCStream(e.data[0],e.data[1],e.data[2]),this.sendOK(e);break}case"IMPORT_CSV_FROM_PATH":{this._bindings.insertCSVFromPath(e.data[0],e.data[1],e.data[2]),this.sendOK(e);break}case"IMPORT_JSON_FROM_PATH":{this._bindings.insertJSONFromPath(e.data[0],e.data[1],e.data[2]),this.sendOK(e);break}case"TOKENIZE":{let t=this._bindings.tokenize(e.data);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"SCRIPT_TOKENS",data:t},[]);break}}}catch(t){return console.log(t),this.failWith(e,t)}}};var Bc=Mo(Tc());var ca=class{constructor(e,t){this._bindings=e,this._conn=t}close(){this._bindings.disconnect(this._conn)}useUnsafe(e){return e(this._bindings,this._conn)}query(e){let t=this._bindings.runQuery(this._conn,e),r=Oe.from(t);return console.assert(r.isSync()),console.assert(r.isFile()),new Ve(r)}async send(e){let t=this._bindings.startPendingQuery(this._conn,e);for(;t==null;)t=await new Promise((a,l)=>{try{a(this._bindings.pollPendingQuery(this._conn))}catch(c){console.log(c),l(c)}});let r=new ua(this._bindings,this._conn,t),n=Oe.from(r);return console.assert(n.isSync()),console.assert(n.isStream()),n}cancelSent(){return this._bindings.cancelPendingQuery(this._conn)}getTableNames(e){return this._bindings.getTableNames(this._conn,e)}prepare(e){let t=this._bindings.createPrepared(this._conn,e);return new wo(this._bindings,this._conn,t)}createScalarFunction(e,t,r){this._bindings.createScalarFunction(this._conn,e,t,r)}insertArrowTable(e,t){let r=aa(e,"stream");this.insertArrowFromIPCStream(r,t)}insertArrowFromIPCStream(e,t){this._bindings.insertArrowFromIPCStream(this._conn,e,t)}insertCSVFromPath(e,t){this._bindings.insertCSVFromPath(this._conn,e,t)}insertJSONFromPath(e,t){this._bindings.insertJSONFromPath(this._conn,e,t)}},ua=class{constructor(e,t,r){this.bindings=e;this.conn=t;this.header=r;this._first=!0,this._depleted=!1}next(){if(this._first)return this._first=!1,{done:!1,value:this.header};if(this._depleted)return{done:!0,value:null};let e=this.bindings.fetchQueryResults(this.conn);return this._depleted=e.length==0,{done:this._depleted,value:e}}[Symbol.iterator](){return this}},wo=class{constructor(e,t,r){this.bindings=e,this.connectionId=t,this.statementId=r}close(){this.bindings.closePrepared(this.connectionId,this.statementId)}query(...e){let t=this.bindings.runPrepared(this.connectionId,this.statementId,e),r=Oe.from(t);return console.assert(r.isSync()),console.assert(r.isFile()),new Ve(r)}send(...e){let t=this.bindings.sendPrepared(this.connectionId,this.statementId,e),r=new ua(this.bindings,this.connectionId,t),n=Oe.from(r);return console.assert(n.isSync()),console.assert(n.isStream()),n}};var Cc=new TextEncoder,Pc=new TextDecoder("utf-8");function Lo(o,e,t){let r=Cc.encode(t),n=o._malloc(r.byteLength),a=o.HEAPU8.subarray(n,n+r.byteLength);a.set(r),o.HEAPF64[(e>>3)+0]=1,o.HEAPF64[(e>>3)+1]=n,o.HEAPF64[(e>>3)+2]=a.byteLength}function Do(o){switch(o){case"UINT8":case"INT8":return 1;case"INT32":case"FLOAT":return 4;case"INT64":case"UINT64":case"DOUBLE":case"VARCHAR":return 8;default:return 0}}function Ao(o,e,t,r){let n=o.HEAPU8.subarray(e,e+r*Do(t));switch(t){case"UINT8":return new Uint8Array(n.buffer,n.byteOffset,r);case"INT8":return new Int8Array(n.buffer,n.byteOffset,r);case"INT32":return new Int32Array(n.buffer,n.byteOffset,r);case"FLOAT":return new Float32Array(n.buffer,n.byteOffset,r);case"DOUBLE":return new Float64Array(n.buffer,n.byteOffset,r);case"VARCHAR":return new Float64Array(n.buffer,n.byteOffset,r);default:return new Array(0)}}function Ic(o,e,t){let r=o.HEAPU8.subarray(e,e+t);return new Uint8Array(r.buffer,r.byteOffset,t)}function _a(o,e,t){let r=o.HEAPU8.subarray(e,e+t*8);return new Float64Array(r.buffer,r.byteOffset,t)}function Mc(o,e,t,r,n,a,l,c){try{let u=o._udfFunctions.get(r);if(!u){Lo(e,t,"Unknown UDF with id: "+r);return}let _=Pc.decode(e.HEAPU8.subarray(n,n+a)),d=JSON.parse(_),f=_a(e,l,c/8),p=w=>{var A;let P=null;switch(w.validityBuffer!==void 0&&(P=Ic(e,f[w.validityBuffer],d.rows)),w.physicalType){case"VARCHAR":{if(w.dataBuffer===null||w.dataBuffer===void 0)throw new Error("malformed data view, expected data buffer for VARCHAR argument");if(w.lengthBuffer===null||w.lengthBuffer===void 0)throw new Error("malformed data view, expected data length buffer for VARCHAR argument");let M=Ao(e,f[w.dataBuffer],w.physicalType,d.rows),D=[],C=_a(e,f[w.lengthBuffer],d.rows);for(let k=0;kD[k]}case"STRUCT":{let M={},D=[];for(let C=0;C<(((A=w.children)==null?void 0:A.length)||0);++C){let k=w.children[C],X=p(k);D.push(Z=>{M[k.name]=X(Z)})}return P!=null?C=>{if(!P[C])return null;for(let k of D)k(C);return M}:C=>{for(let k of D)k(C);return M}}default:{if(w.dataBuffer===void 0)throw new Error("malformed data view, expected data buffer for argument of type: "+w.physicalType);let M=Ao(e,f[w.dataBuffer],w.physicalType,d.rows);return P!=null?D=>P[D]?M[D]:null:D=>M[D]}}},m=[];for(let w=0;w>3)+0]=0,e.HEAPF64[(t>>3)+1]=x,e.HEAPF64[(t>>3)+2]=0}catch(u){Lo(e,t,u.toString())}}function gd(){let o=new TextDecoder;return e=>(typeof SharedArrayBuffer<"u"&&e.buffer instanceof SharedArrayBuffer&&(e=new Uint8Array(e)),o.decode(e))}var hd=gd();function ct(o,e){console.error("FAIL WITH: ".concat(e)),o.ccall("duckdb_web_fail_with",null,["string"],[e])}function Kr(o,e,t){let r=o.HEAPU8.subarray(e,e+t),n=new Uint8Array(new ArrayBuffer(r.byteLength));return n.set(r),n}function te(o,e,t){return hd(o.HEAPU8.subarray(e,e+t))}function fe(o,e,t,r){let n=o.stackSave(),a=o.stackAlloc(3*8);t.unshift("number"),r.unshift(a),o.ccall(e,null,t,r);let l=o.HEAPF64[(a>>3)+0],c=o.HEAPF64[(a>>3)+1],u=o.HEAPF64[(a>>3)+2];return o.stackRestore(n),[l,c,u]}function ye(o){o.ccall("duckdb_web_clear_response",null,[],[])}var da=class{constructor(e){let t=new Float64Array(e.buffer,e.byteOffset,e.byteLength/8),r=new Uint8Array(new ArrayBuffer(e.byteLength));r.set(e.subarray(7*8)),this.totalFileReadsCold=t[0],this.totalFileReadsAhead=t[1],this.totalFileReadsCached=t[2],this.totalFileWrites=t[3],this.totalPageAccesses=t[4],this.totalPageLoads=t[5],this.blockSize=t[6],this.blockStats=r}getBlockStats(e,t){return t=t||{file_reads_cold:0,file_reads_ahead:0,file_reads_cached:0,file_writes:0,page_accesses:0,page_loads:0},t.file_writes=this.blockStats[e*3+0]&15,t.file_reads_cold=this.blockStats[e*3+0]>>4,t.file_reads_ahead=this.blockStats[e*3+1]&15,t.file_reads_cached=this.blockStats[e*3+1]>>4,t.page_accesses=this.blockStats[e*3+1]&15,t.page_loads=this.blockStats[e*3+1]>>4,t}};var kc=new TextEncoder;var fa=class{constructor(e,t){this._instance=null;this._initPromise=null;this._initPromiseResolver=()=>{};this.onInstantiationProgress=[];this._logger=e,this._runtime=t,this._nextUDFId=1}get logger(){return this._logger}get mod(){return this._instance}get pthread(){return this.mod.PThread||null}async instantiate(e=t=>{}){return this._instance!=null?this:(this._initPromise!=null&&(this.onInstantiationProgress.push(e),await this._initPromise),this._initPromise=new Promise(t=>{this._initPromiseResolver=t}),this.onInstantiationProgress=[e],this._instance=await this.instantiateImpl({print:console.log.bind(console),printErr:console.log.bind(console),onRuntimeInitialized:this._initPromiseResolver}),await this._initPromise,this._initPromise=null,this.onInstantiationProgress=this.onInstantiationProgress.filter(t=>t!=e),globalThis.DUCKDB_BINDINGS=this,this)}open(e){let[t,r,n]=fe(this.mod,"duckdb_web_open",["string"],[JSON.stringify(e)]);if(t!==0)throw new Error(te(this.mod,r,n));ye(this.mod)}reset(){let[e,t,r]=fe(this.mod,"duckdb_web_reset",[],[]);if(e!==0)throw new Error(te(this.mod,t,r));ye(this.mod)}getVersion(){let[e,t,r]=fe(this.mod,"duckdb_web_get_version",[],[]);if(e!==0)throw new Error(te(this.mod,t,r));let n=te(this.mod,t,r);return ye(this.mod),n}getFeatureFlags(){return this.mod.ccall("duckdb_web_get_feature_flags","number",[],[])}tokenize(e){let[t,r,n]=fe(this.mod,"duckdb_web_tokenize",["string"],[e]);if(t!==0)throw new Error(te(this.mod,r,n));let a=te(this.mod,r,n);return ye(this.mod),JSON.parse(a)}connect(){let e=this.mod.ccall("duckdb_web_connect","number",[],[]);return new ca(this,e)}disconnect(e){if(this.mod.ccall("duckdb_web_disconnect",null,["number"],[e]),this.pthread)for(let t of[...this.pthread.runningWorkers,...this.pthread.unusedWorkers])t.postMessage({cmd:"dropUDFFunctions",connectionId:e})}runQuery(e,t){let r=kc.encode(t),n=this.mod._malloc(r.length);this.mod.HEAPU8.subarray(n,n+r.length).set(r);let[l,c,u]=fe(this.mod,"duckdb_web_query_run_buffer",["number","number","number"],[e,n,r.length]);if(l!==0)throw new Error(te(this.mod,c,u));let _=Kr(this.mod,c,u);return ye(this.mod),this.mod._free(n),_}startPendingQuery(e,t){let[r,n,a]=fe(this.mod,"duckdb_web_pending_query_start",["number","string"],[e,t]);if(r!==0)throw new Error(te(this.mod,n,a));if(n==0)return null;let l=Kr(this.mod,n,a);return ye(this.mod),l}pollPendingQuery(e){let[t,r,n]=fe(this.mod,"duckdb_web_pending_query_poll",["number"],[e]);if(t!==0)throw new Error(te(this.mod,r,n));if(r==0)return null;let a=Kr(this.mod,r,n);return ye(this.mod),a}cancelPendingQuery(e){return this.mod.ccall("duckdb_web_pending_query_cancel","boolean",["number"],[e])}fetchQueryResults(e){let[t,r,n]=fe(this.mod,"duckdb_web_query_fetch_results",["number"],[e]);if(t!==0)throw new Error(te(this.mod,r,n));let a=Kr(this.mod,r,n);return ye(this.mod),a}getTableNames(e,t){let[r,n,a]=fe(this.mod,"duckdb_web_get_tablenames",["number","string"],[e,t]);if(r!==0)throw new Error(te(this.mod,n,a));let l=te(this.mod,n,a);return ye(this.mod),JSON.parse(l)}createScalarFunction(e,t,r,n){let a={functionId:this._nextUDFId,name:t,returnType:Fn(r)},l={functionId:a.functionId,connectionId:e,name:t,returnType:r,func:n};this._nextUDFId+=1;let[c,u,_]=fe(this.mod,"duckdb_web_udf_scalar_create",["number","string"],[e,JSON.stringify(a)]);if(c!==0)throw new Error(te(this.mod,u,_));if(ye(this.mod),globalThis.DUCKDB_RUNTIME._udfFunctions=(globalThis.DUCKDB_RUNTIME._udfFunctions||new Map).set(l.functionId,l),this.pthread)for(let d of[...this.pthread.runningWorkers,...this.pthread.unusedWorkers])d.postMessage({cmd:"registerUDFFunction",udf:l})}createPrepared(e,t){let[r,n,a]=fe(this.mod,"duckdb_web_prepared_create",["number","string"],[e,t]);if(r!==0)throw new Error(te(this.mod,n,a));return ye(this.mod),n}closePrepared(e,t){let[r,n,a]=fe(this.mod,"duckdb_web_prepared_close",["number","number"],[e,t]);if(r!==0)throw new Error(te(this.mod,n,a));ye(this.mod)}runPrepared(e,t,r){let[n,a,l]=fe(this.mod,"duckdb_web_prepared_run",["number","number","string"],[e,t,JSON.stringify(r)]);if(n!==0)throw new Error(te(this.mod,a,l));let c=Kr(this.mod,a,l);return ye(this.mod),c}sendPrepared(e,t,r){let[n,a,l]=fe(this.mod,"duckdb_web_prepared_send",["number","number","string"],[e,t,JSON.stringify(r)]);if(n!==0)throw new Error(te(this.mod,a,l));let c=Kr(this.mod,a,l);return ye(this.mod),c}insertArrowFromIPCStream(e,t,r){if(t.length==0)return;let n=this.mod._malloc(t.length);this.mod.HEAPU8.subarray(n,n+t.length).set(t);let l=r?JSON.stringify(r):"",[c,u,_]=fe(this.mod,"duckdb_web_insert_arrow_from_ipc_stream",["number","number","number","string"],[e,n,t.length,l]);if(c!==0)throw new Error(te(this.mod,u,_))}insertCSVFromPath(e,t,r){if(r.columns!==void 0){r.columnsFlat=[];for(let _ in r.columns)r.columnsFlat.push(oa(_,r.columns[_]))}let n={...r};n.columns=n.columnsFlat,delete n.columnsFlat;let a=JSON.stringify(n),[l,c,u]=fe(this.mod,"duckdb_web_insert_csv_from_path",["number","string","string"],[e,t,a]);if(l!==0)throw new Error(te(this.mod,c,u))}insertJSONFromPath(e,t,r){if(r.columns!==void 0){r.columnsFlat=[];for(let _ in r.columns)r.columnsFlat.push(oa(_,r.columns[_]))}let n={...r};n.columns=n.columnsFlat,delete n.columnsFlat;let a=JSON.stringify(n),[l,c,u]=fe(this.mod,"duckdb_web_insert_json_from_path",["number","string","string"],[e,t,a]);if(l!==0)throw new Error(te(this.mod,c,u))}globFiles(e){let[t,r,n]=fe(this.mod,"duckdb_web_fs_glob_file_infos",["string"],[e]);if(t!==0)throw new Error(te(this.mod,r,n));let a=te(this.mod,r,n);ye(this.mod);let l=JSON.parse(a);return l==null?[]:l}registerFileURL(e,t,r,n=!1){t===void 0&&(t=e);let[a,l,c]=fe(this.mod,"duckdb_web_fs_register_file_url",["string","string"],[e,t,r,n]);if(a!==0)throw new Error(te(this.mod,l,c));ye(this.mod)}registerFileText(e,t){let r=kc.encode(t);this.registerFileBuffer(e,r)}registerFileBuffer(e,t){let r=this.mod._malloc(t.length);this.mod.HEAPU8.subarray(r,r+t.length).set(t);let[a,l,c]=fe(this.mod,"duckdb_web_fs_register_file_buffer",["string","number","number"],[e,r,t.length]);if(a!==0)throw new Error(te(this.mod,l,c));ye(this.mod)}registerFileHandle(e,t,r,n){let[a,l,c]=fe(this.mod,"duckdb_web_fs_register_file_url",["string","string","number","boolean"],[e,e,r,n]);if(a!==0)throw new Error(te(this.mod,l,c));if(ye(this.mod),globalThis.DUCKDB_RUNTIME._files=(globalThis.DUCKDB_RUNTIME._files||new Map).set(e,t),this.pthread){for(let u of this.pthread.runningWorkers)u.postMessage({cmd:"registerFileHandle",fileName:e,fileHandle:t});for(let u of this.pthread.unusedWorkers)u.postMessage({cmd:"dropFileHandle",fileName:e})}}dropFile(e){let[t,r,n]=fe(this.mod,"duckdb_web_fs_drop_file",["string"],[e]);if(t!==0)throw new Error(te(this.mod,r,n));ye(this.mod)}dropFiles(){let[e,t,r]=fe(this.mod,"duckdb_web_fs_drop_files",[],[]);if(e!==0)throw new Error(te(this.mod,t,r));ye(this.mod)}flushFiles(){this.mod.ccall("duckdb_web_flush_files",null,[],[])}copyFileToPath(e,t){let[r,n,a]=fe(this.mod,"duckdb_web_copy_file_to_path",["string","string"],[e,t]);if(r!==0)throw new Error(te(this.mod,n,a));ye(this.mod)}copyFileToBuffer(e){let[t,r,n]=fe(this.mod,"duckdb_web_copy_file_to_buffer",["string"],[e]);if(t!==0)throw new Error(te(this.mod,r,n));let a=this.mod.HEAPU8.subarray(r,r+n),l=new Uint8Array(a.length);return l.set(a),ye(this.mod),l}collectFileStatistics(e,t){let[r,n,a]=fe(this.mod,"duckdb_web_collect_file_stats",["string","boolean"],[e,t]);if(r!==0)throw new Error(te(this.mod,n,a))}exportFileStatistics(e){let[t,r,n]=fe(this.mod,"duckdb_web_export_file_stats",["string"],[e]);if(t!==0)throw new Error(te(this.mod,r,n));return new da(this.mod.HEAPU8.subarray(r,r+n))}};var pa=class extends fa{constructor(e,t,r,n){super(e,t),this.mainModuleURL=r,this.pthreadWorkerURL=n}locateFile(e,t){if(e.endsWith(".wasm"))return this.mainModuleURL;if(e.endsWith(".worker.js")){if(!this.pthreadWorkerURL)throw new Error("Missing DuckDB worker URL!");return this.pthreadWorkerURL}throw new Error("WASM instantiation requested unexpected file: prefix=".concat(t," path=").concat(e))}instantiateWasm(e,t){globalThis.DUCKDB_RUNTIME=this._runtime;let r=this.onInstantiationProgress;if(WebAssembly.instantiateStreaming)if(typeof TransformStream=="function"){let a=(async()=>{var g;let l=new Request(this.mainModuleURL),c=await fetch(l),u=c.headers.get("content-length"),_=u&&parseInt(u,10)||0,d=new Date,f={startedAt:d,updatedAt:d,bytesTotal:_||0,bytesLoaded:0},p={transform(h,b){f.bytesLoaded+=h.byteLength;let y=new Date;if(y.getTime()-f.updatedAt.getTime()<20){f.updatedAt=y,b.enqueue(h);return}for(let L of r)L(f);b.enqueue(h)}},m=new TransformStream(p);return new Response((g=c.body)==null?void 0:g.pipeThrough(m),c)})();WebAssembly.instantiateStreaming(a,e).then(l=>{t(l.instance,l.module)})}else{console.warn("instantiating without progress handler since transform streams are unavailable");let n=new Request(this.mainModuleURL);WebAssembly.instantiateStreaming(fetch(n),e).then(a=>{t(a.instance,a.module)})}else if(typeof XMLHttpRequest=="function"){let n=new XMLHttpRequest,a=this.mainModuleURL,l=new Date,c={startedAt:l,updatedAt:l,bytesTotal:0,bytesLoaded:0};n.open("GET",a),n.responseType="arraybuffer",n.onerror=u=>{throw this.logger.log({timestamp:new Date,level:4,origin:3,topic:5,event:2,value:"Failed to load WASM: "+u}),new Error(u.toString())},n.onprogress=u=>{c.bytesTotal=u.total,c.bytesLoaded=u.loaded;let _=new Date;if(_.getTime()-c.updatedAt.getTime()<20){c.updatedAt=_;return}for(let d of r)d(c)},n.onload=()=>{WebAssembly.instantiate(n.response,e).then(u=>{t(u.instance,u.module)}).catch(u=>{throw this.logger.log({timestamp:new Date,level:4,origin:3,topic:5,event:2,value:"Failed to instantiate WASM: "+u}),new Error(u)})},n.send()}else console.warn("instantiating with manual fetch since streaming instantiation and xhrs are unavailable"),(async()=>{let a=new Request(this.mainModuleURL),c=await(await fetch(a)).arrayBuffer();WebAssembly.instantiate(c,e).then(u=>{t(u.instance,u.module)})})();return[]}};var ma=class extends pa{constructor(e,t,r,n=null){super(e,t,r,n)}instantiateImpl(e){return(0,Bc.default)({...e,instantiateWasm:this.instantiateWasm.bind(this),locateFile:this.locateFile.bind(this)})}};var Pr=Mo(Oc()),Rc=function(o,e,t){var r;if((r=o==null?void 0:o.endpoint)!=null&&r.startsWith("http")){let n="".concat(o==null?void 0:o.endpoint),a=n.indexOf("://")+3;return n.substring(a)}else return o!=null&&o.endpoint?"".concat(t,".").concat(o==null?void 0:o.endpoint):"".concat(t,".s3.amazonaws.com")};function vd(o,e,t){var a,l,c,u;let r=Hc(e),n=r.path;return Nc(o)&&(n="/".concat(r.bucket).concat(n)),{url:n,query:"",host:Rc(o,e,r.bucket),region:(a=o==null?void 0:o.region)!=null?a:"",service:"s3",method:t,accessKeyId:(l=o==null?void 0:o.accessKeyId)!=null?l:"",secretAccessKey:(c=o==null?void 0:o.secretAccessKey)!=null?c:"",sessionToken:(u=o==null?void 0:o.sessionToken)!=null?u:"",dateNow:new Date().toISOString().replace(/-/g,"").split("T")[0],datetimeNow:new Date().toISOString().replace(/-/g,"").replace(/:/g,"").split(".")[0]+"Z"}}function bd(o,e=!1){let t="0123456789ABCDEF",r="";for(let n=0;n="A"&&a<="Z"||a>="a"&&a<="z"||a>="0"&&a<="9"||a=="_"||a=="-"||a=="~"||a=="."?r+=a:a=="/"?e?r+="%2F":r+=a:(r+="%",r+=t[a.charCodeAt(0)>>4],r+=t[a.charCodeAt(0)&15])}return r}function yd(o,e=null){var g;let t=(g=e==null?void 0:e.contentHash)!=null?g:"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",r=new Map;r.set("x-amz-date",o.datetimeNow),r.set("x-amz-content-sha256",t),o.sessionToken&&r.set("x-amz-security-token",o.sessionToken);let n="";e!=null&&e.contentType&&(n+="content-type;"),n+="host;x-amz-content-sha256;x-amz-date",o.sessionToken&&(n+=";x-amz-security-token");let a=o.method+"\n"+bd(o.url)+"\n"+o.query;e!=null&&e.contentType&&(a+="\ncontent-type:"+(e==null?void 0:e.contentType)),a+="\nhost:"+o.host+"\nx-amz-content-sha256:"+t+"\nx-amz-date:"+o.datetimeNow,o.sessionToken&&o.sessionToken.length>0&&(a+="\nx-amz-security-token:"+o.sessionToken),a+="\n\n"+n+"\n"+t;let l=(0,Pr.sha256)(a),c="AWS4-HMAC-SHA256\n"+o.datetimeNow+"\n"+o.dateNow+"/"+o.region+"/"+o.service+"/aws4_request\n"+l,u="AWS4"+o.secretAccessKey,_=Pr.sha256.hmac.arrayBuffer(u,o.dateNow),d=Pr.sha256.hmac.arrayBuffer(_,o.region),f=Pr.sha256.hmac.arrayBuffer(d,o.service),p=Pr.sha256.hmac.arrayBuffer(f,"aws4_request"),m=Pr.sha256.hmac(p,c);return r.set("Authorization","AWS4-HMAC-SHA256 Credential="+o.accessKeyId+"/"+o.dateNow+"/"+o.region+"/"+o.service+"/aws4_request, SignedHeaders="+n+", Signature="+m),r}var Sd=function(o,e,t,r=null,n=null){let a=vd(o,e,t),l={contentType:r,contentHash:n?Pr.sha256.hex(n):null};return yd(a,l)};function Ft(o,e,t,r,n=null,a=null){(e!=null&&e.accessKeyId||e!=null&&e.sessionToken)&&(Sd(e,t,r,n,a).forEach((c,u)=>{o.setRequestHeader(u,c)}),n&&o.setRequestHeader("content-type",n))}function Hc(o){if(o.indexOf("s3://")!=0)throw new Error("URL needs to start with s3://");let e=o.indexOf("/",5);if(e==-1)throw new Error("URL needs to contain a '/' after the host");let t=o.substring(5,e);if(!t)throw new Error("URL needs to contain a bucket name");let r=o.substring(e);if(!r)throw new Error("URL needs to contain key");return{bucket:t,path:r}}function Nc(o){var e;return!!((e=o==null?void 0:o.endpoint)!=null&&e.startsWith("http"))}function xt(o,e){let t=Hc(e);return Nc(o)?"".concat(o==null?void 0:o.endpoint,"/").concat(t.bucket)+t.path:"https://"+Rc(o,e,t.bucket)+t.path}var le={_files:new Map,_fileInfoCache:new Map,_udfFunctions:new Map,_globalFileInfo:null,getFileInfo(o,e){try{let t=le._fileInfoCache.get(e),[r,n,a]=fe(o,"duckdb_web_fs_get_file_info_by_id",["number","number"],[e,(t==null?void 0:t.cacheEpoch)||0]);if(r!==0)return null;if(a===0)return t;let l=te(o,n,a);ye(o);try{let c=JSON.parse(l);if(c==null)return null;let u={...c,blob:null};return le._fileInfoCache.set(e,u),u}catch(c){return console.warn(c),null}}catch(t){return console.log(t),null}},getGlobalFileInfo(o){var e;try{let[t,r,n]=fe(o,"duckdb_web_get_global_file_info",["number"],[((e=le._globalFileInfo)==null?void 0:e.cacheEpoch)||0]);if(t!==0)return null;if(n===0)return le._globalFileInfo;let a=te(o,r,n);ye(o);let l=JSON.parse(a);return l==null?null:(le._globalFileInfo={...l,blob:null},le._globalFileInfo)}catch(t){return console.log(t),null}},testPlatformFeature:(o,e)=>{switch(e){case 1:return typeof BigInt64Array<"u";default:return console.warn("test for unknown feature: ".concat(e)),!1}},getDefaultDataProtocol(o){return 2},openFile:(o,e,t)=>{var r,n;try{le._fileInfoCache.delete(e);let a=le.getFileInfo(o,e);switch(a==null?void 0:a.dataProtocol){case 4:case 5:{if(t&1&&t&2)throw new Error("Opening file ".concat(a.fileName," failed: cannot open file with both read and write flags set"));if(t&32)throw new Error("Opening file ".concat(a.fileName," failed: appending to HTTP/S3 files is not supported"));if(t&2){let u=new XMLHttpRequest;if(a.dataProtocol==5?(u.open("HEAD",xt(a.s3Config,a.dataUrl),!1),Ft(u,a.s3Config,a.dataUrl,"HEAD")):u.open("HEAD",a.dataUrl,!1),u.send(null),u.status!=200&&u.status!=404)throw new Error("Opening file ".concat(a.fileName," failed: Unexpected return status from server (").concat(u.status,")"));if(u.status==404&&!(t&8||t&16))throw new Error("Opening file ".concat(a.fileName," failed: Cannot write to non-existent file without FILE_FLAGS_FILE_CREATE or FILE_FLAGS_FILE_CREATE_NEW flag."));let _=o._malloc(1),d=new Uint8Array;o.HEAPU8.set(d,_);let f=o._malloc(2*8);return o.HEAPF64[(f>>3)+0]=1,o.HEAPF64[(f>>3)+1]=_,f}else if(!(t&1))throw new Error("Opening file ".concat(a.fileName," failed: unsupported file flags: ").concat(t));let l=null,c=null;if(a.reliableHeadRequests||!a.allowFullHttpReads)try{let u=new XMLHttpRequest;if(a.dataProtocol==5?(u.open("HEAD",xt(a.s3Config,a.dataUrl),!1),Ft(u,a.s3Config,a.dataUrl,"HEAD")):u.open("HEAD",a.dataUrl,!1),u.setRequestHeader("Range","bytes=0-"),u.send(null),l=u.getResponseHeader("Content-Length"),l!==null&&u.status==206){let _=o._malloc(16);return o.HEAPF64[(_>>3)+0]=+l,o.HEAPF64[(_>>3)+1]=0,_}}catch(u){c=u,console.warn("HEAD request with range header failed: ".concat(u))}if(a.allowFullHttpReads){{let _=new XMLHttpRequest;a.dataProtocol==5?(_.open("GET",xt(a.s3Config,a.dataUrl),!1),Ft(_,a.s3Config,a.dataUrl,"GET")):_.open("GET",a.dataUrl,!1),_.responseType="arraybuffer",_.setRequestHeader("Range","bytes=0-0"),_.send(null);let d=(r=_.getResponseHeader("Content-Range"))==null?void 0:r.split("/")[1],f=_.getResponseHeader("Content-Length"),p=null;if(d!==void 0)p=d;else if(!a.reliableHeadRequests){let m=new XMLHttpRequest;a.dataProtocol==5?(m.open("HEAD",xt(a.s3Config,a.dataUrl),!1),Ft(m,a.s3Config,a.dataUrl,"HEAD")):m.open("HEAD",a.dataUrl,!1),m.setRequestHeader("Range","bytes=0-"),m.send(null),l=m.getResponseHeader("Content-Length"),l!==null&&+l>1&&(p=l)}if(_.status==206&&f!==null&&+f==1&&p!==null){let m=o._malloc(16);return o.HEAPF64[(m>>3)+0]=+p,o.HEAPF64[(m>>3)+1]=0,m}if(_.status==200&&f!==null&&l!==null&&+f==+l){console.warn("fall back to full HTTP read for: ".concat(a.dataUrl));let m=o._malloc(_.response.byteLength),g=new Uint8Array(_.response,0,_.response.byteLength);o.HEAPU8.set(g,m);let h=o._malloc(2*8);return o.HEAPF64[(h>>3)+0]=_.response.byteLength,o.HEAPF64[(h>>3)+1]=m,h}}console.warn("falling back to full HTTP read for: ".concat(a.dataUrl));let u=new XMLHttpRequest;if(a.dataProtocol==5?(u.open("GET",xt(a.s3Config,a.dataUrl),!1),Ft(u,a.s3Config,a.dataUrl,"GET")):u.open("GET",a.dataUrl,!1),u.responseType="arraybuffer",u.send(null),u.status==200){let _=o._malloc(u.response.byteLength),d=new Uint8Array(u.response,0,u.response.byteLength);o.HEAPU8.set(d,_);let f=o._malloc(2*8);return o.HEAPF64[(f>>3)+0]=u.response.byteLength,o.HEAPF64[(f>>3)+1]=_,f}}if(c!=null)throw new Error("Reading file ".concat(a.fileName," failed with error: ").concat(c));return 0}case 2:{let l=(n=le._files)==null?void 0:n.get(a.fileName);if(l){let _=o._malloc(16);return o.HEAPF64[(_>>3)+0]=l.size,o.HEAPF64[(_>>3)+1]=0,_}console.warn("Buffering missing file: ".concat(a.fileName));let c=o._malloc(2*8),u=o._malloc(1);return o.HEAPF64[(c>>3)+0]=1,o.HEAPF64[(c>>3)+1]=u,c}}}catch(a){console.error(a.toString()),ct(o,a.toString())}return 0},glob:(o,e,t)=>{var r;try{let n=te(o,e,t);if(n.startsWith("http")||n.startsWith("s3://")){let a=new XMLHttpRequest;if(n.startsWith("s3://")){let l=le.getGlobalFileInfo(o);a.open("HEAD",xt(l==null?void 0:l.s3Config,n),!1),Ft(a,l==null?void 0:l.s3Config,n,"HEAD")}else a.open("HEAD",n,!1);if(a.send(null),a.status!=200&&a.status!==206){if(!((r=le.getGlobalFileInfo(o))!=null&&r.allowFullHttpReads))return ct(o,"HEAD request failed: ".concat(n,", with full http reads are disabled")),0;let l=new XMLHttpRequest;if(n.startsWith("s3://")){let u=le.getGlobalFileInfo(o);l.open("GET",xt(u==null?void 0:u.s3Config,n),!1),Ft(l,u==null?void 0:u.s3Config,n,"HEAD")}else l.open("GET",n,!1);if(l.setRequestHeader("Range","bytes=0-0"),l.send(null),l.status!=200&&l.status!==206)return ct(o,"HEAD and GET requests failed: ".concat(n)),0;let c=l.getResponseHeader("Content-Length");c&&+c>1&&console.warn("Range request for ".concat(n," did not return a partial response: ").concat(l.status,' "').concat(l.statusText,'"'))}o.ccall("duckdb_web_fs_glob_add_path",null,["string"],[n])}}catch(n){return console.log(n),ct(o,n.toString()),0}},checkFile:(o,e,t)=>{try{let r=te(o,e,t);if(r.startsWith("http")||r.startsWith("s3://")){let n=new XMLHttpRequest;if(r.startsWith("s3://")){let a=le.getGlobalFileInfo(o);n.open("HEAD",xt(a==null?void 0:a.s3Config,r),!1),Ft(n,a==null?void 0:a.s3Config,r,"HEAD")}else n.open("HEAD",r,!1);return n.send(null),n.status==206||n.status==200}}catch(r){return console.log(r),!1}return!1},syncFile:(o,e)=>{},closeFile:(o,e)=>{var r;let t=le.getFileInfo(o,e);switch(le._fileInfoCache.delete(e),t==null?void 0:t.dataProtocol){case 0:case 4:case 5:break;case 1:case 2:return;case 3:{let n=(r=le._files)==null?void 0:r.get(t.fileName);if(!n)throw new Error("No OPFS access handle registered with name: ".concat(t.fileName));return n.flush()}}},truncateFile:(o,e,t)=>{var n;let r=le.getFileInfo(o,e);switch(r==null?void 0:r.dataProtocol){case 4:ct(o,"Cannot truncate a http file");return;case 5:ct(o,"Cannot truncate an s3 file");return;case 0:case 1:case 2:ct(o,"truncateFile not implemented");return;case 3:{let a=(n=le._files)==null?void 0:n.get(r.fileName);if(!a)throw new Error("No OPFS access handle registered with name: ".concat(r.fileName));return a.truncate(t)}}return 0},readFile(o,e,t,r,n){var a,l;if(r==0)return 0;try{let c=le.getFileInfo(o,e);switch(c==null?void 0:c.dataProtocol){case 4:case 5:{if(!c.dataUrl)throw new Error("Missing data URL for file ".concat(e));try{let u=new XMLHttpRequest;if(c.dataProtocol==5?(u.open("GET",xt(c==null?void 0:c.s3Config,c.dataUrl),!1),Ft(u,c==null?void 0:c.s3Config,c.dataUrl,"GET")):u.open("GET",c.dataUrl,!1),u.responseType="arraybuffer",u.setRequestHeader("Range","bytes=".concat(n,"-").concat(n+r-1)),u.send(null),u.status==206||u.status==200&&r==u.response.byteLength&&n==0){let _=new Uint8Array(u.response,0,Math.min(u.response.byteLength,r));return o.HEAPU8.set(_,t),_.byteLength}else if(u.status==200){console.warn("Range request for ".concat(c.dataUrl," did not return a partial response: ").concat(u.status,' "').concat(u.statusText,'"'));let _=new Uint8Array(u.response,n,Math.min(u.response.byteLength-n,r));return o.HEAPU8.set(_,t),_.byteLength}else throw new Error("Range request for ".concat(c.dataUrl," did returned non-success status: ").concat(u.status,' "').concat(u.statusText,'"'))}catch(u){throw console.log(u),new Error("Range request for ".concat(c.dataUrl," failed with error: ").concat(u,'"'))}}case 2:{let u=(a=le._files)==null?void 0:a.get(c.fileName);if(!u)throw new Error("No HTML5 file registered with name: ".concat(c.fileName));let _=u.slice(n,n+r),d=new Uint8Array(new FileReaderSync().readAsArrayBuffer(_));return o.HEAPU8.set(d,t),d.byteLength}case 3:{let u=(l=le._files)==null?void 0:l.get(c.fileName);if(!u)throw new Error("No OPFS access handle registered with name: ".concat(c.fileName));let _=o.HEAPU8.subarray(t,t+r);return u.read(_,{at:n})}}return 0}catch(c){return console.log(c),ct(o,c.toString()),0}},writeFile:(o,e,t,r,n)=>{var l;let a=le.getFileInfo(o,e);switch(a==null?void 0:a.dataProtocol){case 4:return ct(o,"Cannot write to HTTP file"),0;case 5:{let c=o.HEAPU8.subarray(t,t+r),u=new XMLHttpRequest;return u.open("PUT",xt(a==null?void 0:a.s3Config,a.dataUrl),!1),Ft(u,a==null?void 0:a.s3Config,a.dataUrl,"PUT","",c),u.send(c),u.status!==200?(ct(o,"Failed writing file: HTTP "+u.status),0):r}case 2:return ct(o,"cannot write using the html5 file reader api"),0;case 3:{let c=(l=le._files)==null?void 0:l.get(a.fileName);if(!c)throw new Error("No OPFS access handle registered with name: ".concat(a.fileName));let u=o.HEAPU8.subarray(t,t+r);return c.write(u,{at:n})}}return 0},getLastFileModificationTime:(o,e)=>{var r;let t=le.getFileInfo(o,e);switch(t==null?void 0:t.dataProtocol){case 2:{if(!((r=le._files)==null?void 0:r.get(t.fileName)))throw Error("No handle available for file: ".concat(t.fileName));return 0}case 4:case 5:return new Date().getTime()}return 0},checkDirectory:(o,e,t)=>{let r=te(o,e,t);return console.log("checkDirectory: ".concat(r)),!1},createDirectory:(o,e,t)=>{let r=te(o,e,t);console.log("createDirectory: ".concat(r))},removeDirectory:(o,e,t)=>{let r=te(o,e,t);console.log("removeDirectory: ".concat(r))},listDirectoryEntries:(o,e,t)=>{let r=te(o,e,t);return console.log("listDirectoryEntries: ".concat(r)),!1},moveFile:(o,e,t,r,n)=>{var u,_;let a=te(o,e,t),l=te(o,r,n),c=(u=le._files)==null?void 0:u.get(a);c!==void 0&&(le._files.delete(c),le._files.set(l,c));for(let[d,f]of((_=le._fileInfoCache)==null?void 0:_.entries())||[])if(f.dataUrl==a){le._fileInfoCache.delete(d);break}return!0},removeFile:(o,e,t)=>{},callScalarUDF:(o,e,t,r,n,a,l)=>{Mc(le,o,e,t,r,n,a,l)}};var Fo=class extends la{postMessage(e,t){globalThis.postMessage(e,t)}async instantiate(e,t,r){return await new ma(this,le,e,t).instantiate(r)}};function Wc(){let o=new Fo;globalThis.onmessage=async e=>{await o.onMessage(e.data)}}Wc();return Xc(Ed);})(); -/*! Bundled license information: - -js-sha256/src/sha256.js: - (** - * [js-sha256]{@link https://github.com/emn178/js-sha256} - * - * @version 0.11.0 - * @author Chen, Yi-Cyuan [emn178@gmail.com] - * @copyright Chen, Yi-Cyuan 2014-2024 - * @license MIT - *) -*/ -//# sourceMappingURL=duckdb-browser-eh.worker.js.map diff --git a/build/assets/duckdb-browser-mvp.worker-CM-L3bpJ.js b/build/assets/duckdb-browser-mvp.worker-CM-L3bpJ.js deleted file mode 100644 index 0c7c35b..0000000 --- a/build/assets/duckdb-browser-mvp.worker-CM-L3bpJ.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict";var duckdb=(()=>{var Wl=Object.create;var Tn=Object.defineProperty;var Vl=Object.getOwnPropertyDescriptor;var zl=Object.getOwnPropertyNames;var $l=Object.getPrototypeOf,ql=Object.prototype.hasOwnProperty;var ga=(c,e)=>(e=Symbol[c])?e:Symbol.for("Symbol."+c);var ki=(c=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(c,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):c)(function(c){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+c+'" is not supported')});var fr=(c,e)=>()=>(e||c((e={exports:{}}).exports,e),e.exports),pr=(c,e)=>{for(var t in e)Tn(c,t,{get:e[t],enumerable:!0})},Mo=(c,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of zl(e))!ql.call(c,n)&&n!==t&&Tn(c,n,{get:()=>e[n],enumerable:!(r=Vl(e,n))||r.enumerable});return c};var Po=(c,e,t)=>(t=c!=null?Wl($l(c)):{},Mo(e||!c||!c.__esModule?Tn(t,"default",{value:c,enumerable:!0}):t,c)),Xl=c=>Mo(Tn({},"__esModule",{value:!0}),c);var Ql=function(c,e){this[0]=c,this[1]=e};var Mr=c=>{var e=c[ga("asyncIterator")],t=!1,r,n={};return e==null?(e=c[ga("iterator")](),r=a=>n[a]=o=>e[a](o)):(e=e.call(c),r=a=>n[a]=o=>{if(t){if(t=!1,a==="throw")throw o;return o}return t=!0,{done:!1,value:new Ql(new Promise(l=>{var u=e[a](o);if(!(u instanceof Object))throw TypeError("Object expected");l(u)}),1)}}),n[ga("iterator")]=()=>n,r("next"),"throw"in e?r("throw"):n.throw=a=>{throw a},"return"in e&&r("return"),n};var bo=fr(()=>{});var So=fr(()=>{});var kl=fr(()=>{});var wo=fr((cS,Tl)=>{"use strict";Tl.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}});var Fl=fr((exports,module)=>{"use strict";var DuckDB=(()=>{var c;var _scriptName=typeof document<"u"?(c=document.currentScript)==null?void 0:c.src:void 0;return typeof __filename<"u"&&(_scriptName=_scriptName||__filename),function(moduleArg={}){var moduleRtn,Module=moduleArg,readyPromiseResolve,readyPromiseReject,readyPromise=new Promise((e,t)=>{readyPromiseResolve=e,readyPromiseReject=t}),ENVIRONMENT_IS_WEB=typeof window=="object",ENVIRONMENT_IS_WORKER=typeof importScripts=="function",ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&process.type!="renderer",ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER,moduleOverrides=Object.assign({},Module),arguments_=[],thisProgram="./this.program",quit_=(e,t)=>{throw t},scriptDirectory="";function locateFile(e){return Module.locateFile?Module.locateFile(e,scriptDirectory):scriptDirectory+e}var readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=bo(),nodePath=So();scriptDirectory=__dirname+"/",readBinary=e=>{e=isFileURI(e)?new URL(e):nodePath.normalize(e);var t=fs.readFileSync(e);return t},readAsync=(e,t=!0)=>(e=isFileURI(e)?new URL(e):nodePath.normalize(e),new Promise((r,n)=>{fs.readFile(e,t?void 0:"utf8",(a,o)=>{a?n(a):r(t?o.buffer:o)})})),!Module.thisProgram&&process.argv.length>1&&(thisProgram=process.argv[1].replace(/\\/g,"/")),arguments_=process.argv.slice(2),quit_=(e,t)=>{throw process.exitCode=e,t}}else(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&(ENVIRONMENT_IS_WORKER?scriptDirectory=self.location.href:typeof document<"u"&&document.currentScript&&(scriptDirectory=document.currentScript.src),_scriptName&&(scriptDirectory=_scriptName),scriptDirectory.startsWith("blob:")?scriptDirectory="":scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1),ENVIRONMENT_IS_WORKER&&(readBinary=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),readAsync=e=>fetch(e,{credentials:"same-origin"}).then(t=>t.ok?t.arrayBuffer():Promise.reject(new Error(t.status+" : "+t.url))));var out=Module.print||console.log.bind(console),err=Module.printErr||console.error.bind(console);Object.assign(Module,moduleOverrides),moduleOverrides=null,Module.arguments&&(arguments_=Module.arguments),Module.thisProgram&&(thisProgram=Module.thisProgram);var dynamicLibraries=Module.dynamicLibraries||[],wasmBinary=Module.wasmBinary,wasmMemory,ABORT=!1,EXITSTATUS;function assert(e,t){e||abort(t)}var HEAP,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateMemoryViews(){var e=wasmMemory.buffer;Module.HEAP8=HEAP8=new Int8Array(e),Module.HEAP16=HEAP16=new Int16Array(e),Module.HEAPU8=HEAPU8=new Uint8Array(e),Module.HEAPU16=HEAPU16=new Uint16Array(e),Module.HEAP32=HEAP32=new Int32Array(e),Module.HEAPU32=HEAPU32=new Uint32Array(e),Module.HEAPF32=HEAPF32=new Float32Array(e),Module.HEAPF64=HEAPF64=new Float64Array(e)}if(Module.wasmMemory)wasmMemory=Module.wasmMemory;else{var INITIAL_MEMORY=Module.INITIAL_MEMORY||16777216;wasmMemory=new WebAssembly.Memory({initial:INITIAL_MEMORY/65536,maximum:65536})}updateMemoryViews();var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATEXIT__=[],__ATPOSTRUN__=[],__RELOC_FUNCS__=[],runtimeInitialized=!1;function preRun(){if(Module.preRun)for(typeof Module.preRun=="function"&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=!0,callRuntimeCallbacks(__RELOC_FUNCS__),!Module.noFSInit&&!FS.initialized&&FS.init(),FS.ignorePermissions=!1,TTY.init(),SOCKFS.root=FS.mount(SOCKFS,{},null),PIPEFS.root=FS.mount(PIPEFS,{},null),callRuntimeCallbacks(__ATINIT__)}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function postRun(){if(Module.postRun)for(typeof Module.postRun=="function"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(e){__ATPRERUN__.unshift(e)}function addOnInit(e){__ATINIT__.unshift(e)}function addOnPreMain(e){__ATMAIN__.unshift(e)}function addOnExit(e){}function addOnPostRun(e){__ATPOSTRUN__.unshift(e)}var runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null;function getUniqueRunDependency(e){return e}function addRunDependency(e){var t;runDependencies++,(t=Module.monitorRunDependencies)==null||t.call(Module,runDependencies)}function removeRunDependency(e){var r;if(runDependencies--,(r=Module.monitorRunDependencies)==null||r.call(Module,runDependencies),runDependencies==0&&(runDependencyWatcher!==null&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var t=dependenciesFulfilled;dependenciesFulfilled=null,t()}}function abort(e){var r;(r=Module.onAbort)==null||r.call(Module,e),e="Aborted("+e+")",err(e),ABORT=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw readyPromiseReject(t),t}var dataURIPrefix="data:application/octet-stream;base64,",isDataURI=e=>e.startsWith(dataURIPrefix),isFileURI=e=>e.startsWith("file://");function findWasmBinary(){var e="./duckdb-mvp.wasm";return isDataURI(e)?e:locateFile(e)}var wasmBinaryFile;function getBinarySync(e){if(e==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(e);throw"both async and sync fetching of the wasm failed"}function getBinaryPromise(e){return wasmBinary?Promise.resolve().then(()=>getBinarySync(e)):readAsync(e).then(t=>new Uint8Array(t),()=>getBinarySync(e))}function instantiateArrayBuffer(e,t,r){return getBinaryPromise(e).then(n=>WebAssembly.instantiate(n,t)).then(r,n=>{err("failed to asynchronously prepare wasm: ".concat(n)),abort(n)})}function instantiateAsync(e,t,r,n){return!e&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(t)&&!ENVIRONMENT_IS_NODE&&typeof fetch=="function"?fetch(t,{credentials:"same-origin"}).then(a=>{var o=WebAssembly.instantiateStreaming(a,r);return o.then(n,function(l){return err("wasm streaming compile failed: ".concat(l)),err("falling back to ArrayBuffer instantiation"),instantiateArrayBuffer(t,r,n)})}):instantiateArrayBuffer(t,r,n)}function getWasmImports(){return{env:wasmImports,wasi_snapshot_preview1:wasmImports,"GOT.mem":new Proxy(wasmImports,GOTHandler),"GOT.func":new Proxy(wasmImports,GOTHandler)}}function createWasm(){var e=getWasmImports();function t(n,a){wasmExports=n.exports,wasmExports=relocateExports(wasmExports,1024);var o=getDylinkMetadata(a);return o.neededDynlibs&&(dynamicLibraries=o.neededDynlibs.concat(dynamicLibraries)),mergeLibSymbols(wasmExports,"main"),LDSO.init(),loadDylibs(),wasmExports=applySignatureConversions(wasmExports),addOnInit(wasmExports.__wasm_call_ctors),__RELOC_FUNCS__.push(wasmExports.__wasm_apply_data_relocs),removeRunDependency("wasm-instantiate"),wasmExports}addRunDependency("wasm-instantiate");function r(n){t(n.instance,n.module)}if(Module.instantiateWasm)try{return Module.instantiateWasm(e,t)}catch(n){err("Module.instantiateWasm callback failed with error: ".concat(n)),readyPromiseReject(n)}return wasmBinaryFile!=null||(wasmBinaryFile=findWasmBinary()),instantiateAsync(wasmBinary,wasmBinaryFile,e,r).catch(readyPromiseReject),{}}var tempDouble,tempI64,ASM_CONSTS={2179464:(e,t)=>{var r=typeof runtime=="object"&&runtime&&typeof runtime.whereToLoad=="function"&&runtime.whereToLoad?runtime.whereToLoad(UTF8ToString(e)):UTF8ToString(t),n=lengthBytesUTF8(r)+1,a=_malloc(n);return stringToUTF8(r,a,n),a},2179830:(e,t)=>{var r=UTF8ToString(e);if(typeof XMLHttpRequest>"u"){let S=kl(),L=So(),x=bo();var n=r.split("/"),a=n.length,o=L.join(S.homedir(),".duckdb/extensions/"+n[a-4]+"/"+n[a-3]+"/"+n[a-2]+"/"),l=L.join(o,n[a-1]);try{if(x.existsSync(o)||x.mkdirSync(o,{recursive:!0}),x.existsSync(l))d=x.readFileSync(l);else{let T=new Int32Array(new SharedArrayBuffer(8));var u=ki("node:worker_threads").Worker,_=new u("const {Worker,isMainThread,parentPort,workerData,} = require('node:worker_threads');var times = 0;var SAB = 23;var Z = 0; async function ZZZ(e) {var x = await fetch(e);var res = await x.arrayBuffer();Atomics.store(SAB, 1, res.byteLength);Atomics.store(SAB, 0, 1);Atomics.notify(SAB, 1);Atomics.notify(SAB, 0);Z = res;};parentPort.on('message', function(event) {if (times == 0) {times++;SAB = event;} else if (times == 1) {times++; ZZZ(event);} else {const a = new Uint8Array(Z);const b = new Uint8Array(event.buffer);var K = Z.byteLength;for (var i = 0; i < K; i++) {b[i] = a[i];}Atomics.notify(event, 0);Atomics.store(SAB, 0, 2);Atomics.notify(SAB, 0);}});",{eval:!0}),d;T[0]=0,T[2]=4,_.postMessage(T),_.postMessage(r),Atomics.wait(T,0,0);let w=new Int32Array(new SharedArrayBuffer(T[1]+3-(T[1]+3)%4));_.postMessage(w),Atomics.wait(T,0,1);var f=new Uint8Array(w.buffer,0,T[1]);d=f,_.terminate(),x.writeFileSync(l,d)}}catch(T){return console.log("Error fetching module",T),0}}else{let S=new XMLHttpRequest;if(S.open("GET",r,!1),S.responseType="arraybuffer",S.send(null),S.status!=200)return 0;d=S.response}for(var p=WebAssembly.validate(d),m=d.byteLength,h=_malloc(m+4),g=new Uint8Array(d),v=0;v{if(!e)return AL.alcErr=40964,1},2182519:e=>{if(!AL.currentCtx)return err("alGetProcAddress() called without a valid context"),1;if(!e)return AL.currentCtx.err=40963,1}};function ExitStatus(e){this.name="ExitStatus",this.message="Program terminated with exit(".concat(e,")"),this.status=e}var GOT={},currentModuleWeakSymbols=new Set([]),GOTHandler={get(e,t){var r=GOT[t];return r||(r=GOT[t]=new WebAssembly.Global({value:"i32",mutable:!0})),currentModuleWeakSymbols.has(t)||(r.required=!0),r}},callRuntimeCallbacks=e=>{for(;e.length>0;)e.shift()(Module)},UTF8Decoder=typeof TextDecoder<"u"?new TextDecoder:void 0,UTF8ArrayToString=(e,t,r)=>{t>>>=0;for(var n=t+r,a=t;e[a]&&!(a>=n);)++a;if(a-t>16&&e.buffer&&UTF8Decoder)return UTF8Decoder.decode(e.subarray(t,a));for(var o="";t>10,56320|d&1023)}}return o},getDylinkMetadata=e=>{var t=0,r=0;function n(){return e[t++]}function a(){for(var M=0,I=1;;){var X=e[t++];if(M+=(X&127)*I,I*=128,!(X&128))break}return M}function o(){var M=a();return t+=M,UTF8ArrayToString(e,t-M,M)}function l(M,I){if(M)throw new Error(I)}var u="dylink.0";if(e instanceof WebAssembly.Module){var _=WebAssembly.Module.customSections(e,u);_.length===0&&(u="dylink",_=WebAssembly.Module.customSections(e,u)),l(_.length===0,"need dylink section"),e=new Uint8Array(_[0]),r=e.length}else{var d=new Uint32Array(new Uint8Array(e.subarray(0,24)).buffer),f=d[0]==1836278016;l(!f,"need to see wasm magic number"),l(e[8]!==0,"need the dylink section to be first"),t=9;var p=a();r=t+p,u=o()}var m={neededDynlibs:[],tlsExports:new Set,weakImports:new Set};if(u=="dylink"){m.memorySize=a(),m.memoryAlign=a(),m.tableSize=a(),m.tableAlign=a();for(var h=a(),g=0;g>>0];case"i8":return HEAP8[e>>>0];case"i16":return HEAP16[e>>>1>>>0];case"i32":return HEAP32[e>>>2>>>0];case"i64":abort("to do getValue(i64) use WASM_BIGINT");case"float":return HEAPF32[e>>>2>>>0];case"double":return HEAPF64[e>>>3>>>0];case"*":return HEAPU32[e>>>2>>>0];default:abort("invalid type for getValue: ".concat(t))}}var newDSO=(e,t,r)=>{var n={refcount:1/0,name:e,exports:r,global:!0};return LDSO.loadedLibsByName[e]=n,t!=null&&(LDSO.loadedLibsByHandle[t]=n),n},LDSO={loadedLibsByName:{},loadedLibsByHandle:{},init(){newDSO("__main__",0,wasmImports)}},___heap_base=2320944,alignMemory=(e,t)=>Math.ceil(e/t)*t,getMemory=e=>{if(runtimeInitialized)return _calloc(e,1);var t=___heap_base,r=t+alignMemory(e,16);return ___heap_base=r,GOT.__heap_base.value=r,t},isInternalSym=e=>["__cpp_exception","__c_longjmp","__wasm_apply_data_relocs","__dso_handle","__tls_size","__tls_align","__set_stack_limits","_emscripten_tls_init","__wasm_init_tls","__wasm_call_ctors","__start_em_asm","__stop_em_asm","__start_em_js","__stop_em_js"].includes(e)||e.startsWith("__em_js__"),uleb128Encode=(e,t)=>{e<128?t.push(e):t.push(e%128|128,e>>7)},sigToWasmTypes=e=>{for(var t={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"},r={parameters:[],results:e[0]=="v"?[]:[t[e[0]]]},n=1;n{var r=e.slice(0,1),n=e.slice(1),a={i:127,p:127,j:126,f:125,d:124,e:111};t.push(96),uleb128Encode(n.length,t);for(var o=0;o{if(typeof WebAssembly.Function=="function")return new WebAssembly.Function(sigToWasmTypes(t),e);var r=[1];generateFuncType(t,r);var n=[0,97,115,109,1,0,0,0,1];uleb128Encode(r.length,n),n.push(...r),n.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var a=new WebAssembly.Module(new Uint8Array(n)),o=new WebAssembly.Instance(a,{e:{f:e}}),l=o.exports.f;return l},wasmTable=new WebAssembly.Table({initial:42010,element:"anyfunc"}),getWasmTableEntry=e=>wasmTable.get(e),updateTableMap=(e,t)=>{if(functionsInTableMap)for(var r=e;r(functionsInTableMap||(functionsInTableMap=new WeakMap,updateTableMap(0,wasmTable.length)),functionsInTableMap.get(e)||0),freeTableIndexes=[],getEmptyTableSlot=()=>{if(freeTableIndexes.length)return freeTableIndexes.pop();try{wasmTable.grow(1)}catch(e){throw e instanceof RangeError?"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.":e}return wasmTable.length-1},setWasmTableEntry=(e,t)=>wasmTable.set(e,t),addFunction=(e,t)=>{var r=getFunctionAddress(e);if(r)return r;var n=getEmptyTableSlot();try{setWasmTableEntry(n,e)}catch(o){if(!(o instanceof TypeError))throw o;var a=convertJsFunctionToWasm(e,t);setWasmTableEntry(n,a)}return functionsInTableMap.set(e,n),n},updateGOT=(e,t)=>{for(var r in e)if(!isInternalSym(r)){var n=e[r];r.startsWith("orig$")&&(r=r.split("$")[1],t=!0),GOT[r]||(GOT[r]=new WebAssembly.Global({value:"i32",mutable:!0})),(t||GOT[r].value==0)&&(typeof n=="function"?GOT[r].value=addFunction(n):typeof n=="number"?GOT[r].value=n:err("unhandled export type for '".concat(r,"': ").concat(typeof n)))}},relocateExports=(e,t,r)=>{var n={};for(var a in e){var o=e[a];typeof o=="object"&&(o=o.value),typeof o=="number"&&(o+=t),n[a]=o}return updateGOT(n,r),n},isSymbolDefined=e=>{var t=wasmImports[e];return!(!t||t.stub)},setTempRet0=e=>__emscripten_tempret_set(e),_setTempRet0=setTempRet0;Module._setTempRet0=_setTempRet0;var createDyncallWrapper=e=>{var t=[],r=[0,97,115,109,1,0,0,0];t.push(r);var n=[e[0].replace("j","i"),"i",e.slice(1).replace(/j/g,"ii")].join(""),a=[3];generateFuncType(n,a),generateFuncType(e,a),generateFuncType("vi",a);var o=[1];uleb128Encode(a.length,o),o.push(...a),t.push(o);var l=[2,15,2,1,101,1,116,1,112,0,0,1,101,1,114,0,2];t.push(l);var u=[3,2,1,0];t.push(u);var _=[7,5,1,1,102,0,1];t.push(_);var d=[];e[0]==="j"?d=[1,1,126]:d.push(0);function f(x){d.push(32),uleb128Encode(x,d)}for(var p=1,m=1;m{e=e.replace(/p/g,"i"),"dynCall_"+e in Module||(Module["dynCall_"+e]=createDyncallWrapper(e));var n=Module["dynCall_"+e];return n(t,...r)},dynCall=(e,t,r=[])=>{if(e.includes("j"))return dynCallLegacy(e,t,r);var n=getWasmTableEntry(t)(...r);return e[0]=="p"?n>>>0:n},stackSave=()=>_emscripten_stack_get_current(),stackRestore=e=>__emscripten_stack_restore(e),createInvokeFunction=e=>(t,...r)=>{var n=stackSave();try{return dynCall(e,t,r)}catch(a){if(stackRestore(n),a!==a+0)throw a;_setThrew(1,0)}},resolveGlobalSymbol=(e,t=!1)=>{var r;return t&&"orig$"+e in wasmImports&&(e="orig$"+e),isSymbolDefined(e)?r=wasmImports[e]:e.startsWith("invoke_")?r=wasmImports[e]=createInvokeFunction(e.split("_")[1]):e.startsWith("__cxa_find_matching_catch_")&&(r=wasmImports[e]=(...n)=>{var a=findMatchingCatch(n);return a}),{sym:r,name:e}},UTF8ToString=(e,t)=>(e>>>=0,e?UTF8ArrayToString(HEAPU8,e,t):""),loadWebAssemblyModule=(binary,flags,libName,localScope,handle)=>{var metadata=getDylinkMetadata(binary);currentModuleWeakSymbols=metadata.weakImports;function loadModule(){var firstLoad=!handle||!HEAP8[handle+8>>>0];if(firstLoad){var memAlign=Math.pow(2,metadata.memoryAlign),memoryBase=metadata.memorySize?alignMemory(getMemory(metadata.memorySize+memAlign),memAlign):0,tableBase=metadata.tableSize?wasmTable.length:0;handle&&(HEAP8[handle+8>>>0]=1,HEAPU32[handle+12>>>2>>>0]=memoryBase,HEAP32[handle+16>>>2>>>0]=metadata.memorySize,HEAPU32[handle+20>>>2>>>0]=tableBase,HEAP32[handle+24>>>2>>>0]=metadata.tableSize)}else memoryBase=HEAPU32[handle+12>>>2>>>0],tableBase=HEAPU32[handle+20>>>2>>>0];var tableGrowthNeeded=tableBase+metadata.tableSize-wasmTable.length;tableGrowthNeeded>0&&wasmTable.grow(tableGrowthNeeded);var moduleExports;function resolveSymbol(e){var t=resolveGlobalSymbol(e).sym;return!t&&localScope&&(t=localScope[e]),t||(t=moduleExports[e]),t}var proxyHandler={get(e,t){switch(t){case"__memory_base":return memoryBase;case"__table_base":return tableBase}if(t in wasmImports&&!wasmImports[t].stub)return wasmImports[t];if(!(t in e)){var r;e[t]=(...n)=>(r||(r=resolveSymbol(t)),r(...n))}return e[t]}},proxy=new Proxy({},proxyHandler),info={"GOT.mem":new Proxy({},GOTHandler),"GOT.func":new Proxy({},GOTHandler),env:proxy,wasi_snapshot_preview1:proxy};function postInstantiation(module,instance){updateTableMap(tableBase,metadata.tableSize),moduleExports=relocateExports(instance.exports,memoryBase),flags.allowUndefined||reportUndefinedSymbols();function addEmAsm(addr,body){for(var args=[],arity=0;arity<16&&body.indexOf("$"+arity)!=-1;arity++)args.push("$"+arity);args=args.join(",");var func="(".concat(args,") => { ").concat(body," };");ASM_CONSTS[start]=eval(func)}if("__start_em_asm"in moduleExports)for(var start=moduleExports.__start_em_asm,stop=moduleExports.__stop_em_asm;start ").concat(body,";");moduleExports[name]=eval(func)}for(var name in moduleExports)if(name.startsWith("__em_js__")){var start=moduleExports[name],jsString=UTF8ToString(start),parts=jsString.split("<::>");addEmJs(name.replace("__em_js__",""),parts[0],parts[1]),delete moduleExports[name]}var applyRelocs=moduleExports.__wasm_apply_data_relocs;applyRelocs&&(runtimeInitialized?applyRelocs():__RELOC_FUNCS__.push(applyRelocs));var init=moduleExports.__wasm_call_ctors;return init&&(runtimeInitialized?init():__ATINIT__.push(init)),moduleExports}if(flags.loadAsync){if(binary instanceof WebAssembly.Module){var instance=new WebAssembly.Instance(binary,info);return Promise.resolve(postInstantiation(binary,instance))}return WebAssembly.instantiate(binary,info).then(e=>postInstantiation(e.module,e.instance))}var module=binary instanceof WebAssembly.Module?binary:new WebAssembly.Module(binary),instance=new WebAssembly.Instance(module,info);return postInstantiation(module,instance)}return flags.loadAsync?metadata.neededDynlibs.reduce((e,t)=>e.then(()=>loadDynamicLibrary(t,flags,localScope)),Promise.resolve()).then(loadModule):(metadata.neededDynlibs.forEach(e=>loadDynamicLibrary(e,flags,localScope)),loadModule())},mergeLibSymbols=(e,t)=>{registerDynCallSymbols(e);for(var[r,n]of Object.entries(e))(o=>{isSymbolDefined(o)||(wasmImports[o]=n)})(r)},asyncLoad=(e,t,r,n)=>{var a=n?"":"al ".concat(e);readAsync(e).then(o=>{t(new Uint8Array(o)),a&&removeRunDependency(a)},o=>{if(r)r();else throw'Loading data file "'.concat(e,'" failed.')}),a&&addRunDependency(a)},preloadPlugins=Module.preloadPlugins||[],registerWasmPlugin=()=>{var e={promiseChainEnd:Promise.resolve(),canHandle:t=>!Module.noWasmDecoding&&t.endsWith(".so"),handle:(t,r,n,a)=>{e.promiseChainEnd=e.promiseChainEnd.then(()=>loadWebAssemblyModule(t,{loadAsync:!0,nodelete:!0},r,{})).then(o=>{preloadedWasm[r]=o,n(t)},o=>{err("failed to instantiate wasm: ".concat(r,": ").concat(o)),a()})}};preloadPlugins.push(e)},preloadedWasm={},registerDynCallSymbols=e=>{for(var[t,r]of Object.entries(e))t.startsWith("dynCall_")&&!Module.hasOwnProperty(t)&&(Module[t]=r)};function loadDynamicLibrary(e,t={global:!0,nodelete:!0},r,n){var a=LDSO.loadedLibsByName[e];if(a)return t.global?a.global||(a.global=!0,mergeLibSymbols(a.exports,e)):(r&&Object.assign(r,a.exports),registerDynCallSymbols(a.exports)),t.nodelete&&a.refcount!==1/0&&(a.refcount=1/0),a.refcount++,n&&(LDSO.loadedLibsByHandle[n]=a),t.loadAsync?Promise.resolve(!0):!0;a=newDSO(e,n,"loading"),a.refcount=t.nodelete?1/0:1,a.global=t.global;function o(){if(n){var _=HEAPU32[n+28>>>2>>>0],d=HEAPU32[n+32>>>2>>>0];if(_&&d){var f=HEAP8.slice(_,_+d);return t.loadAsync?Promise.resolve(f):f}}var p=locateFile(e);if(t.loadAsync)return new Promise((m,h)=>asyncLoad(p,m,h));if(!readBinary)throw new Error("".concat(p,": file not found, and synchronous loading of external files is not available"));return readBinary(p)}function l(){var _=preloadedWasm[e];return _?t.loadAsync?Promise.resolve(_):_:t.loadAsync?o().then(d=>loadWebAssemblyModule(d,t,e,r,n)):loadWebAssemblyModule(o(),t,e,r,n)}function u(_){a.global?mergeLibSymbols(_,e):r&&(Object.assign(r,_),registerDynCallSymbols(_)),a.exports=_}return t.loadAsync?l().then(_=>(u(_),!0)):(u(l()),!0)}var reportUndefinedSymbols=()=>{for(var[e,t]of Object.entries(GOT))if(t.value==0){var r=resolveGlobalSymbol(e,!0).sym;if(!r&&!t.required)continue;if(typeof r=="function")t.value=addFunction(r,r.sig);else if(typeof r=="number")t.value=r;else throw new Error("bad export type for '".concat(e,"': ").concat(typeof r))}},loadDylibs=()=>{if(!dynamicLibraries.length){reportUndefinedSymbols();return}addRunDependency("loadDylibs"),dynamicLibraries.reduce((e,t)=>e.then(()=>loadDynamicLibrary(t,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})),Promise.resolve()).then(()=>{reportUndefinedSymbols(),removeRunDependency("loadDylibs")})},noExitRuntime=Module.noExitRuntime||!0;function setValue(e,t,r="i8"){switch(r.endsWith("*")&&(r="*"),r){case"i1":HEAP8[e>>>0]=t;break;case"i8":HEAP8[e>>>0]=t;break;case"i16":HEAP16[e>>>1>>>0]=t;break;case"i32":HEAP32[e>>>2>>>0]=t;break;case"i64":abort("to do setValue(i64) use WASM_BIGINT");case"float":HEAPF32[e>>>2>>>0]=t;break;case"double":HEAPF64[e>>>3>>>0]=t;break;case"*":HEAPU32[e>>>2>>>0]=t;break;default:abort("invalid type for setValue: ".concat(r))}}function __ZN18duckdb_skiplistlib9skip_list19_throw_exceeds_sizeEm(...e){return wasmImports._ZN18duckdb_skiplistlib9skip_list19_throw_exceeds_sizeEm(...e)}__ZN18duckdb_skiplistlib9skip_list19_throw_exceeds_sizeEm.stub=!0;var convertI32PairToI53Checked=(e,t)=>t+2097152>>>0<4194305-!!e?(e>>>0)+t*4294967296:NaN;function ___assert_fail(e,t,r,n){e>>>=0,t>>>=0,n>>>=0,abort("Assertion failed: ".concat(UTF8ToString(e),", at: ")+[t?UTF8ToString(t):"unknown filename",r,n?UTF8ToString(n):"unknown function"])}___assert_fail.sig="vppip";function ___call_sighandler(e,t){return e>>>=0,getWasmTableEntry(e)(t)}___call_sighandler.sig="vpi";var exceptionCaught=[],uncaughtExceptionCount=0;function ___cxa_begin_catch(e){e>>>=0;var t=new ExceptionInfo(e);return t.get_caught()||(t.set_caught(!0),uncaughtExceptionCount--),t.set_rethrown(!1),exceptionCaught.push(t),___cxa_increment_exception_refcount(e),___cxa_get_exception_ptr(e)}___cxa_begin_catch.sig="pp";function ___cxa_current_primary_exception(){if(!exceptionCaught.length)return 0;var e=exceptionCaught[exceptionCaught.length-1];return ___cxa_increment_exception_refcount(e.excPtr),e.excPtr}___cxa_current_primary_exception.sig="p";var exceptionLast=0,___cxa_end_catch=()=>{_setThrew(0,0);var e=exceptionCaught.pop();___cxa_decrement_exception_refcount(e.excPtr),exceptionLast=0};___cxa_end_catch.sig="v";class ExceptionInfo{constructor(t){this.excPtr=t,this.ptr=t-24}set_type(t){HEAPU32[this.ptr+4>>>2>>>0]=t}get_type(){return HEAPU32[this.ptr+4>>>2>>>0]}set_destructor(t){HEAPU32[this.ptr+8>>>2>>>0]=t}get_destructor(){return HEAPU32[this.ptr+8>>>2>>>0]}set_caught(t){t=t?1:0,HEAP8[this.ptr+12>>>0]=t}get_caught(){return HEAP8[this.ptr+12>>>0]!=0}set_rethrown(t){t=t?1:0,HEAP8[this.ptr+13>>>0]=t}get_rethrown(){return HEAP8[this.ptr+13>>>0]!=0}init(t,r){this.set_adjusted_ptr(0),this.set_type(t),this.set_destructor(r)}set_adjusted_ptr(t){HEAPU32[this.ptr+16>>>2>>>0]=t}get_adjusted_ptr(){return HEAPU32[this.ptr+16>>>2>>>0]}}function ___resumeException(e){throw e>>>=0,exceptionLast||(exceptionLast=e),exceptionLast}___resumeException.sig="vp";var findMatchingCatch=e=>{var t=exceptionLast;if(!t)return setTempRet0(0),0;var r=new ExceptionInfo(t);r.set_adjusted_ptr(t);var n=r.get_type();if(!n)return setTempRet0(0),t;for(var a of e){if(a===0||a===n)break;var o=r.ptr+16;if(___cxa_can_catch(a,n,o))return setTempRet0(a),t}return setTempRet0(n),t};function ___cxa_find_matching_catch_2(){return findMatchingCatch([])}___cxa_find_matching_catch_2.sig="p";function ___cxa_find_matching_catch_3(e){return e>>>=0,findMatchingCatch([e])}___cxa_find_matching_catch_3.sig="pp";function ___cxa_find_matching_catch_4(e,t){return e>>>=0,t>>>=0,findMatchingCatch([e,t])}___cxa_find_matching_catch_4.sig="ppp";var ___cxa_rethrow=()=>{var e=exceptionCaught.pop();e||abort("no exception to throw");var t=e.excPtr;throw e.get_rethrown()||(exceptionCaught.push(e),e.set_rethrown(!0),e.set_caught(!1),uncaughtExceptionCount++),exceptionLast=t,exceptionLast};___cxa_rethrow.sig="v";function ___cxa_rethrow_primary_exception(e){if(e>>>=0,!!e){var t=new ExceptionInfo(e);exceptionCaught.push(t),t.set_rethrown(!0),___cxa_rethrow()}}___cxa_rethrow_primary_exception.sig="vp";function ___cxa_throw(e,t,r){e>>>=0,t>>>=0,r>>>=0;var n=new ExceptionInfo(e);throw n.init(t,r),exceptionLast=e,uncaughtExceptionCount++,exceptionLast}___cxa_throw.sig="vppp";var ___cxa_uncaught_exceptions=()=>uncaughtExceptionCount;___cxa_uncaught_exceptions.sig="i";var ___memory_base=new WebAssembly.Global({value:"i32",mutable:!1},1024),___stack_high=2320944,___stack_low=2255408,___stack_pointer=new WebAssembly.Global({value:"i32",mutable:!0},2320944),PATH={isAbs:e=>e.charAt(0)==="/",splitPath:e=>{var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return t.exec(e).slice(1)},normalizeArray:(e,t)=>{for(var r=0,n=e.length-1;n>=0;n--){var a=e[n];a==="."?e.splice(n,1):a===".."?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:e=>{var t=PATH.isAbs(e),r=e.substr(-1)==="/";return e=PATH.normalizeArray(e.split("/").filter(n=>!!n),!t).join("/"),!e&&!t&&(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=PATH.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"/";e=PATH.normalize(e),e=e.replace(/\/$/,"");var t=e.lastIndexOf("/");return t===-1?e:e.substr(t+1)},join:(...e)=>PATH.normalize(e.join("/")),join2:(e,t)=>PATH.normalize(e+"/"+t)},initRandomFill=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return n=>crypto.getRandomValues(n);if(ENVIRONMENT_IS_NODE)try{var e=ki("crypto"),t=e.randomFillSync;if(t)return n=>e.randomFillSync(n);var r=e.randomBytes;return n=>(n.set(r(n.byteLength)),n)}catch(n){}abort("initRandomDevice")},randomFill=e=>(randomFill=initRandomFill())(e),PATH_FS={resolve:(...e)=>{for(var t="",r=!1,n=e.length-1;n>=-1&&!r;n--){var a=n>=0?e[n]:FS.cwd();if(typeof a!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!a)return"";t=a+"/"+t,r=PATH.isAbs(a)}return t=PATH.normalizeArray(t.split("/").filter(o=>!!o),!r).join("/"),(r?"/":"")+t||"."},relative:(e,t)=>{e=PATH_FS.resolve(e).substr(1),t=PATH_FS.resolve(t).substr(1);function r(d){for(var f=0;f=0&&d[p]==="";p--);return f>p?[]:d.slice(f,p-f+1)}for(var n=r(e.split("/")),a=r(t.split("/")),o=Math.min(n.length,a.length),l=o,u=0;u{for(var t=0,r=0;r=55296&&n<=57343?(t+=4,++r):t+=3}return t},stringToUTF8Array=(e,t,r,n)=>{if(r>>>=0,!(n>0))return 0;for(var a=r,o=r+n-1,l=0;l=55296&&u<=57343){var _=e.charCodeAt(++l);u=65536+((u&1023)<<10)|_&1023}if(u<=127){if(r>=o)break;t[r++>>>0]=u}else if(u<=2047){if(r+1>=o)break;t[r++>>>0]=192|u>>6,t[r++>>>0]=128|u&63}else if(u<=65535){if(r+2>=o)break;t[r++>>>0]=224|u>>12,t[r++>>>0]=128|u>>6&63,t[r++>>>0]=128|u&63}else{if(r+3>=o)break;t[r++>>>0]=240|u>>18,t[r++>>>0]=128|u>>12&63,t[r++>>>0]=128|u>>6&63,t[r++>>>0]=128|u&63}}return t[r>>>0]=0,r-a};function intArrayFromString(e,t,r){var n=r>0?r:lengthBytesUTF8(e)+1,a=new Array(n),o=stringToUTF8Array(e,a,0,a.length);return t&&(a.length=o),a}var FS_stdin_getChar=()=>{if(!FS_stdin_getChar_buffer.length){var e=null;if(ENVIRONMENT_IS_NODE){var t=256,r=Buffer.alloc(t),n=0,a=process.stdin.fd;try{n=fs.readSync(a,r,0,t)}catch(o){if(o.toString().includes("EOF"))n=0;else throw o}n>0&&(e=r.slice(0,n).toString("utf-8"))}else typeof window<"u"&&typeof window.prompt=="function"&&(e=window.prompt("Input: "),e!==null&&(e+="\n"));if(!e)return null;FS_stdin_getChar_buffer=intArrayFromString(e,!0)}return FS_stdin_getChar_buffer.shift()},TTY={ttys:[],init(){},shutdown(){},register(e,t){TTY.ttys[e]={input:[],output:[],ops:t},FS.registerDevice(e,TTY.stream_ops)},stream_ops:{open(e){var t=TTY.ttys[e.node.rdev];if(!t)throw new FS.ErrnoError(43);e.tty=t,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,t,r,n,a){if(!e.tty||!e.tty.ops.get_char)throw new FS.ErrnoError(60);for(var o=0,l=0;l0&&(out(UTF8ArrayToString(e.output,0)),e.output=[])},ioctl_tcgets(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(e,t,r){return 0},ioctl_tiocgwinsz(e){return[24,80]}},default_tty1_ops:{put_char(e,t){t===null||t===10?(err(UTF8ArrayToString(e.output,0)),e.output=[]):t!=0&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(err(UTF8ArrayToString(e.output,0)),e.output=[])}}},zeroMemory=(e,t)=>(HEAPU8.fill(0,e,e+t),e),mmapAlloc=e=>{e=alignMemory(e,65536);var t=_emscripten_builtin_memalign(65536,e);return t?zeroMemory(t,e):0},MEMFS={ops_table:null,mount(e){return MEMFS.createNode(null,"/",16895,0)},createNode(e,t,r,n){if(FS.isBlkdev(r)||FS.isFIFO(r))throw new FS.ErrnoError(63);MEMFS.ops_table||(MEMFS.ops_table={dir:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,lookup:MEMFS.node_ops.lookup,mknod:MEMFS.node_ops.mknod,rename:MEMFS.node_ops.rename,unlink:MEMFS.node_ops.unlink,rmdir:MEMFS.node_ops.rmdir,readdir:MEMFS.node_ops.readdir,symlink:MEMFS.node_ops.symlink},stream:{llseek:MEMFS.stream_ops.llseek}},file:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:{llseek:MEMFS.stream_ops.llseek,read:MEMFS.stream_ops.read,write:MEMFS.stream_ops.write,allocate:MEMFS.stream_ops.allocate,mmap:MEMFS.stream_ops.mmap,msync:MEMFS.stream_ops.msync}},link:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,readlink:MEMFS.node_ops.readlink},stream:{}},chrdev:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:FS.chrdev_stream_ops}});var a=FS.createNode(e,t,r,n);return FS.isDir(a.mode)?(a.node_ops=MEMFS.ops_table.dir.node,a.stream_ops=MEMFS.ops_table.dir.stream,a.contents={}):FS.isFile(a.mode)?(a.node_ops=MEMFS.ops_table.file.node,a.stream_ops=MEMFS.ops_table.file.stream,a.usedBytes=0,a.contents=null):FS.isLink(a.mode)?(a.node_ops=MEMFS.ops_table.link.node,a.stream_ops=MEMFS.ops_table.link.stream):FS.isChrdev(a.mode)&&(a.node_ops=MEMFS.ops_table.chrdev.node,a.stream_ops=MEMFS.ops_table.chrdev.stream),a.timestamp=Date.now(),e&&(e.contents[t]=a,e.timestamp=a.timestamp),a},getFileDataAsTypedArray(e){return 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)){var n=1024*1024;t=Math.max(t,r*(r>>0),r!=0&&(t=Math.max(t,256));var a=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(a.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,t){if(e.usedBytes!=t)if(t==0)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=FS.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,FS.isDir(e.mode)?t.size=4096:FS.isFile(e.mode)?t.size=e.usedBytes:FS.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){t.mode!==void 0&&(e.mode=t.mode),t.timestamp!==void 0&&(e.timestamp=t.timestamp),t.size!==void 0&&MEMFS.resizeFileStorage(e,t.size)},lookup(e,t){throw FS.genericErrors[44]},mknod(e,t,r,n){return MEMFS.createNode(e,t,r,n)},rename(e,t,r){if(FS.isDir(e.mode)){var n;try{n=FS.lookupNode(t,r)}catch(o){}if(n)for(var a in n.contents)throw new FS.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},unlink(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir(e,t){var r=FS.lookupNode(e,t);for(var n in r.contents)throw new FS.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir(e){var t=[".",".."];for(var r of Object.keys(e.contents))t.push(r);return t},symlink(e,t,r){var n=MEMFS.createNode(e,t,41471,0);return n.link=r,n},readlink(e){if(!FS.isLink(e.mode))throw new FS.ErrnoError(28);return e.link}},stream_ops:{read(e,t,r,n,a){var o=e.node.contents;if(a>=e.node.usedBytes)return 0;var l=Math.min(e.node.usedBytes-a,n);if(l>8&&o.subarray)t.set(o.subarray(a,a+l),r);else for(var u=0;u0||r+t>>0))}return{ptr:o,allocated:l}},msync(e,t,r,n,a){return MEMFS.stream_ops.write(e,t,0,n,r,!1),0}}},FS_createDataFile=(e,t,r,n,a,o)=>{FS.createDataFile(e,t,r,n,a,o)},FS_handledByPreloadPlugin=(e,t,r,n)=>{typeof Browser<"u"&&Browser.init();var a=!1;return preloadPlugins.forEach(o=>{a||o.canHandle(t)&&(o.handle(e,t,r,n),a=!0)}),a},FS_createPreloadedFile=(e,t,r,n,a,o,l,u,_,d)=>{var f=t?PATH_FS.resolve(PATH.join2(e,t)):e,p="cp ".concat(f);function m(h){function g(v){d==null||d(),u||FS_createDataFile(e,t,v,n,a,_),o==null||o(),removeRunDependency(p)}FS_handledByPreloadPlugin(h,f,g,()=>{l==null||l(),removeRunDependency(p)})||g(h)}addRunDependency(p),typeof r=="string"?asyncLoad(r,m,l):m(r)},FS_modeStringToFlags=e=>{var t={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},r=t[e];if(typeof r>"u")throw new Error("Unknown file open mode: ".concat(e));return r},FS_getMode=(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},FS={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:class{constructor(e){this.name="ErrnoError",this.errno=e}},genericErrors:{},filesystems:null,syncFSRequests:0,readFiles:{},FSStream:class{constructor(){this.shared={}}get object(){return this.node}set object(e){this.node=e}get isRead(){return(this.flags&2097155)!==1}get isWrite(){return(this.flags&2097155)!==0}get isAppend(){return this.flags&1024}get flags(){return this.shared.flags}set flags(e){this.shared.flags=e}get position(){return this.shared.position}set position(e){this.shared.position=e}},FSNode:class{constructor(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=FS.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n,this.readMode=365,this.writeMode=146}get read(){return(this.mode&this.readMode)===this.readMode}set read(e){e?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(e){e?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return FS.isDir(this.mode)}get isDevice(){return FS.isChrdev(this.mode)}},lookupPath(e,t={}){if(e=PATH_FS.resolve(e),!e)return{path:"",node:null};var r={follow_mount:!0,recurse_count:0};if(t=Object.assign(r,t),t.recurse_count>8)throw new FS.ErrnoError(32);for(var n=e.split("/").filter(p=>!!p),a=FS.root,o="/",l=0;l40)throw new FS.ErrnoError(32)}}return{path:o,node:a}},getPath(e){for(var t;;){if(FS.isRoot(e)){var r=e.mount.mountpoint;return t?r[r.length-1]!=="/"?"".concat(r,"/").concat(t):r+t:r}t=t?"".concat(e.name,"/").concat(t):e.name,e=e.parent}},hashName(e,t){for(var r=0,n=0;n>>0)%FS.nameTable.length},hashAddNode(e){var t=FS.hashName(e.parent.id,e.name);e.name_next=FS.nameTable[t],FS.nameTable[t]=e},hashRemoveNode(e){var t=FS.hashName(e.parent.id,e.name);if(FS.nameTable[t]===e)FS.nameTable[t]=e.name_next;else for(var r=FS.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode(e,t){var r=FS.mayLookup(e);if(r)throw new FS.ErrnoError(r);for(var n=FS.hashName(e.id,t),a=FS.nameTable[n];a;a=a.name_next){var o=a.name;if(a.parent.id===e.id&&o===t)return a}return FS.lookup(e,t)},createNode(e,t,r,n){var a=new FS.FSNode(e,t,r,n);return FS.hashAddNode(a),a},destroyNode(e){FS.hashRemoveNode(e)},isRoot(e){return e===e.parent},isMountpoint(e){return!!e.mounted},isFile(e){return(e&61440)===32768},isDir(e){return(e&61440)===16384},isLink(e){return(e&61440)===40960},isChrdev(e){return(e&61440)===8192},isBlkdev(e){return(e&61440)===24576},isFIFO(e){return(e&61440)===4096},isSocket(e){return(e&49152)===49152},flagsToPermissionString(e){var t=["r","w","rw"][e&3];return e&512&&(t+="w"),t},nodePermissions(e,t){return FS.ignorePermissions?0:t.includes("r")&&!(e.mode&292)||t.includes("w")&&!(e.mode&146)||t.includes("x")&&!(e.mode&73)?2:0},mayLookup(e){if(!FS.isDir(e.mode))return 54;var t=FS.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate(e,t){try{var r=FS.lookupNode(e,t);return 20}catch(n){}return FS.nodePermissions(e,"wx")},mayDelete(e,t,r){var n;try{n=FS.lookupNode(e,t)}catch(o){return o.errno}var a=FS.nodePermissions(e,"wx");if(a)return a;if(r){if(!FS.isDir(n.mode))return 54;if(FS.isRoot(n)||FS.getPath(n)===FS.cwd())return 10}else if(FS.isDir(n.mode))return 31;return 0},mayOpen(e,t){return e?FS.isLink(e.mode)?32:FS.isDir(e.mode)&&(FS.flagsToPermissionString(t)!=="r"||t&512)?31:FS.nodePermissions(e,FS.flagsToPermissionString(t)):44},MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=FS.MAX_OPEN_FDS;e++)if(!FS.streams[e])return e;throw new FS.ErrnoError(33)},getStreamChecked(e){var t=FS.getStream(e);if(!t)throw new FS.ErrnoError(8);return t},getStream:e=>FS.streams[e],createStream(e,t=-1){return e=Object.assign(new FS.FSStream,e),t==-1&&(t=FS.nextfd()),e.fd=t,FS.streams[t]=e,e},closeStream(e){FS.streams[e]=null},dupStream(e,t=-1){var n,a;var r=FS.createStream(e,t);return(a=(n=r.stream_ops)==null?void 0:n.dup)==null||a.call(n,r),r},chrdev_stream_ops:{open(e){var r,n;var t=FS.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,(n=(r=e.stream_ops).open)==null||n.call(r,e)},llseek(){throw new FS.ErrnoError(70)}},major:e=>e>>8,minor:e=>e&255,makedev:(e,t)=>e<<8|t,registerDevice(e,t){FS.devices[e]={stream_ops:t}},getDevice:e=>FS.devices[e],getMounts(e){for(var t=[],r=[e];r.length;){var n=r.pop();t.push(n),r.push(...n.mounts)}return t},syncfs(e,t){typeof e=="function"&&(t=e,e=!1),FS.syncFSRequests++,FS.syncFSRequests>1&&err("warning: ".concat(FS.syncFSRequests," FS.syncfs operations in flight at once, probably just doing extra work"));var r=FS.getMounts(FS.root.mount),n=0;function a(l){return FS.syncFSRequests--,t(l)}function o(l){if(l)return o.errored?void 0:(o.errored=!0,a(l));++n>=r.length&&a(null)}r.forEach(l=>{if(!l.type.syncfs)return o(null);l.type.syncfs(l,e,o)})},mount(e,t,r){var n=r==="/",a=!r,o;if(n&&FS.root)throw new FS.ErrnoError(10);if(!n&&!a){var l=FS.lookupPath(r,{follow_mount:!1});if(r=l.path,o=l.node,FS.isMountpoint(o))throw new FS.ErrnoError(10);if(!FS.isDir(o.mode))throw new FS.ErrnoError(54)}var u={type:e,opts:t,mountpoint:r,mounts:[]},_=e.mount(u);return _.mount=u,u.root=_,n?FS.root=_:o&&(o.mounted=u,o.mount&&o.mount.mounts.push(u)),_},unmount(e){var t=FS.lookupPath(e,{follow_mount:!1});if(!FS.isMountpoint(t.node))throw new FS.ErrnoError(28);var r=t.node,n=r.mounted,a=FS.getMounts(n);Object.keys(FS.nameTable).forEach(l=>{for(var u=FS.nameTable[l];u;){var _=u.name_next;a.includes(u.mount)&&FS.destroyNode(u),u=_}}),r.mounted=null;var o=r.mount.mounts.indexOf(n);r.mount.mounts.splice(o,1)},lookup(e,t){return e.node_ops.lookup(e,t)},mknod(e,t,r){var n=FS.lookupPath(e,{parent:!0}),a=n.node,o=PATH.basename(e);if(!o||o==="."||o==="..")throw new FS.ErrnoError(28);var l=FS.mayCreate(a,o);if(l)throw new FS.ErrnoError(l);if(!a.node_ops.mknod)throw new FS.ErrnoError(63);return a.node_ops.mknod(a,o,t,r)},create(e,t){return t=t!==void 0?t:438,t&=4095,t|=32768,FS.mknod(e,t,0)},mkdir(e,t){return t=t!==void 0?t:511,t&=1023,t|=16384,FS.mknod(e,t,0)},mkdirTree(e,t){for(var r=e.split("/"),n="",a=0;a"u"&&(r=t,t=438),t|=8192,FS.mknod(e,t,r)},symlink(e,t){if(!PATH_FS.resolve(e))throw new FS.ErrnoError(44);var r=FS.lookupPath(t,{parent:!0}),n=r.node;if(!n)throw new FS.ErrnoError(44);var a=PATH.basename(t),o=FS.mayCreate(n,a);if(o)throw new FS.ErrnoError(o);if(!n.node_ops.symlink)throw new FS.ErrnoError(63);return n.node_ops.symlink(n,a,e)},rename(e,t){var r=PATH.dirname(e),n=PATH.dirname(t),a=PATH.basename(e),o=PATH.basename(t),l,u,_;if(l=FS.lookupPath(e,{parent:!0}),u=l.node,l=FS.lookupPath(t,{parent:!0}),_=l.node,!u||!_)throw new FS.ErrnoError(44);if(u.mount!==_.mount)throw new FS.ErrnoError(75);var d=FS.lookupNode(u,a),f=PATH_FS.relative(e,n);if(f.charAt(0)!==".")throw new FS.ErrnoError(28);if(f=PATH_FS.relative(t,r),f.charAt(0)!==".")throw new FS.ErrnoError(55);var p;try{p=FS.lookupNode(_,o)}catch(g){}if(d!==p){var m=FS.isDir(d.mode),h=FS.mayDelete(u,a,m);if(h)throw new FS.ErrnoError(h);if(h=p?FS.mayDelete(_,o,m):FS.mayCreate(_,o),h)throw new FS.ErrnoError(h);if(!u.node_ops.rename)throw new FS.ErrnoError(63);if(FS.isMountpoint(d)||p&&FS.isMountpoint(p))throw new FS.ErrnoError(10);if(_!==u&&(h=FS.nodePermissions(u,"w"),h))throw new FS.ErrnoError(h);FS.hashRemoveNode(d);try{u.node_ops.rename(d,_,o),d.parent=_}catch(g){throw g}finally{FS.hashAddNode(d)}}},rmdir(e){var t=FS.lookupPath(e,{parent:!0}),r=t.node,n=PATH.basename(e),a=FS.lookupNode(r,n),o=FS.mayDelete(r,n,!0);if(o)throw new FS.ErrnoError(o);if(!r.node_ops.rmdir)throw new FS.ErrnoError(63);if(FS.isMountpoint(a))throw new FS.ErrnoError(10);r.node_ops.rmdir(r,n),FS.destroyNode(a)},readdir(e){var t=FS.lookupPath(e,{follow:!0}),r=t.node;if(!r.node_ops.readdir)throw new FS.ErrnoError(54);return r.node_ops.readdir(r)},unlink(e){var t=FS.lookupPath(e,{parent:!0}),r=t.node;if(!r)throw new FS.ErrnoError(44);var n=PATH.basename(e),a=FS.lookupNode(r,n),o=FS.mayDelete(r,n,!1);if(o)throw new FS.ErrnoError(o);if(!r.node_ops.unlink)throw new FS.ErrnoError(63);if(FS.isMountpoint(a))throw new FS.ErrnoError(10);r.node_ops.unlink(r,n),FS.destroyNode(a)},readlink(e){var t=FS.lookupPath(e),r=t.node;if(!r)throw new FS.ErrnoError(44);if(!r.node_ops.readlink)throw new FS.ErrnoError(28);return PATH_FS.resolve(FS.getPath(r.parent),r.node_ops.readlink(r))},stat(e,t){var r=FS.lookupPath(e,{follow:!t}),n=r.node;if(!n)throw new FS.ErrnoError(44);if(!n.node_ops.getattr)throw new FS.ErrnoError(63);return n.node_ops.getattr(n)},lstat(e){return FS.stat(e,!0)},chmod(e,t,r){var n;if(typeof e=="string"){var a=FS.lookupPath(e,{follow:!r});n=a.node}else n=e;if(!n.node_ops.setattr)throw new FS.ErrnoError(63);n.node_ops.setattr(n,{mode:t&4095|n.mode&-4096,timestamp:Date.now()})},lchmod(e,t){FS.chmod(e,t,!0)},fchmod(e,t){var r=FS.getStreamChecked(e);FS.chmod(r.node,t)},chown(e,t,r,n){var a;if(typeof e=="string"){var o=FS.lookupPath(e,{follow:!n});a=o.node}else a=e;if(!a.node_ops.setattr)throw new FS.ErrnoError(63);a.node_ops.setattr(a,{timestamp:Date.now()})},lchown(e,t,r){FS.chown(e,t,r,!0)},fchown(e,t,r){var n=FS.getStreamChecked(e);FS.chown(n.node,t,r)},truncate(e,t){if(t<0)throw new FS.ErrnoError(28);var r;if(typeof e=="string"){var n=FS.lookupPath(e,{follow:!0});r=n.node}else r=e;if(!r.node_ops.setattr)throw new FS.ErrnoError(63);if(FS.isDir(r.mode))throw new FS.ErrnoError(31);if(!FS.isFile(r.mode))throw new FS.ErrnoError(28);var a=FS.nodePermissions(r,"w");if(a)throw new FS.ErrnoError(a);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate(e,t){var r=FS.getStreamChecked(e);if(!(r.flags&2097155))throw new FS.ErrnoError(28);FS.truncate(r.node,t)},utime(e,t,r){var n=FS.lookupPath(e,{follow:!0}),a=n.node;a.node_ops.setattr(a,{timestamp:Math.max(t,r)})},open(e,t,r){if(e==="")throw new FS.ErrnoError(44);t=typeof t=="string"?FS_modeStringToFlags(t):t,t&64?(r=typeof r>"u"?438:r,r=r&4095|32768):r=0;var n;if(typeof e=="object")n=e;else{e=PATH.normalize(e);try{var a=FS.lookupPath(e,{follow:!(t&131072)});n=a.node}catch(_){}}var o=!1;if(t&64)if(n){if(t&128)throw new FS.ErrnoError(20)}else n=FS.mknod(e,r,0),o=!0;if(!n)throw new FS.ErrnoError(44);if(FS.isChrdev(n.mode)&&(t&=-513),t&65536&&!FS.isDir(n.mode))throw new FS.ErrnoError(54);if(!o){var l=FS.mayOpen(n,t);if(l)throw new FS.ErrnoError(l)}t&512&&!o&&FS.truncate(n,0),t&=-131713;var u=FS.createStream({node:n,path:FS.getPath(n),flags:t,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return u.stream_ops.open&&u.stream_ops.open(u),Module.logReadFiles&&!(t&1)&&(e in FS.readFiles||(FS.readFiles[e]=1)),u},close(e){if(FS.isClosed(e))throw new FS.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(t){throw t}finally{FS.closeStream(e.fd)}e.fd=null},isClosed(e){return e.fd===null},llseek(e,t,r){if(FS.isClosed(e))throw new FS.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new FS.ErrnoError(70);if(r!=0&&r!=1&&r!=2)throw new FS.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read(e,t,r,n,a){if(n<0||a<0)throw new FS.ErrnoError(28);if(FS.isClosed(e))throw new FS.ErrnoError(8);if((e.flags&2097155)===1)throw new FS.ErrnoError(8);if(FS.isDir(e.node.mode))throw new FS.ErrnoError(31);if(!e.stream_ops.read)throw new FS.ErrnoError(28);var o=typeof a<"u";if(!o)a=e.position;else if(!e.seekable)throw new FS.ErrnoError(70);var l=e.stream_ops.read(e,t,r,n,a);return o||(e.position+=l),l},write(e,t,r,n,a,o){if(n<0||a<0)throw new FS.ErrnoError(28);if(FS.isClosed(e))throw new FS.ErrnoError(8);if(!(e.flags&2097155))throw new FS.ErrnoError(8);if(FS.isDir(e.node.mode))throw new FS.ErrnoError(31);if(!e.stream_ops.write)throw new FS.ErrnoError(28);e.seekable&&e.flags&1024&&FS.llseek(e,0,2);var l=typeof a<"u";if(!l)a=e.position;else if(!e.seekable)throw new FS.ErrnoError(70);var u=e.stream_ops.write(e,t,r,n,a,o);return l||(e.position+=u),u},allocate(e,t,r){if(FS.isClosed(e))throw new FS.ErrnoError(8);if(t<0||r<=0)throw new FS.ErrnoError(28);if(!(e.flags&2097155))throw new FS.ErrnoError(8);if(!FS.isFile(e.node.mode)&&!FS.isDir(e.node.mode))throw new FS.ErrnoError(43);if(!e.stream_ops.allocate)throw new FS.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap(e,t,r,n,a){if(n&2&&!(a&2)&&(e.flags&2097155)!==2)throw new FS.ErrnoError(2);if((e.flags&2097155)===1)throw new FS.ErrnoError(2);if(!e.stream_ops.mmap)throw new FS.ErrnoError(43);if(!t)throw new FS.ErrnoError(28);return e.stream_ops.mmap(e,t,r,n,a)},msync(e,t,r,n,a){return e.stream_ops.msync?e.stream_ops.msync(e,t,r,n,a):0},ioctl(e,t,r){if(!e.stream_ops.ioctl)throw new FS.ErrnoError(59);return e.stream_ops.ioctl(e,t,r)},readFile(e,t={}){if(t.flags=t.flags||0,t.encoding=t.encoding||"binary",t.encoding!=="utf8"&&t.encoding!=="binary")throw new Error('Invalid encoding type "'.concat(t.encoding,'"'));var r,n=FS.open(e,t.flags),a=FS.stat(e),o=a.size,l=new Uint8Array(o);return FS.read(n,l,0,o,0),t.encoding==="utf8"?r=UTF8ArrayToString(l,0):t.encoding==="binary"&&(r=l),FS.close(n),r},writeFile(e,t,r={}){r.flags=r.flags||577;var n=FS.open(e,r.flags,r.mode);if(typeof t=="string"){var a=new Uint8Array(lengthBytesUTF8(t)+1),o=stringToUTF8Array(t,a,0,a.length);FS.write(n,a,0,o,void 0,r.canOwn)}else if(ArrayBuffer.isView(t))FS.write(n,t,0,t.byteLength,void 0,r.canOwn);else throw new Error("Unsupported data type");FS.close(n)},cwd:()=>FS.currentPath,chdir(e){var t=FS.lookupPath(e,{follow:!0});if(t.node===null)throw new FS.ErrnoError(44);if(!FS.isDir(t.node.mode))throw new FS.ErrnoError(54);var r=FS.nodePermissions(t.node,"x");if(r)throw new FS.ErrnoError(r);FS.currentPath=t.path},createDefaultDirectories(){FS.mkdir("/tmp"),FS.mkdir("/home"),FS.mkdir("/home/web_user")},createDefaultDevices(){FS.mkdir("/dev"),FS.registerDevice(FS.makedev(1,3),{read:()=>0,write:(n,a,o,l,u)=>l}),FS.mkdev("/dev/null",FS.makedev(1,3)),TTY.register(FS.makedev(5,0),TTY.default_tty_ops),TTY.register(FS.makedev(6,0),TTY.default_tty1_ops),FS.mkdev("/dev/tty",FS.makedev(5,0)),FS.mkdev("/dev/tty1",FS.makedev(6,0));var e=new Uint8Array(1024),t=0,r=()=>(t===0&&(t=randomFill(e).byteLength),e[--t]);FS.createDevice("/dev","random",r),FS.createDevice("/dev","urandom",r),FS.mkdir("/dev/shm"),FS.mkdir("/dev/shm/tmp")},createSpecialDirectories(){FS.mkdir("/proc");var e=FS.mkdir("/proc/self");FS.mkdir("/proc/self/fd"),FS.mount({mount(){var t=FS.createNode(e,"fd",16895,73);return t.node_ops={lookup(r,n){var a=+n,o=FS.getStreamChecked(a),l={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>o.path}};return l.parent=l,l}},t}},{},"/proc/self/fd")},createStandardStreams(e,t,r){e?FS.createDevice("/dev","stdin",e):FS.symlink("/dev/tty","/dev/stdin"),t?FS.createDevice("/dev","stdout",null,t):FS.symlink("/dev/tty","/dev/stdout"),r?FS.createDevice("/dev","stderr",null,r):FS.symlink("/dev/tty1","/dev/stderr");var n=FS.open("/dev/stdin",0),a=FS.open("/dev/stdout",1),o=FS.open("/dev/stderr",1)},staticInit(){[44].forEach(e=>{FS.genericErrors[e]=new FS.ErrnoError(e),FS.genericErrors[e].stack=""}),FS.nameTable=new Array(4096),FS.mount(MEMFS,{},"/"),FS.createDefaultDirectories(),FS.createDefaultDevices(),FS.createSpecialDirectories(),FS.filesystems={MEMFS}},init(e,t,r){FS.initialized=!0,e!=null||(e=Module.stdin),t!=null||(t=Module.stdout),r!=null||(r=Module.stderr),FS.createStandardStreams(e,t,r)},quit(){FS.initialized=!1;for(var e=0;ethis.length-1||h<0)){var g=h%this.chunkSize,v=h/this.chunkSize|0;return this.getter(v)[g]}}setDataGetter(h){this.getter=h}cacheLength(){var h=new XMLHttpRequest;if(h.open("HEAD",r,!1),h.send(null),!(h.status>=200&&h.status<300||h.status===304))throw new Error("Couldn't load "+r+". Status: "+h.status);var g=Number(h.getResponseHeader("Content-length")),v,b=(v=h.getResponseHeader("Accept-Ranges"))&&v==="bytes",S=(v=h.getResponseHeader("Content-Encoding"))&&v==="gzip",L=1024*1024;b||(L=g);var x=(w,F)=>{if(w>F)throw new Error("invalid range ("+w+", "+F+") or no bytes requested!");if(F>g-1)throw new Error("only "+g+" bytes available! programmer error!");var E=new XMLHttpRequest;if(E.open("GET",r,!1),g!==L&&E.setRequestHeader("Range","bytes="+w+"-"+F),E.responseType="arraybuffer",E.overrideMimeType&&E.overrideMimeType("text/plain; charset=x-user-defined"),E.send(null),!(E.status>=200&&E.status<300||E.status===304))throw new Error("Couldn't load "+r+". Status: "+E.status);return E.response!==void 0?new Uint8Array(E.response||[]):intArrayFromString(E.responseText||"",!0)},T=this;T.setDataGetter(w=>{var F=w*L,E=(w+1)*L-1;if(E=Math.min(E,g-1),typeof T.chunks[w]>"u"&&(T.chunks[w]=x(F,E)),typeof T.chunks[w]>"u")throw new Error("doXHR failed!");return T.chunks[w]}),(S||!g)&&(L=g=1,g=this.getter(0).length,L=g,out("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=g,this._chunkSize=L,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if(typeof XMLHttpRequest<"u"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var l=new o,u={isDevice:!1,contents:l}}else var u={isDevice:!1,url:r};var _=FS.createFile(e,t,u,n,a);u.contents?_.contents=u.contents:u.url&&(_.contents=null,_.url=u.url),Object.defineProperties(_,{usedBytes:{get:function(){return this.contents.length}}});var d={},f=Object.keys(_.stream_ops);f.forEach(m=>{var h=_.stream_ops[m];d[m]=(...g)=>(FS.forceLoadFile(_),h(...g))});function p(m,h,g,v,b){var S=m.node.contents;if(b>=S.length)return 0;var L=Math.min(S.length-b,v);if(S.slice)for(var x=0;x(FS.forceLoadFile(_),p(m,h,g,v,b)),d.mmap=(m,h,g,v,b)=>{FS.forceLoadFile(_);var S=mmapAlloc(h);if(!S)throw new FS.ErrnoError(48);return p(m,HEAP8,S,h,g),{ptr:S,allocated:!0}},_.stream_ops=d,_}},SYSCALLS={DEFAULT_POLLMASK:5,calculateAt(e,t,r){if(PATH.isAbs(t))return t;var n;if(e===-100)n=FS.cwd();else{var a=SYSCALLS.getStreamFromFD(e);n=a.path}if(t.length==0){if(!r)throw new FS.ErrnoError(44);return n}return PATH.join2(n,t)},doStat(e,t,r){var n=e(t);HEAP32[r>>>2>>>0]=n.dev,HEAP32[r+4>>>2>>>0]=n.mode,HEAPU32[r+8>>>2>>>0]=n.nlink,HEAP32[r+12>>>2>>>0]=n.uid,HEAP32[r+16>>>2>>>0]=n.gid,HEAP32[r+20>>>2>>>0]=n.rdev,tempI64=[n.size>>>0,(tempDouble=n.size,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+24>>>2>>>0]=tempI64[0],HEAP32[r+28>>>2>>>0]=tempI64[1],HEAP32[r+32>>>2>>>0]=4096,HEAP32[r+36>>>2>>>0]=n.blocks;var a=n.atime.getTime(),o=n.mtime.getTime(),l=n.ctime.getTime();return tempI64=[Math.floor(a/1e3)>>>0,(tempDouble=Math.floor(a/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+40>>>2>>>0]=tempI64[0],HEAP32[r+44>>>2>>>0]=tempI64[1],HEAPU32[r+48>>>2>>>0]=a%1e3*1e3*1e3,tempI64=[Math.floor(o/1e3)>>>0,(tempDouble=Math.floor(o/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+56>>>2>>>0]=tempI64[0],HEAP32[r+60>>>2>>>0]=tempI64[1],HEAPU32[r+64>>>2>>>0]=o%1e3*1e3*1e3,tempI64=[Math.floor(l/1e3)>>>0,(tempDouble=Math.floor(l/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+72>>>2>>>0]=tempI64[0],HEAP32[r+76>>>2>>>0]=tempI64[1],HEAPU32[r+80>>>2>>>0]=l%1e3*1e3*1e3,tempI64=[n.ino>>>0,(tempDouble=n.ino,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+88>>>2>>>0]=tempI64[0],HEAP32[r+92>>>2>>>0]=tempI64[1],0},doMsync(e,t,r,n,a){if(!FS.isFile(t.node.mode))throw new FS.ErrnoError(43);if(n&2)return 0;var o=HEAPU8.slice(e,e+r);FS.msync(t,o,a,r,n)},getStreamFromFD(e){var t=FS.getStreamChecked(e);return t},varargs:void 0,getStr(e){var t=UTF8ToString(e);return t}};function ___syscall__newselect(e,t,r,n,a){t>>>=0,r>>>=0,n>>>=0,a>>>=0;try{for(var o=0,l=t?HEAP32[t>>>2>>>0]:0,u=t?HEAP32[t+4>>>2>>>0]:0,_=r?HEAP32[r>>>2>>>0]:0,d=r?HEAP32[r+4>>>2>>>0]:0,f=n?HEAP32[n>>>2>>>0]:0,p=n?HEAP32[n+4>>>2>>>0]:0,m=0,h=0,g=0,v=0,b=0,S=0,L=(t?HEAP32[t>>>2>>>0]:0)|(r?HEAP32[r>>>2>>>0]:0)|(n?HEAP32[n>>>2>>>0]:0),x=(t?HEAP32[t+4>>>2>>>0]:0)|(r?HEAP32[r+4>>>2>>>0]:0)|(n?HEAP32[n+4>>>2>>>0]:0),T=function(k,M,I,X){return k<32?M&X:I&X},w=0;w>>2>>>0]:0,P=t?HEAP32[a+4>>>2>>>0]:0;C=(D+P/1e6)*1e3}A=E.stream_ops.poll(E,C)}A&1&&T(w,l,u,F)&&(w<32?m=m|F:h=h|F,o++),A&4&&T(w,_,d,F)&&(w<32?g=g|F:v=v|F,o++),A&2&&T(w,f,p,F)&&(w<32?b=b|F:S=S|F,o++)}}return t&&(HEAP32[t>>>2>>>0]=m,HEAP32[t+4>>>2>>>0]=h),r&&(HEAP32[r>>>2>>>0]=g,HEAP32[r+4>>>2>>>0]=v),n&&(HEAP32[n>>>2>>>0]=b,HEAP32[n+4>>>2>>>0]=S),o}catch(k){if(typeof FS>"u"||k.name!=="ErrnoError")throw k;return-k.errno}}___syscall__newselect.sig="iipppp";var SOCKFS={mount(e){return Module.websocket=Module.websocket&&typeof Module.websocket=="object"?Module.websocket:{},Module.websocket._callbacks={},Module.websocket.on=function(t,r){return typeof r=="function"&&(this._callbacks[t]=r),this},Module.websocket.emit=function(t,r){typeof this._callbacks[t]=="function"&&this._callbacks[t].call(this,r)},FS.createNode(null,"/",16895,0)},createSocket(e,t,r){t&=-526337;var n=t==1;if(n&&r&&r!=6)throw new FS.ErrnoError(66);var a={family:e,type:t,protocol:r,server:null,error:null,peers:{},pending:[],recv_queue:[],sock_ops:SOCKFS.websocket_sock_ops},o=SOCKFS.nextname(),l=FS.createNode(SOCKFS.root,o,49152,0);l.sock=a;var u=FS.createStream({path:o,node:l,flags:2,seekable:!1,stream_ops:SOCKFS.stream_ops});return a.stream=u,a},getSocket(e){var t=FS.getStream(e);return!t||!FS.isSocket(t.node.mode)?null:t.node.sock},stream_ops:{poll(e){var t=e.node.sock;return t.sock_ops.poll(t)},ioctl(e,t,r){var n=e.node.sock;return n.sock_ops.ioctl(n,t,r)},read(e,t,r,n,a){var o=e.node.sock,l=o.sock_ops.recvmsg(o,n);return l?(t.set(l.buffer,r),l.buffer.length):0},write(e,t,r,n,a){var o=e.node.sock;return o.sock_ops.sendmsg(o,t,r,n)},close(e){var t=e.node.sock;t.sock_ops.close(t)}},nextname(){return SOCKFS.nextname.current||(SOCKFS.nextname.current=0),"socket["+SOCKFS.nextname.current+++"]"},websocket_sock_ops:{createPeer(e,t,r){var n;if(typeof t=="object"&&(n=t,t=null,r=null),n)if(n._socket)t=n._socket.remoteAddress,r=n._socket.remotePort;else{var a=/ws[s]?:\/\/([^:]+):(\d+)/.exec(n.url);if(!a)throw new Error("WebSocket URL must be in the format ws(s)://address:port");t=a[1],r=parseInt(a[2],10)}else try{var o=Module.websocket&&typeof Module.websocket=="object",l="ws:#".replace("#","//");if(o&&typeof Module.websocket.url=="string"&&(l=Module.websocket.url),l==="ws://"||l==="wss://"){var u=t.split("/");l=l+u[0]+":"+r+"/"+u.slice(1).join("/")}var _="binary";o&&typeof Module.websocket.subprotocol=="string"&&(_=Module.websocket.subprotocol);var d=void 0;_!=="null"&&(_=_.replace(/^ +| +$/g,"").split(/ *, */),d=_),o&&Module.websocket.subprotocol===null&&(_="null",d=void 0);var f;ENVIRONMENT_IS_NODE?f=wo():f=WebSocket,n=new f(l,d),n.binaryType="arraybuffer"}catch(m){throw new FS.ErrnoError(23)}var p={addr:t,port:r,socket:n,dgram_send_queue:[]};return SOCKFS.websocket_sock_ops.addPeer(e,p),SOCKFS.websocket_sock_ops.handlePeerEvents(e,p),e.type===2&&typeof e.sport<"u"&&p.dgram_send_queue.push(new Uint8Array([255,255,255,255,112,111,114,116,(e.sport&65280)>>8,e.sport&255])),p},getPeer(e,t,r){return e.peers[t+":"+r]},addPeer(e,t){e.peers[t.addr+":"+t.port]=t},removePeer(e,t){delete e.peers[t.addr+":"+t.port]},handlePeerEvents(e,t){var r=!0,n=function(){Module.websocket.emit("open",e.stream.fd);try{for(var o=t.dgram_send_queue.shift();o;)t.socket.send(o),o=t.dgram_send_queue.shift()}catch(l){t.socket.close()}};function a(o){if(typeof o=="string"){var l=new TextEncoder;o=l.encode(o)}else{if(assert(o.byteLength!==void 0),o.byteLength==0)return;o=new Uint8Array(o)}var u=r;if(r=!1,u&&o.length===10&&o[0]===255&&o[1]===255&&o[2]===255&&o[3]===255&&o[4]===112&&o[5]===111&&o[6]===114&&o[7]===116){var _=o[8]<<8|o[9];SOCKFS.websocket_sock_ops.removePeer(e,t),t.port=_,SOCKFS.websocket_sock_ops.addPeer(e,t);return}e.recv_queue.push({addr:t.addr,port:t.port,data:o}),Module.websocket.emit("message",e.stream.fd)}ENVIRONMENT_IS_NODE?(t.socket.on("open",n),t.socket.on("message",function(o,l){l&&a(new Uint8Array(o).buffer)}),t.socket.on("close",function(){Module.websocket.emit("close",e.stream.fd)}),t.socket.on("error",function(o){e.error=14,Module.websocket.emit("error",[e.stream.fd,e.error,"ECONNREFUSED: Connection refused"])})):(t.socket.onopen=n,t.socket.onclose=function(){Module.websocket.emit("close",e.stream.fd)},t.socket.onmessage=function(l){a(l.data)},t.socket.onerror=function(o){e.error=14,Module.websocket.emit("error",[e.stream.fd,e.error,"ECONNREFUSED: Connection refused"])})},poll(e){if(e.type===1&&e.server)return e.pending.length?65:0;var t=0,r=e.type===1?SOCKFS.websocket_sock_ops.getPeer(e,e.daddr,e.dport):null;return(e.recv_queue.length||!r||r&&r.socket.readyState===r.socket.CLOSING||r&&r.socket.readyState===r.socket.CLOSED)&&(t|=65),(!r||r&&r.socket.readyState===r.socket.OPEN)&&(t|=4),(r&&r.socket.readyState===r.socket.CLOSING||r&&r.socket.readyState===r.socket.CLOSED)&&(t|=16),t},ioctl(e,t,r){switch(t){case 21531:var n=0;return e.recv_queue.length&&(n=e.recv_queue[0].data.length),HEAP32[r>>>2>>>0]=n,0;default:return 28}},close(e){if(e.server){try{e.server.close()}catch(a){}e.server=null}for(var t=Object.keys(e.peers),r=0;r{var t=SOCKFS.getSocket(e);if(!t)throw new FS.ErrnoError(8);return t},Sockets={BUFFER_SIZE:10240,MAX_BUFFER_SIZE:10485760,nextFd:1,fds:{},nextport:1,maxport:65535,peer:null,connections:{},portmap:{},localAddr:4261412874,addrPool:[33554442,50331658,67108874,83886090,100663306,117440522,134217738,150994954,167772170,184549386,201326602,218103818,234881034]},inetPton4=e=>{for(var t=e.split("."),r=0;r<4;r++){var n=Number(t[r]);if(isNaN(n))return null;t[r]=n}return(t[0]|t[1]<<8|t[2]<<16|t[3]<<24)>>>0},jstoi_q=e=>parseInt(e),inetPton6=e=>{var t,r,n,a,o,l=/^((?=.*::)(?!.*::.+::)(::)?([\dA-F]{1,4}:(:|\b)|){5}|([\dA-F]{1,4}:){6})((([\dA-F]{1,4}((?!\3)::|:\b|$))|(?!\2\3)){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4})$/i,u=[];if(!l.test(e))return null;if(e==="::")return[0,0,0,0,0,0,0,0];for(e.startsWith("::")?e=e.replace("::","Z:"):e=e.replace("::",":Z:"),e.indexOf(".")>0?(e=e.replace(new RegExp("[.]","g"),":"),t=e.split(":"),t[t.length-4]=jstoi_q(t[t.length-4])+jstoi_q(t[t.length-3])*256,t[t.length-3]=jstoi_q(t[t.length-2])+jstoi_q(t[t.length-1])*256,t=t.slice(0,t.length-2)):t=e.split(":"),n=0,a=0,r=0;r{switch(t){case 2:r=inetPton4(r),zeroMemory(e,16),a&&(HEAP32[a>>>2>>>0]=16),HEAP16[e>>>1>>>0]=t,HEAP32[e+4>>>2>>>0]=r,HEAP16[e+2>>>1>>>0]=_htons(n);break;case 10:r=inetPton6(r),zeroMemory(e,28),a&&(HEAP32[a>>>2>>>0]=28),HEAP32[e>>>2>>>0]=t,HEAP32[e+8>>>2>>>0]=r[0],HEAP32[e+12>>>2>>>0]=r[1],HEAP32[e+16>>>2>>>0]=r[2],HEAP32[e+20>>>2>>>0]=r[3],HEAP16[e+2>>>1>>>0]=_htons(n);break;default:return 5}return 0},DNS={address_map:{id:1,addrs:{},names:{}},lookup_name(e){var t=inetPton4(e);if(t!==null||(t=inetPton6(e),t!==null))return e;var r;if(DNS.address_map.addrs[e])r=DNS.address_map.addrs[e];else{var n=DNS.address_map.id++;assert(n<65535,"exceeded max address mappings of 65535"),r="172.29."+(n&255)+"."+(n&65280),DNS.address_map.names[r]=e,DNS.address_map.addrs[e]=r}return r},lookup_addr(e){return DNS.address_map.names[e]?DNS.address_map.names[e]:null}};function ___syscall_accept4(e,t,r,n,a,o){t>>>=0,r>>>=0;try{var l=getSocketFromFD(e),u=l.sock_ops.accept(l);if(t)var _=writeSockaddr(t,u.family,DNS.lookup_name(u.daddr),u.dport,r);return u.stream.fd}catch(d){if(typeof FS>"u"||d.name!=="ErrnoError")throw d;return-d.errno}}___syscall_accept4.sig="iippiii";var inetNtop4=e=>(e&255)+"."+(e>>8&255)+"."+(e>>16&255)+"."+(e>>24&255),inetNtop6=e=>{var t="",r=0,n=0,a=0,o=0,l=0,u=0,_=[e[0]&65535,e[0]>>16,e[1]&65535,e[1]>>16,e[2]&65535,e[2]>>16,e[3]&65535,e[3]>>16],d=!0,f="";for(u=0;u<5;u++)if(_[u]!==0){d=!1;break}if(d){if(f=inetNtop4(_[6]|_[7]<<16),_[5]===-1)return t="::ffff:",t+=f,t;if(_[5]===0)return t="::",f==="0.0.0.0"&&(f=""),f==="0.0.0.1"&&(f="1"),t+=f,t}for(r=0;r<8;r++)_[r]===0&&(r-a>1&&(l=0),a=r,l++),l>n&&(n=l,o=r-n+1);for(r=0;r<8;r++){if(n>1&&_[r]===0&&r>=o&&r{var r=HEAP16[e>>>1>>>0],n=_ntohs(HEAPU16[e+2>>>1>>>0]),a;switch(r){case 2:if(t!==16)return{errno:28};a=HEAP32[e+4>>>2>>>0],a=inetNtop4(a);break;case 10:if(t!==28)return{errno:28};a=[HEAP32[e+8>>>2>>>0],HEAP32[e+12>>>2>>>0],HEAP32[e+16>>>2>>>0],HEAP32[e+20>>>2>>>0]],a=inetNtop6(a);break;default:return{errno:5}}return{family:r,addr:a,port:n}},getSocketAddress=(e,t)=>{var r=readSockaddr(e,t);if(r.errno)throw new FS.ErrnoError(r.errno);return r.addr=DNS.lookup_addr(r.addr)||r.addr,r};function ___syscall_bind(e,t,r,n,a,o){t>>>=0,r>>>=0;try{var l=getSocketFromFD(e),u=getSocketAddress(t,r);return l.sock_ops.bind(l,u.addr,u.port),0}catch(_){if(typeof FS>"u"||_.name!=="ErrnoError")throw _;return-_.errno}}___syscall_bind.sig="iippiii";function ___syscall_chdir(e){e>>>=0;try{return e=SYSCALLS.getStr(e),FS.chdir(e),0}catch(t){if(typeof FS>"u"||t.name!=="ErrnoError")throw t;return-t.errno}}___syscall_chdir.sig="ip";function ___syscall_chmod(e,t){e>>>=0;try{return e=SYSCALLS.getStr(e),FS.chmod(e,t),0}catch(r){if(typeof FS>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}___syscall_chmod.sig="ipi";function ___syscall_connect(e,t,r,n,a,o){t>>>=0,r>>>=0;try{var l=getSocketFromFD(e),u=getSocketAddress(t,r);return l.sock_ops.connect(l,u.addr,u.port),0}catch(_){if(typeof FS>"u"||_.name!=="ErrnoError")throw _;return-_.errno}}___syscall_connect.sig="iippiii";function ___syscall_dup(e){try{var t=SYSCALLS.getStreamFromFD(e);return FS.dupStream(t).fd}catch(r){if(typeof FS>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}___syscall_dup.sig="ii";function ___syscall_dup3(e,t,r){try{var n=SYSCALLS.getStreamFromFD(e);if(n.fd===t)return-28;if(t<0||t>=FS.MAX_OPEN_FDS)return-8;var a=FS.getStream(t);return a&&FS.close(a),FS.dupStream(n,t).fd}catch(o){if(typeof FS>"u"||o.name!=="ErrnoError")throw o;return-o.errno}}___syscall_dup3.sig="iiii";function ___syscall_faccessat(e,t,r,n){t>>>=0;try{if(t=SYSCALLS.getStr(t),t=SYSCALLS.calculateAt(e,t),r&-8)return-28;var a=FS.lookupPath(t,{follow:!0}),o=a.node;if(!o)return-44;var l="";return r&4&&(l+="r"),r&2&&(l+="w"),r&1&&(l+="x"),l&&FS.nodePermissions(o,l)?-2:0}catch(u){if(typeof FS>"u"||u.name!=="ErrnoError")throw u;return-u.errno}}___syscall_faccessat.sig="iipii";var ___syscall_fadvise64=(e,t,r,n)=>0;___syscall_fadvise64.sig="iiiiiii";function ___syscall_fallocate(e,t,r,n,a,o){var l=convertI32PairToI53Checked(r,n),u=convertI32PairToI53Checked(a,o);try{if(isNaN(l))return 61;var _=SYSCALLS.getStreamFromFD(e);return FS.allocate(_,l,u),0}catch(d){if(typeof FS>"u"||d.name!=="ErrnoError")throw d;return-d.errno}}___syscall_fallocate.sig="iiiiiii";function ___syscall_fchdir(e){try{var t=SYSCALLS.getStreamFromFD(e);return FS.chdir(t.path),0}catch(r){if(typeof FS>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}___syscall_fchdir.sig="ii";function ___syscall_fchmod(e,t){try{return FS.fchmod(e,t),0}catch(r){if(typeof FS>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}___syscall_fchmod.sig="iii";function ___syscall_fchmodat2(e,t,r,n){t>>>=0;try{var a=n&256;return t=SYSCALLS.getStr(t),t=SYSCALLS.calculateAt(e,t),FS.chmod(t,r,a),0}catch(o){if(typeof FS>"u"||o.name!=="ErrnoError")throw o;return-o.errno}}___syscall_fchmodat2.sig="iipii";function ___syscall_fchown32(e,t,r){try{return FS.fchown(e,t,r),0}catch(n){if(typeof FS>"u"||n.name!=="ErrnoError")throw n;return-n.errno}}___syscall_fchown32.sig="iiii";function ___syscall_fchownat(e,t,r,n,a){t>>>=0;try{t=SYSCALLS.getStr(t);var o=a&256;return a=a&-257,t=SYSCALLS.calculateAt(e,t),(o?FS.lchown:FS.chown)(t,r,n),0}catch(l){if(typeof FS>"u"||l.name!=="ErrnoError")throw l;return-l.errno}}___syscall_fchownat.sig="iipiii";function syscallGetVarargI(){var e=HEAP32[+SYSCALLS.varargs>>>2>>>0];return SYSCALLS.varargs+=4,e}var syscallGetVarargP=syscallGetVarargI;function ___syscall_fcntl64(e,t,r){r>>>=0,SYSCALLS.varargs=r;try{var n=SYSCALLS.getStreamFromFD(e);switch(t){case 0:{var a=syscallGetVarargI();if(a<0)return-28;for(;FS.streams[a];)a++;var o;return o=FS.dupStream(n,a),o.fd}case 1:case 2:return 0;case 3:return n.flags;case 4:{var a=syscallGetVarargI();return n.flags|=a,0}case 12:{var a=syscallGetVarargP(),l=0;return HEAP16[a+l>>>1>>>0]=2,0}case 13:case 14:return 0}return-28}catch(u){if(typeof FS>"u"||u.name!=="ErrnoError")throw u;return-u.errno}}___syscall_fcntl64.sig="iiip";function ___syscall_fdatasync(e){try{var t=SYSCALLS.getStreamFromFD(e);return 0}catch(r){if(typeof FS>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}___syscall_fdatasync.sig="ii";function ___syscall_fstat64(e,t){t>>>=0;try{var r=SYSCALLS.getStreamFromFD(e);return SYSCALLS.doStat(FS.stat,r.path,t)}catch(n){if(typeof FS>"u"||n.name!=="ErrnoError")throw n;return-n.errno}}___syscall_fstat64.sig="iip";function ___syscall_statfs64(e,t,r){e>>>=0,t>>>=0,r>>>=0;try{return e=SYSCALLS.getStr(e),HEAP32[r+4>>>2>>>0]=4096,HEAP32[r+40>>>2>>>0]=4096,HEAP32[r+8>>>2>>>0]=1e6,HEAP32[r+12>>>2>>>0]=5e5,HEAP32[r+16>>>2>>>0]=5e5,HEAP32[r+20>>>2>>>0]=FS.nextInode,HEAP32[r+24>>>2>>>0]=1e6,HEAP32[r+28>>>2>>>0]=42,HEAP32[r+44>>>2>>>0]=2,HEAP32[r+36>>>2>>>0]=255,0}catch(n){if(typeof FS>"u"||n.name!=="ErrnoError")throw n;return-n.errno}}___syscall_statfs64.sig="ippp";function ___syscall_fstatfs64(e,t,r){t>>>=0,r>>>=0;try{var n=SYSCALLS.getStreamFromFD(e);return ___syscall_statfs64(0,t,r)}catch(a){if(typeof FS>"u"||a.name!=="ErrnoError")throw a;return-a.errno}}___syscall_fstatfs64.sig="iipp";function ___syscall_ftruncate64(e,t,r){var n=convertI32PairToI53Checked(t,r);try{return isNaN(n)?61:(FS.ftruncate(e,n),0)}catch(a){if(typeof FS>"u"||a.name!=="ErrnoError")throw a;return-a.errno}}___syscall_ftruncate64.sig="iiii";var stringToUTF8=(e,t,r)=>stringToUTF8Array(e,HEAPU8,t,r);function ___syscall_getcwd(e,t){e>>>=0,t>>>=0;try{if(t===0)return-28;var r=FS.cwd(),n=lengthBytesUTF8(r)+1;return t"u"||a.name!=="ErrnoError")throw a;return-a.errno}}___syscall_getcwd.sig="ipp";function ___syscall_getdents64(e,t,r){t>>>=0,r>>>=0;try{var n=SYSCALLS.getStreamFromFD(e);n.getdents||(n.getdents=FS.readdir(n.path));for(var a=280,o=0,l=FS.llseek(n,0,1),u=Math.floor(l/a);u>>0,(tempDouble=_,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[t+o>>>2>>>0]=tempI64[0],HEAP32[t+o+4>>>2>>>0]=tempI64[1],tempI64=[(u+1)*a>>>0,(tempDouble=(u+1)*a,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[t+o+8>>>2>>>0]=tempI64[0],HEAP32[t+o+12>>>2>>>0]=tempI64[1],HEAP16[t+o+16>>>1>>>0]=280,HEAP8[t+o+18>>>0]=d,stringToUTF8(f,t+o+19,256),o+=a,u+=1}return FS.llseek(n,u*a,0),o}catch(h){if(typeof FS>"u"||h.name!=="ErrnoError")throw h;return-h.errno}}___syscall_getdents64.sig="iipp";function ___syscall_getpeername(e,t,r,n,a,o){t>>>=0,r>>>=0;try{var l=getSocketFromFD(e);if(!l.daddr)return-53;var u=writeSockaddr(t,l.family,DNS.lookup_name(l.daddr),l.dport,r);return 0}catch(_){if(typeof FS>"u"||_.name!=="ErrnoError")throw _;return-_.errno}}___syscall_getpeername.sig="iippiii";function ___syscall_getsockname(e,t,r,n,a,o){t>>>=0,r>>>=0;try{var l=getSocketFromFD(e),u=writeSockaddr(t,l.family,DNS.lookup_name(l.saddr||"0.0.0.0"),l.sport,r);return 0}catch(_){if(typeof FS>"u"||_.name!=="ErrnoError")throw _;return-_.errno}}___syscall_getsockname.sig="iippiii";function ___syscall_getsockopt(e,t,r,n,a,o){n>>>=0,a>>>=0;try{var l=getSocketFromFD(e);return t===1&&r===4?(HEAP32[n>>>2>>>0]=l.error,HEAP32[a>>>2>>>0]=4,l.error=null,0):-50}catch(u){if(typeof FS>"u"||u.name!=="ErrnoError")throw u;return-u.errno}}___syscall_getsockopt.sig="iiiippi";function ___syscall_ioctl(e,t,r){r>>>=0,SYSCALLS.varargs=r;try{var n=SYSCALLS.getStreamFromFD(e);switch(t){case 21509:return n.tty?0:-59;case 21505:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var a=n.tty.ops.ioctl_tcgets(n),o=syscallGetVarargP();HEAP32[o>>>2>>>0]=a.c_iflag||0,HEAP32[o+4>>>2>>>0]=a.c_oflag||0,HEAP32[o+8>>>2>>>0]=a.c_cflag||0,HEAP32[o+12>>>2>>>0]=a.c_lflag||0;for(var l=0;l<32;l++)HEAP8[o+l+17>>>0]=a.c_cc[l]||0;return 0}return 0}case 21510:case 21511:case 21512:return n.tty?0:-59;case 21506:case 21507:case 21508:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){for(var o=syscallGetVarargP(),u=HEAP32[o>>>2>>>0],_=HEAP32[o+4>>>2>>>0],d=HEAP32[o+8>>>2>>>0],f=HEAP32[o+12>>>2>>>0],p=[],l=0;l<32;l++)p.push(HEAP8[o+l+17>>>0]);return n.tty.ops.ioctl_tcsets(n.tty,t,{c_iflag:u,c_oflag:_,c_cflag:d,c_lflag:f,c_cc:p})}return 0}case 21519:{if(!n.tty)return-59;var o=syscallGetVarargP();return HEAP32[o>>>2>>>0]=0,0}case 21520:return n.tty?-28:-59;case 21531:{var o=syscallGetVarargP();return FS.ioctl(n,t,o)}case 21523:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var m=n.tty.ops.ioctl_tiocgwinsz(n.tty),o=syscallGetVarargP();HEAP16[o>>>1>>>0]=m[0],HEAP16[o+2>>>1>>>0]=m[1]}return 0}case 21524:return n.tty?0:-59;case 21515:return n.tty?0:-59;default:return-28}}catch(h){if(typeof FS>"u"||h.name!=="ErrnoError")throw h;return-h.errno}}___syscall_ioctl.sig="iiip";function ___syscall_listen(e,t){try{var r=getSocketFromFD(e);return r.sock_ops.listen(r,t),0}catch(n){if(typeof FS>"u"||n.name!=="ErrnoError")throw n;return-n.errno}}___syscall_listen.sig="iiiiiii";function ___syscall_lstat64(e,t){e>>>=0,t>>>=0;try{return e=SYSCALLS.getStr(e),SYSCALLS.doStat(FS.lstat,e,t)}catch(r){if(typeof FS>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}___syscall_lstat64.sig="ipp";function ___syscall_mkdirat(e,t,r){t>>>=0;try{return t=SYSCALLS.getStr(t),t=SYSCALLS.calculateAt(e,t),t=PATH.normalize(t),t[t.length-1]==="/"&&(t=t.substr(0,t.length-1)),FS.mkdir(t,r,0),0}catch(n){if(typeof FS>"u"||n.name!=="ErrnoError")throw n;return-n.errno}}___syscall_mkdirat.sig="iipi";function ___syscall_mknodat(e,t,r,n){t>>>=0;try{switch(t=SYSCALLS.getStr(t),t=SYSCALLS.calculateAt(e,t),r&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return FS.mknod(t,r,n),0}catch(a){if(typeof FS>"u"||a.name!=="ErrnoError")throw a;return-a.errno}}___syscall_mknodat.sig="iipii";function ___syscall_newfstatat(e,t,r,n){t>>>=0,r>>>=0;try{t=SYSCALLS.getStr(t);var a=n&256,o=n&4096;return n=n&-6401,t=SYSCALLS.calculateAt(e,t,o),SYSCALLS.doStat(a?FS.lstat:FS.stat,t,r)}catch(l){if(typeof FS>"u"||l.name!=="ErrnoError")throw l;return-l.errno}}___syscall_newfstatat.sig="iippi";function ___syscall_openat(e,t,r,n){t>>>=0,n>>>=0,SYSCALLS.varargs=n;try{t=SYSCALLS.getStr(t),t=SYSCALLS.calculateAt(e,t);var a=n?syscallGetVarargI():0;return FS.open(t,r,a).fd}catch(o){if(typeof FS>"u"||o.name!=="ErrnoError")throw o;return-o.errno}}___syscall_openat.sig="iipip";var PIPEFS={BUCKET_BUFFER_SIZE:8192,mount(e){return FS.createNode(null,"/",16895,0)},createPipe(){var e={buckets:[],refcnt:2};e.buckets.push({buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:0,roffset:0});var t=PIPEFS.nextname(),r=PIPEFS.nextname(),n=FS.createNode(PIPEFS.root,t,4096,0),a=FS.createNode(PIPEFS.root,r,4096,0);n.pipe=e,a.pipe=e;var o=FS.createStream({path:t,node:n,flags:0,seekable:!1,stream_ops:PIPEFS.stream_ops});n.stream=o;var l=FS.createStream({path:r,node:a,flags:1,seekable:!1,stream_ops:PIPEFS.stream_ops});return a.stream=l,{readable_fd:o.fd,writable_fd:l.fd}},stream_ops:{poll(e){var t=e.node.pipe;if((e.flags&2097155)===1)return 260;if(t.buckets.length>0)for(var r=0;r0)return 65}return 0},ioctl(e,t,r){return 28},fsync(e){return 28},read(e,t,r,n,a){for(var o=e.node.pipe,l=0,u=0;u=u)return _.buffer.set(l,_.offset),_.offset+=u,u;d>0&&(_.buffer.set(l.subarray(0,d),_.offset),_.offset+=d,l=l.subarray(d,l.byteLength));for(var f=l.byteLength/PIPEFS.BUCKET_BUFFER_SIZE|0,p=l.byteLength%PIPEFS.BUCKET_BUFFER_SIZE,m=0;m0){var h={buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:l.byteLength,roffset:0};o.buckets.push(h),h.buffer.set(l)}return u},close(e){var t=e.node.pipe;t.refcnt--,t.refcnt===0&&(t.buckets=null)}},nextname(){return PIPEFS.nextname.current||(PIPEFS.nextname.current=0),"pipe["+PIPEFS.nextname.current+++"]"}};function ___syscall_pipe(e){e>>>=0;try{if(e==0)throw new FS.ErrnoError(21);var t=PIPEFS.createPipe();return HEAP32[e>>>2>>>0]=t.readable_fd,HEAP32[e+4>>>2>>>0]=t.writable_fd,0}catch(r){if(typeof FS>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}___syscall_pipe.sig="ip";function ___syscall_poll(e,t,r){e>>>=0;try{for(var n=0,a=0;a>>2>>>0],u=HEAP16[o+4>>>1>>>0],_=32,d=FS.getStream(l);d&&(_=SYSCALLS.DEFAULT_POLLMASK,d.stream_ops.poll&&(_=d.stream_ops.poll(d,-1))),_&=u|8|16,_&&n++,HEAP16[o+6>>>1>>>0]=_}return n}catch(f){if(typeof FS>"u"||f.name!=="ErrnoError")throw f;return-f.errno}}___syscall_poll.sig="ipii";function ___syscall_readlinkat(e,t,r,n){t>>>=0,r>>>=0,n>>>=0;try{if(t=SYSCALLS.getStr(t),t=SYSCALLS.calculateAt(e,t),n<=0)return-28;var a=FS.readlink(t),o=Math.min(n,lengthBytesUTF8(a)),l=HEAP8[r+o>>>0];return stringToUTF8(a,r,n+1),HEAP8[r+o>>>0]=l,o}catch(u){if(typeof FS>"u"||u.name!=="ErrnoError")throw u;return-u.errno}}___syscall_readlinkat.sig="iippp";function ___syscall_recvfrom(e,t,r,n,a,o){t>>>=0,r>>>=0,a>>>=0,o>>>=0;try{var l=getSocketFromFD(e),u=l.sock_ops.recvmsg(l,r);if(!u)return 0;if(a)var _=writeSockaddr(a,l.family,DNS.lookup_name(u.addr),u.port,o);return HEAPU8.set(u.buffer,t>>>0),u.buffer.byteLength}catch(d){if(typeof FS>"u"||d.name!=="ErrnoError")throw d;return-d.errno}}___syscall_recvfrom.sig="iippipp";function ___syscall_recvmsg(e,t,r,n,a,o){t>>>=0;try{for(var l=getSocketFromFD(e),u=HEAPU32[t+8>>>2>>>0],_=HEAP32[t+12>>>2>>>0],d=0,f=0;f<_;f++)d+=HEAP32[u+(8*f+4)>>>2>>>0];var p=l.sock_ops.recvmsg(l,d);if(!p)return 0;var m=HEAPU32[t>>>2>>>0];if(m)var h=writeSockaddr(m,l.family,DNS.lookup_name(p.addr),p.port);for(var g=0,v=p.buffer.byteLength,f=0;v>0&&f<_;f++){var b=HEAPU32[u+(8*f+0)>>>2>>>0],S=HEAP32[u+(8*f+4)>>>2>>>0];if(S){var L=Math.min(S,v),x=p.buffer.subarray(g,g+L);HEAPU8.set(x,b+g>>>0),g+=L,v-=L}}return g}catch(T){if(typeof FS>"u"||T.name!=="ErrnoError")throw T;return-T.errno}}___syscall_recvmsg.sig="iipiiii";function ___syscall_renameat(e,t,r,n){t>>>=0,n>>>=0;try{return t=SYSCALLS.getStr(t),n=SYSCALLS.getStr(n),t=SYSCALLS.calculateAt(e,t),n=SYSCALLS.calculateAt(r,n),FS.rename(t,n),0}catch(a){if(typeof FS>"u"||a.name!=="ErrnoError")throw a;return-a.errno}}___syscall_renameat.sig="iipip";function ___syscall_rmdir(e){e>>>=0;try{return e=SYSCALLS.getStr(e),FS.rmdir(e),0}catch(t){if(typeof FS>"u"||t.name!=="ErrnoError")throw t;return-t.errno}}___syscall_rmdir.sig="ip";function ___syscall_sendmsg(e,t,r,n,a,o){t>>>=0,n>>>=0,a>>>=0;try{var l=getSocketFromFD(e),u=HEAPU32[t+8>>>2>>>0],_=HEAP32[t+12>>>2>>>0],d,f,p=HEAPU32[t>>>2>>>0],m=HEAP32[t+4>>>2>>>0];if(p){var h=readSockaddr(p,m);if(h.errno)return-h.errno;f=h.port,d=DNS.lookup_addr(h.addr)||h.addr}for(var g=0,v=0;v<_;v++)g+=HEAP32[u+(8*v+4)>>>2>>>0];for(var b=new Uint8Array(g),S=0,v=0;v<_;v++)for(var L=HEAPU32[u+(8*v+0)>>>2>>>0],x=HEAP32[u+(8*v+4)>>>2>>>0],T=0;T>>0];return l.sock_ops.sendmsg(l,b,0,g,d,f)}catch(w){if(typeof FS>"u"||w.name!=="ErrnoError")throw w;return-w.errno}}___syscall_sendmsg.sig="iipippi";function ___syscall_sendto(e,t,r,n,a,o){t>>>=0,r>>>=0,a>>>=0,o>>>=0;try{var l=getSocketFromFD(e);if(!a)return FS.write(l.stream,HEAP8,t,r);var u=getSocketAddress(a,o);return l.sock_ops.sendmsg(l,HEAP8,t,r,u.addr,u.port)}catch(_){if(typeof FS>"u"||_.name!=="ErrnoError")throw _;return-_.errno}}___syscall_sendto.sig="iippipp";function ___syscall_socket(e,t,r){try{var n=SOCKFS.createSocket(e,t,r);return n.stream.fd}catch(a){if(typeof FS>"u"||a.name!=="ErrnoError")throw a;return-a.errno}}___syscall_socket.sig="iiiiiii";function ___syscall_stat64(e,t){e>>>=0,t>>>=0;try{return e=SYSCALLS.getStr(e),SYSCALLS.doStat(FS.stat,e,t)}catch(r){if(typeof FS>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}___syscall_stat64.sig="ipp";function ___syscall_symlink(e,t){e>>>=0,t>>>=0;try{return e=SYSCALLS.getStr(e),t=SYSCALLS.getStr(t),FS.symlink(e,t),0}catch(r){if(typeof FS>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}___syscall_symlink.sig="ipp";function ___syscall_symlinkat(e,t,r){e>>>=0,r>>>=0;try{return r=SYSCALLS.calculateAt(t,r),FS.symlink(e,r),0}catch(n){if(typeof FS>"u"||n.name!=="ErrnoError")throw n;return-n.errno}}___syscall_symlinkat.sig="ipip";function ___syscall_truncate64(e,t,r){e>>>=0;var n=convertI32PairToI53Checked(t,r);try{return isNaN(n)?61:(e=SYSCALLS.getStr(e),FS.truncate(e,n),0)}catch(a){if(typeof FS>"u"||a.name!=="ErrnoError")throw a;return-a.errno}}___syscall_truncate64.sig="ipii";function ___syscall_unlinkat(e,t,r){t>>>=0;try{return t=SYSCALLS.getStr(t),t=SYSCALLS.calculateAt(e,t),r===0?FS.unlink(t):r===512?FS.rmdir(t):abort("Invalid flags passed to unlinkat"),0}catch(n){if(typeof FS>"u"||n.name!=="ErrnoError")throw n;return-n.errno}}___syscall_unlinkat.sig="iipi";var readI53FromI64=e=>HEAPU32[e>>>2>>>0]+HEAP32[e+4>>>2>>>0]*4294967296;function ___syscall_utimensat(e,t,r,n){t>>>=0,r>>>=0;try{t=SYSCALLS.getStr(t),t=SYSCALLS.calculateAt(e,t,!0);var a=Date.now(),o,l;if(!r)o=a,l=a;else{var u=readI53FromI64(r),_=HEAP32[r+8>>>2>>>0];_==1073741823?o=a:_==1073741822?o=-1:o=u*1e3+_/1e6,r+=16,u=readI53FromI64(r),_=HEAP32[r+8>>>2>>>0],_==1073741823?l=a:_==1073741822?l=-1:l=u*1e3+_/1e6}return(l!=-1||o!=-1)&&FS.utime(t,o,l),0}catch(d){if(typeof FS>"u"||d.name!=="ErrnoError")throw d;return-d.errno}}___syscall_utimensat.sig="iippi";var ___table_base=new WebAssembly.Global({value:"i32",mutable:!1},1),__abort_js=()=>{abort("")};__abort_js.sig="v";var ENV={},stackAlloc=e=>__emscripten_stack_alloc(e),stringToUTF8OnStack=e=>{var t=lengthBytesUTF8(e)+1,r=stackAlloc(t);return stringToUTF8(e,r,t),r},dlSetError=e=>{var t=stackSave(),r=stringToUTF8OnStack(e);___dl_seterr(r,0),stackRestore(t)},dlopenInternal=(e,t)=>{var r=UTF8ToString(e+36),n=HEAP32[e+4>>>2>>>0];r=PATH.normalize(r);var a=[],o=!!(n&256),l=o?null:{},u={global:o,nodelete:!!(n&4096),loadAsync:t.loadAsync};if(t.loadAsync)return loadDynamicLibrary(r,u,l,e);try{return loadDynamicLibrary(r,u,l,e)}catch(_){return dlSetError("Could not load dynamic lib: ".concat(r,"\n").concat(_)),0}};function __dlopen_js(e){return e>>>=0,dlopenInternal(e,{loadAsync:!1})}__dlopen_js.sig="pp";function __dlsym_js(e,t,r){e>>>=0,t>>>=0,r>>>=0,t=UTF8ToString(t);var n,a,o=LDSO.loadedLibsByHandle[e];if(!o.exports.hasOwnProperty(t)||o.exports[t].stub)return dlSetError('Tried to lookup unknown symbol "'.concat(t,'" in dynamic lib: ').concat(o.name)),0;a=Object.keys(o.exports).indexOf(t);var l="orig$"+t;if(n=o.exports[l],n?a=Object.keys(o.exports).indexOf(l):n=o.exports[t],typeof n=="function"){var u=getFunctionAddress(n);u?n=u:(n=addFunction(n,n.sig),HEAPU32[r>>>2>>>0]=a)}return n}__dlsym_js.sig="pppp";function __embind_register_bigint(e,t,r,n,a){e>>>=0,t>>>=0,r>>>=0}__embind_register_bigint.sig="vpppiiii";var embind_init_charCodes=()=>{for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);embind_charCodes=e},embind_charCodes,readLatin1String=e=>{for(var t="",r=e;HEAPU8[r>>>0];)t+=embind_charCodes[HEAPU8[r++>>>0]];return t},awaitingDependencies={},registeredTypes={},typeDependencies={},BindingError,throwBindingError=e=>{throw new BindingError(e)},InternalError,throwInternalError=e=>{throw new InternalError(e)},whenDependentTypesAreResolved=(e,t,r)=>{e.forEach(u=>typeDependencies[u]=t);function n(u){var _=r(u);_.length!==e.length&&throwInternalError("Mismatched type converter count");for(var d=0;d{registeredTypes.hasOwnProperty(u)?a[_]=registeredTypes[u]:(o.push(u),awaitingDependencies.hasOwnProperty(u)||(awaitingDependencies[u]=[]),awaitingDependencies[u].push(()=>{a[_]=registeredTypes[u],++l,l===o.length&&n(a)}))}),o.length===0&&n(a)};function sharedRegisterType(e,t,r={}){var n=t.name;if(e||throwBindingError('type "'.concat(n,'" must have a positive integer typeid pointer')),registeredTypes.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;throwBindingError("Cannot register type '".concat(n,"' twice"))}if(registeredTypes[e]=t,delete typeDependencies[e],awaitingDependencies.hasOwnProperty(e)){var a=awaitingDependencies[e];delete awaitingDependencies[e],a.forEach(o=>o())}}function registerType(e,t,r={}){return sharedRegisterType(e,t,r)}var GenericWireTypeSize=8;function __embind_register_bool(e,t,r,n){e>>>=0,t>>>=0,t=readLatin1String(t),registerType(e,{name:t,fromWireType:function(a){return!!a},toWireType:function(a,o){return o?r:n},argPackAdvance:GenericWireTypeSize,readValueFromPointer:function(a){return this.fromWireType(HEAPU8[a>>>0])},destructorFunction:null})}__embind_register_bool.sig="vppii";var emval_freelist=[],emval_handles=[];function __emval_decref(e){e>>>=0,e>9&&--emval_handles[e+1]===0&&(emval_handles[e]=void 0,emval_freelist.push(e))}__emval_decref.sig="vp";var count_emval_handles=()=>emval_handles.length/2-5-emval_freelist.length,init_emval=()=>{emval_handles.push(0,1,void 0,1,null,1,!0,1,!1,1),Module.count_emval_handles=count_emval_handles},Emval={toValue:e=>(e||throwBindingError("Cannot use deleted val. handle = "+e),emval_handles[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{let t=emval_freelist.pop()||emval_handles.length;return emval_handles[t]=e,emval_handles[t+1]=1,t}}}};function readPointer(e){return this.fromWireType(HEAPU32[e>>>2>>>0])}var EmValType={name:"emscripten::val",fromWireType:e=>{var t=Emval.toValue(e);return __emval_decref(e),t},toWireType:(e,t)=>Emval.toHandle(t),argPackAdvance:GenericWireTypeSize,readValueFromPointer:readPointer,destructorFunction:null};function __embind_register_emval(e){return e>>>=0,registerType(e,EmValType)}__embind_register_emval.sig="vp";var embindRepr=e=>{if(e===null)return"null";var t=typeof e;return t==="object"||t==="array"||t==="function"?e.toString():""+e},floatReadValueFromPointer=(e,t)=>{switch(t){case 4:return function(r){return this.fromWireType(HEAPF32[r>>>2>>>0])};case 8:return function(r){return this.fromWireType(HEAPF64[r>>>3>>>0])};default:throw new TypeError("invalid float width (".concat(t,"): ").concat(e))}},__embind_register_float=function(e,t,r){e>>>=0,t>>>=0,r>>>=0,t=readLatin1String(t),registerType(e,{name:t,fromWireType:n=>n,toWireType:(n,a)=>a,argPackAdvance:GenericWireTypeSize,readValueFromPointer:floatReadValueFromPointer(t,r),destructorFunction:null})};__embind_register_float.sig="vppp";var integerReadValueFromPointer=(e,t,r)=>{switch(t){case 1:return r?n=>HEAP8[n>>>0]:n=>HEAPU8[n>>>0];case 2:return r?n=>HEAP16[n>>>1>>>0]:n=>HEAPU16[n>>>1>>>0];case 4:return r?n=>HEAP32[n>>>2>>>0]:n=>HEAPU32[n>>>2>>>0];default:throw new TypeError("invalid integer width (".concat(t,"): ").concat(e))}};function __embind_register_integer(e,t,r,n,a){e>>>=0,t>>>=0,r>>>=0,t=readLatin1String(t),a===-1&&(a=4294967295);var o=f=>f;if(n===0){var l=32-8*r;o=f=>f<>>l}var u=t.includes("unsigned"),_=(f,p)=>{},d;u?d=function(f,p){return _(p,this.name),p>>>0}:d=function(f,p){return _(p,this.name),p},registerType(e,{name:t,fromWireType:o,toWireType:d,argPackAdvance:GenericWireTypeSize,readValueFromPointer:integerReadValueFromPointer(t,r,n!==0),destructorFunction:null})}__embind_register_integer.sig="vpppii";function __embind_register_memory_view(e,t,r){e>>>=0,r>>>=0;var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],a=n[t];function o(l){var u=HEAPU32[l>>>2>>>0],_=HEAPU32[l+4>>>2>>>0];return new a(HEAP8.buffer,_,u)}r=readLatin1String(r),registerType(e,{name:r,fromWireType:o,argPackAdvance:GenericWireTypeSize,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})}__embind_register_memory_view.sig="vpip";function __embind_register_std_string(e,t){e>>>=0,t>>>=0,t=readLatin1String(t);var r=t==="std::string";registerType(e,{name:t,fromWireType(n){var a=HEAPU32[n>>>2>>>0],o=n+4,l;if(r)for(var u=o,_=0;_<=a;++_){var d=o+_;if(_==a||HEAPU8[d>>>0]==0){var f=d-u,p=UTF8ToString(u,f);l===void 0?l=p:(l+="\0",l+=p),u=d+1}}else{for(var m=new Array(a),_=0;_>>0]);l=m.join("")}return _free(n),l},toWireType(n,a){a instanceof ArrayBuffer&&(a=new Uint8Array(a));var o,l=typeof a=="string";l||a instanceof Uint8Array||a instanceof Uint8ClampedArray||a instanceof Int8Array||throwBindingError("Cannot pass non-string to std::string"),r&&l?o=lengthBytesUTF8(a):o=a.length;var u=_malloc(4+o+1),_=u+4;if(HEAPU32[u>>>2>>>0]=o,r&&l)stringToUTF8(a,_,o+1);else if(l)for(var d=0;d255&&(_free(_),throwBindingError("String has UTF-16 code units that do not fit in 8 bits")),HEAPU8[_+d>>>0]=f}else for(var d=0;d>>0]=a[d];return n!==null&&n.push(_free,u),u},argPackAdvance:GenericWireTypeSize,readValueFromPointer:readPointer,destructorFunction(n){_free(n)}})}__embind_register_std_string.sig="vpp";var UTF16Decoder=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,UTF16ToString=(e,t)=>{for(var r=e,n=r>>1,a=n+t/2;!(n>=a)&&HEAPU16[n>>>0];)++n;if(r=n<<1,r-e>32&&UTF16Decoder)return UTF16Decoder.decode(HEAPU8.subarray(e>>>0,r>>>0));for(var o="",l=0;!(l>=t/2);++l){var u=HEAP16[e+l*2>>>1>>>0];if(u==0)break;o+=String.fromCharCode(u)}return o},stringToUTF16=(e,t,r)=>{if(r!=null||(r=2147483647),r<2)return 0;r-=2;for(var n=t,a=r>>1>>>0]=l,t+=2}return HEAP16[t>>>1>>>0]=0,t-n},lengthBytesUTF16=e=>e.length*2,UTF32ToString=(e,t)=>{for(var r=0,n="";!(r>=t/4);){var a=HEAP32[e+r*4>>>2>>>0];if(a==0)break;if(++r,a>=65536){var o=a-65536;n+=String.fromCharCode(55296|o>>10,56320|o&1023)}else n+=String.fromCharCode(a)}return n},stringToUTF32=(e,t,r)=>{if(t>>>=0,r!=null||(r=2147483647),r<4)return 0;for(var n=t,a=n+r-4,o=0;o=55296&&l<=57343){var u=e.charCodeAt(++o);l=65536+((l&1023)<<10)|u&1023}if(HEAP32[t>>>2>>>0]=l,t+=4,t+4>a)break}return HEAP32[t>>>2>>>0]=0,t-n},lengthBytesUTF32=e=>{for(var t=0,r=0;r=55296&&n<=57343&&++r,t+=4}return t},__embind_register_std_wstring=function(e,t,r){e>>>=0,t>>>=0,r>>>=0,r=readLatin1String(r);var n,a,o,l;t===2?(n=UTF16ToString,a=stringToUTF16,l=lengthBytesUTF16,o=u=>HEAPU16[u>>>1>>>0]):t===4&&(n=UTF32ToString,a=stringToUTF32,l=lengthBytesUTF32,o=u=>HEAPU32[u>>>2>>>0]),registerType(e,{name:r,fromWireType:u=>{for(var _=HEAPU32[u>>>2>>>0],d,f=u+4,p=0;p<=_;++p){var m=u+4+p*t;if(p==_||o(m)==0){var h=m-f,g=n(f,h);d===void 0?d=g:(d+="\0",d+=g),f=m+t}}return _free(u),d},toWireType:(u,_)=>{typeof _!="string"&&throwBindingError("Cannot pass non-string to C++ string type ".concat(r));var d=l(_),f=_malloc(4+d+t);return HEAPU32[f>>>2>>>0]=d/t,a(_,f+4,d+t),u!==null&&u.push(_free,f),f},argPackAdvance:GenericWireTypeSize,readValueFromPointer:readPointer,destructorFunction(u){_free(u)}})};__embind_register_std_wstring.sig="vppp";var __embind_register_void=function(e,t){e>>>=0,t>>>=0,t=readLatin1String(t),registerType(e,{isVoid:!0,name:t,argPackAdvance:0,fromWireType:()=>{},toWireType:(r,n)=>{}})};__embind_register_void.sig="vpp";var handleException=e=>{if(e instanceof ExitStatus||e=="unwind")return EXITSTATUS;quit_(1,e)},runtimeKeepaliveCounter=0,keepRuntimeAlive=()=>noExitRuntime||runtimeKeepaliveCounter>0,_proc_exit=e=>{var t;EXITSTATUS=e,keepRuntimeAlive()||((t=Module.onExit)==null||t.call(Module,e),ABORT=!0),quit_(e,new ExitStatus(e))};_proc_exit.sig="vi";var exitJS=(e,t)=>{EXITSTATUS=e,_proc_exit(e)},_exit=exitJS;_exit.sig="vi";var maybeExit=()=>{if(!keepRuntimeAlive())try{_exit(EXITSTATUS)}catch(e){handleException(e)}},callUserCallback=e=>{if(!ABORT)try{e(),maybeExit()}catch(t){handleException(t)}};function __emscripten_dlopen_js(e,t,r,n){e>>>=0,t>>>=0,r>>>=0,n>>>=0;function a(u){var _=UTF8ToString(e+36);dlSetError("'Could not load dynamic lib: ".concat(_,"\n").concat(u)),callUserCallback(()=>getWasmTableEntry(r)(e,n))}function o(){callUserCallback(()=>getWasmTableEntry(t)(e,n))}var l=dlopenInternal(e,{loadAsync:!0});l?l.then(o,a):a()}__emscripten_dlopen_js.sig="vpppp";var nowIsMonotonic=1,__emscripten_get_now_is_monotonic=()=>nowIsMonotonic;__emscripten_get_now_is_monotonic.sig="i";var getExecutableName=()=>thisProgram||"./this.program";function __emscripten_get_progname(e,t){e>>>=0,stringToUTF8(getExecutableName(),e,t)}__emscripten_get_progname.sig="vpi";function __emscripten_lookup_name(e){e>>>=0;var t=UTF8ToString(e);return inetPton4(DNS.lookup_name(t))}__emscripten_lookup_name.sig="ip";function __emscripten_memcpy_js(e,t,r){return e>>>=0,t>>>=0,r>>>=0,HEAPU8.copyWithin(e>>>0,t>>>0,t+r>>>0)}__emscripten_memcpy_js.sig="vppp";var __emscripten_runtime_keepalive_clear=()=>{noExitRuntime=!1,runtimeKeepaliveCounter=0};__emscripten_runtime_keepalive_clear.sig="v";function __emscripten_set_offscreencanvas_size(e,t,r){return e>>>=0,-1}__emscripten_set_offscreencanvas_size.sig="ipii";function __emscripten_system(e){if(e>>>=0,ENVIRONMENT_IS_NODE){if(!e)return 1;var t=UTF8ToString(e);if(!t.length)return 0;var r=["child_process"].map(ki),n=r.spawnSync(t,[],{shell:!0,stdio:"inherit"}),a=(l,u)=>l<<8|u;if(n.status===null){var o=l=>{switch(l){case"SIGHUP":return 1;case"SIGQUIT":return 3;case"SIGFPE":return 8;case"SIGKILL":return 9;case"SIGALRM":return 14;case"SIGTERM":return 15;default:return 2}};return a(0,o(n.signal))}return a(n.status,0)}return e?-52:0}__emscripten_system.sig="ip";var __emscripten_throw_longjmp=()=>{throw 1/0};__emscripten_throw_longjmp.sig="v";function __gmtime_js(e,t,r){var n=convertI32PairToI53Checked(e,t);r>>>=0;var a=new Date(n*1e3);HEAP32[r>>>2>>>0]=a.getUTCSeconds(),HEAP32[r+4>>>2>>>0]=a.getUTCMinutes(),HEAP32[r+8>>>2>>>0]=a.getUTCHours(),HEAP32[r+12>>>2>>>0]=a.getUTCDate(),HEAP32[r+16>>>2>>>0]=a.getUTCMonth(),HEAP32[r+20>>>2>>>0]=a.getUTCFullYear()-1900,HEAP32[r+24>>>2>>>0]=a.getUTCDay();var o=Date.UTC(a.getUTCFullYear(),0,1,0,0,0,0),l=(a.getTime()-o)/(1e3*60*60*24)|0;HEAP32[r+28>>>2>>>0]=l}__gmtime_js.sig="viip";var isLeapYear=e=>e%4===0&&(e%100!==0||e%400===0),MONTH_DAYS_LEAP_CUMULATIVE=[0,31,60,91,121,152,182,213,244,274,305,335],MONTH_DAYS_REGULAR_CUMULATIVE=[0,31,59,90,120,151,181,212,243,273,304,334],ydayFromDate=e=>{var t=isLeapYear(e.getFullYear()),r=t?MONTH_DAYS_LEAP_CUMULATIVE:MONTH_DAYS_REGULAR_CUMULATIVE,n=r[e.getMonth()]+e.getDate()-1;return n};function __localtime_js(e,t,r){var n=convertI32PairToI53Checked(e,t);r>>>=0;var a=new Date(n*1e3);HEAP32[r>>>2>>>0]=a.getSeconds(),HEAP32[r+4>>>2>>>0]=a.getMinutes(),HEAP32[r+8>>>2>>>0]=a.getHours(),HEAP32[r+12>>>2>>>0]=a.getDate(),HEAP32[r+16>>>2>>>0]=a.getMonth(),HEAP32[r+20>>>2>>>0]=a.getFullYear()-1900,HEAP32[r+24>>>2>>>0]=a.getDay();var o=ydayFromDate(a)|0;HEAP32[r+28>>>2>>>0]=o,HEAP32[r+36>>>2>>>0]=-(a.getTimezoneOffset()*60);var l=new Date(a.getFullYear(),0,1),u=new Date(a.getFullYear(),6,1).getTimezoneOffset(),_=l.getTimezoneOffset(),d=(u!=_&&a.getTimezoneOffset()==Math.min(_,u))|0;HEAP32[r+32>>>2>>>0]=d}__localtime_js.sig="viip";var __mktime_js=function(e){e>>>=0;var t=(()=>{var r=new Date(HEAP32[e+20>>>2>>>0]+1900,HEAP32[e+16>>>2>>>0],HEAP32[e+12>>>2>>>0],HEAP32[e+8>>>2>>>0],HEAP32[e+4>>>2>>>0],HEAP32[e>>>2>>>0],0),n=HEAP32[e+32>>>2>>>0],a=r.getTimezoneOffset(),o=new Date(r.getFullYear(),0,1),l=new Date(r.getFullYear(),6,1).getTimezoneOffset(),u=o.getTimezoneOffset(),_=Math.min(u,l);if(n<0)HEAP32[e+32>>>2>>>0]=+(l!=u&&_==a);else if(n>0!=(_==a)){var d=Math.max(u,l),f=n>0?_:d;r.setTime(r.getTime()+(f-a)*6e4)}HEAP32[e+24>>>2>>>0]=r.getDay();var p=ydayFromDate(r)|0;HEAP32[e+28>>>2>>>0]=p,HEAP32[e>>>2>>>0]=r.getSeconds(),HEAP32[e+4>>>2>>>0]=r.getMinutes(),HEAP32[e+8>>>2>>>0]=r.getHours(),HEAP32[e+12>>>2>>>0]=r.getDate(),HEAP32[e+16>>>2>>>0]=r.getMonth(),HEAP32[e+20>>>2>>>0]=r.getYear();var m=r.getTime();return isNaN(m)?-1:m/1e3})();return setTempRet0((tempDouble=t,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)),t>>>0};__mktime_js.sig="ip";function __mmap_js(e,t,r,n,a,o,l,u){e>>>=0;var _=convertI32PairToI53Checked(a,o);l>>>=0,u>>>=0;try{if(isNaN(_))return 61;var d=SYSCALLS.getStreamFromFD(n),f=FS.mmap(d,e,_,t,r),p=f.ptr;return HEAP32[l>>>2>>>0]=f.allocated,HEAPU32[u>>>2>>>0]=p,0}catch(m){if(typeof FS>"u"||m.name!=="ErrnoError")throw m;return-m.errno}}__mmap_js.sig="ipiiiiipp";function __msync_js(e,t,r,n,a,o,l){e>>>=0,t>>>=0;var u=convertI32PairToI53Checked(o,l);try{return isNaN(u)?61:(SYSCALLS.doMsync(e,SYSCALLS.getStreamFromFD(a),t,n,u),0)}catch(_){if(typeof FS>"u"||_.name!=="ErrnoError")throw _;return-_.errno}}__msync_js.sig="ippiiiii";function __munmap_js(e,t,r,n,a,o,l){e>>>=0,t>>>=0;var u=convertI32PairToI53Checked(o,l);try{var _=SYSCALLS.getStreamFromFD(a);r&2&&SYSCALLS.doMsync(e,_,t,n,u)}catch(d){if(typeof FS>"u"||d.name!=="ErrnoError")throw d;return-d.errno}}__munmap_js.sig="ippiiiii";var timers={},_emscripten_get_now=()=>performance.now();_emscripten_get_now.sig="d";var __setitimer_js=(e,t)=>{if(timers[e]&&(clearTimeout(timers[e].id),delete timers[e]),!t)return 0;var r=setTimeout(()=>{delete timers[e],callUserCallback(()=>__emscripten_timeout(e,_emscripten_get_now()))},t);return timers[e]={id:r,timeout_ms:t},0};__setitimer_js.sig="iid";var __timegm_js=function(e){e>>>=0;var t=(()=>{var r=Date.UTC(HEAP32[e+20>>>2>>>0]+1900,HEAP32[e+16>>>2>>>0],HEAP32[e+12>>>2>>>0],HEAP32[e+8>>>2>>>0],HEAP32[e+4>>>2>>>0],HEAP32[e>>>2>>>0],0),n=new Date(r);HEAP32[e+24>>>2>>>0]=n.getUTCDay();var a=Date.UTC(n.getUTCFullYear(),0,1,0,0,0,0),o=(n.getTime()-a)/(1e3*60*60*24)|0;return HEAP32[e+28>>>2>>>0]=o,n.getTime()/1e3})();return setTempRet0((tempDouble=t,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)),t>>>0};__timegm_js.sig="ip";var __tzset_js=function(e,t,r,n){e>>>=0,t>>>=0,r>>>=0,n>>>=0;var a=new Date().getFullYear(),o=new Date(a,0,1),l=new Date(a,6,1),u=o.getTimezoneOffset(),_=l.getTimezoneOffset(),d=Math.max(u,_);HEAPU32[e>>>2>>>0]=d*60,HEAP32[t>>>2>>>0]=+(u!=_);var f=h=>{var g=h>=0?"-":"+",v=Math.abs(h),b=String(Math.floor(v/60)).padStart(2,"0"),S=String(v%60).padStart(2,"0");return"UTC".concat(g).concat(b).concat(S)},p=f(u),m=f(_);_{if(MainLoop.timingMode=e,MainLoop.timingValue=t,!MainLoop.func)return 1;if(MainLoop.running||(MainLoop.running=!0),e==0)MainLoop.scheduler=function(){var l=Math.max(0,MainLoop.tickStartTime+t-_emscripten_get_now())|0;setTimeout(MainLoop.runner,l)},MainLoop.method="timeout";else if(e==1)MainLoop.scheduler=function(){MainLoop.requestAnimationFrame(MainLoop.runner)},MainLoop.method="rAF";else if(e==2){if(typeof MainLoop.setImmediate>"u")if(typeof setImmediate>"u"){var r=[],n="setimmediate",a=o=>{(o.data===n||o.data.target===n)&&(o.stopPropagation(),r.shift()())};addEventListener("message",a,!0),MainLoop.setImmediate=o=>{var l;r.push(o),ENVIRONMENT_IS_WORKER?((l=Module.setImmediates)!=null||(Module.setImmediates=[]),Module.setImmediates.push(o),postMessage({target:n})):postMessage(n,"*")}}else MainLoop.setImmediate=setImmediate;MainLoop.scheduler=function(){MainLoop.setImmediate(MainLoop.runner)},MainLoop.method="immediate"}return 0};_emscripten_set_main_loop_timing.sig="iii";var setMainLoop=(e,t,r,n,a)=>{MainLoop.func=e,MainLoop.arg=n;var o=MainLoop.currentlyRunningMainloop;function l(){return o0){var _=Date.now(),d=MainLoop.queue.shift();if(d.func(d.arg),MainLoop.remainingBlockers){var f=MainLoop.remainingBlockers,p=f%1==0?f-1:Math.floor(f);d.counted?MainLoop.remainingBlockers=p:(p=p+.5,MainLoop.remainingBlockers=(8*f+p)/9)}if(MainLoop.updateStatus(),!l())return;setTimeout(MainLoop.runner,0);return}if(l()){if(MainLoop.currentFrameNumber=MainLoop.currentFrameNumber+1|0,MainLoop.timingMode==1&&MainLoop.timingValue>1&&MainLoop.currentFrameNumber%MainLoop.timingValue!=0){MainLoop.scheduler();return}else MainLoop.timingMode==0&&(MainLoop.tickStartTime=_emscripten_get_now());MainLoop.runIter(e),l()&&MainLoop.scheduler()}}},a||(t&&t>0?_emscripten_set_main_loop_timing(0,1e3/t):_emscripten_set_main_loop_timing(1,1),MainLoop.scheduler()),r)throw"unwind"},MainLoop={running:!1,scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],preMainLoop:[],postMainLoop:[],pause(){MainLoop.scheduler=null,MainLoop.currentlyRunningMainloop++},resume(){MainLoop.currentlyRunningMainloop++;var e=MainLoop.timingMode,t=MainLoop.timingValue,r=MainLoop.func;MainLoop.func=null,setMainLoop(r,0,!1,MainLoop.arg,!0),_emscripten_set_main_loop_timing(e,t),MainLoop.scheduler()},updateStatus(){var n,a;if(Module.setStatus){var e=Module.statusMessage||"Please wait...",t=(n=MainLoop.remainingBlockers)!=null?n:0,r=(a=MainLoop.expectedBlockers)!=null?a:0;t?t=MainLoop.nextRAF;)MainLoop.nextRAF+=1e3/60;var r=Math.max(MainLoop.nextRAF-t,0);setTimeout(e,r)},requestAnimationFrame(e){if(typeof requestAnimationFrame=="function"){requestAnimationFrame(e);return}var t=MainLoop.fakeRequestAnimationFrame;t(e)}},AL={QUEUE_INTERVAL:25,QUEUE_LOOKAHEAD:.1,DEVICE_NAME:"Emscripten OpenAL",CAPTURE_DEVICE_NAME:"Emscripten OpenAL capture",ALC_EXTENSIONS:{ALC_SOFT_pause_device:!0,ALC_SOFT_HRTF:!0},AL_EXTENSIONS:{AL_EXT_float32:!0,AL_SOFT_loop_points:!0,AL_SOFT_source_length:!0,AL_EXT_source_distance_model:!0,AL_SOFT_source_spatialize:!0},_alcErr:0,alcErr:0,deviceRefCounts:{},alcStringCache:{},paused:!1,stringCache:{},contexts:{},currentCtx:null,buffers:{0:{id:0,refCount:0,audioBuf:null,frequency:0,bytesPerSample:2,channels:1,length:0}},paramArray:[],_nextId:1,newId:()=>AL.freeIds.length>0?AL.freeIds.pop():AL._nextId++,freeIds:[],scheduleContextAudio:e=>{if(!(MainLoop.timingMode===1&&document.visibilityState!="visible"))for(var t in e.sources)AL.scheduleSourceAudio(e.sources[t])},scheduleSourceAudio:(e,t)=>{if(!(MainLoop.timingMode===1&&document.visibilityState!="visible")&&e.state===4114){for(var r=AL.updateSourceTime(e),n=e.bufStartTime,a=e.bufOffset,o=e.bufsProcessed,l=0;l=e.bufQueue.length)if(e.looping)o%=e.bufQueue.length;else break;var f=e.bufQueue[o%e.bufQueue.length];if(f.length===0){if(d++,d===e.bufQueue.length)break}else{var u=e.context.audioCtx.createBufferSource();u.buffer=f.audioBuf,u.playbackRate.value=e.playbackRate,(f.audioBuf._loopStart||f.audioBuf._loopEnd)&&(u.loopStart=f.audioBuf._loopStart,u.loopEnd=f.audioBuf._loopEnd);var p=0;e.type===4136&&e.looping?(p=Number.POSITIVE_INFINITY,u.loop=!0,f.audioBuf._loopStart&&(u.loopStart=f.audioBuf._loopStart),f.audioBuf._loopEnd&&(u.loopEnd=f.audioBuf._loopEnd)):p=(f.audioBuf.duration-a)/e.playbackRate,u._startOffset=a,u._duration=p,u._skipCount=d,d=0,u.connect(e.gain),typeof u.start<"u"?(n=Math.max(n,e.context.audioCtx.currentTime),u.start(n,a)):typeof u.noteOn<"u"&&(n=Math.max(n,e.context.audioCtx.currentTime),u.noteOn(n)),u._startTime=n,e.audioQueue.push(u),n+=p}a=0,o++}}},updateSourceTime:e=>{var t=e.context.audioCtx.currentTime;if(e.state!==4114)return t;isFinite(e.bufStartTime)||(e.bufStartTime=t-e.bufOffset/e.playbackRate,e.bufOffset=0);for(var r=0;e.audioQueue.length;){var n=e.audioQueue[0];if(e.bufsProcessed+=n._skipCount,r=n._startTime+n._duration,t=e.bufQueue.length&&!e.looping)AL.setSourceState(e,4116);else if(e.type===4136&&e.looping){var a=e.bufQueue[0];if(a.length===0)e.bufOffset=0;else{var o=(t-e.bufStartTime)*e.playbackRate,l=a.audioBuf._loopStart||0,u=a.audioBuf._loopEnd||a.audioBuf.duration;u<=l&&(u=a.audioBuf.duration),o0&&(e.bufStartTime+=Math.floor((t-e.bufStartTime)/_)*_)}for(var d=0;d=e.bufQueue.length)if(e.looping)e.bufsProcessed%=e.bufQueue.length;else{AL.setSourceState(e,4116);break}var a=e.bufQueue[e.bufsProcessed];if(a.length>0){if(r=e.bufStartTime+a.audioBuf.duration/e.playbackRate,t{AL.updateSourceTime(e);for(var t=1;t1&&(e.audioQueue.length=1)},stopSourceAudio:e=>{for(var t=0;t{t===4114?((e.state===4114||e.state==4116)&&(e.bufsProcessed=0,e.bufOffset=0),AL.stopSourceAudio(e),e.state=4114,e.bufStartTime=Number.NEGATIVE_INFINITY,AL.scheduleSourceAudio(e)):t===4115?e.state===4114&&(AL.updateSourceTime(e),AL.stopSourceAudio(e),e.state=4115):t===4116?e.state!==4113&&(e.state=4116,e.bufsProcessed=e.bufQueue.length,e.bufStartTime=Number.NEGATIVE_INFINITY,e.bufOffset=0,AL.stopSourceAudio(e)):t===4113&&e.state!==4113&&(e.state=4113,e.bufsProcessed=0,e.bufStartTime=Number.NEGATIVE_INFINITY,e.bufOffset=0,AL.stopSourceAudio(e))},initSourcePanner:e=>{if(e.type!==4144){for(var t=AL.buffers[0],r=0;r{for(var t in e.sources)AL.updateSourceGlobal(e.sources[t])},updateSourceGlobal:e=>{var t=e.panner;if(t){t.refDistance=e.refDistance,t.maxDistance=e.maxDistance,t.rolloffFactor=e.rolloffFactor,t.panningModel=e.context.hrtf?"HRTF":"equalpower";var r=e.context.sourceDistanceModel?e.distanceModel:e.context.distanceModel;switch(r){case 0:t.distanceModel="inverse",t.refDistance=340282e33;break;case 53249:case 53250:t.distanceModel="inverse";break;case 53251:case 53252:t.distanceModel="linear";break;case 53253:case 53254:t.distanceModel="exponential";break}}},updateListenerSpace:e=>{var t=e.audioCtx.listener;t.positionX?(t.positionX.value=e.listener.position[0],t.positionY.value=e.listener.position[1],t.positionZ.value=e.listener.position[2]):t.setPosition(e.listener.position[0],e.listener.position[1],e.listener.position[2]),t.forwardX?(t.forwardX.value=e.listener.direction[0],t.forwardY.value=e.listener.direction[1],t.forwardZ.value=e.listener.direction[2],t.upX.value=e.listener.up[0],t.upY.value=e.listener.up[1],t.upZ.value=e.listener.up[2]):t.setOrientation(e.listener.direction[0],e.listener.direction[1],e.listener.direction[2],e.listener.up[0],e.listener.up[1],e.listener.up[2]);for(var r in e.sources)AL.updateSourceSpace(e.sources[r])},updateSourceSpace:e=>{if(e.panner){var t=e.panner,r=e.position[0],n=e.position[1],a=e.position[2],o=e.direction[0],l=e.direction[1],u=e.direction[2],_=e.context.listener,d=_.position[0],f=_.position[1],p=_.position[2];if(e.relative){var m=-_.direction[0],h=-_.direction[1],g=-_.direction[2],v=_.up[0],b=_.up[1],S=_.up[2],L=(To,Fo,xo)=>{var Co=Math.sqrt(To*To+Fo*Fo+xo*xo);return Co{if(e.state===4114){AL.cancelPendingSourceAudio(e);var t=e.audioQueue[0];if(!t)return;var r;e.type===4136&&e.looping?r=Number.POSITIVE_INFINITY:r=(t.buffer.duration-t._startOffset)/e.playbackRate,t._duration=r,t.playbackRate.value=e.playbackRate,AL.scheduleSourceAudio(e)}},sourceDuration:e=>{for(var t=0,r=0;r{AL.updateSourceTime(e);for(var t=0,r=0;r{var r=e.state==4114;if(r&&AL.setSourceState(e,4113),e.bufQueue[e.bufsProcessed].audioBuf!==null){for(e.bufsProcessed=0;t>e.bufQueue[e.bufsProcessed].audioBuf.duration;)t-=e.bufQueue[e.bufsProcessed].audioBuf.duration,e.bufsProcessed++;e.bufOffset=t}r&&AL.setSourceState(e,4114)},getGlobalParam:(e,t)=>{if(!AL.currentCtx)return null;switch(t){case 49152:return AL.currentCtx.dopplerFactor;case 49155:return AL.currentCtx.speedOfSound;case 53248:return AL.currentCtx.distanceModel;default:return AL.currentCtx.err=40962,null}},setGlobalParam:(e,t,r)=>{if(AL.currentCtx)switch(t){case 49152:if(!Number.isFinite(r)||r<0){AL.currentCtx.err=40963;return}AL.currentCtx.dopplerFactor=r,AL.updateListenerSpace(AL.currentCtx);break;case 49155:if(!Number.isFinite(r)||r<=0){AL.currentCtx.err=40963;return}AL.currentCtx.speedOfSound=r,AL.updateListenerSpace(AL.currentCtx);break;case 53248:switch(r){case 0:case 53249:case 53250:case 53251:case 53252:case 53253:case 53254:AL.currentCtx.distanceModel=r,AL.updateContextGlobal(AL.currentCtx);break;default:AL.currentCtx.err=40963;return}break;default:AL.currentCtx.err=40962;return}},getListenerParam:(e,t)=>{if(!AL.currentCtx)return null;switch(t){case 4100:return AL.currentCtx.listener.position;case 4102:return AL.currentCtx.listener.velocity;case 4111:return AL.currentCtx.listener.direction.concat(AL.currentCtx.listener.up);case 4106:return AL.currentCtx.gain.gain.value;default:return AL.currentCtx.err=40962,null}},setListenerParam:(e,t,r)=>{if(AL.currentCtx){if(r===null){AL.currentCtx.err=40962;return}var n=AL.currentCtx.listener;switch(t){case 4100:if(!Number.isFinite(r[0])||!Number.isFinite(r[1])||!Number.isFinite(r[2])){AL.currentCtx.err=40963;return}n.position[0]=r[0],n.position[1]=r[1],n.position[2]=r[2],AL.updateListenerSpace(AL.currentCtx);break;case 4102:if(!Number.isFinite(r[0])||!Number.isFinite(r[1])||!Number.isFinite(r[2])){AL.currentCtx.err=40963;return}n.velocity[0]=r[0],n.velocity[1]=r[1],n.velocity[2]=r[2],AL.updateListenerSpace(AL.currentCtx);break;case 4106:if(!Number.isFinite(r)||r<0){AL.currentCtx.err=40963;return}AL.currentCtx.gain.gain.value=r;break;case 4111:if(!Number.isFinite(r[0])||!Number.isFinite(r[1])||!Number.isFinite(r[2])||!Number.isFinite(r[3])||!Number.isFinite(r[4])||!Number.isFinite(r[5])){AL.currentCtx.err=40963;return}n.direction[0]=r[0],n.direction[1]=r[1],n.direction[2]=r[2],n.up[0]=r[3],n.up[1]=r[4],n.up[2]=r[5],AL.updateListenerSpace(AL.currentCtx);break;default:AL.currentCtx.err=40962;return}}},getBufferParam:(e,t,r)=>{if(AL.currentCtx){var n=AL.buffers[t];if(!n||t===0){AL.currentCtx.err=40961;return}switch(r){case 8193:return n.frequency;case 8194:return n.bytesPerSample*8;case 8195:return n.channels;case 8196:return n.length*n.bytesPerSample*n.channels;case 8213:return n.length===0?[0,0]:[(n.audioBuf._loopStart||0)*n.frequency,(n.audioBuf._loopEnd||n.length)*n.frequency];default:return AL.currentCtx.err=40962,null}}},setBufferParam:(e,t,r,n)=>{if(AL.currentCtx){var a=AL.buffers[t];if(!a||t===0){AL.currentCtx.err=40961;return}if(n===null){AL.currentCtx.err=40962;return}switch(r){case 8196:if(n!==0){AL.currentCtx.err=40963;return}break;case 8213:if(n[0]<0||n[0]>a.length||n[1]<0||n[1]>a.Length||n[0]>=n[1]){AL.currentCtx.err=40963;return}if(a.refCount>0){AL.currentCtx.err=40964;return}a.audioBuf&&(a.audioBuf._loopStart=n[0]/a.frequency,a.audioBuf._loopEnd=n[1]/a.frequency);break;default:AL.currentCtx.err=40962;return}}},getSourceParam:(e,t,r)=>{if(!AL.currentCtx)return null;var n=AL.currentCtx.sources[t];if(!n)return AL.currentCtx.err=40961,null;switch(r){case 514:return n.relative;case 4097:return n.coneInnerAngle;case 4098:return n.coneOuterAngle;case 4099:return n.pitch;case 4100:return n.position;case 4101:return n.direction;case 4102:return n.velocity;case 4103:return n.looping;case 4105:return n.type===4136?n.bufQueue[0].id:0;case 4106:return n.gain.gain.value;case 4109:return n.minGain;case 4110:return n.maxGain;case 4112:return n.state;case 4117:return n.bufQueue.length===1&&n.bufQueue[0].id===0?0:n.bufQueue.length;case 4118:return n.bufQueue.length===1&&n.bufQueue[0].id===0||n.looping?0:n.bufsProcessed;case 4128:return n.refDistance;case 4129:return n.rolloffFactor;case 4130:return n.coneOuterGain;case 4131:return n.maxDistance;case 4132:return AL.sourceTell(n);case 4133:var a=AL.sourceTell(n);return a>0&&(a*=n.bufQueue[0].frequency),a;case 4134:var a=AL.sourceTell(n);return a>0&&(a*=n.bufQueue[0].frequency*n.bufQueue[0].bytesPerSample),a;case 4135:return n.type;case 4628:return n.spatialize;case 8201:for(var u=0,o=0,l=0;l{if(AL.currentCtx){var a=AL.currentCtx.sources[t];if(!a){AL.currentCtx.err=40961;return}if(n===null){AL.currentCtx.err=40962;return}switch(r){case 514:if(n===1)a.relative=!0,AL.updateSourceSpace(a);else if(n===0)a.relative=!1,AL.updateSourceSpace(a);else{AL.currentCtx.err=40963;return}break;case 4097:if(!Number.isFinite(n)){AL.currentCtx.err=40963;return}a.coneInnerAngle=n,a.panner&&(a.panner.coneInnerAngle=n%360);break;case 4098:if(!Number.isFinite(n)){AL.currentCtx.err=40963;return}a.coneOuterAngle=n,a.panner&&(a.panner.coneOuterAngle=n%360);break;case 4099:if(!Number.isFinite(n)||n<=0){AL.currentCtx.err=40963;return}if(a.pitch===n)break;a.pitch=n,AL.updateSourceRate(a);break;case 4100:if(!Number.isFinite(n[0])||!Number.isFinite(n[1])||!Number.isFinite(n[2])){AL.currentCtx.err=40963;return}a.position[0]=n[0],a.position[1]=n[1],a.position[2]=n[2],AL.updateSourceSpace(a);break;case 4101:if(!Number.isFinite(n[0])||!Number.isFinite(n[1])||!Number.isFinite(n[2])){AL.currentCtx.err=40963;return}a.direction[0]=n[0],a.direction[1]=n[1],a.direction[2]=n[2],AL.updateSourceSpace(a);break;case 4102:if(!Number.isFinite(n[0])||!Number.isFinite(n[1])||!Number.isFinite(n[2])){AL.currentCtx.err=40963;return}a.velocity[0]=n[0],a.velocity[1]=n[1],a.velocity[2]=n[2],AL.updateSourceSpace(a);break;case 4103:if(n===1){if(a.looping=!0,AL.updateSourceTime(a),a.type===4136&&a.audioQueue.length>0){var o=a.audioQueue[0];o.loop=!0,o._duration=Number.POSITIVE_INFINITY}}else if(n===0){a.looping=!1;var l=AL.updateSourceTime(a);if(a.type===4136&&a.audioQueue.length>0){var o=a.audioQueue[0];o.loop=!1,o._duration=a.bufQueue[0].audioBuf.duration/a.playbackRate,o._startTime=l-a.bufOffset/a.playbackRate}}else{AL.currentCtx.err=40963;return}break;case 4105:if(a.state===4114||a.state===4115){AL.currentCtx.err=40964;return}if(n===0){for(var u in a.bufQueue)a.bufQueue[u].refCount--;a.bufQueue.length=1,a.bufQueue[0]=AL.buffers[0],a.bufsProcessed=0,a.type=4144}else{var _=AL.buffers[n];if(!_){AL.currentCtx.err=40963;return}for(var u in a.bufQueue)a.bufQueue[u].refCount--;a.bufQueue.length=0,_.refCount++,a.bufQueue=[_],a.bufsProcessed=0,a.type=4136}AL.initSourcePanner(a),AL.scheduleSourceAudio(a);break;case 4106:if(!Number.isFinite(n)||n<0){AL.currentCtx.err=40963;return}a.gain.gain.value=n;break;case 4109:if(!Number.isFinite(n)||n<0||n>Math.min(a.maxGain,1)){AL.currentCtx.err=40963;return}a.minGain=n;break;case 4110:if(!Number.isFinite(n)||n1){AL.currentCtx.err=40963;return}a.maxGain=n;break;case 4128:if(!Number.isFinite(n)||n<0){AL.currentCtx.err=40963;return}a.refDistance=n,a.panner&&(a.panner.refDistance=n);break;case 4129:if(!Number.isFinite(n)||n<0){AL.currentCtx.err=40963;return}a.rolloffFactor=n,a.panner&&(a.panner.rolloffFactor=n);break;case 4130:if(!Number.isFinite(n)||n<0||n>1){AL.currentCtx.err=40963;return}a.coneOuterGain=n,a.panner&&(a.panner.coneOuterGain=n);break;case 4131:if(!Number.isFinite(n)||n<0){AL.currentCtx.err=40963;return}a.maxDistance=n,a.panner&&(a.panner.maxDistance=n);break;case 4132:if(n<0||n>AL.sourceDuration(a)){AL.currentCtx.err=40963;return}AL.sourceSeek(a,n);break;case 4133:var p=AL.sourceDuration(a);if(p>0){var d;for(var f in a.bufQueue)if(f){d=a.bufQueue[f].frequency;break}n/=d}if(n<0||n>p){AL.currentCtx.err=40963;return}AL.sourceSeek(a,n);break;case 4134:var p=AL.sourceDuration(a);if(p>0){var m;for(var f in a.bufQueue)if(f){var _=a.bufQueue[f];m=_.frequency*_.bytesPerSample*_.channels;break}n/=m}if(n<0||n>p){AL.currentCtx.err=40963;return}AL.sourceSeek(a,n);break;case 4628:if(n!==0&&n!==1&&n!==2){AL.currentCtx.err=40963;return}a.spatialize=n,AL.initSourcePanner(a);break;case 8201:case 8202:case 8203:AL.currentCtx.err=40964;break;case 53248:switch(n){case 0:case 53249:case 53250:case 53251:case 53252:case 53253:case 53254:a.distanceModel=n,AL.currentCtx.sourceDistanceModel&&AL.updateContextGlobal(AL.currentCtx);break;default:AL.currentCtx.err=40963;return}break;default:AL.currentCtx.err=40962;return}}},captures:{},sharedCaptureAudioCtx:null,requireValidCaptureDevice:(e,t)=>{if(e===0)return AL.alcErr=40961,null;var r=AL.captures[e];if(!r)return AL.alcErr=40961,null;var n=r.mediaStreamError;return n?(AL.alcErr=40961,null):r}},_alBuffer3f=(e,t,r,n,a)=>{AL.setBufferParam("alBuffer3f",e,t,null)};_alBuffer3f.sig="viifff";var _alBuffer3i=(e,t,r,n,a)=>{AL.setBufferParam("alBuffer3i",e,t,null)};_alBuffer3i.sig="viiiii";function _alBufferData(e,t,r,n,a){if(r>>>=0,!!AL.currentCtx){var o=AL.buffers[e];if(!o){AL.currentCtx.err=40963;return}if(a<=0){AL.currentCtx.err=40963;return}var l=null;try{switch(t){case 4352:if(n>0){l=AL.currentCtx.audioCtx.createBuffer(1,n,a);for(var u=l.getChannelData(0),_=0;_>>0]*.0078125-1}o.bytesPerSample=1,o.channels=1,o.length=n;break;case 4353:if(n>0){l=AL.currentCtx.audioCtx.createBuffer(1,n>>1,a);var u=l.getChannelData(0);r>>=1;for(var _=0;_>1;++_)u[_]=HEAP16[r++>>>0]*30517578125e-15}o.bytesPerSample=2,o.channels=1,o.length=n>>1;break;case 4354:if(n>0){l=AL.currentCtx.audioCtx.createBuffer(2,n>>1,a);for(var u=l.getChannelData(0),d=l.getChannelData(1),_=0;_>1;++_)u[_]=HEAPU8[r++>>>0]*.0078125-1,d[_]=HEAPU8[r++>>>0]*.0078125-1}o.bytesPerSample=1,o.channels=2,o.length=n>>1;break;case 4355:if(n>0){l=AL.currentCtx.audioCtx.createBuffer(2,n>>2,a);var u=l.getChannelData(0),d=l.getChannelData(1);r>>=1;for(var _=0;_>2;++_)u[_]=HEAP16[r++>>>0]*30517578125e-15,d[_]=HEAP16[r++>>>0]*30517578125e-15}o.bytesPerSample=2,o.channels=2,o.length=n>>2;break;case 65552:if(n>0){l=AL.currentCtx.audioCtx.createBuffer(1,n>>2,a);var u=l.getChannelData(0);r>>=2;for(var _=0;_>2;++_)u[_]=HEAPF32[r++>>>0]}o.bytesPerSample=4,o.channels=1,o.length=n>>2;break;case 65553:if(n>0){l=AL.currentCtx.audioCtx.createBuffer(2,n>>3,a);var u=l.getChannelData(0),d=l.getChannelData(1);r>>=2;for(var _=0;_>3;++_)u[_]=HEAPF32[r++>>>0],d[_]=HEAPF32[r++>>>0]}o.bytesPerSample=4,o.channels=2,o.length=n>>3;break;default:AL.currentCtx.err=40963;return}o.frequency=a,o.audioBuf=l}catch(f){AL.currentCtx.err=40963;return}}}_alBufferData.sig="viipii";var _alBufferf=(e,t,r)=>{AL.setBufferParam("alBufferf",e,t,null)};_alBufferf.sig="viif";function _alBufferfv(e,t,r){if(r>>>=0,!!AL.currentCtx){if(!r){AL.currentCtx.err=40963;return}AL.setBufferParam("alBufferfv",e,t,null)}}_alBufferfv.sig="viip";var _alBufferi=(e,t,r)=>{AL.setBufferParam("alBufferi",e,t,null)};_alBufferi.sig="viii";function _alBufferiv(e,t,r){if(r>>>=0,!!AL.currentCtx){if(!r){AL.currentCtx.err=40963;return}switch(t){case 8213:AL.paramArray[0]=HEAP32[r>>>2>>>0],AL.paramArray[1]=HEAP32[r+4>>>2>>>0],AL.setBufferParam("alBufferiv",e,t,AL.paramArray);break;default:AL.setBufferParam("alBufferiv",e,t,null);break}}}_alBufferiv.sig="viip";function _alDeleteBuffers(e,t){if(t>>>=0,!!AL.currentCtx){for(var r=0;r>>2>>>0];if(n!==0){if(!AL.buffers[n]){AL.currentCtx.err=40961;return}if(AL.buffers[n].refCount){AL.currentCtx.err=40964;return}}}for(var r=0;r>>2>>>0];n!==0&&(AL.deviceRefCounts[AL.buffers[n].deviceId]--,delete AL.buffers[n],AL.freeIds.push(n))}}}_alDeleteBuffers.sig="vip";var _alSourcei=(e,t,r)=>{switch(t){case 514:case 4097:case 4098:case 4103:case 4105:case 4128:case 4129:case 4131:case 4132:case 4133:case 4134:case 4628:case 8201:case 8202:case 53248:AL.setSourceParam("alSourcei",e,t,r);break;default:AL.setSourceParam("alSourcei",e,t,null);break}};_alSourcei.sig="viii";function _alDeleteSources(e,t){if(t>>>=0,!!AL.currentCtx){for(var r=0;r>>2>>>0];if(!AL.currentCtx.sources[n]){AL.currentCtx.err=40961;return}}for(var r=0;r>>2>>>0];AL.setSourceState(AL.currentCtx.sources[n],4116),_alSourcei(n,4105,0),delete AL.currentCtx.sources[n],AL.freeIds.push(n)}}}_alDeleteSources.sig="vip";var _alDisable=e=>{if(AL.currentCtx)switch(e){case 512:AL.currentCtx.sourceDistanceModel=!1,AL.updateContextGlobal(AL.currentCtx);break;default:AL.currentCtx.err=40962;return}};_alDisable.sig="vi";var _alDistanceModel=e=>{AL.setGlobalParam("alDistanceModel",53248,e)};_alDistanceModel.sig="vi";var _alDopplerFactor=e=>{AL.setGlobalParam("alDopplerFactor",49152,e)};_alDopplerFactor.sig="vf";var _alDopplerVelocity=e=>{if(warnOnce("alDopplerVelocity() is deprecated, and only kept for compatibility with OpenAL 1.0. Use alSpeedOfSound() instead."),!!AL.currentCtx&&e<=0){AL.currentCtx.err=40963;return}};_alDopplerVelocity.sig="vf";var _alEnable=e=>{if(AL.currentCtx)switch(e){case 512:AL.currentCtx.sourceDistanceModel=!0,AL.updateContextGlobal(AL.currentCtx);break;default:AL.currentCtx.err=40962;return}};_alEnable.sig="vi";function _alGenBuffers(e,t){if(t>>>=0,!!AL.currentCtx)for(var r=0;r>>2>>>0]=n.id}}_alGenBuffers.sig="vip";function _alGenSources(e,t){if(t>>>=0,!!AL.currentCtx)for(var r=0;r>>2>>>0]=a.id}}_alGenSources.sig="vip";var _alGetBoolean=e=>{var t=AL.getGlobalParam("alGetBoolean",e);if(t===null)return 0;switch(e){case 49152:case 49155:case 53248:return t!==0?1:0;default:return AL.currentCtx.err=40962,0}};_alGetBoolean.sig="ii";function _alGetBooleanv(e,t){t>>>=0;var r=AL.getGlobalParam("alGetBooleanv",e);if(!(r===null||!t))switch(e){case 49152:case 49155:case 53248:HEAP8[t>>>0]=r;break;default:AL.currentCtx.err=40962;return}}_alGetBooleanv.sig="vip";function _alGetBuffer3f(e,t,r,n,a){r>>>=0,n>>>=0,a>>>=0;var o=AL.getBufferParam("alGetBuffer3f",e,t);if(o!==null){if(!r||!n||!a){AL.currentCtx.err=40963;return}AL.currentCtx.err=40962}}_alGetBuffer3f.sig="viippp";function _alGetBuffer3i(e,t,r,n,a){r>>>=0,n>>>=0,a>>>=0;var o=AL.getBufferParam("alGetBuffer3i",e,t);if(o!==null){if(!r||!n||!a){AL.currentCtx.err=40963;return}AL.currentCtx.err=40962}}_alGetBuffer3i.sig="viippp";function _alGetBufferf(e,t,r){r>>>=0;var n=AL.getBufferParam("alGetBufferf",e,t);if(n!==null){if(!r){AL.currentCtx.err=40963;return}AL.currentCtx.err=40962}}_alGetBufferf.sig="viip";function _alGetBufferfv(e,t,r){r>>>=0;var n=AL.getBufferParam("alGetBufferfv",e,t);if(n!==null){if(!r){AL.currentCtx.err=40963;return}AL.currentCtx.err=40962}}_alGetBufferfv.sig="viip";function _alGetBufferi(e,t,r){r>>>=0;var n=AL.getBufferParam("alGetBufferi",e,t);if(n!==null){if(!r){AL.currentCtx.err=40963;return}switch(t){case 8193:case 8194:case 8195:case 8196:HEAP32[r>>>2>>>0]=n;break;default:AL.currentCtx.err=40962;return}}}_alGetBufferi.sig="viip";function _alGetBufferiv(e,t,r){r>>>=0;var n=AL.getBufferParam("alGetBufferiv",e,t);if(n!==null){if(!r){AL.currentCtx.err=40963;return}switch(t){case 8193:case 8194:case 8195:case 8196:HEAP32[r>>>2>>>0]=n;break;case 8213:HEAP32[r>>>2>>>0]=n[0],HEAP32[r+4>>>2>>>0]=n[1];break;default:AL.currentCtx.err=40962;return}}}_alGetBufferiv.sig="viip";var _alGetDouble=e=>{var t=AL.getGlobalParam("alGetDouble",e);if(t===null)return 0;switch(e){case 49152:case 49155:case 53248:return t;default:return AL.currentCtx.err=40962,0}};_alGetDouble.sig="di";function _alGetDoublev(e,t){t>>>=0;var r=AL.getGlobalParam("alGetDoublev",e);if(!(r===null||!t))switch(e){case 49152:case 49155:case 53248:HEAPF64[t>>>3>>>0]=r;break;default:AL.currentCtx.err=40962;return}}_alGetDoublev.sig="vip";function _alGetEnumValue(e){if(e>>>=0,!AL.currentCtx)return 0;if(!e)return AL.currentCtx.err=40963,0;var t=UTF8ToString(e);switch(t){case"AL_BITS":return 8194;case"AL_BUFFER":return 4105;case"AL_BUFFERS_PROCESSED":return 4118;case"AL_BUFFERS_QUEUED":return 4117;case"AL_BYTE_OFFSET":return 4134;case"AL_CHANNELS":return 8195;case"AL_CONE_INNER_ANGLE":return 4097;case"AL_CONE_OUTER_ANGLE":return 4098;case"AL_CONE_OUTER_GAIN":return 4130;case"AL_DIRECTION":return 4101;case"AL_DISTANCE_MODEL":return 53248;case"AL_DOPPLER_FACTOR":return 49152;case"AL_DOPPLER_VELOCITY":return 49153;case"AL_EXPONENT_DISTANCE":return 53253;case"AL_EXPONENT_DISTANCE_CLAMPED":return 53254;case"AL_EXTENSIONS":return 45060;case"AL_FORMAT_MONO16":return 4353;case"AL_FORMAT_MONO8":return 4352;case"AL_FORMAT_STEREO16":return 4355;case"AL_FORMAT_STEREO8":return 4354;case"AL_FREQUENCY":return 8193;case"AL_GAIN":return 4106;case"AL_INITIAL":return 4113;case"AL_INVALID":return-1;case"AL_ILLEGAL_ENUM":case"AL_INVALID_ENUM":return 40962;case"AL_INVALID_NAME":return 40961;case"AL_ILLEGAL_COMMAND":case"AL_INVALID_OPERATION":return 40964;case"AL_INVALID_VALUE":return 40963;case"AL_INVERSE_DISTANCE":return 53249;case"AL_INVERSE_DISTANCE_CLAMPED":return 53250;case"AL_LINEAR_DISTANCE":return 53251;case"AL_LINEAR_DISTANCE_CLAMPED":return 53252;case"AL_LOOPING":return 4103;case"AL_MAX_DISTANCE":return 4131;case"AL_MAX_GAIN":return 4110;case"AL_MIN_GAIN":return 4109;case"AL_NONE":return 0;case"AL_NO_ERROR":return 0;case"AL_ORIENTATION":return 4111;case"AL_OUT_OF_MEMORY":return 40965;case"AL_PAUSED":return 4115;case"AL_PENDING":return 8209;case"AL_PITCH":return 4099;case"AL_PLAYING":return 4114;case"AL_POSITION":return 4100;case"AL_PROCESSED":return 8210;case"AL_REFERENCE_DISTANCE":return 4128;case"AL_RENDERER":return 45059;case"AL_ROLLOFF_FACTOR":return 4129;case"AL_SAMPLE_OFFSET":return 4133;case"AL_SEC_OFFSET":return 4132;case"AL_SIZE":return 8196;case"AL_SOURCE_RELATIVE":return 514;case"AL_SOURCE_STATE":return 4112;case"AL_SOURCE_TYPE":return 4135;case"AL_SPEED_OF_SOUND":return 49155;case"AL_STATIC":return 4136;case"AL_STOPPED":return 4116;case"AL_STREAMING":return 4137;case"AL_UNDETERMINED":return 4144;case"AL_UNUSED":return 8208;case"AL_VELOCITY":return 4102;case"AL_VENDOR":return 45057;case"AL_VERSION":return 45058;case"AL_AUTO_SOFT":return 2;case"AL_SOURCE_DISTANCE_MODEL":return 512;case"AL_SOURCE_SPATIALIZE_SOFT":return 4628;case"AL_LOOP_POINTS_SOFT":return 8213;case"AL_BYTE_LENGTH_SOFT":return 8201;case"AL_SAMPLE_LENGTH_SOFT":return 8202;case"AL_SEC_LENGTH_SOFT":return 8203;case"AL_FORMAT_MONO_FLOAT32":return 65552;case"AL_FORMAT_STEREO_FLOAT32":return 65553;default:return AL.currentCtx.err=40963,0}}_alGetEnumValue.sig="ip";var _alGetError=()=>{if(!AL.currentCtx)return 40964;var e=AL.currentCtx.err;return AL.currentCtx.err=0,e};_alGetError.sig="i";var _alGetFloat=e=>{var t=AL.getGlobalParam("alGetFloat",e);if(t===null)return 0;switch(e){case 49152:case 49155:case 53248:return t;default:return 0}};_alGetFloat.sig="fi";function _alGetFloatv(e,t){t>>>=0;var r=AL.getGlobalParam("alGetFloatv",e);if(!(r===null||!t))switch(e){case 49152:case 49155:case 53248:HEAPF32[t>>>2>>>0]=r;break;default:AL.currentCtx.err=40962;return}}_alGetFloatv.sig="vip";var _alGetInteger=e=>{var t=AL.getGlobalParam("alGetInteger",e);if(t===null)return 0;switch(e){case 49152:case 49155:case 53248:return t;default:return AL.currentCtx.err=40962,0}};_alGetInteger.sig="ii";function _alGetIntegerv(e,t){t>>>=0;var r=AL.getGlobalParam("alGetIntegerv",e);if(!(r===null||!t))switch(e){case 49152:case 49155:case 53248:HEAP32[t>>>2>>>0]=r;break;default:AL.currentCtx.err=40962;return}}_alGetIntegerv.sig="vip";function _alGetListener3f(e,t,r,n){t>>>=0,r>>>=0,n>>>=0;var a=AL.getListenerParam("alGetListener3f",e);if(a!==null){if(!t||!r||!n){AL.currentCtx.err=40963;return}switch(e){case 4100:case 4102:HEAPF32[t>>>2>>>0]=a[0],HEAPF32[r>>>2>>>0]=a[1],HEAPF32[n>>>2>>>0]=a[2];break;default:AL.currentCtx.err=40962;return}}}_alGetListener3f.sig="vippp";function _alGetListener3i(e,t,r,n){t>>>=0,r>>>=0,n>>>=0;var a=AL.getListenerParam("alGetListener3i",e);if(a!==null){if(!t||!r||!n){AL.currentCtx.err=40963;return}switch(e){case 4100:case 4102:HEAP32[t>>>2>>>0]=a[0],HEAP32[r>>>2>>>0]=a[1],HEAP32[n>>>2>>>0]=a[2];break;default:AL.currentCtx.err=40962;return}}}_alGetListener3i.sig="vippp";function _alGetListenerf(e,t){t>>>=0;var r=AL.getListenerParam("alGetListenerf",e);if(r!==null){if(!t){AL.currentCtx.err=40963;return}switch(e){case 4106:HEAPF32[t>>>2>>>0]=r;break;default:AL.currentCtx.err=40962;return}}}_alGetListenerf.sig="vip";function _alGetListenerfv(e,t){t>>>=0;var r=AL.getListenerParam("alGetListenerfv",e);if(r!==null){if(!t){AL.currentCtx.err=40963;return}switch(e){case 4100:case 4102:HEAPF32[t>>>2>>>0]=r[0],HEAPF32[t+4>>>2>>>0]=r[1],HEAPF32[t+8>>>2>>>0]=r[2];break;case 4111:HEAPF32[t>>>2>>>0]=r[0],HEAPF32[t+4>>>2>>>0]=r[1],HEAPF32[t+8>>>2>>>0]=r[2],HEAPF32[t+12>>>2>>>0]=r[3],HEAPF32[t+16>>>2>>>0]=r[4],HEAPF32[t+20>>>2>>>0]=r[5];break;default:AL.currentCtx.err=40962;return}}}_alGetListenerfv.sig="vip";function _alGetListeneri(e,t){t>>>=0;var r=AL.getListenerParam("alGetListeneri",e);if(r!==null){if(!t){AL.currentCtx.err=40963;return}AL.currentCtx.err=40962}}_alGetListeneri.sig="vip";function _alGetListeneriv(e,t){t>>>=0;var r=AL.getListenerParam("alGetListeneriv",e);if(r!==null){if(!t){AL.currentCtx.err=40963;return}switch(e){case 4100:case 4102:HEAP32[t>>>2>>>0]=r[0],HEAP32[t+4>>>2>>>0]=r[1],HEAP32[t+8>>>2>>>0]=r[2];break;case 4111:HEAP32[t>>>2>>>0]=r[0],HEAP32[t+4>>>2>>>0]=r[1],HEAP32[t+8>>>2>>>0]=r[2],HEAP32[t+12>>>2>>>0]=r[3],HEAP32[t+16>>>2>>>0]=r[4],HEAP32[t+20>>>2>>>0]=r[5];break;default:AL.currentCtx.err=40962;return}}}_alGetListeneriv.sig="vip";function _alGetSource3f(e,t,r,n,a){r>>>=0,n>>>=0,a>>>=0;var o=AL.getSourceParam("alGetSource3f",e,t);if(o!==null){if(!r||!n||!a){AL.currentCtx.err=40963;return}switch(t){case 4100:case 4101:case 4102:HEAPF32[r>>>2>>>0]=o[0],HEAPF32[n>>>2>>>0]=o[1],HEAPF32[a>>>2>>>0]=o[2];break;default:AL.currentCtx.err=40962;return}}}_alGetSource3f.sig="viippp";function _alGetSource3i(e,t,r,n,a){r>>>=0,n>>>=0,a>>>=0;var o=AL.getSourceParam("alGetSource3i",e,t);if(o!==null){if(!r||!n||!a){AL.currentCtx.err=40963;return}switch(t){case 4100:case 4101:case 4102:HEAP32[r>>>2>>>0]=o[0],HEAP32[n>>>2>>>0]=o[1],HEAP32[a>>>2>>>0]=o[2];break;default:AL.currentCtx.err=40962;return}}}_alGetSource3i.sig="viippp";function _alGetSourcef(e,t,r){r>>>=0;var n=AL.getSourceParam("alGetSourcef",e,t);if(n!==null){if(!r){AL.currentCtx.err=40963;return}switch(t){case 4097:case 4098:case 4099:case 4106:case 4109:case 4110:case 4128:case 4129:case 4130:case 4131:case 4132:case 4133:case 4134:case 8203:HEAPF32[r>>>2>>>0]=n;break;default:AL.currentCtx.err=40962;return}}}_alGetSourcef.sig="viip";function _alGetSourcefv(e,t,r){r>>>=0;var n=AL.getSourceParam("alGetSourcefv",e,t);if(n!==null){if(!r){AL.currentCtx.err=40963;return}switch(t){case 4097:case 4098:case 4099:case 4106:case 4109:case 4110:case 4128:case 4129:case 4130:case 4131:case 4132:case 4133:case 4134:case 8203:HEAPF32[r>>>2>>>0]=n[0];break;case 4100:case 4101:case 4102:HEAPF32[r>>>2>>>0]=n[0],HEAPF32[r+4>>>2>>>0]=n[1],HEAPF32[r+8>>>2>>>0]=n[2];break;default:AL.currentCtx.err=40962;return}}}_alGetSourcefv.sig="viip";function _alGetSourcei(e,t,r){r>>>=0;var n=AL.getSourceParam("alGetSourcei",e,t);if(n!==null){if(!r){AL.currentCtx.err=40963;return}switch(t){case 514:case 4097:case 4098:case 4103:case 4105:case 4112:case 4117:case 4118:case 4128:case 4129:case 4131:case 4132:case 4133:case 4134:case 4135:case 4628:case 8201:case 8202:case 53248:HEAP32[r>>>2>>>0]=n;break;default:AL.currentCtx.err=40962;return}}}_alGetSourcei.sig="viip";function _alGetSourceiv(e,t,r){r>>>=0;var n=AL.getSourceParam("alGetSourceiv",e,t);if(n!==null){if(!r){AL.currentCtx.err=40963;return}switch(t){case 514:case 4097:case 4098:case 4103:case 4105:case 4112:case 4117:case 4118:case 4128:case 4129:case 4131:case 4132:case 4133:case 4134:case 4135:case 4628:case 8201:case 8202:case 53248:HEAP32[r>>>2>>>0]=n;break;case 4100:case 4101:case 4102:HEAP32[r>>>2>>>0]=n[0],HEAP32[r+4>>>2>>>0]=n[1],HEAP32[r+8>>>2>>>0]=n[2];break;default:AL.currentCtx.err=40962;return}}}_alGetSourceiv.sig="viip";var stringToNewUTF8=e=>{var t=lengthBytesUTF8(e)+1,r=_malloc(t);return r&&stringToUTF8(e,r,t),r};function _alGetString(e){if(AL.stringCache[e])return AL.stringCache[e];var t;switch(e){case 0:t="No Error";break;case 40961:t="Invalid Name";break;case 40962:t="Invalid Enum";break;case 40963:t="Invalid Value";break;case 40964:t="Invalid Operation";break;case 40965:t="Out of Memory";break;case 45057:t="Emscripten";break;case 45058:t="1.1";break;case 45059:t="WebAudio";break;case 45060:t=Object.keys(AL.AL_EXTENSIONS).join(" ");break;default:return AL.currentCtx&&(AL.currentCtx.err=40962),0}return t=stringToNewUTF8(t),AL.stringCache[e]=t,t}_alGetString.sig="pi";var _alIsBuffer=e=>!(!AL.currentCtx||e>AL.buffers.length||!AL.buffers[e]);_alIsBuffer.sig="ii";var _alIsEnabled=e=>{if(!AL.currentCtx)return 0;switch(e){case 512:return AL.currentCtx.sourceDistanceModel?0:1;default:return AL.currentCtx.err=40962,0}};_alIsEnabled.sig="ii";function _alIsExtensionPresent(e){e>>>=0;var t=UTF8ToString(e);return AL.AL_EXTENSIONS[t]?1:0}_alIsExtensionPresent.sig="ip";var _alIsSource=e=>!(!AL.currentCtx||!AL.currentCtx.sources[e]);_alIsSource.sig="ii";var _alListener3f=(e,t,r,n)=>{switch(e){case 4100:case 4102:AL.paramArray[0]=t,AL.paramArray[1]=r,AL.paramArray[2]=n,AL.setListenerParam("alListener3f",e,AL.paramArray);break;default:AL.setListenerParam("alListener3f",e,null);break}};_alListener3f.sig="vifff";var _alListener3i=(e,t,r,n)=>{switch(e){case 4100:case 4102:AL.paramArray[0]=t,AL.paramArray[1]=r,AL.paramArray[2]=n,AL.setListenerParam("alListener3i",e,AL.paramArray);break;default:AL.setListenerParam("alListener3i",e,null);break}};_alListener3i.sig="viiii";var _alListenerf=(e,t)=>{switch(e){case 4106:AL.setListenerParam("alListenerf",e,t);break;default:AL.setListenerParam("alListenerf",e,null);break}};_alListenerf.sig="vif";function _alListenerfv(e,t){if(t>>>=0,!!AL.currentCtx){if(!t){AL.currentCtx.err=40963;return}switch(e){case 4100:case 4102:AL.paramArray[0]=HEAPF32[t>>>2>>>0],AL.paramArray[1]=HEAPF32[t+4>>>2>>>0],AL.paramArray[2]=HEAPF32[t+8>>>2>>>0],AL.setListenerParam("alListenerfv",e,AL.paramArray);break;case 4111:AL.paramArray[0]=HEAPF32[t>>>2>>>0],AL.paramArray[1]=HEAPF32[t+4>>>2>>>0],AL.paramArray[2]=HEAPF32[t+8>>>2>>>0],AL.paramArray[3]=HEAPF32[t+12>>>2>>>0],AL.paramArray[4]=HEAPF32[t+16>>>2>>>0],AL.paramArray[5]=HEAPF32[t+20>>>2>>>0],AL.setListenerParam("alListenerfv",e,AL.paramArray);break;default:AL.setListenerParam("alListenerfv",e,null);break}}}_alListenerfv.sig="vip";var _alListeneri=(e,t)=>{AL.setListenerParam("alListeneri",e,null)};_alListeneri.sig="vii";function _alListeneriv(e,t){if(t>>>=0,!!AL.currentCtx){if(!t){AL.currentCtx.err=40963;return}switch(e){case 4100:case 4102:AL.paramArray[0]=HEAP32[t>>>2>>>0],AL.paramArray[1]=HEAP32[t+4>>>2>>>0],AL.paramArray[2]=HEAP32[t+8>>>2>>>0],AL.setListenerParam("alListeneriv",e,AL.paramArray);break;case 4111:AL.paramArray[0]=HEAP32[t>>>2>>>0],AL.paramArray[1]=HEAP32[t+4>>>2>>>0],AL.paramArray[2]=HEAP32[t+8>>>2>>>0],AL.paramArray[3]=HEAP32[t+12>>>2>>>0],AL.paramArray[4]=HEAP32[t+16>>>2>>>0],AL.paramArray[5]=HEAP32[t+20>>>2>>>0],AL.setListenerParam("alListeneriv",e,AL.paramArray);break;default:AL.setListenerParam("alListeneriv",e,null);break}}}_alListeneriv.sig="vip";var _alSource3f=(e,t,r,n,a)=>{switch(t){case 4100:case 4101:case 4102:AL.paramArray[0]=r,AL.paramArray[1]=n,AL.paramArray[2]=a,AL.setSourceParam("alSource3f",e,t,AL.paramArray);break;default:AL.setSourceParam("alSource3f",e,t,null);break}};_alSource3f.sig="viifff";var _alSource3i=(e,t,r,n,a)=>{switch(t){case 4100:case 4101:case 4102:AL.paramArray[0]=r,AL.paramArray[1]=n,AL.paramArray[2]=a,AL.setSourceParam("alSource3i",e,t,AL.paramArray);break;default:AL.setSourceParam("alSource3i",e,t,null);break}};_alSource3i.sig="viiiii";var _alSourcePause=e=>{if(AL.currentCtx){var t=AL.currentCtx.sources[e];if(!t){AL.currentCtx.err=40961;return}AL.setSourceState(t,4115)}};_alSourcePause.sig="vi";function _alSourcePausev(e,t){if(t>>>=0,!!AL.currentCtx){t||(AL.currentCtx.err=40963);for(var r=0;r>>2>>>0]]){AL.currentCtx.err=40961;return}for(var r=0;r>>2>>>0];AL.setSourceState(AL.currentCtx.sources[n],4115)}}}_alSourcePausev.sig="vip";var _alSourcePlay=e=>{if(AL.currentCtx){var t=AL.currentCtx.sources[e];if(!t){AL.currentCtx.err=40961;return}AL.setSourceState(t,4114)}};_alSourcePlay.sig="vi";function _alSourcePlayv(e,t){if(t>>>=0,!!AL.currentCtx){t||(AL.currentCtx.err=40963);for(var r=0;r>>2>>>0]]){AL.currentCtx.err=40961;return}for(var r=0;r>>2>>>0];AL.setSourceState(AL.currentCtx.sources[n],4114)}}}_alSourcePlayv.sig="vip";function _alSourceQueueBuffers(e,t,r){if(r>>>=0,!!AL.currentCtx){var n=AL.currentCtx.sources[e];if(!n){AL.currentCtx.err=40961;return}if(n.type===4136){AL.currentCtx.err=40964;return}if(t!==0){for(var a=AL.buffers[0],o=0;o>>2>>>0],u=AL.buffers[l];if(!u){AL.currentCtx.err=40961;return}a.id!==0&&(u.frequency!==a.frequency||u.bytesPerSample!==a.bytesPerSample||u.channels!==a.channels)&&(AL.currentCtx.err=40964)}n.bufQueue.length===1&&n.bufQueue[0].id===0&&(n.bufQueue.length=0),n.type=4137;for(var o=0;o>>2>>>0],u=AL.buffers[l];u.refCount++,n.bufQueue.push(u)}n.looping&&AL.cancelPendingSourceAudio(n),AL.initSourcePanner(n),AL.scheduleSourceAudio(n)}}}_alSourceQueueBuffers.sig="viip";var _alSourceRewind=e=>{if(AL.currentCtx){var t=AL.currentCtx.sources[e];if(!t){AL.currentCtx.err=40961;return}AL.setSourceState(t,4116),AL.setSourceState(t,4113)}};_alSourceRewind.sig="vi";function _alSourceRewindv(e,t){if(t>>>=0,!!AL.currentCtx){t||(AL.currentCtx.err=40963);for(var r=0;r>>2>>>0]]){AL.currentCtx.err=40961;return}for(var r=0;r>>2>>>0];AL.setSourceState(AL.currentCtx.sources[n],4113)}}}_alSourceRewindv.sig="vip";var _alSourceStop=e=>{if(AL.currentCtx){var t=AL.currentCtx.sources[e];if(!t){AL.currentCtx.err=40961;return}AL.setSourceState(t,4116)}};_alSourceStop.sig="vi";function _alSourceStopv(e,t){if(t>>>=0,!!AL.currentCtx){t||(AL.currentCtx.err=40963);for(var r=0;r>>2>>>0]]){AL.currentCtx.err=40961;return}for(var r=0;r>>2>>>0];AL.setSourceState(AL.currentCtx.sources[n],4116)}}}_alSourceStopv.sig="vip";function _alSourceUnqueueBuffers(e,t,r){if(r>>>=0,!!AL.currentCtx){var n=AL.currentCtx.sources[e];if(!n){AL.currentCtx.err=40961;return}if(t>(n.bufQueue.length===1&&n.bufQueue[0].id===0?0:n.bufsProcessed)){AL.currentCtx.err=40963;return}if(t!==0){for(var a=0;a>>2>>>0]=o.id,n.bufsProcessed--}n.bufQueue.length===0&&n.bufQueue.push(AL.buffers[0]),AL.initSourcePanner(n),AL.scheduleSourceAudio(n)}}}_alSourceUnqueueBuffers.sig="viip";var _alSourcef=(e,t,r)=>{switch(t){case 4097:case 4098:case 4099:case 4106:case 4109:case 4110:case 4128:case 4129:case 4130:case 4131:case 4132:case 4133:case 4134:case 8203:AL.setSourceParam("alSourcef",e,t,r);break;default:AL.setSourceParam("alSourcef",e,t,null);break}};_alSourcef.sig="viif";function _alSourcefv(e,t,r){if(r>>>=0,!!AL.currentCtx){if(!r){AL.currentCtx.err=40963;return}switch(t){case 4097:case 4098:case 4099:case 4106:case 4109:case 4110:case 4128:case 4129:case 4130:case 4131:case 4132:case 4133:case 4134:case 8203:var n=HEAPF32[r>>>2>>>0];AL.setSourceParam("alSourcefv",e,t,n);break;case 4100:case 4101:case 4102:AL.paramArray[0]=HEAPF32[r>>>2>>>0],AL.paramArray[1]=HEAPF32[r+4>>>2>>>0],AL.paramArray[2]=HEAPF32[r+8>>>2>>>0],AL.setSourceParam("alSourcefv",e,t,AL.paramArray);break;default:AL.setSourceParam("alSourcefv",e,t,null);break}}}_alSourcefv.sig="viip";function _alSourceiv(e,t,r){if(r>>>=0,!!AL.currentCtx){if(!r){AL.currentCtx.err=40963;return}switch(t){case 514:case 4097:case 4098:case 4103:case 4105:case 4128:case 4129:case 4131:case 4132:case 4133:case 4134:case 4628:case 8201:case 8202:case 53248:var n=HEAP32[r>>>2>>>0];AL.setSourceParam("alSourceiv",e,t,n);break;case 4100:case 4101:case 4102:AL.paramArray[0]=HEAP32[r>>>2>>>0],AL.paramArray[1]=HEAP32[r+4>>>2>>>0],AL.paramArray[2]=HEAP32[r+8>>>2>>>0],AL.setSourceParam("alSourceiv",e,t,AL.paramArray);break;default:AL.setSourceParam("alSourceiv",e,t,null);break}}}_alSourceiv.sig="viip";var _alSpeedOfSound=e=>{AL.setGlobalParam("alSpeedOfSound",49155,e)};_alSpeedOfSound.sig="vf";var _alcCaptureCloseDevice=function(e){var r,n,a,o;e>>>=0;var t=AL.requireValidCaptureDevice(e,"alcCaptureCloseDevice");return t?(delete AL.captures[e],AL.freeIds.push(e),(r=t.mediaStreamSourceNode)==null||r.disconnect(),(n=t.mergerNode)==null||n.disconnect(),(a=t.splitterNode)==null||a.disconnect(),(o=t.scriptProcessorNode)==null||o.disconnect(),t.mediaStream&&t.mediaStream.getTracks().forEach(l=>l.stop()),delete t.buffers,t.capturedFrameCount=0,t.isCapturing=!1,!0):!1};_alcCaptureCloseDevice.sig="ip";var listenOnce=(e,t,r)=>{e.addEventListener(t,r,{once:!0})},autoResumeAudioContext=(e,t)=>{t||(t=[document,document.getElementById("canvas")]),["keydown","mousedown","touchstart"].forEach(r=>{t.forEach(n=>{n&&listenOnce(n,r,()=>{e.state==="suspended"&&e.resume()})})})};function _alcCaptureOpenDevice(e,t,r,n){var x;e>>>=0;var a=AL.CAPTURE_DEVICE_NAME;if(e!==0&&(a=UTF8ToString(e),a!==AL.CAPTURE_DEVICE_NAME))return AL.alcErr=40965,0;if(n<0)return AL.alcErr=40964,0;navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia;var o=navigator.getUserMedia||navigator.mediaDevices&&navigator.mediaDevices.getUserMedia;if(!o)return AL.alcErr=40965,0;var l=window.AudioContext||window.webkitAudioContext;if(!AL.sharedCaptureAudioCtx)try{AL.sharedCaptureAudioCtx=new l}catch(T){return AL.alcErr=40965,0}autoResumeAudioContext(AL.sharedCaptureAudioCtx);var u;switch(r){case 65552:case 4353:case 4352:u=1;break;case 65553:case 4355:case 4354:u=2;break;default:return AL.alcErr=40964,0}function _(T){return new Float32Array(T)}function d(T){return new Int16Array(T)}function f(T){return new Uint8Array(T)}var p,m;switch(r){case 65552:case 65553:p="f32",m=_;break;case 4353:case 4355:p="i16",m=d;break;case 4352:case 4354:p="u8",m=f;break}var h=[];try{for(var g=0;g{v.mediaStreamError=T},S=T=>{v.mediaStreamSourceNode=v.audioCtx.createMediaStreamSource(T),v.mediaStream=T;var w=1;switch(v.mediaStreamSourceNode.channelCountMode){case"max":w=u;break;case"clamped-max":w=Math.min(u,v.mediaStreamSourceNode.channelCount);break;case"explicit":w=v.mediaStreamSourceNode.channelCount;break}v.inputChannelCount=w;var F=512;v.scriptProcessorNode=v.audioCtx.createScriptProcessor(F,w,u),w>u?(v.mergerNode=v.audioCtx.createChannelMerger(w),v.mediaStreamSourceNode.connect(v.mergerNode),v.mergerNode.connect(v.scriptProcessorNode)):w{if(v.isCapturing){var A=v,C=E.inputBuffer;switch(r){case 65552:for(var k=C.getChannelData(0),D=0;D>>=0,t>>>=0;var n=AL.requireValidCaptureDevice(e,"alcCaptureSamples");if(!n)return;var a=n.requestedSampleRate,o=n.audioCtx.sampleRate,l=o/a;if(r<0||r>n.capturedFrameCount/l){AL.alcErr=40964;return}function u(x,T){HEAPF32[t+4*x>>>2>>>0]=T}function _(x,T){HEAP16[t+2*x>>>1>>>0]=T}function d(x,T){HEAP8[t+x>>>0]=T}var f;switch(n.requestedSampleType){case"f32":f=u;break;case"i16":f=_;break;case"u8":f=d;break;default:return}if(Math.floor(l)==l)for(var p=0,m=0;m>>=0;var t=AL.requireValidCaptureDevice(e,"alcCaptureStart");t&&(t.isCapturing||(t.isCapturing=!0,t.capturedFrameCount=0,t.capturePlayhead=0))}_alcCaptureStart.sig="vp";function _alcCaptureStop(e){e>>>=0;var t=AL.requireValidCaptureDevice(e,"alcCaptureStop");t&&(t.isCapturing=!1)}_alcCaptureStop.sig="vp";function _alcCloseDevice(e){return e>>>=0,!(e in AL.deviceRefCounts)||AL.deviceRefCounts[e]>0?0:(delete AL.deviceRefCounts[e],AL.freeIds.push(e),1)}_alcCloseDevice.sig="ip";function _alcCreateContext(e,t){if(e>>>=0,t>>>=0,!(e in AL.deviceRefCounts))return AL.alcErr=40961,0;var r=null,n=[],a=null;if(t>>=2,t)for(var o=0,l=0;o=HEAP32[t++>>>0],n.push(o),o!==0;)switch(l=HEAP32[t++>>>0],n.push(l),o){case 4103:r||(r={}),r.sampleRate=l;break;case 4112:case 4113:break;case 6546:switch(l){case 0:a=!1;break;case 1:a=!0;break;case 2:break;default:return AL.alcErr=40964,0}break;case 6550:if(l!==0)return AL.alcErr=40964,0;break;default:return AL.alcErr=40964,0}var u=window.AudioContext||window.webkitAudioContext,_=null;try{r?_=new u(r):_=new u}catch(h){return h.name==="NotSupportedError"?AL.alcErr=40964:AL.alcErr=40961,0}autoResumeAudioContext(_),typeof _.createGain>"u"&&(_.createGain=_.createGainNode);var d=_.createGain();d.connect(_.destination);var f={deviceId:e,id:AL.newId(),attrs:n,audioCtx:_,listener:{position:[0,0,0],velocity:[0,0,0],direction:[0,0,0],up:[0,0,0]},sources:[],interval:setInterval(()=>AL.scheduleContextAudio(f),AL.QUEUE_INTERVAL),gain:d,distanceModel:53250,speedOfSound:343.3,dopplerFactor:1,sourceDistanceModel:!1,hrtf:a||!1,_err:0,get err(){return this._err},set err(h){(this._err===0||h===0)&&(this._err=h)}};if(AL.deviceRefCounts[e]++,AL.contexts[f.id]=f,a!==null)for(var p in AL.contexts){var m=AL.contexts[p];m.deviceId===e&&(m.hrtf=a,AL.updateContextGlobal(m))}return f.id}_alcCreateContext.sig="ppp";function _alcDestroyContext(e){e>>>=0;var t=AL.contexts[e];if(AL.currentCtx===t){AL.alcErr=40962;return}AL.contexts[e].interval&&clearInterval(AL.contexts[e].interval),AL.deviceRefCounts[t.deviceId]--,delete AL.contexts[e],AL.freeIds.push(e)}_alcDestroyContext.sig="vp";function _alcGetContextsDevice(e){return e>>>=0,e in AL.contexts?AL.contexts[e].deviceId:0}_alcGetContextsDevice.sig="pp";function _alcGetCurrentContext(){return AL.currentCtx!==null?AL.currentCtx.id:0}_alcGetCurrentContext.sig="p";function _alcGetEnumValue(e,t){if(e>>>=0,t>>>=0,e!==0&&!(e in AL.deviceRefCounts))return 0;if(!t)return AL.alcErr=40964,0;var r=UTF8ToString(t);switch(r){case"ALC_NO_ERROR":return 0;case"ALC_INVALID_DEVICE":return 40961;case"ALC_INVALID_CONTEXT":return 40962;case"ALC_INVALID_ENUM":return 40963;case"ALC_INVALID_VALUE":return 40964;case"ALC_OUT_OF_MEMORY":return 40965;case"ALC_MAJOR_VERSION":return 4096;case"ALC_MINOR_VERSION":return 4097;case"ALC_ATTRIBUTES_SIZE":return 4098;case"ALC_ALL_ATTRIBUTES":return 4099;case"ALC_DEFAULT_DEVICE_SPECIFIER":return 4100;case"ALC_DEVICE_SPECIFIER":return 4101;case"ALC_EXTENSIONS":return 4102;case"ALC_FREQUENCY":return 4103;case"ALC_REFRESH":return 4104;case"ALC_SYNC":return 4105;case"ALC_MONO_SOURCES":return 4112;case"ALC_STEREO_SOURCES":return 4113;case"ALC_CAPTURE_DEVICE_SPECIFIER":return 784;case"ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER":return 785;case"ALC_CAPTURE_SAMPLES":return 786;case"ALC_HRTF_SOFT":return 6546;case"ALC_HRTF_ID_SOFT":return 6550;case"ALC_DONT_CARE_SOFT":return 2;case"ALC_HRTF_STATUS_SOFT":return 6547;case"ALC_NUM_HRTF_SPECIFIERS_SOFT":return 6548;case"ALC_HRTF_SPECIFIER_SOFT":return 6549;case"ALC_HRTF_DISABLED_SOFT":return 0;case"ALC_HRTF_ENABLED_SOFT":return 1;case"ALC_HRTF_DENIED_SOFT":return 2;case"ALC_HRTF_REQUIRED_SOFT":return 3;case"ALC_HRTF_HEADPHONES_DETECTED_SOFT":return 4;case"ALC_HRTF_UNSUPPORTED_FORMAT_SOFT":return 5;default:return AL.alcErr=40964,0}}_alcGetEnumValue.sig="ipp";function _alcGetError(e){e>>>=0;var t=AL.alcErr;return AL.alcErr=0,t}_alcGetError.sig="ip";function _alcGetIntegerv(e,t,r,n){if(e>>>=0,n>>>=0,!(r===0||!n))switch(t){case 4096:HEAP32[n>>>2>>>0]=1;break;case 4097:HEAP32[n>>>2>>>0]=1;break;case 4098:if(!(e in AL.deviceRefCounts)){AL.alcErr=40961;return}if(!AL.currentCtx){AL.alcErr=40962;return}HEAP32[n>>>2>>>0]=AL.currentCtx.attrs.length;break;case 4099:if(!(e in AL.deviceRefCounts)){AL.alcErr=40961;return}if(!AL.currentCtx){AL.alcErr=40962;return}for(var a=0;a>>2>>>0]=AL.currentCtx.attrs[a];break;case 4103:if(!(e in AL.deviceRefCounts)){AL.alcErr=40961;return}if(!AL.currentCtx){AL.alcErr=40962;return}HEAP32[n>>>2>>>0]=AL.currentCtx.audioCtx.sampleRate;break;case 4112:case 4113:if(!(e in AL.deviceRefCounts)){AL.alcErr=40961;return}if(!AL.currentCtx){AL.alcErr=40962;return}HEAP32[n>>>2>>>0]=2147483647;break;case 6546:case 6547:if(!(e in AL.deviceRefCounts)){AL.alcErr=40961;return}var o=0;for(var l in AL.contexts){var u=AL.contexts[l];u.deviceId===e&&(o=u.hrtf?1:0)}HEAP32[n>>>2>>>0]=o;break;case 6548:if(!(e in AL.deviceRefCounts)){AL.alcErr=40961;return}HEAP32[n>>>2>>>0]=1;break;case 131075:if(!(e in AL.deviceRefCounts)){AL.alcErr=40961;return}if(!AL.currentCtx){AL.alcErr=40962;return}HEAP32[n>>>2>>>0]=1;case 786:var _=AL.requireValidCaptureDevice(e,"alcGetIntegerv");if(!_)return;var d=_.capturedFrameCount,f=_.requestedSampleRate,p=_.audioCtx.sampleRate,m=Math.floor(d*(f/p));HEAP32[n>>>2>>>0]=m;break;default:AL.alcErr=40963;return}}_alcGetIntegerv.sig="vpiip";function _alcGetString(e,t){if(e>>>=0,AL.alcStringCache[t])return AL.alcStringCache[t];var r;switch(t){case 0:r="No Error";break;case 40961:r="Invalid Device";break;case 40962:r="Invalid Context";break;case 40963:r="Invalid Enum";break;case 40964:r="Invalid Value";break;case 40965:r="Out of Memory";break;case 4100:if(typeof AudioContext<"u"||typeof webkitAudioContext<"u")r=AL.DEVICE_NAME;else return 0;break;case 4101:typeof AudioContext<"u"||typeof webkitAudioContext<"u"?r=AL.DEVICE_NAME+"\0":r="\0";break;case 785:r=AL.CAPTURE_DEVICE_NAME;break;case 784:if(e===0)r=AL.CAPTURE_DEVICE_NAME+"\0";else{var n=AL.requireValidCaptureDevice(e,"alcGetString");if(!n)return 0;r=n.deviceName}break;case 4102:if(!e)return AL.alcErr=40961,0;r=Object.keys(AL.ALC_EXTENSIONS).join(" ");break;default:return AL.alcErr=40963,0}return r=stringToNewUTF8(r),AL.alcStringCache[t]=r,r}_alcGetString.sig="ppi";function _alcIsExtensionPresent(e,t){e>>>=0,t>>>=0;var r=UTF8ToString(t);return AL.ALC_EXTENSIONS[r]?1:0}_alcIsExtensionPresent.sig="ipp";function _alcMakeContextCurrent(e){return e>>>=0,e===0?AL.currentCtx=null:AL.currentCtx=AL.contexts[e],1}_alcMakeContextCurrent.sig="ip";function _alcOpenDevice(e){if(e>>>=0,e){var t=UTF8ToString(e);if(t!==AL.DEVICE_NAME)return 0}if(typeof AudioContext<"u"||typeof webkitAudioContext<"u"){var r=AL.newId();return AL.deviceRefCounts[r]=0,r}return 0}_alcOpenDevice.sig="pp";function _alcProcessContext(e){e>>>=0}_alcProcessContext.sig="vp";function _alcSuspendContext(e){e>>>=0}_alcSuspendContext.sig="vp";function _duckdb_web_fs_directory_create(e,t){return e>>>=0,globalThis.DUCKDB_RUNTIME.createDirectory(Module,e,t)}_duckdb_web_fs_directory_create.sig="vpi";function _duckdb_web_fs_directory_exists(e,t){return e>>>=0,globalThis.DUCKDB_RUNTIME.checkDirectory(Module,e,t)}_duckdb_web_fs_directory_exists.sig="ipi";function _duckdb_web_fs_directory_list_files(e,t){return e>>>=0,globalThis.DUCKDB_RUNTIME.listDirectoryEntries(Module,e,t)}_duckdb_web_fs_directory_list_files.sig="ipi";function _duckdb_web_fs_directory_remove(e,t){return e>>>=0,globalThis.DUCKDB_RUNTIME.removeDirectory(Module,e,t)}_duckdb_web_fs_directory_remove.sig="vpi";function _duckdb_web_fs_file_close(e){return globalThis.DUCKDB_RUNTIME.closeFile(Module,e)}_duckdb_web_fs_file_close.sig="vi";function _duckdb_web_fs_file_exists(e,t){return e>>>=0,globalThis.DUCKDB_RUNTIME.checkFile(Module,e,t)}_duckdb_web_fs_file_exists.sig="ipi";function _duckdb_web_fs_file_get_last_modified_time(e){return globalThis.DUCKDB_RUNTIME.getLastFileModificationTime(Module,e)}_duckdb_web_fs_file_get_last_modified_time.sig="ii";function _duckdb_web_fs_file_move(e,t,r,n){return e>>>=0,r>>>=0,globalThis.DUCKDB_RUNTIME.moveFile(Module,e,t,r,n)}_duckdb_web_fs_file_move.sig="vpipi";function _duckdb_web_fs_file_open(e,t){return globalThis.DUCKDB_RUNTIME.openFile(Module,e,t)}_duckdb_web_fs_file_open.sig="pii";function _duckdb_web_fs_file_read(e,t,r,n){return t>>>=0,globalThis.DUCKDB_RUNTIME.readFile(Module,e,t,r,n)}_duckdb_web_fs_file_read.sig="iipid";function _duckdb_web_fs_file_truncate(e,t){return globalThis.DUCKDB_RUNTIME.truncateFile(Module,e,t)}_duckdb_web_fs_file_truncate.sig="vid";function _duckdb_web_fs_file_write(e,t,r,n){return t>>>=0,globalThis.DUCKDB_RUNTIME.writeFile(Module,e,t,r,n)}_duckdb_web_fs_file_write.sig="iipid";function _duckdb_web_fs_get_default_data_protocol(e){return globalThis.DUCKDB_RUNTIME.getDefaultDataProtocol(e)}_duckdb_web_fs_get_default_data_protocol.sig="i";function _duckdb_web_fs_glob(e,t){return e>>>=0,globalThis.DUCKDB_RUNTIME.glob(Module,e,t)}_duckdb_web_fs_glob.sig="vpi";function _duckdb_web_test_platform_feature(e){return globalThis.DUCKDB_RUNTIME.testPlatformFeature(Module,e)}_duckdb_web_test_platform_feature.sig="ii";function _duckdb_web_udf_scalar_call(e,t,r,n,a,o){return e>>>=0,r>>>=0,a>>>=0,globalThis.DUCKDB_RUNTIME.callScalarUDF(Module,e,t,r,n,a,o)}_duckdb_web_udf_scalar_call.sig="vpipipi";var _emscripten_alcDevicePauseSOFT=e=>{if(!(e in AL.deviceRefCounts)){AL.alcErr=40961;return}if(!AL.paused){AL.paused=!0;for(var t in AL.contexts){var r=AL.contexts[t];r.deviceId===e&&(r.audioCtx.suspend(),clearInterval(r.interval),r.interval=null)}}};_emscripten_alcDevicePauseSOFT.sig="vi";var _emscripten_alcDeviceResumeSOFT=e=>{if(!(e in AL.deviceRefCounts)){AL.alcErr=40961;return}if(AL.paused){AL.paused=!1;for(var t in AL.contexts){var r=AL.contexts[t];r.deviceId===e&&(r.interval=setInterval(()=>AL.scheduleContextAudio(r),AL.QUEUE_INTERVAL),r.audioCtx.resume())}}};_emscripten_alcDeviceResumeSOFT.sig="vi";var _emscripten_alcGetStringiSOFT=(e,t,r)=>{if(!(e in AL.deviceRefCounts))return AL.alcErr=40961,0;if(AL.alcStringCache[t])return AL.alcStringCache[t];var n;switch(t){case 6549:if(r===0)n="Web Audio HRTF";else return AL.alcErr=40964,0;break;default:return r!==0?(AL.alcErr=40963,0):_alcGetString(e,t)}return n=stringToNewUTF8(n),AL.alcStringCache[t]=n,n};_emscripten_alcGetStringiSOFT.sig="iiii";var _emscripten_alcResetDeviceSOFT=(e,t)=>{if(!(e in AL.deviceRefCounts))return AL.alcErr=40961,0;var r=null;if(t>>=2,t)for(var n=0,a=0;n=HEAP32[t++>>>0],n!==0;)switch(a=HEAP32[t++>>>0],n){case 6546:a===1?r=!0:a===0&&(r=!1);break}if(r!==null)for(var o in AL.contexts){var l=AL.contexts[o];l.deviceId===e&&(l.hrtf=r,AL.updateContextGlobal(l))}return 1};_emscripten_alcResetDeviceSOFT.sig="iii";var readEmAsmArgsArray=[],readEmAsmArgs=(e,t)=>{readEmAsmArgsArray.length=0;for(var r;r=HEAPU8[e++>>>0];){var n=r!=105;n&=r!=112,t+=n&&t%8?4:0,readEmAsmArgsArray.push(r==112?HEAPU32[t>>>2>>>0]:r==105?HEAP32[t>>>2>>>0]:HEAPF64[t>>>3>>>0]),t+=n?8:4}return readEmAsmArgsArray},runEmAsmFunction=(e,t,r)=>{var n=readEmAsmArgs(t,r);return ASM_CONSTS[e](...n)};function _emscripten_asm_const_int(e,t,r){return e>>>=0,t>>>=0,r>>>=0,runEmAsmFunction(e,t,r)}_emscripten_asm_const_int.sig="ippp";function _emscripten_asm_const_ptr(e,t,r){return e>>>=0,t>>>=0,r>>>=0,runEmAsmFunction(e,t,r)}_emscripten_asm_const_ptr.sig="pppp";function _emscripten_console_error(e){e>>>=0,console.error(UTF8ToString(e))}_emscripten_console_error.sig="vp";function _emscripten_console_log(e){e>>>=0,console.log(UTF8ToString(e))}_emscripten_console_log.sig="vp";function _emscripten_console_trace(e){e>>>=0,console.trace(UTF8ToString(e))}_emscripten_console_trace.sig="vp";function _emscripten_console_warn(e){e>>>=0,console.warn(UTF8ToString(e))}_emscripten_console_warn.sig="vp";var _emscripten_date_now=()=>Date.now();_emscripten_date_now.sig="d";function _emscripten_err(e){return e>>>=0,err(UTF8ToString(e))}_emscripten_err.sig="vp";var getHeapMax=()=>4294901760;function _emscripten_get_heap_max(){return getHeapMax()}_emscripten_get_heap_max.sig="p";var _emscripten_get_now_res=()=>ENVIRONMENT_IS_NODE?1:1e3;_emscripten_get_now_res.sig="d";var GLctx,webgl_enable_ANGLE_instanced_arrays=e=>{var t=e.getExtension("ANGLE_instanced_arrays");if(t)return e.vertexAttribDivisor=(r,n)=>t.vertexAttribDivisorANGLE(r,n),e.drawArraysInstanced=(r,n,a,o)=>t.drawArraysInstancedANGLE(r,n,a,o),e.drawElementsInstanced=(r,n,a,o,l)=>t.drawElementsInstancedANGLE(r,n,a,o,l),1},webgl_enable_OES_vertex_array_object=e=>{var t=e.getExtension("OES_vertex_array_object");if(t)return e.createVertexArray=()=>t.createVertexArrayOES(),e.deleteVertexArray=r=>t.deleteVertexArrayOES(r),e.bindVertexArray=r=>t.bindVertexArrayOES(r),e.isVertexArray=r=>t.isVertexArrayOES(r),1},webgl_enable_WEBGL_draw_buffers=e=>{var t=e.getExtension("WEBGL_draw_buffers");if(t)return e.drawBuffers=(r,n)=>t.drawBuffersWEBGL(r,n),1},webgl_enable_EXT_polygon_offset_clamp=e=>!!(e.extPolygonOffsetClamp=e.getExtension("EXT_polygon_offset_clamp")),webgl_enable_EXT_clip_control=e=>!!(e.extClipControl=e.getExtension("EXT_clip_control")),webgl_enable_WEBGL_polygon_mode=e=>!!(e.webglPolygonMode=e.getExtension("WEBGL_polygon_mode")),webgl_enable_WEBGL_multi_draw=e=>!!(e.multiDrawWebgl=e.getExtension("WEBGL_multi_draw")),getEmscriptenSupportedExtensions=e=>{var t=["ANGLE_instanced_arrays","EXT_blend_minmax","EXT_disjoint_timer_query","EXT_frag_depth","EXT_shader_texture_lod","EXT_sRGB","OES_element_index_uint","OES_fbo_render_mipmap","OES_standard_derivatives","OES_texture_float","OES_texture_half_float","OES_texture_half_float_linear","OES_vertex_array_object","WEBGL_color_buffer_float","WEBGL_depth_texture","WEBGL_draw_buffers","EXT_clip_control","EXT_color_buffer_half_float","EXT_depth_clamp","EXT_float_blend","EXT_polygon_offset_clamp","EXT_texture_compression_bptc","EXT_texture_compression_rgtc","EXT_texture_filter_anisotropic","KHR_parallel_shader_compile","OES_texture_float_linear","WEBGL_blend_func_extended","WEBGL_compressed_texture_astc","WEBGL_compressed_texture_etc","WEBGL_compressed_texture_etc1","WEBGL_compressed_texture_s3tc","WEBGL_compressed_texture_s3tc_srgb","WEBGL_debug_renderer_info","WEBGL_debug_shaders","WEBGL_lose_context","WEBGL_multi_draw","WEBGL_polygon_mode"];return(e.getSupportedExtensions()||[]).filter(r=>t.includes(r))},GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:[],offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,unpackRowLength:0,recordError:e=>{GL.lastError||(GL.lastError=e)},getNewId:e=>{for(var t=GL.counter++,r=e.length;r{for(var a=0;a>>2>>>0]=l}},getSource:(e,t,r,n)=>{for(var a="",o=0;o>>2>>>0]:void 0;a+=UTF8ToString(HEAPU32[r+o*4>>>2>>>0],l)}return a},createContext:(e,t)=>{if(!e.getContextSafariWebGL2Fixed){let o=function(l,u){var _=e.getContextSafariWebGL2Fixed(l,u);return l=="webgl"==_ instanceof WebGLRenderingContext?_:null};var a=o;e.getContextSafariWebGL2Fixed=e.getContext,e.getContext=o}var r=e.getContext("webgl",t);if(!r)return 0;var n=GL.registerContext(r,t);return n},registerContext:(e,t)=>{var r=GL.getNewId(GL.contexts),n={handle:r,attributes:t,version:t.majorVersion,GLctx:e};return e.canvas&&(e.canvas.GLctxObject=n),GL.contexts[r]=n,(typeof t.enableExtensionsByDefault>"u"||t.enableExtensionsByDefault)&&GL.initExtensions(n),r},makeContextCurrent:e=>{var t;return GL.currentContext=GL.contexts[e],Module.ctx=GLctx=(t=GL.currentContext)==null?void 0:t.GLctx,!(e&&!GLctx)},getContext:e=>GL.contexts[e],deleteContext:e=>{GL.currentContext===GL.contexts[e]&&(GL.currentContext=null),typeof JSEvents=="object"&&JSEvents.removeAllHandlersOnTarget(GL.contexts[e].GLctx.canvas),GL.contexts[e]&&GL.contexts[e].GLctx.canvas&&(GL.contexts[e].GLctx.canvas.GLctxObject=void 0),GL.contexts[e]=null},initExtensions:e=>{if(e||(e=GL.currentContext),!e.initExtensionsDone){e.initExtensionsDone=!0;var t=e.GLctx;webgl_enable_WEBGL_multi_draw(t),webgl_enable_EXT_polygon_offset_clamp(t),webgl_enable_EXT_clip_control(t),webgl_enable_WEBGL_polygon_mode(t),webgl_enable_ANGLE_instanced_arrays(t),webgl_enable_OES_vertex_array_object(t),webgl_enable_WEBGL_draw_buffers(t),t.disjointTimerQueryExt=t.getExtension("EXT_disjoint_timer_query"),getEmscriptenSupportedExtensions(t).forEach(r=>{!r.includes("lose_context")&&!r.includes("debug")&&t.getExtension(r)})}}},_glActiveTexture=e=>GLctx.activeTexture(e);_glActiveTexture.sig="vi";var _emscripten_glActiveTexture=_glActiveTexture;_emscripten_glActiveTexture.sig="vi";var _glAttachShader=(e,t)=>{GLctx.attachShader(GL.programs[e],GL.shaders[t])};_glAttachShader.sig="vii";var _emscripten_glAttachShader=_glAttachShader;_emscripten_glAttachShader.sig="vii";var _glBeginQueryEXT=(e,t)=>{GLctx.disjointTimerQueryExt.beginQueryEXT(e,GL.queries[t])};_glBeginQueryEXT.sig="vii";var _emscripten_glBeginQueryEXT=_glBeginQueryEXT;function _glBindAttribLocation(e,t,r){r>>>=0,GLctx.bindAttribLocation(GL.programs[e],t,UTF8ToString(r))}_glBindAttribLocation.sig="viip";var _emscripten_glBindAttribLocation=_glBindAttribLocation;_emscripten_glBindAttribLocation.sig="viip";var _glBindBuffer=(e,t)=>{GLctx.bindBuffer(e,GL.buffers[t])};_glBindBuffer.sig="vii";var _emscripten_glBindBuffer=_glBindBuffer;_emscripten_glBindBuffer.sig="vii";var _glBindFramebuffer=(e,t)=>{GLctx.bindFramebuffer(e,GL.framebuffers[t])};_glBindFramebuffer.sig="vii";var _emscripten_glBindFramebuffer=_glBindFramebuffer;_emscripten_glBindFramebuffer.sig="vii";var _glBindRenderbuffer=(e,t)=>{GLctx.bindRenderbuffer(e,GL.renderbuffers[t])};_glBindRenderbuffer.sig="vii";var _emscripten_glBindRenderbuffer=_glBindRenderbuffer;_emscripten_glBindRenderbuffer.sig="vii";var _glBindTexture=(e,t)=>{GLctx.bindTexture(e,GL.textures[t])};_glBindTexture.sig="vii";var _emscripten_glBindTexture=_glBindTexture;_emscripten_glBindTexture.sig="vii";var _glBindVertexArray=e=>{GLctx.bindVertexArray(GL.vaos[e])};_glBindVertexArray.sig="vi";var _glBindVertexArrayOES=_glBindVertexArray;_glBindVertexArrayOES.sig="vi";var _emscripten_glBindVertexArrayOES=_glBindVertexArrayOES;_emscripten_glBindVertexArrayOES.sig="vi";var _glBlendColor=(e,t,r,n)=>GLctx.blendColor(e,t,r,n);_glBlendColor.sig="vffff";var _emscripten_glBlendColor=_glBlendColor;_emscripten_glBlendColor.sig="vffff";var _glBlendEquation=e=>GLctx.blendEquation(e);_glBlendEquation.sig="vi";var _emscripten_glBlendEquation=_glBlendEquation;_emscripten_glBlendEquation.sig="vi";var _glBlendEquationSeparate=(e,t)=>GLctx.blendEquationSeparate(e,t);_glBlendEquationSeparate.sig="vii";var _emscripten_glBlendEquationSeparate=_glBlendEquationSeparate;_emscripten_glBlendEquationSeparate.sig="vii";var _glBlendFunc=(e,t)=>GLctx.blendFunc(e,t);_glBlendFunc.sig="vii";var _emscripten_glBlendFunc=_glBlendFunc;_emscripten_glBlendFunc.sig="vii";var _glBlendFuncSeparate=(e,t,r,n)=>GLctx.blendFuncSeparate(e,t,r,n);_glBlendFuncSeparate.sig="viiii";var _emscripten_glBlendFuncSeparate=_glBlendFuncSeparate;_emscripten_glBlendFuncSeparate.sig="viiii";function _glBufferData(e,t,r,n){t>>>=0,r>>>=0,GLctx.bufferData(e,r?HEAPU8.subarray(r>>>0,r+t>>>0):t,n)}_glBufferData.sig="vippi";var _emscripten_glBufferData=_glBufferData;_emscripten_glBufferData.sig="vippi";function _glBufferSubData(e,t,r,n){t>>>=0,r>>>=0,n>>>=0,GLctx.bufferSubData(e,t,HEAPU8.subarray(n>>>0,n+r>>>0))}_glBufferSubData.sig="vippp";var _emscripten_glBufferSubData=_glBufferSubData;_emscripten_glBufferSubData.sig="vippp";var _glCheckFramebufferStatus=e=>GLctx.checkFramebufferStatus(e);_glCheckFramebufferStatus.sig="ii";var _emscripten_glCheckFramebufferStatus=_glCheckFramebufferStatus;_emscripten_glCheckFramebufferStatus.sig="ii";var _glClear=e=>GLctx.clear(e);_glClear.sig="vi";var _emscripten_glClear=_glClear;_emscripten_glClear.sig="vi";var _glClearColor=(e,t,r,n)=>GLctx.clearColor(e,t,r,n);_glClearColor.sig="vffff";var _emscripten_glClearColor=_glClearColor;_emscripten_glClearColor.sig="vffff";var _glClearDepthf=e=>GLctx.clearDepth(e);_glClearDepthf.sig="vf";var _emscripten_glClearDepthf=_glClearDepthf;_emscripten_glClearDepthf.sig="vf";var _glClearStencil=e=>GLctx.clearStencil(e);_glClearStencil.sig="vi";var _emscripten_glClearStencil=_glClearStencil;_emscripten_glClearStencil.sig="vi";var _glClipControlEXT=(e,t)=>{GLctx.extClipControl.clipControlEXT(e,t)};_glClipControlEXT.sig="vii";var _emscripten_glClipControlEXT=_glClipControlEXT,_glColorMask=(e,t,r,n)=>{GLctx.colorMask(!!e,!!t,!!r,!!n)};_glColorMask.sig="viiii";var _emscripten_glColorMask=_glColorMask;_emscripten_glColorMask.sig="viiii";var _glCompileShader=e=>{GLctx.compileShader(GL.shaders[e])};_glCompileShader.sig="vi";var _emscripten_glCompileShader=_glCompileShader;_emscripten_glCompileShader.sig="vi";function _glCompressedTexImage2D(e,t,r,n,a,o,l,u){u>>>=0,GLctx.compressedTexImage2D(e,t,r,n,a,o,HEAPU8.subarray(u>>>0,u+l>>>0))}_glCompressedTexImage2D.sig="viiiiiiip";var _emscripten_glCompressedTexImage2D=_glCompressedTexImage2D;_emscripten_glCompressedTexImage2D.sig="viiiiiiip";function _glCompressedTexSubImage2D(e,t,r,n,a,o,l,u,_){_>>>=0,GLctx.compressedTexSubImage2D(e,t,r,n,a,o,l,HEAPU8.subarray(_>>>0,_+u>>>0))}_glCompressedTexSubImage2D.sig="viiiiiiiip";var _emscripten_glCompressedTexSubImage2D=_glCompressedTexSubImage2D;_emscripten_glCompressedTexSubImage2D.sig="viiiiiiiip";var _glCopyTexImage2D=(e,t,r,n,a,o,l,u)=>GLctx.copyTexImage2D(e,t,r,n,a,o,l,u);_glCopyTexImage2D.sig="viiiiiiii";var _emscripten_glCopyTexImage2D=_glCopyTexImage2D;_emscripten_glCopyTexImage2D.sig="viiiiiiii";var _glCopyTexSubImage2D=(e,t,r,n,a,o,l,u)=>GLctx.copyTexSubImage2D(e,t,r,n,a,o,l,u);_glCopyTexSubImage2D.sig="viiiiiiii";var _emscripten_glCopyTexSubImage2D=_glCopyTexSubImage2D;_emscripten_glCopyTexSubImage2D.sig="viiiiiiii";var _glCreateProgram=()=>{var e=GL.getNewId(GL.programs),t=GLctx.createProgram();return t.name=e,t.maxUniformLength=t.maxAttributeLength=t.maxUniformBlockNameLength=0,t.uniformIdCounter=1,GL.programs[e]=t,e};_glCreateProgram.sig="i";var _emscripten_glCreateProgram=_glCreateProgram;_emscripten_glCreateProgram.sig="i";var _glCreateShader=e=>{var t=GL.getNewId(GL.shaders);return GL.shaders[t]=GLctx.createShader(e),t};_glCreateShader.sig="ii";var _emscripten_glCreateShader=_glCreateShader;_emscripten_glCreateShader.sig="ii";var _glCullFace=e=>GLctx.cullFace(e);_glCullFace.sig="vi";var _emscripten_glCullFace=_glCullFace;_emscripten_glCullFace.sig="vi";function _glDeleteBuffers(e,t){t>>>=0;for(var r=0;r>>2>>>0],a=GL.buffers[n];a&&(GLctx.deleteBuffer(a),a.name=0,GL.buffers[n]=null)}}_glDeleteBuffers.sig="vip";var _emscripten_glDeleteBuffers=_glDeleteBuffers;_emscripten_glDeleteBuffers.sig="vip";function _glDeleteFramebuffers(e,t){t>>>=0;for(var r=0;r>>2>>>0],a=GL.framebuffers[n];a&&(GLctx.deleteFramebuffer(a),a.name=0,GL.framebuffers[n]=null)}}_glDeleteFramebuffers.sig="vip";var _emscripten_glDeleteFramebuffers=_glDeleteFramebuffers;_emscripten_glDeleteFramebuffers.sig="vip";var _glDeleteProgram=e=>{if(e){var t=GL.programs[e];if(!t){GL.recordError(1281);return}GLctx.deleteProgram(t),t.name=0,GL.programs[e]=null}};_glDeleteProgram.sig="vi";var _emscripten_glDeleteProgram=_glDeleteProgram;_emscripten_glDeleteProgram.sig="vi";function _glDeleteQueriesEXT(e,t){t>>>=0;for(var r=0;r>>2>>>0],a=GL.queries[n];a&&(GLctx.disjointTimerQueryExt.deleteQueryEXT(a),GL.queries[n]=null)}}_glDeleteQueriesEXT.sig="vip";var _emscripten_glDeleteQueriesEXT=_glDeleteQueriesEXT;function _glDeleteRenderbuffers(e,t){t>>>=0;for(var r=0;r>>2>>>0],a=GL.renderbuffers[n];a&&(GLctx.deleteRenderbuffer(a),a.name=0,GL.renderbuffers[n]=null)}}_glDeleteRenderbuffers.sig="vip";var _emscripten_glDeleteRenderbuffers=_glDeleteRenderbuffers;_emscripten_glDeleteRenderbuffers.sig="vip";var _glDeleteShader=e=>{if(e){var t=GL.shaders[e];if(!t){GL.recordError(1281);return}GLctx.deleteShader(t),GL.shaders[e]=null}};_glDeleteShader.sig="vi";var _emscripten_glDeleteShader=_glDeleteShader;_emscripten_glDeleteShader.sig="vi";function _glDeleteTextures(e,t){t>>>=0;for(var r=0;r>>2>>>0],a=GL.textures[n];a&&(GLctx.deleteTexture(a),a.name=0,GL.textures[n]=null)}}_glDeleteTextures.sig="vip";var _emscripten_glDeleteTextures=_glDeleteTextures;_emscripten_glDeleteTextures.sig="vip";function _glDeleteVertexArrays(e,t){t>>>=0;for(var r=0;r>>2>>>0];GLctx.deleteVertexArray(GL.vaos[n]),GL.vaos[n]=null}}_glDeleteVertexArrays.sig="vip";var _glDeleteVertexArraysOES=_glDeleteVertexArrays;_glDeleteVertexArraysOES.sig="vip";var _emscripten_glDeleteVertexArraysOES=_glDeleteVertexArraysOES;_emscripten_glDeleteVertexArraysOES.sig="vip";var _glDepthFunc=e=>GLctx.depthFunc(e);_glDepthFunc.sig="vi";var _emscripten_glDepthFunc=_glDepthFunc;_emscripten_glDepthFunc.sig="vi";var _glDepthMask=e=>{GLctx.depthMask(!!e)};_glDepthMask.sig="vi";var _emscripten_glDepthMask=_glDepthMask;_emscripten_glDepthMask.sig="vi";var _glDepthRangef=(e,t)=>GLctx.depthRange(e,t);_glDepthRangef.sig="vff";var _emscripten_glDepthRangef=_glDepthRangef;_emscripten_glDepthRangef.sig="vff";var _glDetachShader=(e,t)=>{GLctx.detachShader(GL.programs[e],GL.shaders[t])};_glDetachShader.sig="vii";var _emscripten_glDetachShader=_glDetachShader;_emscripten_glDetachShader.sig="vii";var _glDisable=e=>GLctx.disable(e);_glDisable.sig="vi";var _emscripten_glDisable=_glDisable;_emscripten_glDisable.sig="vi";var _glDisableVertexAttribArray=e=>{GLctx.disableVertexAttribArray(e)};_glDisableVertexAttribArray.sig="vi";var _emscripten_glDisableVertexAttribArray=_glDisableVertexAttribArray;_emscripten_glDisableVertexAttribArray.sig="vi";var _glDrawArrays=(e,t,r)=>{GLctx.drawArrays(e,t,r)};_glDrawArrays.sig="viii";var _emscripten_glDrawArrays=_glDrawArrays;_emscripten_glDrawArrays.sig="viii";var _glDrawArraysInstanced=(e,t,r,n)=>{GLctx.drawArraysInstanced(e,t,r,n)};_glDrawArraysInstanced.sig="viiii";var _glDrawArraysInstancedANGLE=_glDrawArraysInstanced,_emscripten_glDrawArraysInstancedANGLE=_glDrawArraysInstancedANGLE,tempFixedLengthArray=[];function _glDrawBuffers(e,t){t>>>=0;for(var r=tempFixedLengthArray[e],n=0;n>>2>>>0];GLctx.drawBuffers(r)}_glDrawBuffers.sig="vip";var _glDrawBuffersWEBGL=_glDrawBuffers,_emscripten_glDrawBuffersWEBGL=_glDrawBuffersWEBGL;function _glDrawElements(e,t,r,n){n>>>=0,GLctx.drawElements(e,t,r,n)}_glDrawElements.sig="viiip";var _emscripten_glDrawElements=_glDrawElements;_emscripten_glDrawElements.sig="viiip";function _glDrawElementsInstanced(e,t,r,n,a){n>>>=0,GLctx.drawElementsInstanced(e,t,r,n,a)}_glDrawElementsInstanced.sig="viiipi";var _glDrawElementsInstancedANGLE=_glDrawElementsInstanced,_emscripten_glDrawElementsInstancedANGLE=_glDrawElementsInstancedANGLE,_glEnable=e=>GLctx.enable(e);_glEnable.sig="vi";var _emscripten_glEnable=_glEnable;_emscripten_glEnable.sig="vi";var _glEnableVertexAttribArray=e=>{GLctx.enableVertexAttribArray(e)};_glEnableVertexAttribArray.sig="vi";var _emscripten_glEnableVertexAttribArray=_glEnableVertexAttribArray;_emscripten_glEnableVertexAttribArray.sig="vi";var _glEndQueryEXT=e=>{GLctx.disjointTimerQueryExt.endQueryEXT(e)};_glEndQueryEXT.sig="vi";var _emscripten_glEndQueryEXT=_glEndQueryEXT,_glFinish=()=>GLctx.finish();_glFinish.sig="v";var _emscripten_glFinish=_glFinish;_emscripten_glFinish.sig="v";var _glFlush=()=>GLctx.flush();_glFlush.sig="v";var _emscripten_glFlush=_glFlush;_emscripten_glFlush.sig="v";var _glFramebufferRenderbuffer=(e,t,r,n)=>{GLctx.framebufferRenderbuffer(e,t,r,GL.renderbuffers[n])};_glFramebufferRenderbuffer.sig="viiii";var _emscripten_glFramebufferRenderbuffer=_glFramebufferRenderbuffer;_emscripten_glFramebufferRenderbuffer.sig="viiii";var _glFramebufferTexture2D=(e,t,r,n,a)=>{GLctx.framebufferTexture2D(e,t,r,GL.textures[n],a)};_glFramebufferTexture2D.sig="viiiii";var _emscripten_glFramebufferTexture2D=_glFramebufferTexture2D;_emscripten_glFramebufferTexture2D.sig="viiiii";var _glFrontFace=e=>GLctx.frontFace(e);_glFrontFace.sig="vi";var _emscripten_glFrontFace=_glFrontFace;_emscripten_glFrontFace.sig="vi";function _glGenBuffers(e,t){t>>>=0,GL.genObject(e,t,"createBuffer",GL.buffers)}_glGenBuffers.sig="vip";var _emscripten_glGenBuffers=_glGenBuffers;_emscripten_glGenBuffers.sig="vip";function _glGenFramebuffers(e,t){t>>>=0,GL.genObject(e,t,"createFramebuffer",GL.framebuffers)}_glGenFramebuffers.sig="vip";var _emscripten_glGenFramebuffers=_glGenFramebuffers;_emscripten_glGenFramebuffers.sig="vip";function _glGenQueriesEXT(e,t){t>>>=0;for(var r=0;r>>2>>>0]=0;return}var a=GL.getNewId(GL.queries);n.name=a,GL.queries[a]=n,HEAP32[t+r*4>>>2>>>0]=a}}_glGenQueriesEXT.sig="vip";var _emscripten_glGenQueriesEXT=_glGenQueriesEXT;function _glGenRenderbuffers(e,t){t>>>=0,GL.genObject(e,t,"createRenderbuffer",GL.renderbuffers)}_glGenRenderbuffers.sig="vip";var _emscripten_glGenRenderbuffers=_glGenRenderbuffers;_emscripten_glGenRenderbuffers.sig="vip";function _glGenTextures(e,t){t>>>=0,GL.genObject(e,t,"createTexture",GL.textures)}_glGenTextures.sig="vip";var _emscripten_glGenTextures=_glGenTextures;_emscripten_glGenTextures.sig="vip";function _glGenVertexArrays(e,t){t>>>=0,GL.genObject(e,t,"createVertexArray",GL.vaos)}_glGenVertexArrays.sig="vip";var _glGenVertexArraysOES=_glGenVertexArrays;_glGenVertexArraysOES.sig="vip";var _emscripten_glGenVertexArraysOES=_glGenVertexArraysOES;_emscripten_glGenVertexArraysOES.sig="vip";var _glGenerateMipmap=e=>GLctx.generateMipmap(e);_glGenerateMipmap.sig="vi";var _emscripten_glGenerateMipmap=_glGenerateMipmap;_emscripten_glGenerateMipmap.sig="vi";var __glGetActiveAttribOrUniform=(e,t,r,n,a,o,l,u)=>{t=GL.programs[t];var _=GLctx[e](t,r);if(_){var d=u&&stringToUTF8(_.name,u,n);a&&(HEAP32[a>>>2>>>0]=d),o&&(HEAP32[o>>>2>>>0]=_.size),l&&(HEAP32[l>>>2>>>0]=_.type)}};function _glGetActiveAttrib(e,t,r,n,a,o,l){n>>>=0,a>>>=0,o>>>=0,l>>>=0,__glGetActiveAttribOrUniform("getActiveAttrib",e,t,r,n,a,o,l)}_glGetActiveAttrib.sig="viiipppp";var _emscripten_glGetActiveAttrib=_glGetActiveAttrib;_emscripten_glGetActiveAttrib.sig="viiipppp";function _glGetActiveUniform(e,t,r,n,a,o,l){n>>>=0,a>>>=0,o>>>=0,l>>>=0,__glGetActiveAttribOrUniform("getActiveUniform",e,t,r,n,a,o,l)}_glGetActiveUniform.sig="viiipppp";var _emscripten_glGetActiveUniform=_glGetActiveUniform;_emscripten_glGetActiveUniform.sig="viiipppp";function _glGetAttachedShaders(e,t,r,n){r>>>=0,n>>>=0;var a=GLctx.getAttachedShaders(GL.programs[e]),o=a.length;o>t&&(o=t),HEAP32[r>>>2>>>0]=o;for(var l=0;l>>2>>>0]=u}}_glGetAttachedShaders.sig="viipp";var _emscripten_glGetAttachedShaders=_glGetAttachedShaders;_emscripten_glGetAttachedShaders.sig="viipp";function _glGetAttribLocation(e,t){return t>>>=0,GLctx.getAttribLocation(GL.programs[e],UTF8ToString(t))}_glGetAttribLocation.sig="iip";var _emscripten_glGetAttribLocation=_glGetAttribLocation;_emscripten_glGetAttribLocation.sig="iip";var writeI53ToI64=(e,t)=>{HEAPU32[e>>>2>>>0]=t;var r=HEAPU32[e>>>2>>>0];HEAPU32[e+4>>>2>>>0]=(t-r)/4294967296},emscriptenWebGLGet=(e,t,r)=>{if(!t){GL.recordError(1281);return}var n=void 0;switch(e){case 36346:n=1;break;case 36344:r!=0&&r!=1&&GL.recordError(1280);return;case 36345:n=0;break;case 34466:var a=GLctx.getParameter(34467);n=a?a.length:0;break}if(n===void 0){var o=GLctx.getParameter(e);switch(typeof o){case"number":n=o;break;case"boolean":n=o?1:0;break;case"string":GL.recordError(1280);return;case"object":if(o===null)switch(e){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 34068:{n=0;break}default:{GL.recordError(1280);return}}else if(o instanceof Float32Array||o instanceof Uint32Array||o instanceof Int32Array||o instanceof Array){for(var l=0;l>>2>>>0]=o[l];break;case 2:HEAPF32[t+l*4>>>2>>>0]=o[l];break;case 4:HEAP8[t+l>>>0]=o[l]?1:0;break}return}else try{n=o.name|0}catch(u){GL.recordError(1280),err("GL_INVALID_ENUM in glGet".concat(r,"v: Unknown object returned from WebGL getParameter(").concat(e,")! (error: ").concat(u,")"));return}break;default:GL.recordError(1280),err("GL_INVALID_ENUM in glGet".concat(r,"v: Native code calling glGet").concat(r,"v(").concat(e,") and it returns ").concat(o," of type ").concat(typeof o,"!"));return}}switch(r){case 1:writeI53ToI64(t,n);break;case 0:HEAP32[t>>>2>>>0]=n;break;case 2:HEAPF32[t>>>2>>>0]=n;break;case 4:HEAP8[t>>>0]=n?1:0;break}};function _glGetBooleanv(e,t){return t>>>=0,emscriptenWebGLGet(e,t,4)}_glGetBooleanv.sig="vip";var _emscripten_glGetBooleanv=_glGetBooleanv;_emscripten_glGetBooleanv.sig="vip";function _glGetBufferParameteriv(e,t,r){if(r>>>=0,!r){GL.recordError(1281);return}HEAP32[r>>>2>>>0]=GLctx.getBufferParameter(e,t)}_glGetBufferParameteriv.sig="viip";var _emscripten_glGetBufferParameteriv=_glGetBufferParameteriv;_emscripten_glGetBufferParameteriv.sig="viip";var _glGetError=()=>{var e=GLctx.getError()||GL.lastError;return GL.lastError=0,e};_glGetError.sig="i";var _emscripten_glGetError=_glGetError;_emscripten_glGetError.sig="i";function _glGetFloatv(e,t){return t>>>=0,emscriptenWebGLGet(e,t,2)}_glGetFloatv.sig="vip";var _emscripten_glGetFloatv=_glGetFloatv;_emscripten_glGetFloatv.sig="vip";function _glGetFramebufferAttachmentParameteriv(e,t,r,n){n>>>=0;var a=GLctx.getFramebufferAttachmentParameter(e,t,r);(a instanceof WebGLRenderbuffer||a instanceof WebGLTexture)&&(a=a.name|0),HEAP32[n>>>2>>>0]=a}_glGetFramebufferAttachmentParameteriv.sig="viiip";var _emscripten_glGetFramebufferAttachmentParameteriv=_glGetFramebufferAttachmentParameteriv;_emscripten_glGetFramebufferAttachmentParameteriv.sig="viiip";function _glGetIntegerv(e,t){return t>>>=0,emscriptenWebGLGet(e,t,0)}_glGetIntegerv.sig="vip";var _emscripten_glGetIntegerv=_glGetIntegerv;_emscripten_glGetIntegerv.sig="vip";function _glGetProgramInfoLog(e,t,r,n){r>>>=0,n>>>=0;var a=GLctx.getProgramInfoLog(GL.programs[e]);a===null&&(a="(unknown error)");var o=t>0&&n?stringToUTF8(a,n,t):0;r&&(HEAP32[r>>>2>>>0]=o)}_glGetProgramInfoLog.sig="viipp";var _emscripten_glGetProgramInfoLog=_glGetProgramInfoLog;_emscripten_glGetProgramInfoLog.sig="viipp";function _glGetProgramiv(e,t,r){if(r>>>=0,!r){GL.recordError(1281);return}if(e>=GL.counter){GL.recordError(1281);return}if(e=GL.programs[e],t==35716){var n=GLctx.getProgramInfoLog(e);n===null&&(n="(unknown error)"),HEAP32[r>>>2>>>0]=n.length+1}else if(t==35719){if(!e.maxUniformLength)for(var a=GLctx.getProgramParameter(e,35718),o=0;o>>2>>>0]=e.maxUniformLength}else if(t==35722){if(!e.maxAttributeLength)for(var l=GLctx.getProgramParameter(e,35721),o=0;o>>2>>>0]=e.maxAttributeLength}else if(t==35381){if(!e.maxUniformBlockNameLength)for(var u=GLctx.getProgramParameter(e,35382),o=0;o>>2>>>0]=e.maxUniformBlockNameLength}else HEAP32[r>>>2>>>0]=GLctx.getProgramParameter(e,t)}_glGetProgramiv.sig="viip";var _emscripten_glGetProgramiv=_glGetProgramiv;_emscripten_glGetProgramiv.sig="viip";function _glGetQueryObjecti64vEXT(e,t,r){if(r>>>=0,!r){GL.recordError(1281);return}var n=GL.queries[e],a;a=GLctx.disjointTimerQueryExt.getQueryObjectEXT(n,t);var o;typeof a=="boolean"?o=a?1:0:o=a,writeI53ToI64(r,o)}_glGetQueryObjecti64vEXT.sig="viip";var _emscripten_glGetQueryObjecti64vEXT=_glGetQueryObjecti64vEXT;function _glGetQueryObjectivEXT(e,t,r){if(r>>>=0,!r){GL.recordError(1281);return}var n=GL.queries[e],a=GLctx.disjointTimerQueryExt.getQueryObjectEXT(n,t),o;typeof a=="boolean"?o=a?1:0:o=a,HEAP32[r>>>2>>>0]=o}_glGetQueryObjectivEXT.sig="viip";var _emscripten_glGetQueryObjectivEXT=_glGetQueryObjectivEXT,_glGetQueryObjectui64vEXT=_glGetQueryObjecti64vEXT,_emscripten_glGetQueryObjectui64vEXT=_glGetQueryObjectui64vEXT,_glGetQueryObjectuivEXT=_glGetQueryObjectivEXT,_emscripten_glGetQueryObjectuivEXT=_glGetQueryObjectuivEXT;function _glGetQueryivEXT(e,t,r){if(r>>>=0,!r){GL.recordError(1281);return}HEAP32[r>>>2>>>0]=GLctx.disjointTimerQueryExt.getQueryEXT(e,t)}_glGetQueryivEXT.sig="viip";var _emscripten_glGetQueryivEXT=_glGetQueryivEXT;function _glGetRenderbufferParameteriv(e,t,r){if(r>>>=0,!r){GL.recordError(1281);return}HEAP32[r>>>2>>>0]=GLctx.getRenderbufferParameter(e,t)}_glGetRenderbufferParameteriv.sig="viip";var _emscripten_glGetRenderbufferParameteriv=_glGetRenderbufferParameteriv;_emscripten_glGetRenderbufferParameteriv.sig="viip";function _glGetShaderInfoLog(e,t,r,n){r>>>=0,n>>>=0;var a=GLctx.getShaderInfoLog(GL.shaders[e]);a===null&&(a="(unknown error)");var o=t>0&&n?stringToUTF8(a,n,t):0;r&&(HEAP32[r>>>2>>>0]=o)}_glGetShaderInfoLog.sig="viipp";var _emscripten_glGetShaderInfoLog=_glGetShaderInfoLog;_emscripten_glGetShaderInfoLog.sig="viipp";function _glGetShaderPrecisionFormat(e,t,r,n){r>>>=0,n>>>=0;var a=GLctx.getShaderPrecisionFormat(e,t);HEAP32[r>>>2>>>0]=a.rangeMin,HEAP32[r+4>>>2>>>0]=a.rangeMax,HEAP32[n>>>2>>>0]=a.precision}_glGetShaderPrecisionFormat.sig="viipp";var _emscripten_glGetShaderPrecisionFormat=_glGetShaderPrecisionFormat;_emscripten_glGetShaderPrecisionFormat.sig="viipp";function _glGetShaderSource(e,t,r,n){r>>>=0,n>>>=0;var a=GLctx.getShaderSource(GL.shaders[e]);if(a){var o=t>0&&n?stringToUTF8(a,n,t):0;r&&(HEAP32[r>>>2>>>0]=o)}}_glGetShaderSource.sig="viipp";var _emscripten_glGetShaderSource=_glGetShaderSource;_emscripten_glGetShaderSource.sig="viipp";function _glGetShaderiv(e,t,r){if(r>>>=0,!r){GL.recordError(1281);return}if(t==35716){var n=GLctx.getShaderInfoLog(GL.shaders[e]);n===null&&(n="(unknown error)");var a=n?n.length+1:0;HEAP32[r>>>2>>>0]=a}else if(t==35720){var o=GLctx.getShaderSource(GL.shaders[e]),l=o?o.length+1:0;HEAP32[r>>>2>>>0]=l}else HEAP32[r>>>2>>>0]=GLctx.getShaderParameter(GL.shaders[e],t)}_glGetShaderiv.sig="viip";var _emscripten_glGetShaderiv=_glGetShaderiv;_emscripten_glGetShaderiv.sig="viip";var webglGetExtensions=function e(){var t=getEmscriptenSupportedExtensions(GLctx);return t=t.concat(t.map(r=>"GL_"+r)),t};function _glGetString(e){var t=GL.stringCache[e];if(!t){switch(e){case 7939:t=stringToNewUTF8(webglGetExtensions().join(" "));break;case 7936:case 7937:case 37445:case 37446:var r=GLctx.getParameter(e);r||GL.recordError(1280),t=r?stringToNewUTF8(r):0;break;case 7938:var n=GLctx.getParameter(7938),a="OpenGL ES 2.0 (".concat(n,")");t=stringToNewUTF8(a);break;case 35724:var o=GLctx.getParameter(35724),l=/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/,u=o.match(l);u!==null&&(u[1].length==3&&(u[1]=u[1]+"0"),o="OpenGL ES GLSL ES ".concat(u[1]," (").concat(o,")")),t=stringToNewUTF8(o);break;default:GL.recordError(1280)}GL.stringCache[e]=t}return t}_glGetString.sig="pi";var _emscripten_glGetString=_glGetString;_emscripten_glGetString.sig="pi";function _glGetTexParameterfv(e,t,r){if(r>>>=0,!r){GL.recordError(1281);return}HEAPF32[r>>>2>>>0]=GLctx.getTexParameter(e,t)}_glGetTexParameterfv.sig="viip";var _emscripten_glGetTexParameterfv=_glGetTexParameterfv;_emscripten_glGetTexParameterfv.sig="viip";function _glGetTexParameteriv(e,t,r){if(r>>>=0,!r){GL.recordError(1281);return}HEAP32[r>>>2>>>0]=GLctx.getTexParameter(e,t)}_glGetTexParameteriv.sig="viip";var _emscripten_glGetTexParameteriv=_glGetTexParameteriv;_emscripten_glGetTexParameteriv.sig="viip";var webglGetLeftBracePos=e=>e.slice(-1)=="]"&&e.lastIndexOf("["),webglPrepareUniformLocationsBeforeFirstUse=e=>{var t=e.uniformLocsById,r=e.uniformSizeAndIdsByName,n,a;if(!t){e.uniformLocsById=t={},e.uniformArrayNamesById={};var o=GLctx.getProgramParameter(e,35718);for(n=0;n0?u.slice(0,d):u,p=e.uniformIdCounter;for(e.uniformIdCounter+=_,r[f]=[_,p],a=0;a<_;++a)t[p]=a,e.uniformArrayNamesById[p++]=f}}};function _glGetUniformLocation(e,t){if(t>>>=0,t=UTF8ToString(t),e=GL.programs[e]){webglPrepareUniformLocationsBeforeFirstUse(e);var r=e.uniformLocsById,n=0,a=t,o=webglGetLeftBracePos(t);o>0&&(n=jstoi_q(t.slice(o+1))>>>0,a=t.slice(0,o));var l=e.uniformSizeAndIdsByName[a];if(l&&n{var t=GLctx.currentProgram;if(t){var r=t.uniformLocsById[e];return typeof r=="number"&&(t.uniformLocsById[e]=r=GLctx.getUniformLocation(t,t.uniformArrayNamesById[e]+(r>0?"[".concat(r,"]"):""))),r}else GL.recordError(1282)},emscriptenWebGLGetUniform=(e,t,r,n)=>{if(!r){GL.recordError(1281);return}e=GL.programs[e],webglPrepareUniformLocationsBeforeFirstUse(e);var a=GLctx.getUniform(e,webglGetUniformLocation(t));if(typeof a=="number"||typeof a=="boolean")switch(n){case 0:HEAP32[r>>>2>>>0]=a;break;case 2:HEAPF32[r>>>2>>>0]=a;break}else for(var o=0;o>>2>>>0]=a[o];break;case 2:HEAPF32[r+o*4>>>2>>>0]=a[o];break}};function _glGetUniformfv(e,t,r){r>>>=0,emscriptenWebGLGetUniform(e,t,r,2)}_glGetUniformfv.sig="viip";var _emscripten_glGetUniformfv=_glGetUniformfv;_emscripten_glGetUniformfv.sig="viip";function _glGetUniformiv(e,t,r){r>>>=0,emscriptenWebGLGetUniform(e,t,r,0)}_glGetUniformiv.sig="viip";var _emscripten_glGetUniformiv=_glGetUniformiv;_emscripten_glGetUniformiv.sig="viip";function _glGetVertexAttribPointerv(e,t,r){if(r>>>=0,!r){GL.recordError(1281);return}HEAP32[r>>>2>>>0]=GLctx.getVertexAttribOffset(e,t)}_glGetVertexAttribPointerv.sig="viip";var _emscripten_glGetVertexAttribPointerv=_glGetVertexAttribPointerv;_emscripten_glGetVertexAttribPointerv.sig="viip";var emscriptenWebGLGetVertexAttrib=(e,t,r,n)=>{if(!r){GL.recordError(1281);return}var a=GLctx.getVertexAttrib(e,t);if(t==34975)HEAP32[r>>>2>>>0]=a&&a.name;else if(typeof a=="number"||typeof a=="boolean")switch(n){case 0:HEAP32[r>>>2>>>0]=a;break;case 2:HEAPF32[r>>>2>>>0]=a;break;case 5:HEAP32[r>>>2>>>0]=Math.fround(a);break}else for(var o=0;o>>2>>>0]=a[o];break;case 2:HEAPF32[r+o*4>>>2>>>0]=a[o];break;case 5:HEAP32[r+o*4>>>2>>>0]=Math.fround(a[o]);break}};function _glGetVertexAttribfv(e,t,r){r>>>=0,emscriptenWebGLGetVertexAttrib(e,t,r,2)}_glGetVertexAttribfv.sig="viip";var _emscripten_glGetVertexAttribfv=_glGetVertexAttribfv;_emscripten_glGetVertexAttribfv.sig="viip";function _glGetVertexAttribiv(e,t,r){r>>>=0,emscriptenWebGLGetVertexAttrib(e,t,r,5)}_glGetVertexAttribiv.sig="viip";var _emscripten_glGetVertexAttribiv=_glGetVertexAttribiv;_emscripten_glGetVertexAttribiv.sig="viip";var _glHint=(e,t)=>GLctx.hint(e,t);_glHint.sig="vii";var _emscripten_glHint=_glHint;_emscripten_glHint.sig="vii";var _glIsBuffer=e=>{var t=GL.buffers[e];return t?GLctx.isBuffer(t):0};_glIsBuffer.sig="ii";var _emscripten_glIsBuffer=_glIsBuffer;_emscripten_glIsBuffer.sig="ii";var _glIsEnabled=e=>GLctx.isEnabled(e);_glIsEnabled.sig="ii";var _emscripten_glIsEnabled=_glIsEnabled;_emscripten_glIsEnabled.sig="ii";var _glIsFramebuffer=e=>{var t=GL.framebuffers[e];return t?GLctx.isFramebuffer(t):0};_glIsFramebuffer.sig="ii";var _emscripten_glIsFramebuffer=_glIsFramebuffer;_emscripten_glIsFramebuffer.sig="ii";var _glIsProgram=e=>(e=GL.programs[e],e?GLctx.isProgram(e):0);_glIsProgram.sig="ii";var _emscripten_glIsProgram=_glIsProgram;_emscripten_glIsProgram.sig="ii";var _glIsQueryEXT=e=>{var t=GL.queries[e];return t?GLctx.disjointTimerQueryExt.isQueryEXT(t):0};_glIsQueryEXT.sig="ii";var _emscripten_glIsQueryEXT=_glIsQueryEXT,_glIsRenderbuffer=e=>{var t=GL.renderbuffers[e];return t?GLctx.isRenderbuffer(t):0};_glIsRenderbuffer.sig="ii";var _emscripten_glIsRenderbuffer=_glIsRenderbuffer;_emscripten_glIsRenderbuffer.sig="ii";var _glIsShader=e=>{var t=GL.shaders[e];return t?GLctx.isShader(t):0};_glIsShader.sig="ii";var _emscripten_glIsShader=_glIsShader;_emscripten_glIsShader.sig="ii";var _glIsTexture=e=>{var t=GL.textures[e];return t?GLctx.isTexture(t):0};_glIsTexture.sig="ii";var _emscripten_glIsTexture=_glIsTexture;_emscripten_glIsTexture.sig="ii";var _glIsVertexArray=e=>{var t=GL.vaos[e];return t?GLctx.isVertexArray(t):0};_glIsVertexArray.sig="ii";var _glIsVertexArrayOES=_glIsVertexArray;_glIsVertexArrayOES.sig="ii";var _emscripten_glIsVertexArrayOES=_glIsVertexArrayOES;_emscripten_glIsVertexArrayOES.sig="ii";var _glLineWidth=e=>GLctx.lineWidth(e);_glLineWidth.sig="vf";var _emscripten_glLineWidth=_glLineWidth;_emscripten_glLineWidth.sig="vf";var _glLinkProgram=e=>{e=GL.programs[e],GLctx.linkProgram(e),e.uniformLocsById=0,e.uniformSizeAndIdsByName={}};_glLinkProgram.sig="vi";var _emscripten_glLinkProgram=_glLinkProgram;_emscripten_glLinkProgram.sig="vi";var _glPixelStorei=(e,t)=>{e==3317?GL.unpackAlignment=t:e==3314&&(GL.unpackRowLength=t),GLctx.pixelStorei(e,t)};_glPixelStorei.sig="vii";var _emscripten_glPixelStorei=_glPixelStorei;_emscripten_glPixelStorei.sig="vii";var _glPolygonModeWEBGL=(e,t)=>{GLctx.webglPolygonMode.polygonModeWEBGL(e,t)};_glPolygonModeWEBGL.sig="vii";var _emscripten_glPolygonModeWEBGL=_glPolygonModeWEBGL,_glPolygonOffset=(e,t)=>GLctx.polygonOffset(e,t);_glPolygonOffset.sig="vff";var _emscripten_glPolygonOffset=_glPolygonOffset;_emscripten_glPolygonOffset.sig="vff";var _glPolygonOffsetClampEXT=(e,t,r)=>{GLctx.extPolygonOffsetClamp.polygonOffsetClampEXT(e,t,r)};_glPolygonOffsetClampEXT.sig="vfff";var _emscripten_glPolygonOffsetClampEXT=_glPolygonOffsetClampEXT,_glQueryCounterEXT=(e,t)=>{GLctx.disjointTimerQueryExt.queryCounterEXT(GL.queries[e],t)};_glQueryCounterEXT.sig="vii";var _emscripten_glQueryCounterEXT=_glQueryCounterEXT,computeUnpackAlignedImageSize=(e,t,r)=>{function n(l,u){return l+u-1&-u}var a=(GL.unpackRowLength||e)*r,o=n(a,GL.unpackAlignment);return t*o},colorChannelsInGlTextureFormat=e=>{var t={5:3,6:4,8:2,29502:3,29504:4};return t[e-6402]||1},heapObjectForWebGLType=e=>(e-=5120,e==1?HEAPU8:e==4?HEAP32:e==6?HEAPF32:e==5||e==28922?HEAPU32:HEAPU16),toTypedArrayIndex=(e,t)=>e>>>31-Math.clz32(t.BYTES_PER_ELEMENT),emscriptenWebGLGetTexPixelData=(e,t,r,n,a,o)=>{var l=heapObjectForWebGLType(e),u=colorChannelsInGlTextureFormat(t)*l.BYTES_PER_ELEMENT,_=computeUnpackAlignedImageSize(r,n,u);return l.subarray(toTypedArrayIndex(a,l)>>>0,toTypedArrayIndex(a+_,l)>>>0)};function _glReadPixels(e,t,r,n,a,o,l){l>>>=0;var u=emscriptenWebGLGetTexPixelData(o,a,r,n,l,a);if(!u){GL.recordError(1280);return}GLctx.readPixels(e,t,r,n,a,o,u)}_glReadPixels.sig="viiiiiip";var _emscripten_glReadPixels=_glReadPixels;_emscripten_glReadPixels.sig="viiiiiip";var _glReleaseShaderCompiler=()=>{};_glReleaseShaderCompiler.sig="v";var _emscripten_glReleaseShaderCompiler=_glReleaseShaderCompiler;_emscripten_glReleaseShaderCompiler.sig="v";var _glRenderbufferStorage=(e,t,r,n)=>GLctx.renderbufferStorage(e,t,r,n);_glRenderbufferStorage.sig="viiii";var _emscripten_glRenderbufferStorage=_glRenderbufferStorage;_emscripten_glRenderbufferStorage.sig="viiii";var _glSampleCoverage=(e,t)=>{GLctx.sampleCoverage(e,!!t)};_glSampleCoverage.sig="vfi";var _emscripten_glSampleCoverage=_glSampleCoverage;_emscripten_glSampleCoverage.sig="vfi";var _glScissor=(e,t,r,n)=>GLctx.scissor(e,t,r,n);_glScissor.sig="viiii";var _emscripten_glScissor=_glScissor;_emscripten_glScissor.sig="viiii";function _glShaderBinary(e,t,r,n,a){t>>>=0,n>>>=0,GL.recordError(1280)}_glShaderBinary.sig="vipipi";var _emscripten_glShaderBinary=_glShaderBinary;_emscripten_glShaderBinary.sig="vipipi";function _glShaderSource(e,t,r,n){r>>>=0,n>>>=0;var a=GL.getSource(e,t,r,n);GLctx.shaderSource(GL.shaders[e],a)}_glShaderSource.sig="viipp";var _emscripten_glShaderSource=_glShaderSource;_emscripten_glShaderSource.sig="viipp";var _glStencilFunc=(e,t,r)=>GLctx.stencilFunc(e,t,r);_glStencilFunc.sig="viii";var _emscripten_glStencilFunc=_glStencilFunc;_emscripten_glStencilFunc.sig="viii";var _glStencilFuncSeparate=(e,t,r,n)=>GLctx.stencilFuncSeparate(e,t,r,n);_glStencilFuncSeparate.sig="viiii";var _emscripten_glStencilFuncSeparate=_glStencilFuncSeparate;_emscripten_glStencilFuncSeparate.sig="viiii";var _glStencilMask=e=>GLctx.stencilMask(e);_glStencilMask.sig="vi";var _emscripten_glStencilMask=_glStencilMask;_emscripten_glStencilMask.sig="vi";var _glStencilMaskSeparate=(e,t)=>GLctx.stencilMaskSeparate(e,t);_glStencilMaskSeparate.sig="vii";var _emscripten_glStencilMaskSeparate=_glStencilMaskSeparate;_emscripten_glStencilMaskSeparate.sig="vii";var _glStencilOp=(e,t,r)=>GLctx.stencilOp(e,t,r);_glStencilOp.sig="viii";var _emscripten_glStencilOp=_glStencilOp;_emscripten_glStencilOp.sig="viii";var _glStencilOpSeparate=(e,t,r,n)=>GLctx.stencilOpSeparate(e,t,r,n);_glStencilOpSeparate.sig="viiii";var _emscripten_glStencilOpSeparate=_glStencilOpSeparate;_emscripten_glStencilOpSeparate.sig="viiii";function _glTexImage2D(e,t,r,n,a,o,l,u,_){_>>>=0;var d=_?emscriptenWebGLGetTexPixelData(u,l,n,a,_,r):null;GLctx.texImage2D(e,t,r,n,a,o,l,u,d)}_glTexImage2D.sig="viiiiiiiip";var _emscripten_glTexImage2D=_glTexImage2D;_emscripten_glTexImage2D.sig="viiiiiiiip";var _glTexParameterf=(e,t,r)=>GLctx.texParameterf(e,t,r);_glTexParameterf.sig="viif";var _emscripten_glTexParameterf=_glTexParameterf;_emscripten_glTexParameterf.sig="viif";function _glTexParameterfv(e,t,r){r>>>=0;var n=HEAPF32[r>>>2>>>0];GLctx.texParameterf(e,t,n)}_glTexParameterfv.sig="viip";var _emscripten_glTexParameterfv=_glTexParameterfv;_emscripten_glTexParameterfv.sig="viip";var _glTexParameteri=(e,t,r)=>GLctx.texParameteri(e,t,r);_glTexParameteri.sig="viii";var _emscripten_glTexParameteri=_glTexParameteri;_emscripten_glTexParameteri.sig="viii";function _glTexParameteriv(e,t,r){r>>>=0;var n=HEAP32[r>>>2>>>0];GLctx.texParameteri(e,t,n)}_glTexParameteriv.sig="viip";var _emscripten_glTexParameteriv=_glTexParameteriv;_emscripten_glTexParameteriv.sig="viip";function _glTexSubImage2D(e,t,r,n,a,o,l,u,_){_>>>=0;var d=_?emscriptenWebGLGetTexPixelData(u,l,a,o,_,0):null;GLctx.texSubImage2D(e,t,r,n,a,o,l,u,d)}_glTexSubImage2D.sig="viiiiiiiip";var _emscripten_glTexSubImage2D=_glTexSubImage2D;_emscripten_glTexSubImage2D.sig="viiiiiiiip";var _glUniform1f=(e,t)=>{GLctx.uniform1f(webglGetUniformLocation(e),t)};_glUniform1f.sig="vif";var _emscripten_glUniform1f=_glUniform1f;_emscripten_glUniform1f.sig="vif";var miniTempWebGLFloatBuffers=[];function _glUniform1fv(e,t,r){if(r>>>=0,t<=288)for(var n=miniTempWebGLFloatBuffers[t],a=0;a>>2>>>0];else var n=HEAPF32.subarray(r>>>2>>>0,r+t*4>>>2>>>0);GLctx.uniform1fv(webglGetUniformLocation(e),n)}_glUniform1fv.sig="viip";var _emscripten_glUniform1fv=_glUniform1fv;_emscripten_glUniform1fv.sig="viip";var _glUniform1i=(e,t)=>{GLctx.uniform1i(webglGetUniformLocation(e),t)};_glUniform1i.sig="vii";var _emscripten_glUniform1i=_glUniform1i;_emscripten_glUniform1i.sig="vii";var miniTempWebGLIntBuffers=[];function _glUniform1iv(e,t,r){if(r>>>=0,t<=288)for(var n=miniTempWebGLIntBuffers[t],a=0;a>>2>>>0];else var n=HEAP32.subarray(r>>>2>>>0,r+t*4>>>2>>>0);GLctx.uniform1iv(webglGetUniformLocation(e),n)}_glUniform1iv.sig="viip";var _emscripten_glUniform1iv=_glUniform1iv;_emscripten_glUniform1iv.sig="viip";var _glUniform2f=(e,t,r)=>{GLctx.uniform2f(webglGetUniformLocation(e),t,r)};_glUniform2f.sig="viff";var _emscripten_glUniform2f=_glUniform2f;_emscripten_glUniform2f.sig="viff";function _glUniform2fv(e,t,r){if(r>>>=0,t<=144){t*=2;for(var n=miniTempWebGLFloatBuffers[t],a=0;a>>2>>>0],n[a+1]=HEAPF32[r+(4*a+4)>>>2>>>0]}else var n=HEAPF32.subarray(r>>>2>>>0,r+t*8>>>2>>>0);GLctx.uniform2fv(webglGetUniformLocation(e),n)}_glUniform2fv.sig="viip";var _emscripten_glUniform2fv=_glUniform2fv;_emscripten_glUniform2fv.sig="viip";var _glUniform2i=(e,t,r)=>{GLctx.uniform2i(webglGetUniformLocation(e),t,r)};_glUniform2i.sig="viii";var _emscripten_glUniform2i=_glUniform2i;_emscripten_glUniform2i.sig="viii";function _glUniform2iv(e,t,r){if(r>>>=0,t<=144){t*=2;for(var n=miniTempWebGLIntBuffers[t],a=0;a>>2>>>0],n[a+1]=HEAP32[r+(4*a+4)>>>2>>>0]}else var n=HEAP32.subarray(r>>>2>>>0,r+t*8>>>2>>>0);GLctx.uniform2iv(webglGetUniformLocation(e),n)}_glUniform2iv.sig="viip";var _emscripten_glUniform2iv=_glUniform2iv;_emscripten_glUniform2iv.sig="viip";var _glUniform3f=(e,t,r,n)=>{GLctx.uniform3f(webglGetUniformLocation(e),t,r,n)};_glUniform3f.sig="vifff";var _emscripten_glUniform3f=_glUniform3f;_emscripten_glUniform3f.sig="vifff";function _glUniform3fv(e,t,r){if(r>>>=0,t<=96){t*=3;for(var n=miniTempWebGLFloatBuffers[t],a=0;a>>2>>>0],n[a+1]=HEAPF32[r+(4*a+4)>>>2>>>0],n[a+2]=HEAPF32[r+(4*a+8)>>>2>>>0]}else var n=HEAPF32.subarray(r>>>2>>>0,r+t*12>>>2>>>0);GLctx.uniform3fv(webglGetUniformLocation(e),n)}_glUniform3fv.sig="viip";var _emscripten_glUniform3fv=_glUniform3fv;_emscripten_glUniform3fv.sig="viip";var _glUniform3i=(e,t,r,n)=>{GLctx.uniform3i(webglGetUniformLocation(e),t,r,n)};_glUniform3i.sig="viiii";var _emscripten_glUniform3i=_glUniform3i;_emscripten_glUniform3i.sig="viiii";function _glUniform3iv(e,t,r){if(r>>>=0,t<=96){t*=3;for(var n=miniTempWebGLIntBuffers[t],a=0;a>>2>>>0],n[a+1]=HEAP32[r+(4*a+4)>>>2>>>0],n[a+2]=HEAP32[r+(4*a+8)>>>2>>>0]}else var n=HEAP32.subarray(r>>>2>>>0,r+t*12>>>2>>>0);GLctx.uniform3iv(webglGetUniformLocation(e),n)}_glUniform3iv.sig="viip";var _emscripten_glUniform3iv=_glUniform3iv;_emscripten_glUniform3iv.sig="viip";var _glUniform4f=(e,t,r,n,a)=>{GLctx.uniform4f(webglGetUniformLocation(e),t,r,n,a)};_glUniform4f.sig="viffff";var _emscripten_glUniform4f=_glUniform4f;_emscripten_glUniform4f.sig="viffff";function _glUniform4fv(e,t,r){if(r>>>=0,t<=72){var n=miniTempWebGLFloatBuffers[4*t],a=HEAPF32;r=r>>>2,t*=4;for(var o=0;o>>0],n[o+1]=a[l+1>>>0],n[o+2]=a[l+2>>>0],n[o+3]=a[l+3>>>0]}}else var n=HEAPF32.subarray(r>>>2>>>0,r+t*16>>>2>>>0);GLctx.uniform4fv(webglGetUniformLocation(e),n)}_glUniform4fv.sig="viip";var _emscripten_glUniform4fv=_glUniform4fv;_emscripten_glUniform4fv.sig="viip";var _glUniform4i=(e,t,r,n,a)=>{GLctx.uniform4i(webglGetUniformLocation(e),t,r,n,a)};_glUniform4i.sig="viiiii";var _emscripten_glUniform4i=_glUniform4i;_emscripten_glUniform4i.sig="viiiii";function _glUniform4iv(e,t,r){if(r>>>=0,t<=72){t*=4;for(var n=miniTempWebGLIntBuffers[t],a=0;a>>2>>>0],n[a+1]=HEAP32[r+(4*a+4)>>>2>>>0],n[a+2]=HEAP32[r+(4*a+8)>>>2>>>0],n[a+3]=HEAP32[r+(4*a+12)>>>2>>>0]}else var n=HEAP32.subarray(r>>>2>>>0,r+t*16>>>2>>>0);GLctx.uniform4iv(webglGetUniformLocation(e),n)}_glUniform4iv.sig="viip";var _emscripten_glUniform4iv=_glUniform4iv;_emscripten_glUniform4iv.sig="viip";function _glUniformMatrix2fv(e,t,r,n){if(n>>>=0,t<=72){t*=4;for(var a=miniTempWebGLFloatBuffers[t],o=0;o>>2>>>0],a[o+1]=HEAPF32[n+(4*o+4)>>>2>>>0],a[o+2]=HEAPF32[n+(4*o+8)>>>2>>>0],a[o+3]=HEAPF32[n+(4*o+12)>>>2>>>0]}else var a=HEAPF32.subarray(n>>>2>>>0,n+t*16>>>2>>>0);GLctx.uniformMatrix2fv(webglGetUniformLocation(e),!!r,a)}_glUniformMatrix2fv.sig="viiip";var _emscripten_glUniformMatrix2fv=_glUniformMatrix2fv;_emscripten_glUniformMatrix2fv.sig="viiip";function _glUniformMatrix3fv(e,t,r,n){if(n>>>=0,t<=32){t*=9;for(var a=miniTempWebGLFloatBuffers[t],o=0;o>>2>>>0],a[o+1]=HEAPF32[n+(4*o+4)>>>2>>>0],a[o+2]=HEAPF32[n+(4*o+8)>>>2>>>0],a[o+3]=HEAPF32[n+(4*o+12)>>>2>>>0],a[o+4]=HEAPF32[n+(4*o+16)>>>2>>>0],a[o+5]=HEAPF32[n+(4*o+20)>>>2>>>0],a[o+6]=HEAPF32[n+(4*o+24)>>>2>>>0],a[o+7]=HEAPF32[n+(4*o+28)>>>2>>>0],a[o+8]=HEAPF32[n+(4*o+32)>>>2>>>0]}else var a=HEAPF32.subarray(n>>>2>>>0,n+t*36>>>2>>>0);GLctx.uniformMatrix3fv(webglGetUniformLocation(e),!!r,a)}_glUniformMatrix3fv.sig="viiip";var _emscripten_glUniformMatrix3fv=_glUniformMatrix3fv;_emscripten_glUniformMatrix3fv.sig="viiip";function _glUniformMatrix4fv(e,t,r,n){if(n>>>=0,t<=18){var a=miniTempWebGLFloatBuffers[16*t],o=HEAPF32;n=n>>>2,t*=16;for(var l=0;l>>0],a[l+1]=o[u+1>>>0],a[l+2]=o[u+2>>>0],a[l+3]=o[u+3>>>0],a[l+4]=o[u+4>>>0],a[l+5]=o[u+5>>>0],a[l+6]=o[u+6>>>0],a[l+7]=o[u+7>>>0],a[l+8]=o[u+8>>>0],a[l+9]=o[u+9>>>0],a[l+10]=o[u+10>>>0],a[l+11]=o[u+11>>>0],a[l+12]=o[u+12>>>0],a[l+13]=o[u+13>>>0],a[l+14]=o[u+14>>>0],a[l+15]=o[u+15>>>0]}}else var a=HEAPF32.subarray(n>>>2>>>0,n+t*64>>>2>>>0);GLctx.uniformMatrix4fv(webglGetUniformLocation(e),!!r,a)}_glUniformMatrix4fv.sig="viiip";var _emscripten_glUniformMatrix4fv=_glUniformMatrix4fv;_emscripten_glUniformMatrix4fv.sig="viiip";var _glUseProgram=e=>{e=GL.programs[e],GLctx.useProgram(e),GLctx.currentProgram=e};_glUseProgram.sig="vi";var _emscripten_glUseProgram=_glUseProgram;_emscripten_glUseProgram.sig="vi";var _glValidateProgram=e=>{GLctx.validateProgram(GL.programs[e])};_glValidateProgram.sig="vi";var _emscripten_glValidateProgram=_glValidateProgram;_emscripten_glValidateProgram.sig="vi";var _glVertexAttrib1f=(e,t)=>GLctx.vertexAttrib1f(e,t);_glVertexAttrib1f.sig="vif";var _emscripten_glVertexAttrib1f=_glVertexAttrib1f;_emscripten_glVertexAttrib1f.sig="vif";function _glVertexAttrib1fv(e,t){t>>>=0,GLctx.vertexAttrib1f(e,HEAPF32[t>>>2])}_glVertexAttrib1fv.sig="vip";var _emscripten_glVertexAttrib1fv=_glVertexAttrib1fv;_emscripten_glVertexAttrib1fv.sig="vip";var _glVertexAttrib2f=(e,t,r)=>GLctx.vertexAttrib2f(e,t,r);_glVertexAttrib2f.sig="viff";var _emscripten_glVertexAttrib2f=_glVertexAttrib2f;_emscripten_glVertexAttrib2f.sig="viff";function _glVertexAttrib2fv(e,t){t>>>=0,GLctx.vertexAttrib2f(e,HEAPF32[t>>>2],HEAPF32[t+4>>>2])}_glVertexAttrib2fv.sig="vip";var _emscripten_glVertexAttrib2fv=_glVertexAttrib2fv;_emscripten_glVertexAttrib2fv.sig="vip";var _glVertexAttrib3f=(e,t,r,n)=>GLctx.vertexAttrib3f(e,t,r,n);_glVertexAttrib3f.sig="vifff";var _emscripten_glVertexAttrib3f=_glVertexAttrib3f;_emscripten_glVertexAttrib3f.sig="vifff";function _glVertexAttrib3fv(e,t){t>>>=0,GLctx.vertexAttrib3f(e,HEAPF32[t>>>2],HEAPF32[t+4>>>2],HEAPF32[t+8>>>2])}_glVertexAttrib3fv.sig="vip";var _emscripten_glVertexAttrib3fv=_glVertexAttrib3fv;_emscripten_glVertexAttrib3fv.sig="vip";var _glVertexAttrib4f=(e,t,r,n,a)=>GLctx.vertexAttrib4f(e,t,r,n,a);_glVertexAttrib4f.sig="viffff";var _emscripten_glVertexAttrib4f=_glVertexAttrib4f;_emscripten_glVertexAttrib4f.sig="viffff";function _glVertexAttrib4fv(e,t){t>>>=0,GLctx.vertexAttrib4f(e,HEAPF32[t>>>2],HEAPF32[t+4>>>2],HEAPF32[t+8>>>2],HEAPF32[t+12>>>2])}_glVertexAttrib4fv.sig="vip";var _emscripten_glVertexAttrib4fv=_glVertexAttrib4fv;_emscripten_glVertexAttrib4fv.sig="vip";var _glVertexAttribDivisor=(e,t)=>{GLctx.vertexAttribDivisor(e,t)};_glVertexAttribDivisor.sig="vii";var _glVertexAttribDivisorANGLE=_glVertexAttribDivisor,_emscripten_glVertexAttribDivisorANGLE=_glVertexAttribDivisorANGLE;function _glVertexAttribPointer(e,t,r,n,a,o){o>>>=0,GLctx.vertexAttribPointer(e,t,r,!!n,a,o)}_glVertexAttribPointer.sig="viiiiip";var _emscripten_glVertexAttribPointer=_glVertexAttribPointer;_emscripten_glVertexAttribPointer.sig="viiiiip";var _glViewport=(e,t,r,n)=>GLctx.viewport(e,t,r,n);_glViewport.sig="viiii";var _emscripten_glViewport=_glViewport;_emscripten_glViewport.sig="viiii";function _emscripten_out(e){return e>>>=0,out(UTF8ToString(e))}_emscripten_out.sig="vp";class HandleAllocator{constructor(){this.allocated=[void 0],this.freelist=[]}get(t){return this.allocated[t]}has(t){return this.allocated[t]!==void 0}allocate(t){var r=this.freelist.pop()||this.allocated.length;return this.allocated[r]=t,r}free(t){this.allocated[t]=void 0,this.freelist.push(t)}}var promiseMap=new HandleAllocator,makePromise=()=>{var e={};return e.promise=new Promise((t,r)=>{e.reject=r,e.resolve=t}),e.id=promiseMap.allocate(e),e};function _emscripten_promise_create(){return makePromise().id}_emscripten_promise_create.sig="p";function _emscripten_promise_destroy(e){e>>>=0,promiseMap.free(e)}_emscripten_promise_destroy.sig="vp";var getPromise=e=>promiseMap.get(e).promise;function _emscripten_promise_resolve(e,t,r){e>>>=0,r>>>=0;var n=promiseMap.get(e);switch(t){case 0:n.resolve(r);return;case 1:n.resolve(getPromise(r));return;case 2:n.resolve(getPromise(r)),_emscripten_promise_destroy(r);return;case 3:n.reject(r);return}}_emscripten_promise_resolve.sig="vpip";var growMemory=e=>{var t=wasmMemory.buffer,r=(e-t.byteLength+65535)/65536;try{return wasmMemory.grow(r),updateMemoryViews(),1}catch(n){}};function _emscripten_resize_heap(e){e>>>=0;var t=HEAPU8.length,r=getHeapMax();if(e>r)return!1;for(var n=1;n<=4;n*=2){var a=t*(1+.2/n);a=Math.min(a,e+100663296);var o=Math.min(r,alignMemory(Math.max(e,a),65536)),l=growMemory(o);if(l)return!0}return!1}_emscripten_resize_heap.sig="ip";function _emscripten_wget_data(e,t,r,n){throw e>>>=0,t>>>=0,r>>>=0,n>>>=0,"Please compile your program with async support in order to use asynchronous operations like emscripten_wget_data"}_emscripten_wget_data.sig="vpppp";var getEnvStrings=()=>{if(!getEnvStrings.strings){var e=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:e,_:getExecutableName()};for(var r in ENV)ENV[r]===void 0?delete t[r]:t[r]=ENV[r];var n=[];for(var r in t)n.push("".concat(r,"=").concat(t[r]));getEnvStrings.strings=n}return getEnvStrings.strings},stringToAscii=(e,t)=>{for(var r=0;r>>0]=e.charCodeAt(r);HEAP8[t>>>0]=0},_environ_get=function(e,t){e>>>=0,t>>>=0;var r=0;return getEnvStrings().forEach((n,a)=>{var o=t+r;HEAPU32[e+a*4>>>2>>>0]=o,stringToAscii(n,o),r+=n.length+1}),0};_environ_get.sig="ipp";var _environ_sizes_get=function(e,t){e>>>=0,t>>>=0;var r=getEnvStrings();HEAPU32[e>>>2>>>0]=r.length;var n=0;return r.forEach(a=>n+=a.length+1),HEAPU32[t>>>2>>>0]=n,0};_environ_sizes_get.sig="ipp";function _fd_close(e){try{var t=SYSCALLS.getStreamFromFD(e);return FS.close(t),0}catch(r){if(typeof FS>"u"||r.name!=="ErrnoError")throw r;return r.errno}}_fd_close.sig="ii";function _fd_fdstat_get(e,t){t>>>=0;try{var r=0,n=0,a=0,o=SYSCALLS.getStreamFromFD(e),l=o.tty?2:FS.isDir(o.mode)?3:FS.isLink(o.mode)?7:4;return HEAP8[t>>>0]=l,HEAP16[t+2>>>1>>>0]=a,tempI64=[r>>>0,(tempDouble=r,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[t+8>>>2>>>0]=tempI64[0],HEAP32[t+12>>>2>>>0]=tempI64[1],tempI64=[n>>>0,(tempDouble=n,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[t+16>>>2>>>0]=tempI64[0],HEAP32[t+20>>>2>>>0]=tempI64[1],0}catch(u){if(typeof FS>"u"||u.name!=="ErrnoError")throw u;return u.errno}}_fd_fdstat_get.sig="iip";var doReadv=(e,t,r,n)=>{for(var a=0,o=0;o>>2>>>0],u=HEAPU32[t+4>>>2>>>0];t+=8;var _=FS.read(e,HEAP8,l,u,n);if(_<0)return-1;if(a+=_,_>>=0,r>>>=0;var l=convertI32PairToI53Checked(n,a);o>>>=0;try{if(isNaN(l))return 61;var u=SYSCALLS.getStreamFromFD(e),_=doReadv(u,t,r,l);return HEAPU32[o>>>2>>>0]=_,0}catch(d){if(typeof FS>"u"||d.name!=="ErrnoError")throw d;return d.errno}}_fd_pread.sig="iippiip";var doWritev=(e,t,r,n)=>{for(var a=0,o=0;o>>2>>>0],u=HEAPU32[t+4>>>2>>>0];t+=8;var _=FS.write(e,HEAP8,l,u,n);if(_<0)return-1;if(a+=_,_>>=0,r>>>=0;var l=convertI32PairToI53Checked(n,a);o>>>=0;try{if(isNaN(l))return 61;var u=SYSCALLS.getStreamFromFD(e),_=doWritev(u,t,r,l);return HEAPU32[o>>>2>>>0]=_,0}catch(d){if(typeof FS>"u"||d.name!=="ErrnoError")throw d;return d.errno}}_fd_pwrite.sig="iippiip";function _fd_read(e,t,r,n){t>>>=0,r>>>=0,n>>>=0;try{var a=SYSCALLS.getStreamFromFD(e),o=doReadv(a,t,r);return HEAPU32[n>>>2>>>0]=o,0}catch(l){if(typeof FS>"u"||l.name!=="ErrnoError")throw l;return l.errno}}_fd_read.sig="iippp";function _fd_seek(e,t,r,n,a){var o=convertI32PairToI53Checked(t,r);a>>>=0;try{if(isNaN(o))return 61;var l=SYSCALLS.getStreamFromFD(e);return FS.llseek(l,o,n),tempI64=[l.position>>>0,(tempDouble=l.position,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[a>>>2>>>0]=tempI64[0],HEAP32[a+4>>>2>>>0]=tempI64[1],l.getdents&&o===0&&n===0&&(l.getdents=null),0}catch(u){if(typeof FS>"u"||u.name!=="ErrnoError")throw u;return u.errno}}_fd_seek.sig="iiiiip";function _fd_sync(e){var r;try{var t=SYSCALLS.getStreamFromFD(e);return(r=t.stream_ops)!=null&&r.fsync?t.stream_ops.fsync(t):0}catch(n){if(typeof FS>"u"||n.name!=="ErrnoError")throw n;return n.errno}}_fd_sync.sig="ii";function _fd_write(e,t,r,n){t>>>=0,r>>>=0,n>>>=0;try{var a=SYSCALLS.getStreamFromFD(e),o=doWritev(a,t,r);return HEAPU32[n>>>2>>>0]=o,0}catch(l){if(typeof FS>"u"||l.name!=="ErrnoError")throw l;return l.errno}}_fd_write.sig="iippp";function _getaddrinfo(e,t,r,n){e>>>=0,t>>>=0,r>>>=0,n>>>=0;var a=[],o=null,l=0,u=0,_=0,d=0,f=0,p=0,m,h;function g(v,b,S,L,x,T){var w,F,E,A;return F=v===10?28:16,x=v===10?inetNtop6(x):inetNtop4(x),w=_malloc(F),A=writeSockaddr(w,v,x,T),assert(!A),E=_malloc(32),HEAP32[E+4>>>2>>>0]=v,HEAP32[E+8>>>2>>>0]=b,HEAP32[E+12>>>2>>>0]=S,HEAPU32[E+24>>>2>>>0]=L,HEAPU32[E+20>>>2>>>0]=w,v===10?HEAP32[E+16>>>2>>>0]=28:HEAP32[E+16>>>2>>>0]=16,HEAP32[E+28>>>2>>>0]=0,E}if(r&&(_=HEAP32[r>>>2>>>0],d=HEAP32[r+4>>>2>>>0],f=HEAP32[r+8>>>2>>>0],p=HEAP32[r+12>>>2>>>0]),f&&!p&&(p=f===2?17:6),!f&&p&&(f=p===17?2:1),p===0&&(p=6),f===0&&(f=1),!e&&!t)return-2;if(_&-1088||r!==0&&HEAP32[r>>>2>>>0]&2&&!e)return-1;if(_&32)return-2;if(f!==0&&f!==1&&f!==2)return-7;if(d!==0&&d!==2&&d!==10)return-6;if(t&&(t=UTF8ToString(t),u=parseInt(t,10),isNaN(u)))return _&1024?-2:-8;if(!e)return d===0&&(d=2),_&1||(d===2?l=_htonl(2130706433):l=[0,0,0,1]),m=g(d,f,p,null,l,u),HEAPU32[n>>>2>>>0]=m,0;if(e=UTF8ToString(e),l=inetPton4(e),l!==null)if(d===0||d===2)d=2;else if(d===10&&_&8)l=[0,0,_htonl(65535),l],d=10;else return-2;else if(l=inetPton6(e),l!==null)if(d===0||d===10)d=10;else return-2;return l!=null?(m=g(d,f,p,e,l,u),HEAPU32[n>>>2>>>0]=m,0):_&4?-2:(e=DNS.lookup_name(e),l=inetPton4(e),d===0?d=2:d===10&&(l=[0,0,_htonl(65535),l]),m=g(d,f,p,null,l,u),HEAPU32[n>>>2>>>0]=m,0)}_getaddrinfo.sig="ipppp";function _getentropy(e,t){return e>>>=0,t>>>=0,randomFill(HEAPU8.subarray(e>>>0,e+t>>>0)),0}_getentropy.sig="ipp";function _getnameinfo(e,t,r,n,a,o,l){e>>>=0,r>>>=0,a>>>=0;var u=readSockaddr(e,t);if(u.errno)return-6;var _=u.port,d=u.addr,f=!1;if(r&&n){var p;if(l&1||!(p=DNS.lookup_addr(d))){if(l&8)return-2}else d=p;var m=stringToUTF8(d,r,n);m+1>=n&&(f=!0)}if(a&&o){_=""+_;var m=stringToUTF8(_,a,o);m+1>=o&&(f=!0)}return f?-12:0}_getnameinfo.sig="ipipipii";function _llvm_eh_typeid_for(e){return e>>>=0,e}_llvm_eh_typeid_for.sig="vp";function _pthread_kill(...e){return wasmImports.pthread_kill(...e)}_pthread_kill.stub=!0;var arraySum=(e,t)=>{for(var r=0,n=0;n<=t;r+=e[n++]);return r},MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31],MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31],addDays=(e,t)=>{for(var r=new Date(e.getTime());t>0;){var n=isLeapYear(r.getFullYear()),a=r.getMonth(),o=(n?MONTH_DAYS_LEAP:MONTH_DAYS_REGULAR)[a];if(t>o-r.getDate())t-=o-r.getDate()+1,r.setDate(1),a<11?r.setMonth(a+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1));else return r.setDate(r.getDate()+t),r}return r};function _strptime(e,t,r){e>>>=0,t>>>=0,r>>>=0;for(var n=UTF8ToString(t),a="\\!@#$^&*()+=-[]/{}|:<>?,.",o=0,l=a.length;ou[oe]||Z).replace(/%(.)/g,(Z,oe)=>{let Q=_[oe];return Q?(m.push(oe),"(".concat(Q,")")):oe}).replace(/\s+/g,"\\s*"),g=new RegExp("^"+h,"i").exec(UTF8ToString(e));function v(){function Z(oe,Q,Ie){return typeof oe!="number"||isNaN(oe)?Q:oe>=Q?oe<=Ie?oe:Ie:Q}return{year:Z(HEAP32[r+20>>>2>>>0]+1900,1970,9999),month:Z(HEAP32[r+16>>>2>>>0],0,11),day:Z(HEAP32[r+12>>>2>>>0],1,31),hour:Z(HEAP32[r+8>>>2>>>0],0,23),min:Z(HEAP32[r+4>>>2>>>0],0,59),sec:Z(HEAP32[r>>>2>>>0],0,59),gmtoff:0}}if(g){var b=v(),S,L=Z=>{var oe=m.indexOf(Z);if(oe>=0)return g[oe+1]};if((S=L("S"))&&(b.sec=jstoi_q(S)),(S=L("M"))&&(b.min=jstoi_q(S)),S=L("H"))b.hour=jstoi_q(S);else if(S=L("I")){var x=jstoi_q(S);(S=L("p"))&&(x+=S.toUpperCase()[0]==="P"?12:0),b.hour=x}if(S=L("Y"))b.year=jstoi_q(S);else if(S=L("y")){var T=jstoi_q(S);(S=L("C"))?T+=jstoi_q(S)*100:T+=T<69?2e3:1900,b.year=T}if((S=L("m"))?b.month=jstoi_q(S)-1:(S=L("b"))&&(b.month=d[S.substring(0,3).toUpperCase()]||0),S=L("d"))b.day=jstoi_q(S);else if(S=L("j"))for(var w=jstoi_q(S),F=isLeapYear(b.year),E=0;E<12;++E){var A=arraySum(F?MONTH_DAYS_LEAP:MONTH_DAYS_REGULAR,E-1);w<=A+(F?MONTH_DAYS_LEAP:MONTH_DAYS_REGULAR)[E]&&(b.day=w-A)}else if(S=L("a")){var C=S.substring(0,3).toUpperCase();if(S=L("U")){var D=f[C],P=jstoi_q(S),k=new Date(b.year,0,1),M;k.getDay()===0?M=addDays(k,D+7*(P-1)):M=addDays(k,7-k.getDay()+D+7*(P-1)),b.day=M.getDate(),b.month=M.getMonth()}else if(S=L("W")){var D=p[C],P=jstoi_q(S),k=new Date(b.year,0,1),M;k.getDay()===1?M=addDays(k,D+7*(P-1)):M=addDays(k,7-k.getDay()+1+D+7*(P-1)),b.day=M.getDate(),b.month=M.getMonth()}}if(S=L("z"))if(S.toLowerCase()==="z")b.gmtoff=0;else{var I=S.match(/^((?:\-|\+)\d\d):?(\d\d)?/);b.gmtoff=I[1]*3600,I[2]&&(b.gmtoff+=b.gmtoff>0?I[2]*60:-I[2]*60)}var X=new Date(b.year,b.month,b.day,b.hour,b.min,b.sec,0);return HEAP32[r>>>2>>>0]=X.getSeconds(),HEAP32[r+4>>>2>>>0]=X.getMinutes(),HEAP32[r+8>>>2>>>0]=X.getHours(),HEAP32[r+12>>>2>>>0]=X.getDate(),HEAP32[r+16>>>2>>>0]=X.getMonth(),HEAP32[r+20>>>2>>>0]=X.getFullYear()-1900,HEAP32[r+24>>>2>>>0]=X.getDay(),HEAP32[r+28>>>2>>>0]=arraySum(isLeapYear(X.getFullYear())?MONTH_DAYS_LEAP:MONTH_DAYS_REGULAR,X.getMonth()-1)+X.getDate()-1,HEAP32[r+32>>>2>>>0]=0,HEAP32[r+36>>>2>>>0]=b.gmtoff,e+intArrayFromString(g[0]).length-1}return 0}_strptime.sig="pppp";var getCFunc=e=>{var t=Module["_"+e];return t},writeArrayToMemory=(e,t)=>{HEAP8.set(e,t>>>0)},ccall=(e,t,r,n,a)=>{var o={string:g=>{var v=0;return g!=null&&g!==0&&(v=stringToUTF8OnStack(g)),v},array:g=>{var v=stackAlloc(g.length);return writeArrayToMemory(g,v),v}};function l(g){return t==="string"?UTF8ToString(g):t==="boolean"?!!g:g}var u=getCFunc(e),_=[],d=0;if(n)for(var f=0;f{t>9223372036854776e3?(HEAPU32[e>>>2>>>0]=4294967295,HEAPU32[e+4>>>2>>>0]=2147483647):t<-9223372036854776e3?(HEAPU32[e>>>2>>>0]=0,HEAPU32[e+4>>>2>>>0]=2147483648):writeI53ToI64(e,t)},writeI53ToI64Signaling=(e,t)=>{if(t>9223372036854776e3||t<-9223372036854776e3)throw"RangeError: ".concat(t);writeI53ToI64(e,t)},writeI53ToU64Clamped=(e,t)=>{t>18446744073709552e3?(HEAPU32[e>>>2>>>0]=4294967295,HEAPU32[e+4>>>2>>>0]=4294967295):t<0?(HEAPU32[e>>>2>>>0]=0,HEAPU32[e+4>>>2>>>0]=0):writeI53ToI64(e,t)},writeI53ToU64Signaling=(e,t)=>{if(t<0||t>18446744073709552e3)throw"RangeError: ".concat(t);writeI53ToI64(e,t)},readI53FromU64=e=>HEAPU32[e>>>2>>>0]+HEAPU32[e+4>>>2>>>0]*4294967296,convertI32PairToI53=(e,t)=>(e>>>0)+t*4294967296,convertU32PairToI53=(e,t)=>(e>>>0)+(t>>>0)*4294967296,getTempRet0=e=>__emscripten_tempret_get(),_stackAlloc=stackAlloc,_stackSave=stackSave,_stackRestore=stackSave,_getTempRet0=getTempRet0;Module._getTempRet0=_getTempRet0;var ptrToString=e=>"0x"+e.toString(16).padStart(8,"0");function _emscripten_notify_memory_growth(e){e>>>=0,updateMemoryViews()}_emscripten_notify_memory_growth.sig="vp";var withStackSave=e=>{var t=stackSave(),r=e();return stackRestore(t),r},ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135},strError=e=>UTF8ToString(_strerror(e)),Protocols={list:[],map:{}},_setprotoent=e=>{function t(o,l,u){var _=_malloc(o.length+1);stringToAscii(o,_);for(var d=0,f=u.length,p=_malloc((f+1)*4),m=0;m>>2>>>0]=g}HEAPU32[p+d>>>2>>>0]=0;var v=_malloc(12);return HEAPU32[v>>>2>>>0]=_,HEAPU32[v+4>>>2>>>0]=p,HEAP32[v+8>>>2>>>0]=l,v}var r=Protocols.list,n=Protocols.map;if(r.length===0){var a=t("tcp",6,["TCP"]);r.push(a),n.tcp=n[6]=a,a=t("udp",17,["UDP"]),r.push(a),n.udp=n[17]=a}_setprotoent.index=0};_setprotoent.sig="vi";var _endprotoent=()=>{};_endprotoent.sig="v";function _getprotoent(e){if(_setprotoent.index===Protocols.list.length)return 0;var t=Protocols.list[_setprotoent.index++];return t}_getprotoent.sig="p";function _getprotobyname(e){e>>>=0,e=UTF8ToString(e),_setprotoent(!0);var t=Protocols.map[e];return t}_getprotobyname.sig="pp";function _getprotobynumber(e){_setprotoent(!0);var t=Protocols.map[e];return t}_getprotobynumber.sig="pi";function _emscripten_run_script(ptr){ptr>>>=0,eval(UTF8ToString(ptr))}_emscripten_run_script.sig="vp";function _emscripten_run_script_int(ptr){return ptr>>>=0,eval(UTF8ToString(ptr))|0}_emscripten_run_script_int.sig="ip";function _emscripten_run_script_string(ptr){ptr>>>=0;var s=eval(UTF8ToString(ptr));if(s==null)return 0;s+="";var me=_emscripten_run_script_string,len=lengthBytesUTF8(s);return(!me.bufferSize||me.bufferSizeMath.random();_emscripten_random.sig="f";var warnOnce=e=>{warnOnce.shown||(warnOnce.shown={}),warnOnce.shown[e]||(warnOnce.shown[e]=1,ENVIRONMENT_IS_NODE&&(e="warning: "+e),err(e))};function jsStackTrace(){return new Error().stack.toString()}function getCallstack(e){var t=jsStackTrace(),r=t.lastIndexOf("_emscripten_log"),n=t.lastIndexOf("_emscripten_get_callstack"),a=t.indexOf("\n",Math.max(r,n))+1;t=t.slice(a),e&8&&typeof emscripten_source_map>"u"&&(warnOnce('Source map information is not available, emscripten_log with EM_LOG_C_STACK will be ignored. Build with "--pre-js $EMSCRIPTEN/src/emscripten-source-map.min.js" linker flag to add source map loading to code.'),e^=8,e|=16);var o=t.split("\n");t="";var l=new RegExp("\\s*(.*?)@(.*?):([0-9]+):([0-9]+)"),u=new RegExp("\\s*(.*?)@(.*):(.*)(:(.*))?"),_=new RegExp("\\s*at (.*?) \\((.*):(.*):(.*)\\)");for(var d in o){var f=o[d],p="",m="",h=0,g=0,v=_.exec(f);if(v&&v.length==5)p=v[1],m=v[2],h=v[3],g=v[4];else if(v=l.exec(f)||u.exec(f),v&&v.length>=4)p=v[1],m=v[2],h=v[3],g=v[4]|0;else{t+=f+"\n";continue}var b=!1;if(e&8){var S=emscripten_source_map.originalPositionFor({line:h,column:g});b=S==null?void 0:S.source,b&&(e&64&&(S.source=S.source.substring(S.source.replace(/\\/g,"/").lastIndexOf("/")+1)),t+=" at ".concat(p," (").concat(S.source,":").concat(S.line,":").concat(S.column,")\n"))}(e&16||!b)&&(e&64&&(m=m.substring(m.replace(/\\/g,"/").lastIndexOf("/")+1)),t+=(b?" = ".concat(p):" at ".concat(p))+" (".concat(m,":").concat(h,":").concat(g,")\n"))}return t=t.replace(/\s+$/,""),t}var emscriptenLog=(e,t)=>{e&24&&(t=t.replace(/\s+$/,""),t+=(t.length>0?"\n":"")+getCallstack(e)),e&1?e&4?console.error(t):e&2?console.warn(t):e&512?console.info(t):e&256?console.debug(t):console.log(t):e&6?err(t):out(t)},reallyNegative=e=>e<0||e===0&&1/e===-1/0,reSign=(e,t)=>{if(e<=0)return e;var r=t<=32?Math.abs(1<=r&&(t<=32||e>r)&&(e=-2*r+e),e},unSign=(e,t)=>e>=0?e:t<=32?2*Math.abs(1<{for(var t=e;HEAPU8[t>>>0];)++t;return t-e},formatString=(e,t)=>{var r=e,n=t;function a(we,ke){return(ke==="double"||ke==="i64")&&we&7&&(we+=4),we}function o(we){var ke;return n=a(n,we),we==="double"?(ke=HEAPF64[n>>>3>>>0],n+=8):we=="i64"?(ke=[HEAP32[n>>>2>>>0],HEAP32[n+4>>>2>>>0]],n+=8):(we="i32",ke=HEAP32[n>>>2>>>0],n+=4),ke}for(var l=[],u,_,d;;){var f=r;if(u=HEAP8[r>>>0],u===0)break;if(_=HEAP8[r+1>>>0],u==37){var p=!1,m=!1,h=!1,g=!1,v=!1;e:for(;;){switch(_){case 43:p=!0;break;case 45:m=!0;break;case 35:h=!0;break;case 48:if(g)break e;g=!0;break;case 32:v=!0;break;default:break e}r++,_=HEAP8[r+1>>>0]}var b=0;if(_==42)b=o("i32"),r++,_=HEAP8[r+1>>>0];else for(;_>=48&&_<=57;)b=b*10+(_-48),r++,_=HEAP8[r+1>>>0];var S=!1,L=-1;if(_==46){if(L=0,S=!0,r++,_=HEAP8[r+1>>>0],_==42)L=o("i32"),r++;else for(;;){var x=HEAP8[r+1>>>0];if(x<48||x>57)break;L=L*10+(x-48),r++}_=HEAP8[r+1>>>0]}L<0&&(L=6,S=!1);var T;switch(String.fromCharCode(_)){case"h":var w=HEAP8[r+2>>>0];w==104?(r++,T=1):T=2;break;case"l":var w=HEAP8[r+2>>>0];w==108?(r++,T=8):T=4;break;case"L":case"q":case"j":T=8;break;case"z":case"t":case"I":T=4;break;default:T=null}switch(T&&r++,_=HEAP8[r+1>>>0],String.fromCharCode(_)){case"d":case"i":case"u":case"o":case"x":case"X":case"p":{var F=_==100||_==105;T=T||4,d=o("i"+T*8);var E;if(T==8&&(d=_==117?convertU32PairToI53(d[0],d[1]):convertI32PairToI53(d[0],d[1])),T<=4){var A=Math.pow(256,T)-1;d=(F?reSign:unSign)(d&A,T*8)}var C=Math.abs(d),D="";if(_==100||_==105)E=reSign(d,8*T).toString(10);else if(_==117)E=unSign(d,8*T).toString(10),d=Math.abs(d);else if(_==111)E=(h?"0":"")+C.toString(8);else if(_==120||_==88){if(D=h&&d!=0?"0x":"",d<0){d=-d,E=(C-1).toString(16);for(var P=[],k=0;k=0&&(p?D="+"+D:v&&(D=" "+D)),E.charAt(0)=="-"&&(D="-"+D,E=E.substr(1));D.length+E.lengthl.push(we.charCodeAt(0)));break}case"f":case"F":case"e":case"E":case"g":case"G":{d=o("double");var E;if(isNaN(d))E="nan",g=!1;else if(!isFinite(d))E=(d<0?"-":"")+"inf",g=!1;else{var M=!1,I=Math.min(L,20);if(_==103||_==71){M=!0,L=L||1;var X=parseInt(d.toExponential(I).split("e")[1],10);L>X&&X>=-4?(_=(_==103?"f":"F").charCodeAt(0),L-=X+1):(_=(_==103?"e":"E").charCodeAt(0),L--),I=Math.min(L,20)}_==101||_==69?(E=d.toExponential(I),/[eE][-+]\d$/.test(E)&&(E=E.slice(0,-1)+"0"+E.slice(-1))):(_==102||_==70)&&(E=d.toFixed(I),d===0&&reallyNegative(d)&&(E="-"+E));var Z=E.split("e");if(M&&!h)for(;Z[0].length>1&&Z[0].includes(".")&&(Z[0].slice(-1)=="0"||Z[0].slice(-1)==".");)Z[0]=Z[0].slice(0,-1);else for(h&&E.indexOf(".")==-1&&(Z[0]+=".");L>I++;)Z[0]+="0";E=Z[0]+(Z.length>1?"e"+Z[1]:""),_==69&&(E=E.toUpperCase()),d>=0&&(p?E="+"+E:v&&(E=" "+E))}for(;E.lengthl.push(ke.charCodeAt(0)));break}case"s":{var oe=o("i8*"),Q=oe?strLen(oe):6;if(S&&(Q=Math.min(Q,L)),!m)for(;Q>>0]);else l=l.concat(intArrayFromString("(null)".substr(0,Q),!0));if(m)for(;Q0;)l.push(32);m||l.push(o("i8"));break}case"n":{var Ie=o("i32*");HEAP32[Ie>>>2>>>0]=l.length;break}case"%":{l.push(u);break}default:for(var k=f;k>>0])}r+=2}else l.push(u),r+=1}return l};function _emscripten_log(e,t,r){t>>>=0,r>>>=0;var n=formatString(t,r),a=UTF8ArrayToString(n,0);emscriptenLog(e,a)}_emscripten_log.sig="vipp";function _emscripten_get_compiler_setting(e){throw e>>>=0,"You must build with -sRETAIN_COMPILER_SETTINGS for getCompilerSetting or emscripten_get_compiler_setting to work"}_emscripten_get_compiler_setting.sig="pp";var _emscripten_has_asyncify=()=>0;_emscripten_has_asyncify.sig="i";function _emscripten_debugger(){debugger}_emscripten_debugger.sig="v";function _emscripten_print_double(e,t,r){t>>>=0;var n=e+"";return t?stringToUTF8(n,t,r):lengthBytesUTF8(n)}_emscripten_print_double.sig="idpi";function _emscripten_asm_const_double(e,t,r){return e>>>=0,t>>>=0,r>>>=0,runEmAsmFunction(e,t,r)}_emscripten_asm_const_double.sig="dppp";var runMainThreadEmAsm=(e,t,r,n)=>{var a=readEmAsmArgs(t,r);return ASM_CONSTS[e](...a)};function _emscripten_asm_const_int_sync_on_main_thread(e,t,r){return e>>>=0,t>>>=0,r>>>=0,runMainThreadEmAsm(e,t,r,1)}_emscripten_asm_const_int_sync_on_main_thread.sig="ippp";function _emscripten_asm_const_ptr_sync_on_main_thread(e,t,r){return e>>>=0,t>>>=0,r>>>=0,runMainThreadEmAsm(e,t,r,1)}_emscripten_asm_const_ptr_sync_on_main_thread.sig="pppp";var _emscripten_asm_const_double_sync_on_main_thread=_emscripten_asm_const_int_sync_on_main_thread;_emscripten_asm_const_double_sync_on_main_thread.sig="dppp";function _emscripten_asm_const_async_on_main_thread(e,t,r){return e>>>=0,t>>>=0,r>>>=0,runMainThreadEmAsm(e,t,r,0)}_emscripten_asm_const_async_on_main_thread.sig="vppp";var jstoi_s=Number;function __Unwind_Backtrace(e,t){e>>>=0,t>>>=0;for(var r=getCallstack(),n=r.split("\n"),a=0;a>>=0,t>>>=0,abort("Unwind_GetIPInfo")}__Unwind_GetIPInfo.sig="ppp";function __Unwind_FindEnclosingFunction(e){return e>>>=0,0}__Unwind_FindEnclosingFunction.sig="pp";function __Unwind_RaiseException(e){return e>>>=0,err("Warning: _Unwind_RaiseException is not correctly implemented"),___cxa_throw(e,0,0)}__Unwind_RaiseException.sig="ip";function __Unwind_DeleteException(e){e>>>=0,err("TODO: Unwind_DeleteException")}__Unwind_DeleteException.sig="vp";var getDynCaller=(e,t)=>(...r)=>dynCall(e,t,r),_emscripten_exit_with_live_runtime=()=>{throw"unwind"};_emscripten_exit_with_live_runtime.sig="v";var _emscripten_force_exit=e=>{__emscripten_runtime_keepalive_clear(),_exit(e)};_emscripten_force_exit.sig="vi";function _emscripten_outn(e,t){return e>>>=0,t>>>=0,out(UTF8ToString(e,t))}_emscripten_outn.sig="vpp";function _emscripten_errn(e,t){return e>>>=0,t>>>=0,err(UTF8ToString(e,t))}_emscripten_errn.sig="vpp";var _emscripten_throw_number=e=>{throw e};_emscripten_throw_number.sig="vd";function _emscripten_throw_string(e){throw e>>>=0,UTF8ToString(e)}_emscripten_throw_string.sig="vp";var runtimeKeepalivePush=()=>{runtimeKeepaliveCounter+=1};runtimeKeepalivePush.sig="v";var runtimeKeepalivePop=()=>{runtimeKeepaliveCounter-=1};runtimeKeepalivePop.sig="v";var _emscripten_runtime_keepalive_push=runtimeKeepalivePush;_emscripten_runtime_keepalive_push.sig="v";var _emscripten_runtime_keepalive_pop=runtimeKeepalivePop;_emscripten_runtime_keepalive_pop.sig="v";var _emscripten_runtime_keepalive_check=keepRuntimeAlive;_emscripten_runtime_keepalive_check.sig="i";var asmjsMangle=e=>(e=="__main_argc_argv"&&(e="main"),e.startsWith("dynCall_")?e:"_"+e),___global_base=1024;function __emscripten_fs_load_embedded_files(e){e>>>=0;do{var t=HEAPU32[e>>>2>>>0];e+=4;var r=HEAPU32[e>>>2>>>0];e+=4;var n=HEAPU32[e>>>2>>>0];e+=4;var a=UTF8ToString(t);FS.createPath("/",PATH.dirname(a),!0,!0),FS.createDataFile(a,null,HEAP8.subarray(n>>>0,n+r>>>0),!0,!0,!0)}while(HEAPU32[e>>>2>>>0])}__emscripten_fs_load_embedded_files.sig="vp";var POINTER_SIZE=4;function getNativeTypeSize(e){switch(e){case"i1":case"i8":case"u8":return 1;case"i16":case"u16":return 2;case"i32":case"u32":return 4;case"i64":case"u64":return 8;case"float":return 4;case"double":return 8;default:{if(e[e.length-1]==="*")return POINTER_SIZE;if(e[0]==="i"){let t=Number(e.substr(1));return assert(t%8===0,"getNativeTypeSize invalid bits ".concat(t,", ").concat(e," type")),t/8}return 0}}}var STACK_SIZE=65536,STACK_ALIGN=16,ASSERTIONS=0,cwrap=(e,t,r,n)=>{var a=!r||r.every(l=>l==="number"||l==="boolean"),o=t!=="string";return o&&a&&!n?getCFunc(e):(...l)=>ccall(e,t,r,l,n)},removeFunction=e=>{functionsInTableMap.delete(getWasmTableEntry(e)),setWasmTableEntry(e,null),freeTableIndexes.push(e)},_emscripten_math_cbrt=Math.cbrt;_emscripten_math_cbrt.sig="dd";var _emscripten_math_pow=Math.pow;_emscripten_math_pow.sig="ddd";var _emscripten_math_random=Math.random;_emscripten_math_random.sig="d";var _emscripten_math_sign=Math.sign;_emscripten_math_sign.sig="dd";var _emscripten_math_sqrt=Math.sqrt;_emscripten_math_sqrt.sig="dd";var _emscripten_math_exp=Math.exp;_emscripten_math_exp.sig="dd";var _emscripten_math_expm1=Math.expm1;_emscripten_math_expm1.sig="dd";var _emscripten_math_fmod=(e,t)=>e%t;_emscripten_math_fmod.sig="ddd";var _emscripten_math_log=Math.log;_emscripten_math_log.sig="dd";var _emscripten_math_log1p=Math.log1p;_emscripten_math_log1p.sig="dd";var _emscripten_math_log10=Math.log10;_emscripten_math_log10.sig="dd";var _emscripten_math_log2=Math.log2;_emscripten_math_log2.sig="dd";var _emscripten_math_round=Math.round;_emscripten_math_round.sig="dd";var _emscripten_math_acos=Math.acos;_emscripten_math_acos.sig="dd";var _emscripten_math_acosh=Math.acosh;_emscripten_math_acosh.sig="dd";var _emscripten_math_asin=Math.asin;_emscripten_math_asin.sig="dd";var _emscripten_math_asinh=Math.asinh;_emscripten_math_asinh.sig="dd";var _emscripten_math_atan=Math.atan;_emscripten_math_atan.sig="dd";var _emscripten_math_atanh=Math.atanh;_emscripten_math_atanh.sig="dd";var _emscripten_math_atan2=Math.atan2;_emscripten_math_atan2.sig="ddd";var _emscripten_math_cos=Math.cos;_emscripten_math_cos.sig="dd";var _emscripten_math_cosh=Math.cosh;_emscripten_math_cosh.sig="dd";function _emscripten_math_hypot(e,t){t>>>=0;for(var r=[],n=0;n>>3>>>0]);return Math.hypot(...r)}_emscripten_math_hypot.sig="dip";var _emscripten_math_sin=Math.sin;_emscripten_math_sin.sig="dd";var _emscripten_math_sinh=Math.sinh;_emscripten_math_sinh.sig="dd";var _emscripten_math_tan=Math.tan;_emscripten_math_tan.sig="dd";var _emscripten_math_tanh=Math.tanh;_emscripten_math_tanh.sig="dd";function intArrayToString(e){for(var t=[],r=0;r255&&(n&=255),t.push(String.fromCharCode(n))}return t.join("")}var AsciiToString=e=>{e>>>=0;for(var t="";;){var r=HEAPU8[e++>>>0];if(!r)return t;t+=String.fromCharCode(r)}},JSEvents={removeAllEventListeners(){for(;JSEvents.eventHandlers.length;)JSEvents._removeHandler(JSEvents.eventHandlers.length-1);JSEvents.deferredCalls=[]},inEventHandler:0,deferredCalls:[],deferCall(e,t,r){function n(o,l){if(o.length!=l.length)return!1;for(var u in o)if(o[u]!=l[u])return!1;return!0}for(var a of JSEvents.deferredCalls)if(a.targetFunction==e&&n(a.argsList,r))return;JSEvents.deferredCalls.push({targetFunction:e,precedence:t,argsList:r}),JSEvents.deferredCalls.sort((o,l)=>o.precedencet.targetFunction!=e)},canPerformEventHandlerRequests(){return navigator.userActivation?navigator.userActivation.isActive:JSEvents.inEventHandler&&JSEvents.currentEventHandler.allowsDeferredCalls},runDeferredCalls(){if(JSEvents.canPerformEventHandlerRequests()){var e=JSEvents.deferredCalls;JSEvents.deferredCalls=[];for(var t of e)t.targetFunction(...t.argsList)}},eventHandlers:[],removeAllHandlersOnTarget:(e,t)=>{for(var r=0;re>2?UTF8ToString(e):e,specialHTMLTargets=[0,typeof document<"u"?document:0,typeof window<"u"?window:0],findEventTarget=e=>{e=maybeCStringToJsString(e);var t=specialHTMLTargets[e]||(typeof document<"u"?document.querySelector(e):void 0);return t},registerKeyEventCallback=(e,t,r,n,a,o,l)=>{JSEvents.keyEvent||(JSEvents.keyEvent=_malloc(160));var u=d=>{var f=JSEvents.keyEvent;HEAPF64[f>>>3>>>0]=d.timeStamp;var p=f>>>2;HEAP32[p+2>>>0]=d.location,HEAP8[f+12>>>0]=d.ctrlKey,HEAP8[f+13>>>0]=d.shiftKey,HEAP8[f+14>>>0]=d.altKey,HEAP8[f+15>>>0]=d.metaKey,HEAP8[f+16>>>0]=d.repeat,HEAP32[p+5>>>0]=d.charCode,HEAP32[p+6>>>0]=d.keyCode,HEAP32[p+7>>>0]=d.which,stringToUTF8(d.key||"",f+32,32),stringToUTF8(d.code||"",f+64,32),stringToUTF8(d.char||"",f+96,32),stringToUTF8(d.locale||"",f+128,32),getWasmTableEntry(n)(a,f,t)&&d.preventDefault()},_={target:findEventTarget(e),eventTypeString:o,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)},findCanvasEventTarget=findEventTarget;function _emscripten_set_keypress_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerKeyEventCallback(e,t,r,n,1,"keypress",a)}_emscripten_set_keypress_callback_on_thread.sig="ippipp";function _emscripten_set_keydown_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerKeyEventCallback(e,t,r,n,2,"keydown",a)}_emscripten_set_keydown_callback_on_thread.sig="ippipp";function _emscripten_set_keyup_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerKeyEventCallback(e,t,r,n,3,"keyup",a)}_emscripten_set_keyup_callback_on_thread.sig="ippipp";var getBoundingClientRect=e=>specialHTMLTargets.indexOf(e)<0?e.getBoundingClientRect():{left:0,top:0},fillMouseEventData=(e,t,r)=>{HEAPF64[e>>>3>>>0]=t.timeStamp;var n=e>>>2;HEAP32[n+2>>>0]=t.screenX,HEAP32[n+3>>>0]=t.screenY,HEAP32[n+4>>>0]=t.clientX,HEAP32[n+5>>>0]=t.clientY,HEAP8[e+24>>>0]=t.ctrlKey,HEAP8[e+25>>>0]=t.shiftKey,HEAP8[e+26>>>0]=t.altKey,HEAP8[e+27>>>0]=t.metaKey,HEAP16[n*2+14>>>0]=t.button,HEAP16[n*2+15>>>0]=t.buttons,HEAP32[n+8>>>0]=t.movementX,HEAP32[n+9>>>0]=t.movementY;var a=getBoundingClientRect(r);HEAP32[n+10>>>0]=t.clientX-(a.left|0),HEAP32[n+11>>>0]=t.clientY-(a.top|0)},registerMouseEventCallback=(e,t,r,n,a,o,l)=>{JSEvents.mouseEvent||(JSEvents.mouseEvent=_malloc(64)),e=findEventTarget(e);var u=(d=event)=>{fillMouseEventData(JSEvents.mouseEvent,d,e),getWasmTableEntry(n)(a,JSEvents.mouseEvent,t)&&d.preventDefault()},_={target:e,allowsDeferredCalls:o!="mousemove"&&o!="mouseenter"&&o!="mouseleave",eventTypeString:o,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)};function _emscripten_set_click_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerMouseEventCallback(e,t,r,n,4,"click",a)}_emscripten_set_click_callback_on_thread.sig="ippipp";function _emscripten_set_mousedown_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerMouseEventCallback(e,t,r,n,5,"mousedown",a)}_emscripten_set_mousedown_callback_on_thread.sig="ippipp";function _emscripten_set_mouseup_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerMouseEventCallback(e,t,r,n,6,"mouseup",a)}_emscripten_set_mouseup_callback_on_thread.sig="ippipp";function _emscripten_set_dblclick_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerMouseEventCallback(e,t,r,n,7,"dblclick",a)}_emscripten_set_dblclick_callback_on_thread.sig="ippipp";function _emscripten_set_mousemove_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerMouseEventCallback(e,t,r,n,8,"mousemove",a)}_emscripten_set_mousemove_callback_on_thread.sig="ippipp";function _emscripten_set_mouseenter_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerMouseEventCallback(e,t,r,n,33,"mouseenter",a)}_emscripten_set_mouseenter_callback_on_thread.sig="ippipp";function _emscripten_set_mouseleave_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerMouseEventCallback(e,t,r,n,34,"mouseleave",a)}_emscripten_set_mouseleave_callback_on_thread.sig="ippipp";function _emscripten_set_mouseover_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerMouseEventCallback(e,t,r,n,35,"mouseover",a)}_emscripten_set_mouseover_callback_on_thread.sig="ippipp";function _emscripten_set_mouseout_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerMouseEventCallback(e,t,r,n,36,"mouseout",a)}_emscripten_set_mouseout_callback_on_thread.sig="ippipp";function _emscripten_get_mouse_status(e){return e>>>=0,JSEvents.mouseEvent?(HEAP8.set(HEAP8.subarray(JSEvents.mouseEvent>>>0,JSEvents.mouseEvent+64>>>0),e>>>0),0):-7}_emscripten_get_mouse_status.sig="ip";var registerWheelEventCallback=(e,t,r,n,a,o,l)=>{JSEvents.wheelEvent||(JSEvents.wheelEvent=_malloc(96));var u=(d=event)=>{var f=JSEvents.wheelEvent;fillMouseEventData(f,d,e),HEAPF64[f+64>>>3>>>0]=d.deltaX,HEAPF64[f+72>>>3>>>0]=d.deltaY,HEAPF64[f+80>>>3>>>0]=d.deltaZ,HEAP32[f+88>>>2>>>0]=d.deltaMode,getWasmTableEntry(n)(a,f,t)&&d.preventDefault()},_={target:e,allowsDeferredCalls:!0,eventTypeString:o,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)};function _emscripten_set_wheel_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,e=findEventTarget(e),e?typeof e.onwheel<"u"?registerWheelEventCallback(e,t,r,n,9,"wheel",a):-1:-4}_emscripten_set_wheel_callback_on_thread.sig="ippipp";var registerUiEventCallback=(e,t,r,n,a,o,l)=>{JSEvents.uiEvent||(JSEvents.uiEvent=_malloc(36)),e=findEventTarget(e);var u=(d=event)=>{if(d.target==e){var f=document.body;if(f){var p=JSEvents.uiEvent;HEAP32[p>>>2>>>0]=0,HEAP32[p+4>>>2>>>0]=f.clientWidth,HEAP32[p+8>>>2>>>0]=f.clientHeight,HEAP32[p+12>>>2>>>0]=innerWidth,HEAP32[p+16>>>2>>>0]=innerHeight,HEAP32[p+20>>>2>>>0]=outerWidth,HEAP32[p+24>>>2>>>0]=outerHeight,HEAP32[p+28>>>2>>>0]=pageXOffset|0,HEAP32[p+32>>>2>>>0]=pageYOffset|0,getWasmTableEntry(n)(a,p,t)&&d.preventDefault()}}},_={target:e,eventTypeString:o,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)};function _emscripten_set_resize_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerUiEventCallback(e,t,r,n,10,"resize",a)}_emscripten_set_resize_callback_on_thread.sig="ippipp";function _emscripten_set_scroll_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerUiEventCallback(e,t,r,n,11,"scroll",a)}_emscripten_set_scroll_callback_on_thread.sig="ippipp";var registerFocusEventCallback=(e,t,r,n,a,o,l)=>{JSEvents.focusEvent||(JSEvents.focusEvent=_malloc(256));var u=(d=event)=>{var f=JSEvents.getNodeNameForTarget(d.target),p=d.target.id?d.target.id:"",m=JSEvents.focusEvent;stringToUTF8(f,m+0,128),stringToUTF8(p,m+128,128),getWasmTableEntry(n)(a,m,t)&&d.preventDefault()},_={target:findEventTarget(e),eventTypeString:o,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)};function _emscripten_set_blur_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerFocusEventCallback(e,t,r,n,12,"blur",a)}_emscripten_set_blur_callback_on_thread.sig="ippipp";function _emscripten_set_focus_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerFocusEventCallback(e,t,r,n,13,"focus",a)}_emscripten_set_focus_callback_on_thread.sig="ippipp";function _emscripten_set_focusin_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerFocusEventCallback(e,t,r,n,14,"focusin",a)}_emscripten_set_focusin_callback_on_thread.sig="ippipp";function _emscripten_set_focusout_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerFocusEventCallback(e,t,r,n,15,"focusout",a)}_emscripten_set_focusout_callback_on_thread.sig="ippipp";var fillDeviceOrientationEventData=(e,t,r)=>{HEAPF64[e>>>3>>>0]=t.alpha,HEAPF64[e+8>>>3>>>0]=t.beta,HEAPF64[e+16>>>3>>>0]=t.gamma,HEAP8[e+24>>>0]=t.absolute},registerDeviceOrientationEventCallback=(e,t,r,n,a,o,l)=>{JSEvents.deviceOrientationEvent||(JSEvents.deviceOrientationEvent=_malloc(32));var u=(d=event)=>{fillDeviceOrientationEventData(JSEvents.deviceOrientationEvent,d,e),getWasmTableEntry(n)(a,JSEvents.deviceOrientationEvent,t)&&d.preventDefault()},_={target:findEventTarget(e),eventTypeString:o,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)};function _emscripten_set_deviceorientation_callback_on_thread(e,t,r,n){return e>>>=0,r>>>=0,n>>>=0,registerDeviceOrientationEventCallback(2,e,t,r,16,"deviceorientation",n)}_emscripten_set_deviceorientation_callback_on_thread.sig="ipipp";function _emscripten_get_deviceorientation_status(e){return e>>>=0,JSEvents.deviceOrientationEvent?(HEAP32.set(HEAP32.subarray(JSEvents.deviceOrientationEvent>>>0,32),e>>>0),0):-7}_emscripten_get_deviceorientation_status.sig="ip";var fillDeviceMotionEventData=(e,t,r)=>{var n=0,a=t.acceleration;n|=a&&1;var o=t.accelerationIncludingGravity;n|=o&&2;var l=t.rotationRate;n|=l&&4,a=a||{},o=o||{},l=l||{},HEAPF64[e>>>3>>>0]=a.x,HEAPF64[e+8>>>3>>>0]=a.y,HEAPF64[e+16>>>3>>>0]=a.z,HEAPF64[e+24>>>3>>>0]=o.x,HEAPF64[e+32>>>3>>>0]=o.y,HEAPF64[e+40>>>3>>>0]=o.z,HEAPF64[e+48>>>3>>>0]=l.alpha,HEAPF64[e+56>>>3>>>0]=l.beta,HEAPF64[e+64>>>3>>>0]=l.gamma},registerDeviceMotionEventCallback=(e,t,r,n,a,o,l)=>{JSEvents.deviceMotionEvent||(JSEvents.deviceMotionEvent=_malloc(80));var u=(d=event)=>{fillDeviceMotionEventData(JSEvents.deviceMotionEvent,d,e),getWasmTableEntry(n)(a,JSEvents.deviceMotionEvent,t)&&d.preventDefault()},_={target:findEventTarget(e),eventTypeString:o,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)};function _emscripten_set_devicemotion_callback_on_thread(e,t,r,n){return e>>>=0,r>>>=0,n>>>=0,registerDeviceMotionEventCallback(2,e,t,r,17,"devicemotion",n)}_emscripten_set_devicemotion_callback_on_thread.sig="ipipp";function _emscripten_get_devicemotion_status(e){return e>>>=0,JSEvents.deviceMotionEvent?(HEAP32.set(HEAP32.subarray(JSEvents.deviceMotionEvent>>>0,80),e>>>0),0):-7}_emscripten_get_devicemotion_status.sig="ip";var screenOrientation=()=>{if(window.screen)return screen.orientation||screen.mozOrientation||screen.webkitOrientation},fillOrientationChangeEventData=e=>{var t=["portrait-primary","portrait-secondary","landscape-primary","landscape-secondary"],r=["portrait","portrait","landscape","landscape"],n=0,a=0,o=screenOrientation();typeof o=="object"?(n=t.indexOf(o.type),n<0&&(n=r.indexOf(o.type)),n>=0&&(n=1<>>2>>>0]=n,HEAP32[e+4>>>2>>>0]=a},registerOrientationChangeEventCallback=(e,t,r,n,a,o,l)=>{JSEvents.orientationChangeEvent||(JSEvents.orientationChangeEvent=_malloc(8));var u=(d=event)=>{var f=JSEvents.orientationChangeEvent;fillOrientationChangeEventData(f),getWasmTableEntry(n)(a,f,t)&&d.preventDefault()},_={target:e,eventTypeString:o,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)};function _emscripten_set_orientationchange_callback_on_thread(e,t,r,n){return e>>>=0,r>>>=0,n>>>=0,!window.screen||!screen.orientation?-1:registerOrientationChangeEventCallback(screen.orientation,e,t,r,18,"change",n)}_emscripten_set_orientationchange_callback_on_thread.sig="ipipp";function _emscripten_get_orientation_status(e){return e>>>=0,!screenOrientation()&&typeof orientation>"u"?-1:(fillOrientationChangeEventData(e),0)}_emscripten_get_orientation_status.sig="ip";var _emscripten_lock_orientation=e=>{var t=[];e&1&&t.push("portrait-primary"),e&2&&t.push("portrait-secondary"),e&4&&t.push("landscape-primary"),e&8&&t.push("landscape-secondary");var r;if(screen.lockOrientation)r=screen.lockOrientation(t);else if(screen.mozLockOrientation)r=screen.mozLockOrientation(t);else if(screen.webkitLockOrientation)r=screen.webkitLockOrientation(t);else return-1;return r?0:-6};_emscripten_lock_orientation.sig="ii";var _emscripten_unlock_orientation=()=>{if(screen.unlockOrientation)screen.unlockOrientation();else if(screen.mozUnlockOrientation)screen.mozUnlockOrientation();else if(screen.webkitUnlockOrientation)screen.webkitUnlockOrientation();else return-1;return 0};_emscripten_unlock_orientation.sig="i";var fillFullscreenChangeEventData=e=>{var t=document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement,r=!!t;HEAP8[e>>>0]=r,HEAP8[e+1>>>0]=JSEvents.fullscreenEnabled();var n=r?t:JSEvents.previousFullscreenElement,a=JSEvents.getNodeNameForTarget(n),o=(n==null?void 0:n.id)||"";stringToUTF8(a,e+2,128),stringToUTF8(o,e+130,128),HEAP32[e+260>>>2>>>0]=n?n.clientWidth:0,HEAP32[e+264>>>2>>>0]=n?n.clientHeight:0,HEAP32[e+268>>>2>>>0]=screen.width,HEAP32[e+272>>>2>>>0]=screen.height,r&&(JSEvents.previousFullscreenElement=t)},registerFullscreenChangeEventCallback=(e,t,r,n,a,o,l)=>{JSEvents.fullscreenChangeEvent||(JSEvents.fullscreenChangeEvent=_malloc(276));var u=(d=event)=>{var f=JSEvents.fullscreenChangeEvent;fillFullscreenChangeEventData(f),getWasmTableEntry(n)(a,f,t)&&d.preventDefault()},_={target:e,eventTypeString:o,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)};function _emscripten_set_fullscreenchange_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,JSEvents.fullscreenEnabled()?(e=findEventTarget(e),e?(registerFullscreenChangeEventCallback(e,t,r,n,19,"webkitfullscreenchange",a),registerFullscreenChangeEventCallback(e,t,r,n,19,"fullscreenchange",a)):-4):-1}_emscripten_set_fullscreenchange_callback_on_thread.sig="ippipp";function _emscripten_get_fullscreen_status(e){return e>>>=0,JSEvents.fullscreenEnabled()?(fillFullscreenChangeEventData(e),0):-1}_emscripten_get_fullscreen_status.sig="ip";function _emscripten_get_canvas_element_size(e,t,r){e>>>=0,t>>>=0,r>>>=0;var n=findCanvasEventTarget(e);if(!n)return-4;HEAP32[t>>>2>>>0]=n.width,HEAP32[r>>>2>>>0]=n.height}_emscripten_get_canvas_element_size.sig="ippp";var getCanvasElementSize=e=>{var t=stackSave(),r=stackAlloc(8),n=r+4,a=stringToUTF8OnStack(e.id),o=_emscripten_get_canvas_element_size(a,r,n),l=[HEAP32[r>>>2>>>0],HEAP32[n>>>2>>>0]];return stackRestore(t),l};function _emscripten_set_canvas_element_size(e,t,r){e>>>=0;var n=findCanvasEventTarget(e);return n?(n.width=t,n.height=r,0):-4}_emscripten_set_canvas_element_size.sig="ipii";var setCanvasElementSize=(e,t,r)=>{if(!e.controlTransferredOffscreen)e.width=t,e.height=r;else{var n=stackSave(),a=stringToUTF8OnStack(e.id);_emscripten_set_canvas_element_size(a,t,r),stackRestore(n)}},registerRestoreOldStyle=e=>{var t=getCanvasElementSize(e),r=t[0],n=t[1],a=e.style.width,o=e.style.height,l=e.style.backgroundColor,u=document.body.style.backgroundColor,_=e.style.paddingLeft,d=e.style.paddingRight,f=e.style.paddingTop,p=e.style.paddingBottom,m=e.style.marginLeft,h=e.style.marginRight,g=e.style.marginTop,v=e.style.marginBottom,b=document.body.style.margin,S=document.documentElement.style.overflow,L=document.body.scroll,x=e.style.imageRendering;function T(){var w=document.fullscreenElement||document.webkitFullscreenElement;w||(document.removeEventListener("fullscreenchange",T),document.removeEventListener("webkitfullscreenchange",T),setCanvasElementSize(e,r,n),e.style.width=a,e.style.height=o,e.style.backgroundColor=l,u||(document.body.style.backgroundColor="white"),document.body.style.backgroundColor=u,e.style.paddingLeft=_,e.style.paddingRight=d,e.style.paddingTop=f,e.style.paddingBottom=p,e.style.marginLeft=m,e.style.marginRight=h,e.style.marginTop=g,e.style.marginBottom=v,document.body.style.margin=b,document.documentElement.style.overflow=S,document.body.scroll=L,e.style.imageRendering=x,e.GLctxObject&&e.GLctxObject.GLctx.viewport(0,0,r,n),currentFullscreenStrategy.canvasResizedCallback&&getWasmTableEntry(currentFullscreenStrategy.canvasResizedCallback)(37,0,currentFullscreenStrategy.canvasResizedCallbackUserData))}return document.addEventListener("fullscreenchange",T),document.addEventListener("webkitfullscreenchange",T),T},setLetterbox=(e,t,r)=>{e.style.paddingLeft=e.style.paddingRight=r+"px",e.style.paddingTop=e.style.paddingBottom=t+"px"},JSEvents_resizeCanvasForFullscreen=(e,t)=>{var b,S;var r=registerRestoreOldStyle(e),n=t.softFullscreen?innerWidth:screen.width,a=t.softFullscreen?innerHeight:screen.height,o=getBoundingClientRect(e),l=o.width,u=o.height,_=getCanvasElementSize(e),d=_[0],f=_[1];if(t.scaleMode==3)setLetterbox(e,(a-u)/2,(n-l)/2),n=l,a=u;else if(t.scaleMode==2)if(n*f{if((t.scaleMode!=0||t.canvasResolutionScaleMode!=0)&&JSEvents_resizeCanvasForFullscreen(e,t),e.requestFullscreen)e.requestFullscreen();else if(e.webkitRequestFullscreen)e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);else return JSEvents.fullscreenEnabled()?-3:-1;return currentFullscreenStrategy=t,t.canvasResizedCallback&&getWasmTableEntry(t.canvasResizedCallback)(37,0,t.canvasResizedCallbackUserData),0},hideEverythingExceptGivenElement=e=>{for(var t=e,r=t.parentNode,n=[];t!=document.body;){for(var a=r.children,o=0;o{for(var t of e)t.node.style.display=t.displayState},currentFullscreenStrategy={},restoreOldWindowedStyle=null,softFullscreenResizeWebGLRenderTarget=()=>{var e=devicePixelRatio,t=currentFullscreenStrategy.canvasResolutionScaleMode==2,r=currentFullscreenStrategy.scaleMode==2,n=currentFullscreenStrategy.canvasResolutionScaleMode!=0,a=currentFullscreenStrategy.scaleMode==3,o=t?Math.round(innerWidth*e):innerWidth,l=t?Math.round(innerHeight*e):innerHeight,u=o,_=l,d=currentFullscreenStrategy.target,f=getCanvasElementSize(d),p=f[0],m=f[1],h;if(r&&(u*mp*_&&(u=_*p/m|0),h=(l-_)/2|0),n&&(setCanvasElementSize(d,u,_),d.GLctxObject&&d.GLctxObject.GLctx.viewport(0,0,u,_)),t&&(h/=e,u/=e,_/=e,u=Math.round(u*1e4)/1e4,_=Math.round(_*1e4)/1e4,h=Math.round(h*1e4)/1e4),a){var g=(innerHeight-jstoi_q(d.style.height))/2,v=(innerWidth-jstoi_q(d.style.width))/2;setLetterbox(d,g,v)}else{d.style.width=u+"px",d.style.height=_+"px";var v=(innerWidth-u)/2;setLetterbox(d,h,v)}!a&¤tFullscreenStrategy.canvasResizedCallback&&getWasmTableEntry(currentFullscreenStrategy.canvasResizedCallback)(37,0,currentFullscreenStrategy.canvasResizedCallbackUserData)},doRequestFullscreen=(e,t)=>JSEvents.fullscreenEnabled()?(e=findEventTarget(e),e?!e.requestFullscreen&&!e.webkitRequestFullscreen?-3:JSEvents.canPerformEventHandlerRequests()?JSEvents_requestFullscreen(e,t):t.deferUntilInEventHandler?(JSEvents.deferCall(JSEvents_requestFullscreen,1,[e,t]),1):-2:-4):-1;function _emscripten_request_fullscreen(e,t){e>>>=0;var r={scaleMode:0,canvasResolutionScaleMode:0,filteringMode:0,deferUntilInEventHandler:t,canvasResizedCallbackTargetThread:2};return doRequestFullscreen(e,r)}_emscripten_request_fullscreen.sig="ipi";function _emscripten_request_fullscreen_strategy(e,t,r){e>>>=0,r>>>=0;var n={scaleMode:HEAP32[r>>>2>>>0],canvasResolutionScaleMode:HEAP32[r+4>>>2>>>0],filteringMode:HEAP32[r+8>>>2>>>0],deferUntilInEventHandler:t,canvasResizedCallback:HEAP32[r+12>>>2>>>0],canvasResizedCallbackUserData:HEAP32[r+16>>>2>>>0]};return doRequestFullscreen(e,n)}_emscripten_request_fullscreen_strategy.sig="ipip";function _emscripten_enter_soft_fullscreen(e,t){if(e>>>=0,t>>>=0,e=findEventTarget(e),!e)return-4;var r={scaleMode:HEAP32[t>>>2>>>0],canvasResolutionScaleMode:HEAP32[t+4>>>2>>>0],filteringMode:HEAP32[t+8>>>2>>>0],canvasResizedCallback:HEAP32[t+12>>>2>>>0],canvasResizedCallbackUserData:HEAP32[t+16>>>2>>>0],target:e,softFullscreen:!0},n=JSEvents_resizeCanvasForFullscreen(e,r);document.documentElement.style.overflow="hidden",document.body.scroll="no",document.body.style.margin="0px";var a=hideEverythingExceptGivenElement(e);function o(){n(),restoreHiddenElements(a),removeEventListener("resize",softFullscreenResizeWebGLRenderTarget),r.canvasResizedCallback&&getWasmTableEntry(r.canvasResizedCallback)(37,0,r.canvasResizedCallbackUserData),currentFullscreenStrategy=0}return restoreOldWindowedStyle=o,currentFullscreenStrategy=r,addEventListener("resize",softFullscreenResizeWebGLRenderTarget),r.canvasResizedCallback&&getWasmTableEntry(r.canvasResizedCallback)(37,0,r.canvasResizedCallbackUserData),0}_emscripten_enter_soft_fullscreen.sig="ipp";var _emscripten_exit_soft_fullscreen=()=>(restoreOldWindowedStyle==null||restoreOldWindowedStyle(),restoreOldWindowedStyle=null,0);_emscripten_exit_soft_fullscreen.sig="i";var _emscripten_exit_fullscreen=()=>{if(!JSEvents.fullscreenEnabled())return-1;JSEvents.removeDeferredCalls(JSEvents_requestFullscreen);var e=specialHTMLTargets[1];if(e.exitFullscreen)e.fullscreenElement&&e.exitFullscreen();else if(e.webkitExitFullscreen)e.webkitFullscreenElement&&e.webkitExitFullscreen();else return-1;return 0};_emscripten_exit_fullscreen.sig="i";var fillPointerlockChangeEventData=e=>{var t=document.pointerLockElement||document.mozPointerLockElement||document.webkitPointerLockElement||document.msPointerLockElement,r=!!t;HEAP8[e>>>0]=r;var n=JSEvents.getNodeNameForTarget(t),a=(t==null?void 0:t.id)||"";stringToUTF8(n,e+1,128),stringToUTF8(a,e+129,128)},registerPointerlockChangeEventCallback=(e,t,r,n,a,o,l)=>{JSEvents.pointerlockChangeEvent||(JSEvents.pointerlockChangeEvent=_malloc(257));var u=(d=event)=>{var f=JSEvents.pointerlockChangeEvent;fillPointerlockChangeEventData(f),getWasmTableEntry(n)(a,f,t)&&d.preventDefault()},_={target:e,eventTypeString:o,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)};function _emscripten_set_pointerlockchange_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,!document||!document.body||!document.body.requestPointerLock&&!document.body.mozRequestPointerLock&&!document.body.webkitRequestPointerLock&&!document.body.msRequestPointerLock?-1:(e=findEventTarget(e),e?(registerPointerlockChangeEventCallback(e,t,r,n,20,"mozpointerlockchange",a),registerPointerlockChangeEventCallback(e,t,r,n,20,"webkitpointerlockchange",a),registerPointerlockChangeEventCallback(e,t,r,n,20,"mspointerlockchange",a),registerPointerlockChangeEventCallback(e,t,r,n,20,"pointerlockchange",a)):-4)}_emscripten_set_pointerlockchange_callback_on_thread.sig="ippipp";var registerPointerlockErrorEventCallback=(e,t,r,n,a,o,l)=>{var u=(d=event)=>{getWasmTableEntry(n)(a,0,t)&&d.preventDefault()},_={target:e,eventTypeString:o,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)};function _emscripten_set_pointerlockerror_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,!document||!document.body.requestPointerLock&&!document.body.mozRequestPointerLock&&!document.body.webkitRequestPointerLock&&!document.body.msRequestPointerLock?-1:(e=findEventTarget(e),e?(registerPointerlockErrorEventCallback(e,t,r,n,38,"mozpointerlockerror",a),registerPointerlockErrorEventCallback(e,t,r,n,38,"webkitpointerlockerror",a),registerPointerlockErrorEventCallback(e,t,r,n,38,"mspointerlockerror",a),registerPointerlockErrorEventCallback(e,t,r,n,38,"pointerlockerror",a)):-4)}_emscripten_set_pointerlockerror_callback_on_thread.sig="ippipp";function _emscripten_get_pointerlock_status(e){return e>>>=0,e&&fillPointerlockChangeEventData(e),!document.body||!document.body.requestPointerLock&&!document.body.mozRequestPointerLock&&!document.body.webkitRequestPointerLock&&!document.body.msRequestPointerLock?-1:0}_emscripten_get_pointerlock_status.sig="ip";var requestPointerLock=e=>{if(e.requestPointerLock)e.requestPointerLock();else return document.body.requestPointerLock?-3:-1;return 0};function _emscripten_request_pointerlock(e,t){return e>>>=0,e=findEventTarget(e),e?e.requestPointerLock?JSEvents.canPerformEventHandlerRequests()?requestPointerLock(e):t?(JSEvents.deferCall(requestPointerLock,2,[e]),1):-2:-1:-4}_emscripten_request_pointerlock.sig="ipi";var _emscripten_exit_pointerlock=()=>{if(JSEvents.removeDeferredCalls(requestPointerLock),document.exitPointerLock)document.exitPointerLock();else return-1;return 0};_emscripten_exit_pointerlock.sig="i";var _emscripten_vibrate=e=>navigator.vibrate?(navigator.vibrate(e),0):-1;_emscripten_vibrate.sig="ii";function _emscripten_vibrate_pattern(e,t){if(e>>>=0,!navigator.vibrate)return-1;for(var r=[],n=0;n>>2>>>0];r.push(a)}return navigator.vibrate(r),0}_emscripten_vibrate_pattern.sig="ipi";var fillVisibilityChangeEventData=e=>{var t=["hidden","visible","prerender","unloaded"],r=t.indexOf(document.visibilityState);HEAP8[e>>>0]=document.hidden,HEAP32[e+4>>>2>>>0]=r},registerVisibilityChangeEventCallback=(e,t,r,n,a,o,l)=>{JSEvents.visibilityChangeEvent||(JSEvents.visibilityChangeEvent=_malloc(8));var u=(d=event)=>{var f=JSEvents.visibilityChangeEvent;fillVisibilityChangeEventData(f),getWasmTableEntry(n)(a,f,t)&&d.preventDefault()},_={target:e,eventTypeString:o,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)};function _emscripten_set_visibilitychange_callback_on_thread(e,t,r,n){return e>>>=0,r>>>=0,n>>>=0,specialHTMLTargets[1]?registerVisibilityChangeEventCallback(specialHTMLTargets[1],e,t,r,21,"visibilitychange",n):-4}_emscripten_set_visibilitychange_callback_on_thread.sig="ipipp";function _emscripten_get_visibility_status(e){return e>>>=0,typeof document.visibilityState>"u"&&typeof document.hidden>"u"?-1:(fillVisibilityChangeEventData(e),0)}_emscripten_get_visibility_status.sig="ip";var registerTouchEventCallback=(e,t,r,n,a,o,l)=>{JSEvents.touchEvent||(JSEvents.touchEvent=_malloc(1552)),e=findEventTarget(e);var u=d=>{var f,p={},m=d.touches;for(let L of m)L.isChanged=L.onTarget=0,p[L.identifier]=L;for(let L of d.changedTouches)L.isChanged=1,p[L.identifier]=L;for(let L of d.targetTouches)p[L.identifier].onTarget=1;var h=JSEvents.touchEvent;HEAPF64[h>>>3>>>0]=d.timeStamp,HEAP8[h+12>>>0]=d.ctrlKey,HEAP8[h+13>>>0]=d.shiftKey,HEAP8[h+14>>>0]=d.altKey,HEAP8[h+15>>>0]=d.metaKey;var g=h+16,v=getBoundingClientRect(e),b=0;for(let L of Object.values(p)){var S=g>>>2;if(HEAP32[S+0>>>0]=L.identifier,HEAP32[S+1>>>0]=L.screenX,HEAP32[S+2>>>0]=L.screenY,HEAP32[S+3>>>0]=L.clientX,HEAP32[S+4>>>0]=L.clientY,HEAP32[S+5>>>0]=L.pageX,HEAP32[S+6>>>0]=L.pageY,HEAP8[g+28>>>0]=L.isChanged,HEAP8[g+29>>>0]=L.onTarget,HEAP32[S+8>>>0]=L.clientX-(v.left|0),HEAP32[S+9>>>0]=L.clientY-(v.top|0),g+=48,++b>31)break}HEAP32[h+8>>>2>>>0]=b,getWasmTableEntry(n)(a,h,t)&&d.preventDefault()},_={target:e,allowsDeferredCalls:o=="touchstart"||o=="touchend",eventTypeString:o,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)};function _emscripten_set_touchstart_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerTouchEventCallback(e,t,r,n,22,"touchstart",a)}_emscripten_set_touchstart_callback_on_thread.sig="ippipp";function _emscripten_set_touchend_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerTouchEventCallback(e,t,r,n,23,"touchend",a)}_emscripten_set_touchend_callback_on_thread.sig="ippipp";function _emscripten_set_touchmove_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerTouchEventCallback(e,t,r,n,24,"touchmove",a)}_emscripten_set_touchmove_callback_on_thread.sig="ippipp";function _emscripten_set_touchcancel_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerTouchEventCallback(e,t,r,n,25,"touchcancel",a)}_emscripten_set_touchcancel_callback_on_thread.sig="ippipp";var fillGamepadEventData=(e,t)=>{HEAPF64[e>>>3>>>0]=t.timestamp;for(var r=0;r>>3>>>0]=t.axes[r];for(var r=0;r>>3>>>0]=t.buttons[r].value:HEAPF64[e+r*8+528>>>3>>>0]=t.buttons[r];for(var r=0;r>>0]=t.buttons[r].pressed:HEAP8[e+r+1040>>>0]=t.buttons[r]==1;HEAP8[e+1104>>>0]=t.connected,HEAP32[e+1108>>>2>>>0]=t.index,HEAP32[e+8>>>2>>>0]=t.axes.length,HEAP32[e+12>>>2>>>0]=t.buttons.length,stringToUTF8(t.id,e+1112,64),stringToUTF8(t.mapping,e+1176,64)},registerGamepadEventCallback=(e,t,r,n,a,o,l)=>{JSEvents.gamepadEvent||(JSEvents.gamepadEvent=_malloc(1240));var u=(d=event)=>{var f=JSEvents.gamepadEvent;fillGamepadEventData(f,d.gamepad),getWasmTableEntry(n)(a,f,t)&&d.preventDefault()},_={target:findEventTarget(e),allowsDeferredCalls:!0,eventTypeString:o,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)},_emscripten_sample_gamepad_data=()=>{try{if(navigator.getGamepads)return(JSEvents.lastGamepadState=navigator.getGamepads())?0:-1}catch(e){navigator.getGamepads=null}return-1};_emscripten_sample_gamepad_data.sig="i";function _emscripten_set_gamepadconnected_callback_on_thread(e,t,r,n){return e>>>=0,r>>>=0,n>>>=0,_emscripten_sample_gamepad_data()?-1:registerGamepadEventCallback(2,e,t,r,26,"gamepadconnected",n)}_emscripten_set_gamepadconnected_callback_on_thread.sig="ipipp";function _emscripten_set_gamepaddisconnected_callback_on_thread(e,t,r,n){return e>>>=0,r>>>=0,n>>>=0,_emscripten_sample_gamepad_data()?-1:registerGamepadEventCallback(2,e,t,r,27,"gamepaddisconnected",n)}_emscripten_set_gamepaddisconnected_callback_on_thread.sig="ipipp";var _emscripten_get_num_gamepads=()=>JSEvents.lastGamepadState.length;_emscripten_get_num_gamepads.sig="i";function _emscripten_get_gamepad_status(e,t){return t>>>=0,e<0||e>=JSEvents.lastGamepadState.length?-5:JSEvents.lastGamepadState[e]?(fillGamepadEventData(t,JSEvents.lastGamepadState[e]),0):-7}_emscripten_get_gamepad_status.sig="iip";var registerBeforeUnloadEventCallback=(e,t,r,n,a,o)=>{var l=(_=event)=>{var d=getWasmTableEntry(n)(a,0,t);if(d&&(d=UTF8ToString(d)),d)return _.preventDefault(),_.returnValue=d,d},u={target:findEventTarget(e),eventTypeString:o,callbackfunc:n,handlerFunc:l,useCapture:r};return JSEvents.registerOrRemoveHandler(u)};function _emscripten_set_beforeunload_callback_on_thread(e,t,r){return e>>>=0,t>>>=0,r>>>=0,typeof onbeforeunload>"u"?-1:r!==1?-5:registerBeforeUnloadEventCallback(2,e,!0,t,28,"beforeunload")}_emscripten_set_beforeunload_callback_on_thread.sig="ippp";var fillBatteryEventData=(e,t)=>{HEAPF64[e>>>3>>>0]=t.chargingTime,HEAPF64[e+8>>>3>>>0]=t.dischargingTime,HEAPF64[e+16>>>3>>>0]=t.level,HEAP8[e+24>>>0]=t.charging},battery=()=>navigator.battery||navigator.mozBattery||navigator.webkitBattery,registerBatteryEventCallback=(e,t,r,n,a,o,l)=>{JSEvents.batteryEvent||(JSEvents.batteryEvent=_malloc(32));var u=(d=event)=>{var f=JSEvents.batteryEvent;fillBatteryEventData(f,battery()),getWasmTableEntry(n)(a,f,t)&&d.preventDefault()},_={target:findEventTarget(e),eventTypeString:o,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)};function _emscripten_set_batterychargingchange_callback_on_thread(e,t,r){return e>>>=0,t>>>=0,r>>>=0,battery()?registerBatteryEventCallback(battery(),e,!0,t,29,"chargingchange",r):-1}_emscripten_set_batterychargingchange_callback_on_thread.sig="ippp";function _emscripten_set_batterylevelchange_callback_on_thread(e,t,r){return e>>>=0,t>>>=0,r>>>=0,battery()?registerBatteryEventCallback(battery(),e,!0,t,30,"levelchange",r):-1}_emscripten_set_batterylevelchange_callback_on_thread.sig="ippp";function _emscripten_get_battery_status(e){return e>>>=0,battery()?(fillBatteryEventData(e,battery()),0):-1}_emscripten_get_battery_status.sig="ip";function _emscripten_set_element_css_size(e,t,r){return e>>>=0,e=findEventTarget(e),e?(e.style.width=t+"px",e.style.height=r+"px",0):-4}_emscripten_set_element_css_size.sig="ipdd";function _emscripten_get_element_css_size(e,t,r){if(e>>>=0,t>>>=0,r>>>=0,e=findEventTarget(e),!e)return-4;var n=getBoundingClientRect(e);return HEAPF64[t>>>3>>>0]=n.width,HEAPF64[r>>>3>>>0]=n.height,0}_emscripten_get_element_css_size.sig="ippp";var _emscripten_html5_remove_all_event_listeners=()=>JSEvents.removeAllEventListeners();_emscripten_html5_remove_all_event_listeners.sig="v";var _emscripten_request_animation_frame=function(e,t){return e>>>=0,t>>>=0,requestAnimationFrame(r=>getWasmTableEntry(e)(r,t))};_emscripten_request_animation_frame.sig="ipp";var _emscripten_cancel_animation_frame=e=>cancelAnimationFrame(e);_emscripten_cancel_animation_frame.sig="vi";function _emscripten_request_animation_frame_loop(e,t){e>>>=0,t>>>=0;function r(n){getWasmTableEntry(e)(n,t)&&requestAnimationFrame(r)}return requestAnimationFrame(r)}_emscripten_request_animation_frame_loop.sig="vpp";var _emscripten_performance_now=()=>performance.now();_emscripten_performance_now.sig="d";var _emscripten_get_device_pixel_ratio=()=>typeof devicePixelRatio=="number"&&devicePixelRatio||1;_emscripten_get_device_pixel_ratio.sig="d";function _emscripten_get_callstack(e,t,r){t>>>=0;var n=getCallstack(e);if(!t||r<=0)return lengthBytesUTF8(n)+1;var a=stringToUTF8(n,t,r);return a+1}_emscripten_get_callstack.sig="iipi";var convertFrameToPC=e=>(abort("Cannot use convertFrameToPC (needed by __builtin_return_address) without -sUSE_OFFSET_CONVERTER"),0);function _emscripten_return_address(e){var t=jsStackTrace().split("\n");t[0]=="Error"&&t.shift();var r=t[e+3];return convertFrameToPC(r)}_emscripten_return_address.sig="pi";var UNWIND_CACHE={},saveInUnwindCache=e=>{e.forEach(t=>{var r=convertFrameToPC(t);r&&(UNWIND_CACHE[r]=t)})};function _emscripten_stack_snapshot(){var e=jsStackTrace().split("\n");return e[0]=="Error"&&e.shift(),saveInUnwindCache(e),UNWIND_CACHE.last_addr=convertFrameToPC(e[3]),UNWIND_CACHE.last_stack=e,UNWIND_CACHE.last_addr}_emscripten_stack_snapshot.sig="p";function _emscripten_stack_unwind_buffer(e,t,r){e>>>=0,t>>>=0;var n;UNWIND_CACHE.last_addr==e?n=UNWIND_CACHE.last_stack:(n=jsStackTrace().split("\n"),n[0]=="Error"&&n.shift(),saveInUnwindCache(n));for(var a=3;n[a]&&convertFrameToPC(n[a])!=e;)++a;for(var o=0;o>>2>>>0]=convertFrameToPC(n[o+a]);return o}_emscripten_stack_unwind_buffer.sig="ippi";function _emscripten_pc_get_function(e){return e>>>=0,abort("Cannot use emscripten_pc_get_function without -sUSE_OFFSET_CONVERTER"),0}_emscripten_pc_get_function.sig="pp";var convertPCtoSourceLocation=e=>{if(UNWIND_CACHE.last_get_source_pc==e)return UNWIND_CACHE.last_source;var t,r;if(!r){var n=UNWIND_CACHE[e];if(!n)return null;(t=/\((.*):(\d+):(\d+)\)$/.exec(n))?r={file:t[1],line:t[2],column:t[3]}:(t=/@(.*):(\d+):(\d+)/.exec(n))&&(r={file:t[1],line:t[2],column:t[3]})}return UNWIND_CACHE.last_get_source_pc=e,UNWIND_CACHE.last_source=r,r};function _emscripten_pc_get_file(e){e>>>=0;var t=convertPCtoSourceLocation(e);return t?(_emscripten_pc_get_file.ret&&_free(_emscripten_pc_get_file.ret),_emscripten_pc_get_file.ret=stringToNewUTF8(t.file),_emscripten_pc_get_file.ret):0}_emscripten_pc_get_file.sig="pp";function _emscripten_pc_get_line(e){e>>>=0;var t=convertPCtoSourceLocation(e);return t?t.line:0}_emscripten_pc_get_line.sig="ip";function _emscripten_pc_get_column(e){e>>>=0;var t=convertPCtoSourceLocation(e);return t&&t.column||0}_emscripten_pc_get_column.sig="ip";var _sched_yield=()=>0;Module._sched_yield=_sched_yield,_sched_yield.sig="i";function _random_get(e,t){e>>>=0,t>>>=0;try{return _getentropy(e,t),0}catch(r){if(typeof FS>"u"||r.name!=="ErrnoError")throw r;return r.errno}}_random_get.sig="ipp";var checkWasiClock=e=>e==0||e==1||e==2||e==3;function _clock_time_get(e,t,r,n){var a=convertI32PairToI53Checked(t,r);if(n>>>=0,!checkWasiClock(e))return 28;var o;if(e===0)o=Date.now();else if(nowIsMonotonic)o=_emscripten_get_now();else return 52;var l=Math.round(o*1e3*1e3);return HEAP32[n>>>2>>>0]=l>>>0,HEAP32[n+4>>>2>>>0]=l/Math.pow(2,32)>>>0,0}_clock_time_get.sig="iiiip";function _clock_res_get(e,t){if(t>>>=0,!checkWasiClock(e))return 28;var r;if(e===0)r=1e6;else if(nowIsMonotonic)r=_emscripten_get_now_res();else return 52;return HEAP32[t>>>2>>>0]=r>>>0,HEAP32[t+4>>>2>>>0]=r/Math.pow(2,32)>>>0,0}_clock_res_get.sig="iip";var wasiRightsToMuslOFlags=e=>{if(e&2&&e&64)return 2;if(e&2)return 0;if(e&64)return 1;throw new FS.ErrnoError(28)},wasiOFlagsToMuslOFlags=e=>{var t=0;return e&1&&(t|=64),e&8&&(t|=512),e&2&&(t|=65536),e&4&&(t|=128),t},_emscripten_unwind_to_js_event_loop=()=>{throw"unwind"};_emscripten_unwind_to_js_event_loop.sig="v";var safeSetTimeout=(e,t)=>setTimeout(()=>{callUserCallback(e)},t),setImmediateWrapped=e=>{setImmediateWrapped.mapping||(setImmediateWrapped.mapping=[]);var t=setImmediateWrapped.mapping.length;return setImmediateWrapped.mapping[t]=setImmediate(()=>{setImmediateWrapped.mapping[t]=void 0,e()}),t},clearImmediateWrapped=e=>{clearImmediate(setImmediateWrapped.mapping[e]),setImmediateWrapped.mapping[e]=void 0},polyfillSetImmediate=()=>{},_emscripten_set_immediate=function(e,t){return e>>>=0,t>>>=0,emSetImmediate(()=>{callUserCallback(()=>getWasmTableEntry(e)(t))})};_emscripten_set_immediate.sig="ipp";var _emscripten_clear_immediate=e=>{emClearImmediate(e)};_emscripten_clear_immediate.sig="vi";var _emscripten_set_immediate_loop=function(e,t){e>>>=0,t>>>=0;function r(){callUserCallback(()=>{getWasmTableEntry(e)(t)&&emSetImmediate(r)})}emSetImmediate(r)};_emscripten_set_immediate_loop.sig="vpp";var _emscripten_set_timeout=function(e,t,r){return e>>>=0,r>>>=0,safeSetTimeout(()=>getWasmTableEntry(e)(r),t)};_emscripten_set_timeout.sig="ipdp";var _emscripten_clear_timeout=clearTimeout;_emscripten_clear_timeout.sig="vi";var _emscripten_set_timeout_loop=function(e,t,r){e>>>=0,r>>>=0;function n(){var a=_emscripten_get_now(),o=a+t;callUserCallback(()=>{getWasmTableEntry(e)(a,r)&&setTimeout(n,o-_emscripten_get_now())})}return setTimeout(n,0)};_emscripten_set_timeout_loop.sig="vpdp";var _emscripten_set_interval=function(e,t,r){return e>>>=0,r>>>=0,setInterval(()=>{callUserCallback(()=>getWasmTableEntry(e)(r))},t)};_emscripten_set_interval.sig="ipdp";var _emscripten_clear_interval=e=>{clearInterval(e)};_emscripten_clear_interval.sig="vi";var registerPostMainLoop=e=>{typeof MainLoop<"u"&&MainLoop.postMainLoop.push(e)},registerPreMainLoop=e=>{typeof MainLoop<"u"&&MainLoop.preMainLoop.push(e)};function _emscripten_get_main_loop_timing(e,t){e>>>=0,t>>>=0,e&&(HEAP32[e>>>2>>>0]=MainLoop.timingMode),t&&(HEAP32[t>>>2>>>0]=MainLoop.timingValue)}_emscripten_get_main_loop_timing.sig="vpp";function _emscripten_set_main_loop(e,t,r){e>>>=0;var n=getWasmTableEntry(e);setMainLoop(n,t,r)}_emscripten_set_main_loop.sig="vpii";var _emscripten_set_main_loop_arg=function(e,t,r,n){e>>>=0,t>>>=0;var a=()=>getWasmTableEntry(e)(t);setMainLoop(a,r,n,t)};_emscripten_set_main_loop_arg.sig="vppii";var _emscripten_cancel_main_loop=()=>{MainLoop.pause(),MainLoop.func=null};_emscripten_cancel_main_loop.sig="v";var _emscripten_pause_main_loop=()=>{MainLoop.pause()};_emscripten_pause_main_loop.sig="v";var _emscripten_resume_main_loop=()=>{MainLoop.resume()};_emscripten_resume_main_loop.sig="v";var __emscripten_push_main_loop_blocker=function(e,t,r){e>>>=0,t>>>=0,r>>>=0,MainLoop.queue.push({func:()=>{getWasmTableEntry(e)(t)},name:UTF8ToString(r),counted:!0}),MainLoop.updateStatus()};__emscripten_push_main_loop_blocker.sig="vppp";var __emscripten_push_uncounted_main_loop_blocker=function(e,t,r){e>>>=0,t>>>=0,r>>>=0,MainLoop.queue.push({func:()=>{getWasmTableEntry(e)(t)},name:UTF8ToString(r),counted:!1}),MainLoop.updateStatus()};__emscripten_push_uncounted_main_loop_blocker.sig="vppp";var _emscripten_set_main_loop_expected_blockers=e=>{MainLoop.expectedBlockers=e,MainLoop.remainingBlockers=e,MainLoop.updateStatus()};_emscripten_set_main_loop_expected_blockers.sig="vi";var idsToPromises=(e,t)=>{for(var r=[],n=0;n>>2>>>0];r[n]=getPromise(a)}return r},makePromiseCallback=(e,t)=>r=>{var n=stackSave(),a=stackAlloc(POINTER_SIZE);HEAPU32[a>>>2>>>0]=0;try{var o=getWasmTableEntry(e)(a,t,r),l=HEAPU32[a>>>2>>>0]}catch(_){throw typeof _!="number"?0:_}finally{stackRestore(n)}switch(o){case 0:return l;case 1:return getPromise(l);case 2:var u=getPromise(l);return _emscripten_promise_destroy(l),u;case 3:throw l}};function _emscripten_promise_then(e,t,r,n){e>>>=0,t>>>=0,r>>>=0,n>>>=0;var a=getPromise(e),o=promiseMap.allocate({promise:a.then(makePromiseCallback(t,n),makePromiseCallback(r,n))});return o}_emscripten_promise_then.sig="ppppp";var _emscripten_promise_all=function(e,t,r){e>>>=0,t>>>=0,r>>>=0;var n=idsToPromises(e,r),a=promiseMap.allocate({promise:Promise.all(n).then(o=>{if(t)for(var l=0;l>>2>>>0]=u}return t})});return a};_emscripten_promise_all.sig="pppp";var setPromiseResult=(e,t,r)=>{var n=t?0:3;HEAP32[e>>>2>>>0]=n,HEAPU32[e+4>>>2>>>0]=r},_emscripten_promise_all_settled=function(e,t,r){e>>>=0,t>>>=0,r>>>=0;var n=idsToPromises(e,r),a=promiseMap.allocate({promise:Promise.allSettled(n).then(o=>{if(t)for(var l=t,u=0;u>>=0,t>>>=0,r>>>=0;var n=idsToPromises(e,r),a=promiseMap.allocate({promise:Promise.any(n).catch(o=>{if(t)for(var l=0;l>>2>>>0]=o.errors[l];throw t})});return a};_emscripten_promise_any.sig="pppp";function _emscripten_promise_race(e,t){e>>>=0,t>>>=0;var r=idsToPromises(e,t),n=promiseMap.allocate({promise:Promise.race(r)});return n}_emscripten_promise_race.sig="ppp";function _emscripten_promise_await(e,t){e>>>=0,t>>>=0,abort("emscripten_promise_await is only available with ASYNCIFY")}_emscripten_promise_await.sig="vpp";function ___cxa_call_unexpected(e){return e>>>=0,abort("Unexpected exception thrown, this is not properly supported - aborting")}___cxa_call_unexpected.sig="vp";var getExceptionMessageCommon=e=>{var t=stackSave(),r=stackAlloc(4),n=stackAlloc(4);___get_exception_message(e,r,n);var a=HEAPU32[r>>>2>>>0],o=HEAPU32[n>>>2>>>0],l=UTF8ToString(a);_free(a);var u;return o&&(u=UTF8ToString(o),_free(o)),stackRestore(t),[l,u]},incrementExceptionRefcount=e=>___cxa_increment_exception_refcount(e),decrementExceptionRefcount=e=>___cxa_decrement_exception_refcount(e),getExceptionMessage=e=>getExceptionMessageCommon(e),Browser={useWebGL:!1,isFullscreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init(){if(Browser.initted)return;Browser.initted=!0;var e={};e.canHandle=function(o){return!Module.noImageDecoding&&/\.(jpg|jpeg|png|bmp|webp)$/i.test(o)},e.handle=function(o,l,u,_){var d=new Blob([o],{type:Browser.getMimetype(l)});d.size!==o.length&&(d=new Blob([new Uint8Array(o).buffer],{type:Browser.getMimetype(l)}));var f=URL.createObjectURL(d),p=new Image;p.onload=()=>{var m=document.createElement("canvas");m.width=p.width,m.height=p.height;var h=m.getContext("2d");h.drawImage(p,0,0),preloadedImages[l]=m,URL.revokeObjectURL(f),u==null||u(o)},p.onerror=m=>{err("Image ".concat(f," could not be decoded")),_==null||_()},p.src=f},preloadPlugins.push(e);var t={};t.canHandle=function(o){return!Module.noAudioDecoding&&o.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},t.handle=function(o,l,u,_){var d=!1;function f(v){d||(d=!0,preloadedAudios[l]=v,u==null||u(o))}function p(){d||(d=!0,preloadedAudios[l]=new Audio,_==null||_())}var m=new Blob([o],{type:Browser.getMimetype(l)}),h=URL.createObjectURL(m),g=new Audio;g.addEventListener("canplaythrough",()=>f(g),!1),g.onerror=function(b){if(d)return;err("warning: browser could not fully decode audio ".concat(l,", trying slower base64 approach"));function S(L){for(var x="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",T="=",w="",F=0,E=0,A=0;A=6;){var C=F>>E-6&63;E-=6,w+=x[C]}return E==2?(w+=x[(F&3)<<4],w+=T+T):E==4&&(w+=x[(F&15)<<2],w+=T),w}g.src="data:audio/x-"+l.substr(-3)+";base64,"+S(o),f(g)},g.src=h,safeSetTimeout(()=>{f(g)},1e4)},preloadPlugins.push(t);function r(){Browser.pointerLock=document.pointerLockElement===Module.canvas||document.mozPointerLockElement===Module.canvas||document.webkitPointerLockElement===Module.canvas||document.msPointerLockElement===Module.canvas}var n=Module.canvas;n&&(n.requestPointerLock=n.requestPointerLock||n.mozRequestPointerLock||n.webkitRequestPointerLock||n.msRequestPointerLock||(()=>{}),n.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||(()=>{}),n.exitPointerLock=n.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",r,!1),document.addEventListener("mozpointerlockchange",r,!1),document.addEventListener("webkitpointerlockchange",r,!1),document.addEventListener("mspointerlockchange",r,!1),Module.elementPointerLock&&n.addEventListener("click",a=>{!Browser.pointerLock&&Module.canvas.requestPointerLock&&(Module.canvas.requestPointerLock(),a.preventDefault())},!1))},createContext(e,t,r,n){if(t&&Module.ctx&&e==Module.canvas)return Module.ctx;var a,o;if(t){var l={antialias:!1,alpha:!1,majorVersion:1};if(n)for(var u in n)l[u]=n[u];typeof GL<"u"&&(o=GL.createContext(e,l),o&&(a=GL.getContext(o).GLctx))}else a=e.getContext("2d");return a?(r&&(Module.ctx=a,t&&GL.makeContextCurrent(o),Browser.useWebGL=t,Browser.moduleContextCreatedCallbacks.forEach(_=>_()),Browser.init()),a):null},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen(e,t){Browser.lockPointer=e,Browser.resizeCanvas=t,typeof Browser.lockPointer>"u"&&(Browser.lockPointer=!0),typeof Browser.resizeCanvas>"u"&&(Browser.resizeCanvas=!1);var r=Module.canvas;function n(){var l,u;Browser.isFullscreen=!1;var o=r.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===o?(r.exitFullscreen=Browser.exitFullscreen,Browser.lockPointer&&r.requestPointerLock(),Browser.isFullscreen=!0,Browser.resizeCanvas?Browser.setFullscreenCanvasSize():Browser.updateCanvasDimensions(r)):(o.parentNode.insertBefore(r,o),o.parentNode.removeChild(o),Browser.resizeCanvas?Browser.setWindowedCanvasSize():Browser.updateCanvasDimensions(r)),(l=Module.onFullScreen)==null||l.call(Module,Browser.isFullscreen),(u=Module.onFullscreen)==null||u.call(Module,Browser.isFullscreen)}Browser.fullscreenHandlersInstalled||(Browser.fullscreenHandlersInstalled=!0,document.addEventListener("fullscreenchange",n,!1),document.addEventListener("mozfullscreenchange",n,!1),document.addEventListener("webkitfullscreenchange",n,!1),document.addEventListener("MSFullscreenChange",n,!1));var a=document.createElement("div");r.parentNode.insertBefore(a,r),a.appendChild(r),a.requestFullscreen=a.requestFullscreen||a.mozRequestFullScreen||a.msRequestFullscreen||(a.webkitRequestFullscreen?()=>a.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):null)||(a.webkitRequestFullScreen?()=>a.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT):null),a.requestFullscreen()},exitFullscreen(){if(!Browser.isFullscreen)return!1;var e=document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||(()=>{});return e.apply(document,[]),!0},safeSetTimeout(e,t){return safeSetTimeout(e,t)},getMimetype(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(e){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(e)},getMovementX(e){return e.movementX||e.mozMovementX||e.webkitMovementX||0},getMovementY(e){return e.movementY||e.mozMovementY||e.webkitMovementY||0},getMouseWheelDelta(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:{},calculateMouseCoords(e,t){var r=Module.canvas.getBoundingClientRect(),n=Module.canvas.width,a=Module.canvas.height,o=typeof window.scrollX<"u"?window.scrollX:window.pageXOffset,l=typeof window.scrollY<"u"?window.scrollY:window.pageYOffset,u=e-(o+r.left),_=t-(l+r.top);return u=u*(n/r.width),_=_*(a/r.height),{x:u,y:_}},setMouseCoords(e,t){let{x:r,y:n}=Browser.calculateMouseCoords(e,t);Browser.mouseMovementX=r-Browser.mouseX,Browser.mouseMovementY=n-Browser.mouseY,Browser.mouseX=r,Browser.mouseY=n},calculateMouseEvent(e){if(Browser.pointerLock)e.type!="mousemove"&&"mozMovementX"in e?Browser.mouseMovementX=Browser.mouseMovementY=0:(Browser.mouseMovementX=Browser.getMovementX(e),Browser.mouseMovementY=Browser.getMovementY(e)),Browser.mouseX+=Browser.mouseMovementX,Browser.mouseY+=Browser.mouseMovementY;else{if(e.type==="touchstart"||e.type==="touchend"||e.type==="touchmove"){var t=e.touch;if(t===void 0)return;var r=Browser.calculateMouseCoords(t.pageX,t.pageY);if(e.type==="touchstart")Browser.lastTouches[t.identifier]=r,Browser.touches[t.identifier]=r;else if(e.type==="touchend"||e.type==="touchmove"){var n=Browser.touches[t.identifier];n||(n=r),Browser.lastTouches[t.identifier]=n,Browser.touches[t.identifier]=r}return}Browser.setMouseCoords(e.pageX,e.pageY)}},resizeListeners:[],updateResizeListeners(){var e=Module.canvas;Browser.resizeListeners.forEach(t=>t(e.width,e.height))},setCanvasSize(e,t,r){var n=Module.canvas;Browser.updateCanvasDimensions(n,e,t),r||Browser.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize(){if(typeof SDL<"u"){var e=HEAPU32[SDL.screen>>>2>>>0];e=e|8388608,HEAP32[SDL.screen>>>2>>>0]=e}Browser.updateCanvasDimensions(Module.canvas),Browser.updateResizeListeners()},setWindowedCanvasSize(){if(typeof SDL<"u"){var e=HEAPU32[SDL.screen>>>2>>>0];e=e&-8388609,HEAP32[SDL.screen>>>2>>>0]=e}Browser.updateCanvasDimensions(Module.canvas),Browser.updateResizeListeners()},updateCanvasDimensions(e,t,r){t&&r?(e.widthNative=t,e.heightNative=r):(t=e.widthNative,r=e.heightNative);var n=t,a=r;if(Module.forcedAspectRatio&&Module.forcedAspectRatio>0&&(n/a>>=0,t>>>=0,r>>>=0;var n=UTF8ToString(e),a=FS.analyzePath(n);return a.exists?(FS.createPreloadedFile(PATH.dirname(n),PATH.basename(n),new Uint8Array(a.object.contents),!0,!0,()=>{t&&getWasmTableEntry(t)(e)},()=>{r&&getWasmTableEntry(r)(e)},!0),0):-1};_emscripten_run_preload_plugins.sig="ippp";var Browser_asyncPrepareDataCounter=0,_emscripten_run_preload_plugins_data=function(e,t,r,n,a,o){e>>>=0,r>>>=0,n>>>=0,a>>>=0,o>>>=0;var l=UTF8ToString(r),u="prepare_data_"+Browser_asyncPrepareDataCounter+++"."+l,_=stringToNewUTF8(u);FS.createPreloadedFile("/",u,HEAPU8.subarray(e>>>0,e+t>>>0),!0,!0,()=>{a&&getWasmTableEntry(a)(n,_)},()=>{o&&getWasmTableEntry(o)(n)},!0)};_emscripten_run_preload_plugins_data.sig="vpipppp";var _emscripten_async_run_script=function(e,t){e>>>=0,safeSetTimeout(()=>_emscripten_run_script(e),t)};_emscripten_async_run_script.sig="vpi";var _emscripten_async_load_script=function(url,onload,onerror){url>>>=0,onload>>>=0,onerror>>>=0,url=UTF8ToString(url);var loadDone=()=>{if(onload){var e=()=>callUserCallback(getWasmTableEntry(onload));runDependencies>0?dependenciesFulfilled=e:e()}},loadError=()=>{onerror&&callUserCallback(getWasmTableEntry(onerror))};if(ENVIRONMENT_IS_NODE){readAsync(url,!1).then(data=>{eval(data),loadDone()},loadError);return}var script=document.createElement("script");script.onload=loadDone,script.onerror=loadError,script.src=url,document.body.appendChild(script)};_emscripten_async_load_script.sig="vppp";var safeRequestAnimationFrame=e=>MainLoop.requestAnimationFrame(()=>{callUserCallback(e)});function _emscripten_async_call(e,t,r){e>>>=0,t>>>=0;function n(){getWasmTableEntry(e)(t)}r>=0||ENVIRONMENT_IS_NODE?safeSetTimeout(n,r):safeRequestAnimationFrame(n)}_emscripten_async_call.sig="vppi";function _emscripten_get_window_title(){var e=256;return _emscripten_get_window_title.buffer||(_emscripten_get_window_title.buffer=_malloc(e)),stringToUTF8(document.title,_emscripten_get_window_title.buffer,e),_emscripten_get_window_title.buffer}_emscripten_get_window_title.sig="p";function _emscripten_set_window_title(e){return e>>>=0,document.title=UTF8ToString(e)}_emscripten_set_window_title.sig="vp";function _emscripten_get_screen_size(e,t){e>>>=0,t>>>=0,HEAP32[e>>>2>>>0]=screen.width,HEAP32[t>>>2>>>0]=screen.height}_emscripten_get_screen_size.sig="vpp";var _emscripten_hide_mouse=()=>{for(var e=document.styleSheets[0],t=e.cssRules,r=0;r{Browser.setCanvasSize(e,t)};_emscripten_set_canvas_size.sig="vii";function _emscripten_get_canvas_size(e,t,r){e>>>=0,t>>>=0,r>>>=0;var n=Module.canvas;HEAP32[e>>>2>>>0]=n.width,HEAP32[t>>>2>>>0]=n.height,HEAP32[r>>>2>>>0]=Browser.isFullscreen?1:0}_emscripten_get_canvas_size.sig="vppp";function _emscripten_create_worker(e){e>>>=0,e=UTF8ToString(e);var t=Browser.workers.length,r={worker:new Worker(e),callbacks:[],awaited:0,buffer:0,bufferSize:0};return r.worker.onmessage=function(a){if(!ABORT){var o=Browser.workers[t];if(o){var l=a.data.callbackId,u=o.callbacks[l];if(u){a.data.finalResponse&&(o.awaited--,o.callbacks[l]=null);var _=a.data.data;_?(_.byteLength||(_=new Uint8Array(_)),(!o.buffer||o.bufferSize<_.length)&&(o.buffer&&_free(o.buffer),o.bufferSize=_.length,o.buffer=_malloc(_.length)),HEAPU8.set(_,o.buffer>>>0),u.func(o.buffer,_.length,u.arg)):u.func(0,0,u.arg)}}}},Browser.workers.push(r),t}_emscripten_create_worker.sig="ip";var _emscripten_destroy_worker=e=>{var t=Browser.workers[e];t.worker.terminate(),t.buffer&&_free(t.buffer),Browser.workers[e]=null};_emscripten_destroy_worker.sig="vi";function _emscripten_call_worker(e,t,r,n,a,o){t>>>=0,r>>>=0,a>>>=0,o>>>=0,t=UTF8ToString(t);var l=Browser.workers[e],u=-1;a&&(u=l.callbacks.length,l.callbacks.push({func:getWasmTableEntry(a),arg:o}),l.awaited++);var _={funcName:t,callbackId:u,data:r?new Uint8Array(HEAPU8.subarray(r>>>0,r+n>>>0)):0};r?l.worker.postMessage(_,[_.data.buffer]):l.worker.postMessage(_)}_emscripten_call_worker.sig="vippipp";var _emscripten_get_worker_queue_size=e=>{var t=Browser.workers[e];return t?t.awaited:-1};_emscripten_get_worker_queue_size.sig="ii";var getPreloadedImageData=(e,t,r)=>{e=PATH_FS.resolve(e);var n=preloadedImages[e];if(!n)return 0;var a=n.getContext("2d"),o=a.getImageData(0,0,n.width,n.height),l=_malloc(n.width*n.height*4);return HEAPU8.set(o.data,l>>>0),HEAP32[t>>>2>>>0]=n.width,HEAP32[r>>>2>>>0]=n.height,l};function _emscripten_get_preloaded_image_data(e,t,r){return e>>>=0,t>>>=0,r>>>=0,getPreloadedImageData(UTF8ToString(e),t,r)}_emscripten_get_preloaded_image_data.sig="pppp";var getPreloadedImageData__data=["$PATH_FS","malloc"];function _emscripten_get_preloaded_image_data_from_FILE(e,t,r){e>>>=0,t>>>=0,r>>>=0;var n=_fileno(e),a=FS.getStream(n);return a?getPreloadedImageData(a.path,t,r):0}_emscripten_get_preloaded_image_data_from_FILE.sig="pppp";var wget={wgetRequests:{},nextWgetRequestHandle:0,getNextWgetRequestHandle(){var e=wget.nextWgetRequestHandle;return wget.nextWgetRequestHandle++,e}},FS_mkdirTree=(e,t)=>FS.mkdirTree(e,t),FS_unlink=e=>FS.unlink(e),_emscripten_async_wget=function(e,t,r,n){e>>>=0,t>>>=0,r>>>=0,n>>>=0;var a=UTF8ToString(e),o=UTF8ToString(t);o=PATH_FS.resolve(o);function l(_){_&&callUserCallback(()=>{var d=stackSave();getWasmTableEntry(_)(stringToUTF8OnStack(o)),stackRestore(d)})}var u=PATH.dirname(o);FS_createPreloadedFile(u,PATH.basename(o),a,!0,!0,()=>l(r),()=>l(n),!1,!1,()=>{try{FS_unlink(o)}catch(_){}FS_mkdirTree(u)})};_emscripten_async_wget.sig="vpppp";var _emscripten_async_wget_data=function(e,t,r,n){e>>>=0,t>>>=0,r>>>=0,n>>>=0,asyncLoad(UTF8ToString(e),a=>{callUserCallback(()=>{var o=_malloc(a.length);HEAPU8.set(a,o>>>0),getWasmTableEntry(r)(t,o,a.length),_free(o)})},()=>{n&&callUserCallback(()=>{getWasmTableEntry(n)(t)})},!0)};_emscripten_async_wget_data.sig="vpppp";var _emscripten_async_wget2=function(e,t,r,n,a,o,l,u){e>>>=0,t>>>=0,r>>>=0,n>>>=0,a>>>=0,o>>>=0,l>>>=0,u>>>=0;var _=UTF8ToString(e),d=UTF8ToString(t);d=PATH_FS.resolve(d);var f=UTF8ToString(r),p=UTF8ToString(n),m=d.lastIndexOf("/"),h=new XMLHttpRequest;h.open(f,_,!0),h.responseType="arraybuffer";var g=wget.getNextWgetRequestHandle(),v=PATH.dirname(d);return h.onload=b=>{if(h.status>=200&&h.status<300){try{FS.unlink(d)}catch(L){}if(FS.mkdirTree(v),FS.createDataFile(d.substr(0,m),d.substr(m+1),new Uint8Array(h.response),!0,!0,!1),o){var S=stackSave();getWasmTableEntry(o)(g,a,stringToUTF8OnStack(d)),stackRestore(S)}}else l&&getWasmTableEntry(l)(g,a,h.status);delete wget.wgetRequests[g]},h.onerror=b=>{l&&getWasmTableEntry(l)(g,a,h.status),delete wget.wgetRequests[g]},h.onprogress=b=>{if(b.lengthComputable||b.lengthComputable===void 0&&b.total!=0){var S=b.loaded/b.total*100;u&&getWasmTableEntry(u)(g,a,S)}},h.onabort=b=>{delete wget.wgetRequests[g]},f=="POST"?(h.setRequestHeader("Content-type","application/x-www-form-urlencoded"),h.send(p)):h.send(null),wget.wgetRequests[g]=h,g};_emscripten_async_wget2.sig="ipppppppp";function _emscripten_async_wget2_data(e,t,r,n,a,o,l,u){e>>>=0,t>>>=0,r>>>=0,n>>>=0,o>>>=0,l>>>=0,u>>>=0;var _=UTF8ToString(e),d=UTF8ToString(t),f=UTF8ToString(r),p=new XMLHttpRequest;p.open(d,_,!0),p.responseType="arraybuffer";var m=wget.getNextWgetRequestHandle();function h(){if(l){var g=stackSave(),v=0;p.statusText&&(v=stringToUTF8OnStack(p.statusText)),getWasmTableEntry(l)(m,n,p.status,v),stackRestore(g)}}return p.onload=g=>{if(p.status>=200&&p.status<300||p.status===0&&_.substr(0,4).toLowerCase()!="http"){var v=new Uint8Array(p.response),b=_malloc(v.length);HEAPU8.set(v,b>>>0),o&&getWasmTableEntry(o)(m,n,b,v.length),a&&_free(b)}else h();delete wget.wgetRequests[m]},p.onerror=g=>{h(),delete wget.wgetRequests[m]},p.onprogress=g=>{u&&getWasmTableEntry(u)(m,n,g.loaded,g.lengthComputable||g.lengthComputable===void 0?g.total:0)},p.onabort=g=>{delete wget.wgetRequests[m]},d=="POST"?(p.setRequestHeader("Content-type","application/x-www-form-urlencoded"),p.send(f)):p.send(null),wget.wgetRequests[m]=p,m}_emscripten_async_wget2_data.sig="ippppippp";var _emscripten_async_wget2_abort=e=>{var t=wget.wgetRequests[e];t==null||t.abort()};_emscripten_async_wget2_abort.sig="vi";function ___asctime_r(e,t){e>>>=0,t>>>=0;var r={tm_sec:HEAP32[e>>>2>>>0],tm_min:HEAP32[e+4>>>2>>>0],tm_hour:HEAP32[e+8>>>2>>>0],tm_mday:HEAP32[e+12>>>2>>>0],tm_mon:HEAP32[e+16>>>2>>>0],tm_year:HEAP32[e+20>>>2>>>0],tm_wday:HEAP32[e+24>>>2>>>0]},n=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],o=n[r.tm_wday]+" "+a[r.tm_mon]+(r.tm_mday<10?" ":" ")+r.tm_mday+(r.tm_hour<10?" 0":" ")+r.tm_hour+(r.tm_min<10?":0":":")+r.tm_min+(r.tm_sec<10?":0":":")+r.tm_sec+" "+(1900+r.tm_year)+"\n";return stringToUTF8(o,t,26),t}___asctime_r.sig="ppp";function _strptime_l(e,t,r,n){return e>>>=0,t>>>=0,r>>>=0,n>>>=0,_strptime(e,t,r)}_strptime_l.sig="ppppp";function ___syscall_shutdown(e,t){try{return getSocketFromFD(e),-52}catch(r){if(typeof FS>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}Module.___syscall_shutdown=___syscall_shutdown,___syscall_shutdown.sig="iiiiiii";function __dlsym_catchup_js(e,t){e>>>=0;var r=LDSO.loadedLibsByHandle[e],n=r.exports,a=Object.keys(n)[t],o=n[a],l=addFunction(o,o.sig);return l}__dlsym_catchup_js.sig="ppi";var FS_createPath=FS.createPath,FS_createDevice=FS.createDevice,FS_readFile=FS.readFile,FS_createLazyFile=FS.createLazyFile,_setNetworkCallback=(e,t,r)=>{function n(a){try{if(e==="error"){var o=stackSave(),l=stringToUTF8OnStack(a[2]);getWasmTableEntry(r)(a[0],a[1],l,t),stackRestore(o)}else getWasmTableEntry(r)(a,t)}catch(u){if(!(u instanceof ExitStatus))throw u&&typeof u=="object"&&u.stack&&err("exception thrown: "+[u,u.stack]),u}}Module.websocket.on(e,r?n:null)};function _emscripten_set_socket_error_callback(e,t){e>>>=0,t>>>=0,_setNetworkCallback("error",e,t)}_emscripten_set_socket_error_callback.sig="vpp";function _emscripten_set_socket_open_callback(e,t){e>>>=0,t>>>=0,_setNetworkCallback("open",e,t)}_emscripten_set_socket_open_callback.sig="vpp";function _emscripten_set_socket_listen_callback(e,t){e>>>=0,t>>>=0,_setNetworkCallback("listen",e,t)}_emscripten_set_socket_listen_callback.sig="vpp";function _emscripten_set_socket_connection_callback(e,t){e>>>=0,t>>>=0,_setNetworkCallback("connection",e,t)}_emscripten_set_socket_connection_callback.sig="vpp";function _emscripten_set_socket_message_callback(e,t){e>>>=0,t>>>=0,_setNetworkCallback("message",e,t)}_emscripten_set_socket_message_callback.sig="vpp";function _emscripten_set_socket_close_callback(e,t){e>>>=0,t>>>=0,_setNetworkCallback("close",e,t)}_emscripten_set_socket_close_callback.sig="vpp";function _emscripten_webgl_enable_ANGLE_instanced_arrays(e){return e>>>=0,webgl_enable_ANGLE_instanced_arrays(GL.contexts[e].GLctx)}_emscripten_webgl_enable_ANGLE_instanced_arrays.sig="ip";function _emscripten_webgl_enable_OES_vertex_array_object(e){return e>>>=0,webgl_enable_OES_vertex_array_object(GL.contexts[e].GLctx)}_emscripten_webgl_enable_OES_vertex_array_object.sig="ip";function _emscripten_webgl_enable_WEBGL_draw_buffers(e){return e>>>=0,webgl_enable_WEBGL_draw_buffers(GL.contexts[e].GLctx)}_emscripten_webgl_enable_WEBGL_draw_buffers.sig="ip";function _emscripten_webgl_enable_WEBGL_multi_draw(e){return e>>>=0,webgl_enable_WEBGL_multi_draw(GL.contexts[e].GLctx)}_emscripten_webgl_enable_WEBGL_multi_draw.sig="ip";function _emscripten_webgl_enable_EXT_polygon_offset_clamp(e){return e>>>=0,webgl_enable_EXT_polygon_offset_clamp(GL.contexts[e].GLctx)}_emscripten_webgl_enable_EXT_polygon_offset_clamp.sig="ip";function _emscripten_webgl_enable_EXT_clip_control(e){return e>>>=0,webgl_enable_EXT_clip_control(GL.contexts[e].GLctx)}_emscripten_webgl_enable_EXT_clip_control.sig="ip";function _emscripten_webgl_enable_WEBGL_polygon_mode(e){return e>>>=0,webgl_enable_WEBGL_polygon_mode(GL.contexts[e].GLctx)}_emscripten_webgl_enable_WEBGL_polygon_mode.sig="ip";function _glVertexPointer(e,t,r,n){throw n>>>=0,"Legacy GL function (glVertexPointer) called. If you want legacy GL emulation, you need to compile with -sLEGACY_GL_EMULATION to enable legacy GL emulation."}_glVertexPointer.sig="viiip";var _glMatrixMode=()=>{throw"Legacy GL function (glMatrixMode) called. If you want legacy GL emulation, you need to compile with -sLEGACY_GL_EMULATION to enable legacy GL emulation."};_glMatrixMode.sig="vi";var _glBegin=()=>{throw"Legacy GL function (glBegin) called. If you want legacy GL emulation, you need to compile with -sLEGACY_GL_EMULATION to enable legacy GL emulation."};_glBegin.sig="vi";var _glLoadIdentity=()=>{throw"Legacy GL function (glLoadIdentity) called. If you want legacy GL emulation, you need to compile with -sLEGACY_GL_EMULATION to enable legacy GL emulation."};_glLoadIdentity.sig="v";var _glVertexAttribDivisorNV=_glVertexAttribDivisor,_glDrawArraysInstancedNV=_glDrawArraysInstanced,_glDrawElementsInstancedNV=_glDrawElementsInstanced,_glVertexAttribDivisorEXT=_glVertexAttribDivisor,_glDrawArraysInstancedEXT=_glDrawArraysInstanced,_glDrawElementsInstancedEXT=_glDrawElementsInstanced,_glVertexAttribDivisorARB=_glVertexAttribDivisor,_glDrawArraysInstancedARB=_glDrawArraysInstanced,_glDrawElementsInstancedARB=_glDrawElementsInstanced,_glDrawBuffersEXT=_glDrawBuffers;function _glMultiDrawArraysWEBGL(e,t,r,n){t>>>=0,r>>>=0,GLctx.multiDrawWebgl.multiDrawArraysWEBGL(e,HEAP32,t>>>2,HEAP32,r>>>2,n)}_glMultiDrawArraysWEBGL.sig="vippi";var _glMultiDrawArrays=_glMultiDrawArraysWEBGL;_glMultiDrawArrays.sig="vippi";var _glMultiDrawArraysANGLE=_glMultiDrawArraysWEBGL;function _glMultiDrawArraysInstancedWEBGL(e,t,r,n,a){t>>>=0,r>>>=0,n>>>=0,GLctx.multiDrawWebgl.multiDrawArraysInstancedWEBGL(e,HEAP32,t>>>2,HEAP32,r>>>2,HEAP32,n>>>2,a)}_glMultiDrawArraysInstancedWEBGL.sig="vipppi";var _glMultiDrawArraysInstancedANGLE=_glMultiDrawArraysInstancedWEBGL;function _glMultiDrawElementsWEBGL(e,t,r,n,a){t>>>=0,n>>>=0,GLctx.multiDrawWebgl.multiDrawElementsWEBGL(e,HEAP32,t>>>2,r,HEAP32,n>>>2,a)}_glMultiDrawElementsWEBGL.sig="vipipi";var _glMultiDrawElements=_glMultiDrawElementsWEBGL;_glMultiDrawElements.sig="vipipi";var _glMultiDrawElementsANGLE=_glMultiDrawElementsWEBGL;function _glMultiDrawElementsInstancedWEBGL(e,t,r,n,a,o){t>>>=0,n>>>=0,a>>>=0,GLctx.multiDrawWebgl.multiDrawElementsInstancedWEBGL(e,HEAP32,t>>>2,r,HEAP32,n>>>2,HEAP32,a>>>2,o)}_glMultiDrawElementsInstancedWEBGL.sig="vipippi";var _glMultiDrawElementsInstancedANGLE=_glMultiDrawElementsInstancedWEBGL,_glClearDepth=e=>GLctx.clearDepth(e);_glClearDepth.sig="vd";var _glDepthRange=(e,t)=>GLctx.depthRange(e,t);_glDepthRange.sig="vdd";var _emscripten_glGenVertexArrays=_glGenVertexArrays;_emscripten_glGenVertexArrays.sig="vip";var _emscripten_glDeleteVertexArrays=_glDeleteVertexArrays;_emscripten_glDeleteVertexArrays.sig="vip";var _emscripten_glBindVertexArray=_glBindVertexArray;_emscripten_glBindVertexArray.sig="vi";var _emscripten_glIsVertexArray=_glIsVertexArray;_emscripten_glIsVertexArray.sig="ii";var _emscripten_glVertexPointer=_glVertexPointer;_emscripten_glVertexPointer.sig="viiip";var _emscripten_glMatrixMode=_glMatrixMode;_emscripten_glMatrixMode.sig="vi";var _emscripten_glBegin=_glBegin;_emscripten_glBegin.sig="vi";var _emscripten_glLoadIdentity=_glLoadIdentity;_emscripten_glLoadIdentity.sig="v";var _emscripten_glVertexAttribDivisor=_glVertexAttribDivisor;_emscripten_glVertexAttribDivisor.sig="vii";var _emscripten_glDrawArraysInstanced=_glDrawArraysInstanced;_emscripten_glDrawArraysInstanced.sig="viiii";var _emscripten_glDrawElementsInstanced=_glDrawElementsInstanced;_emscripten_glDrawElementsInstanced.sig="viiipi";var _emscripten_glVertexAttribDivisorNV=_glVertexAttribDivisorNV,_emscripten_glDrawArraysInstancedNV=_glDrawArraysInstancedNV,_emscripten_glDrawElementsInstancedNV=_glDrawElementsInstancedNV,_emscripten_glVertexAttribDivisorEXT=_glVertexAttribDivisorEXT,_emscripten_glDrawArraysInstancedEXT=_glDrawArraysInstancedEXT,_emscripten_glDrawElementsInstancedEXT=_glDrawElementsInstancedEXT,_emscripten_glVertexAttribDivisorARB=_glVertexAttribDivisorARB,_emscripten_glDrawArraysInstancedARB=_glDrawArraysInstancedARB,_emscripten_glDrawElementsInstancedARB=_glDrawElementsInstancedARB,_emscripten_glDrawBuffers=_glDrawBuffers;_emscripten_glDrawBuffers.sig="vip";var _emscripten_glDrawBuffersEXT=_glDrawBuffersEXT,_emscripten_glMultiDrawArrays=_glMultiDrawArrays;_emscripten_glMultiDrawArrays.sig="vippi";var _emscripten_glMultiDrawArraysANGLE=_glMultiDrawArraysANGLE,_emscripten_glMultiDrawArraysWEBGL=_glMultiDrawArraysWEBGL,_emscripten_glMultiDrawArraysInstancedANGLE=_glMultiDrawArraysInstancedANGLE,_emscripten_glMultiDrawArraysInstancedWEBGL=_glMultiDrawArraysInstancedWEBGL,_emscripten_glMultiDrawElements=_glMultiDrawElements;_emscripten_glMultiDrawElements.sig="vipipi";var _emscripten_glMultiDrawElementsANGLE=_glMultiDrawElementsANGLE,_emscripten_glMultiDrawElementsWEBGL=_glMultiDrawElementsWEBGL,_emscripten_glMultiDrawElementsInstancedANGLE=_glMultiDrawElementsInstancedANGLE,_emscripten_glMultiDrawElementsInstancedWEBGL=_glMultiDrawElementsInstancedWEBGL,_emscripten_glClearDepth=_glClearDepth;_emscripten_glClearDepth.sig="vd";var _emscripten_glDepthRange=_glDepthRange;_emscripten_glDepthRange.sig="vdd";var writeGLArray=(e,t,r,n)=>{var a=e.length,o=r>>2;for(var u=0;u>>0]=e[u];return a},webglPowerPreferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(e,t){e>>>=0,t>>>=0;var r=t>>>2,n=HEAP32[r+2>>>0],a={alpha:!!HEAP8[t+0>>>0],depth:!!HEAP8[t+1>>>0],stencil:!!HEAP8[t+2>>>0],antialias:!!HEAP8[t+3>>>0],premultipliedAlpha:!!HEAP8[t+4>>>0],preserveDrawingBuffer:!!HEAP8[t+5>>>0],powerPreference:webglPowerPreferences[n],failIfMajorPerformanceCaveat:!!HEAP8[t+12>>>0],majorVersion:HEAP32[r+4>>>0],minorVersion:HEAP32[r+5>>>0],enableExtensionsByDefault:HEAP8[t+24>>>0],explicitSwapControl:HEAP8[t+25>>>0],proxyContextToMainThread:HEAP32[r+7>>>0],renderViaOffscreenBackBuffer:HEAP8[t+32>>>0]},o=findCanvasEventTarget(e);if(!o||a.explicitSwapControl)return 0;var l=GL.createContext(o,a);return l}_emscripten_webgl_do_create_context.sig="ppp";var _emscripten_webgl_create_context=_emscripten_webgl_do_create_context;_emscripten_webgl_create_context.sig="ppp";function _emscripten_webgl_do_get_current_context(){return GL.currentContext?GL.currentContext.handle:0}_emscripten_webgl_do_get_current_context.sig="p";var _emscripten_webgl_get_current_context=_emscripten_webgl_do_get_current_context;_emscripten_webgl_get_current_context.sig="p";var _emscripten_webgl_do_commit_frame=()=>!GL.currentContext||!GL.currentContext.GLctx||!GL.currentContext.attributes.explicitSwapControl?-3:0;_emscripten_webgl_do_commit_frame.sig="i";var _emscripten_webgl_commit_frame=_emscripten_webgl_do_commit_frame;_emscripten_webgl_commit_frame.sig="i";function _emscripten_webgl_make_context_current(e){e>>>=0;var t=GL.makeContextCurrent(e);return t?0:-5}_emscripten_webgl_make_context_current.sig="ip";function _emscripten_webgl_get_drawing_buffer_size(e,t,r){e>>>=0,t>>>=0,r>>>=0;var n=GL.getContext(e);return!n||!n.GLctx||!t||!r?-5:(HEAP32[t>>>2>>>0]=n.GLctx.drawingBufferWidth,HEAP32[r>>>2>>>0]=n.GLctx.drawingBufferHeight,0)}_emscripten_webgl_get_drawing_buffer_size.sig="ippp";function _emscripten_webgl_get_context_attributes(e,t){if(e>>>=0,t>>>=0,!t)return-5;if(e=GL.contexts[e],!e)return-3;var r=e.GLctx;if(!r)return-3;r=r.getContextAttributes(),HEAP8[t>>>0]=r.alpha,HEAP8[t+1>>>0]=r.depth,HEAP8[t+2>>>0]=r.stencil,HEAP8[t+3>>>0]=r.antialias,HEAP8[t+4>>>0]=r.premultipliedAlpha,HEAP8[t+5>>>0]=r.preserveDrawingBuffer;var n=r.powerPreference&&webglPowerPreferences.indexOf(r.powerPreference);return HEAP32[t+8>>>2>>>0]=n,HEAP8[t+12>>>0]=r.failIfMajorPerformanceCaveat,HEAP32[t+16>>>2>>>0]=e.version,HEAP32[t+20>>>2>>>0]=0,HEAP8[t+24>>>0]=e.attributes.enableExtensionsByDefault,0}_emscripten_webgl_get_context_attributes.sig="ipp";function _emscripten_webgl_destroy_context(e){e>>>=0,GL.currentContext==e&&(GL.currentContext=0),GL.deleteContext(e)}_emscripten_webgl_destroy_context.sig="ip";function _emscripten_webgl_enable_extension(e,t){e>>>=0,t>>>=0;var r=GL.getContext(e),n=UTF8ToString(t);n.startsWith("GL_")&&(n=n.substr(3)),n=="ANGLE_instanced_arrays"&&webgl_enable_ANGLE_instanced_arrays(GLctx),n=="OES_vertex_array_object"&&webgl_enable_OES_vertex_array_object(GLctx),n=="WEBGL_draw_buffers"&&webgl_enable_WEBGL_draw_buffers(GLctx),n=="WEBGL_multi_draw"&&webgl_enable_WEBGL_multi_draw(GLctx),n=="EXT_polygon_offset_clamp"&&webgl_enable_EXT_polygon_offset_clamp(GLctx),n=="EXT_clip_control"&&webgl_enable_EXT_clip_control(GLctx),n=="WEBGL_polygon_mode"&&webgl_enable_WEBGL_polygon_mode(GLctx);var a=r.GLctx.getExtension(n);return!!a}_emscripten_webgl_enable_extension.sig="ipp";var _emscripten_supports_offscreencanvas=()=>0;_emscripten_supports_offscreencanvas.sig="i";var registerWebGlEventCallback=(e,t,r,n,a,o,l)=>{var u=(d=event)=>{getWasmTableEntry(n)(a,0,t)&&d.preventDefault()},_={target:findEventTarget(e),eventTypeString:o,callbackfunc:n,handlerFunc:u,useCapture:r};JSEvents.registerOrRemoveHandler(_)};function _emscripten_set_webglcontextlost_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerWebGlEventCallback(e,t,r,n,31,"webglcontextlost",a),0}_emscripten_set_webglcontextlost_callback_on_thread.sig="ippipp";function _emscripten_set_webglcontextrestored_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,a>>>=0,registerWebGlEventCallback(e,t,r,n,32,"webglcontextrestored",a),0}_emscripten_set_webglcontextrestored_callback_on_thread.sig="ippipp";function _emscripten_is_webgl_context_lost(e){return e>>>=0,!GL.contexts[e]||GL.contexts[e].GLctx.isContextLost()}_emscripten_is_webgl_context_lost.sig="ip";function _emscripten_webgl_get_supported_extensions(){return stringToNewUTF8(GLctx.getSupportedExtensions().join(" "))}_emscripten_webgl_get_supported_extensions.sig="p";var _emscripten_webgl_get_program_parameter_d=(e,t)=>GLctx.getProgramParameter(GL.programs[e],t);_emscripten_webgl_get_program_parameter_d.sig="dii";function _emscripten_webgl_get_program_info_log_utf8(e){return stringToNewUTF8(GLctx.getProgramInfoLog(GL.programs[e]))}_emscripten_webgl_get_program_info_log_utf8.sig="pi";var _emscripten_webgl_get_shader_parameter_d=(e,t)=>GLctx.getShaderParameter(GL.shaders[e],t);_emscripten_webgl_get_shader_parameter_d.sig="dii";function _emscripten_webgl_get_shader_info_log_utf8(e){return stringToNewUTF8(GLctx.getShaderInfoLog(GL.shaders[e]))}_emscripten_webgl_get_shader_info_log_utf8.sig="pi";function _emscripten_webgl_get_shader_source_utf8(e){return stringToNewUTF8(GLctx.getShaderSource(GL.shaders[e]))}_emscripten_webgl_get_shader_source_utf8.sig="pi";var _emscripten_webgl_get_vertex_attrib_d=(e,t)=>GLctx.getVertexAttrib(e,t);_emscripten_webgl_get_vertex_attrib_d.sig="dii";var _emscripten_webgl_get_vertex_attrib_o=(e,t)=>{var r=GLctx.getVertexAttrib(e,t);return r==null?void 0:r.name};_emscripten_webgl_get_vertex_attrib_o.sig="iii";function _emscripten_webgl_get_vertex_attrib_v(e,t,r,n,a){return r>>>=0,writeGLArray(GLctx.getVertexAttrib(e,t),r,n,a)}_emscripten_webgl_get_vertex_attrib_v.sig="iiipii";var _emscripten_webgl_get_uniform_d=(e,t)=>GLctx.getUniform(GL.programs[e],webglGetUniformLocation(t));_emscripten_webgl_get_uniform_d.sig="dii";function _emscripten_webgl_get_uniform_v(e,t,r,n,a){return r>>>=0,writeGLArray(GLctx.getUniform(GL.programs[e],webglGetUniformLocation(t)),r,n,a)}_emscripten_webgl_get_uniform_v.sig="iiipii";function _emscripten_webgl_get_parameter_v(e,t,r,n){return t>>>=0,writeGLArray(GLctx.getParameter(e),t,r,n)}_emscripten_webgl_get_parameter_v.sig="iipii";var _emscripten_webgl_get_parameter_d=e=>GLctx.getParameter(e);_emscripten_webgl_get_parameter_d.sig="di";var _emscripten_webgl_get_parameter_o=e=>{var t=GLctx.getParameter(e);return t==null?void 0:t.name};_emscripten_webgl_get_parameter_o.sig="ii";function _emscripten_webgl_get_parameter_utf8(e){return stringToNewUTF8(GLctx.getParameter(e))}_emscripten_webgl_get_parameter_utf8.sig="pi";function _emscripten_webgl_get_parameter_i64v(e,t){return t>>>=0,writeI53ToI64(t,GLctx.getParameter(e))}_emscripten_webgl_get_parameter_i64v.sig="vip";var _glutPostRedisplay=()=>{GLUT.displayFunc&&!GLUT.requestedAnimationFrame&&(GLUT.requestedAnimationFrame=!0,MainLoop.requestAnimationFrame(()=>{GLUT.requestedAnimationFrame=!1,MainLoop.runIter(()=>getWasmTableEntry(GLUT.displayFunc)())}))};_glutPostRedisplay.sig="v";var GLUT={initTime:null,idleFunc:null,displayFunc:null,keyboardFunc:null,keyboardUpFunc:null,specialFunc:null,specialUpFunc:null,reshapeFunc:null,motionFunc:null,passiveMotionFunc:null,mouseFunc:null,buttons:0,modifiers:0,initWindowWidth:256,initWindowHeight:256,initDisplayMode:18,windowX:0,windowY:0,windowWidth:0,windowHeight:0,requestedAnimationFrame:!1,saveModifiers:e=>{GLUT.modifiers=0,e.shiftKey&&(GLUT.modifiers+=1),e.ctrlKey&&(GLUT.modifiers+=2),e.altKey&&(GLUT.modifiers+=4)},onMousemove:e=>{var t=Browser.mouseX,r=Browser.mouseY;Browser.calculateMouseEvent(e);var n=Browser.mouseX,a=Browser.mouseY;n==t&&a==r||(GLUT.buttons==0&&e.target==Module.canvas&&GLUT.passiveMotionFunc?(e.preventDefault(),GLUT.saveModifiers(e),getWasmTableEntry(GLUT.passiveMotionFunc)(t,r)):GLUT.buttons!=0&&GLUT.motionFunc&&(e.preventDefault(),GLUT.saveModifiers(e),getWasmTableEntry(GLUT.motionFunc)(t,r)))},getSpecialKey:e=>{var t=null;switch(e){case 8:t=120;break;case 46:t=111;break;case 112:t=1;break;case 113:t=2;break;case 114:t=3;break;case 115:t=4;break;case 116:t=5;break;case 117:t=6;break;case 118:t=7;break;case 119:t=8;break;case 120:t=9;break;case 121:t=10;break;case 122:t=11;break;case 123:t=12;break;case 37:t=100;break;case 38:t=101;break;case 39:t=102;break;case 40:t=103;break;case 33:t=104;break;case 34:t=105;break;case 36:t=106;break;case 35:t=107;break;case 45:t=108;break;case 16:case 5:t=112;break;case 6:t=113;break;case 17:case 3:t=114;break;case 4:t=115;break;case 18:case 2:t=116;break;case 1:t=117;break}return t},getASCIIKey:e=>{if(e.ctrlKey||e.altKey||e.metaKey)return null;var t=e.keyCode;if(48<=t&&t<=57)return t;if(65<=t&&t<=90)return e.shiftKey?t:t+32;if(96<=t&&t<=105)return t-48;if(106<=t&&t<=111)return t-106+42;switch(t){case 9:case 13:case 27:case 32:case 61:return t}var r=e.shiftKey;switch(t){case 186:return r?58:59;case 187:return r?43:61;case 188:return r?60:44;case 189:return r?95:45;case 190:return r?62:46;case 191:return r?63:47;case 219:return r?123:91;case 220:return r?124:47;case 221:return r?125:93;case 222:return r?34:39}return null},onKeydown:e=>{if(GLUT.specialFunc||GLUT.keyboardFunc){var t=GLUT.getSpecialKey(e.keyCode);t!==null?GLUT.specialFunc&&(e.preventDefault(),GLUT.saveModifiers(e),getWasmTableEntry(GLUT.specialFunc)(t,Browser.mouseX,Browser.mouseY)):(t=GLUT.getASCIIKey(e),t!==null&&GLUT.keyboardFunc&&(e.preventDefault(),GLUT.saveModifiers(e),getWasmTableEntry(GLUT.keyboardFunc)(t,Browser.mouseX,Browser.mouseY)))}},onKeyup:e=>{if(GLUT.specialUpFunc||GLUT.keyboardUpFunc){var t=GLUT.getSpecialKey(e.keyCode);t!==null?GLUT.specialUpFunc&&(e.preventDefault(),GLUT.saveModifiers(e),getWasmTableEntry(GLUT.specialUpFunc)(t,Browser.mouseX,Browser.mouseY)):(t=GLUT.getASCIIKey(e),t!==null&&GLUT.keyboardUpFunc&&(e.preventDefault(),GLUT.saveModifiers(e),getWasmTableEntry(GLUT.keyboardUpFunc)(t,Browser.mouseX,Browser.mouseY)))}},touchHandler:e=>{if(e.target==Module.canvas){var t=e.changedTouches,r=t[0],n="";switch(e.type){case"touchstart":n="mousedown";break;case"touchmove":n="mousemove";break;case"touchend":n="mouseup";break;default:return}var a=document.createEvent("MouseEvent");a.initMouseEvent(n,!0,!0,window,1,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),r.target.dispatchEvent(a),e.preventDefault()}},onMouseButtonDown:e=>{if(Browser.calculateMouseEvent(e),GLUT.buttons|=1<{Browser.calculateMouseEvent(e),GLUT.buttons&=~(1<{Browser.calculateMouseEvent(e);var t=window.event||e,r=-Browser.getMouseWheelDelta(e);r=r==0?0:r>0?Math.max(r,1):Math.min(r,-1);var n=3;r<0&&(n=4),GLUT.mouseFunc&&(e.preventDefault(),GLUT.saveModifiers(e),getWasmTableEntry(GLUT.mouseFunc)(n,0,Browser.mouseX,Browser.mouseY))},onFullscreenEventChange:e=>{var t,r;document.fullscreen||document.fullScreen||document.mozFullScreen||document.webkitIsFullScreen?(t=screen.width,r=screen.height):(t=GLUT.windowWidth,r=GLUT.windowHeight,document.removeEventListener("fullscreenchange",GLUT.onFullscreenEventChange,!0),document.removeEventListener("mozfullscreenchange",GLUT.onFullscreenEventChange,!0),document.removeEventListener("webkitfullscreenchange",GLUT.onFullscreenEventChange,!0)),Browser.setCanvasSize(t,r,!0),GLUT.reshapeFunc&&getWasmTableEntry(GLUT.reshapeFunc)(t,r),_glutPostRedisplay()}},_glutGetModifiers=()=>GLUT.modifiers;_glutGetModifiers.sig="i";function _glutInit(e,t){e>>>=0,t>>>=0,GLUT.initTime=Date.now();var r="ontouchstart"in document.documentElement;r&&(window.addEventListener("touchmove",GLUT.touchHandler,!0),window.addEventListener("touchstart",GLUT.touchHandler,!0),window.addEventListener("touchend",GLUT.touchHandler,!0)),window.addEventListener("keydown",GLUT.onKeydown,!0),window.addEventListener("keyup",GLUT.onKeyup,!0),window.addEventListener("mousemove",GLUT.onMousemove,!0),window.addEventListener("mousedown",GLUT.onMouseButtonDown,!0),window.addEventListener("mouseup",GLUT.onMouseButtonUp,!0),window.addEventListener("mousewheel",GLUT.onMouseWheel,!0),window.addEventListener("DOMMouseScroll",GLUT.onMouseWheel,!0),Browser.resizeListeners.push((n,a)=>{GLUT.reshapeFunc&&getWasmTableEntry(GLUT.reshapeFunc)(n,a)}),__ATEXIT__.push(()=>{r&&(window.removeEventListener("touchmove",GLUT.touchHandler,!0),window.removeEventListener("touchstart",GLUT.touchHandler,!0),window.removeEventListener("touchend",GLUT.touchHandler,!0)),window.removeEventListener("keydown",GLUT.onKeydown,!0),window.removeEventListener("keyup",GLUT.onKeyup,!0),window.removeEventListener("mousemove",GLUT.onMousemove,!0),window.removeEventListener("mousedown",GLUT.onMouseButtonDown,!0),window.removeEventListener("mouseup",GLUT.onMouseButtonUp,!0),window.removeEventListener("mousewheel",GLUT.onMouseWheel,!0),window.removeEventListener("DOMMouseScroll",GLUT.onMouseWheel,!0),Module.canvas.width=Module.canvas.height=1})}_glutInit.sig="vpp";var _glutInitWindowSize=(e,t)=>{Browser.setCanvasSize(GLUT.initWindowWidth=e,GLUT.initWindowHeight=t)};_glutInitWindowSize.sig="vii";var _glutInitWindowPosition=(e,t)=>{};_glutInitWindowPosition.sig="vii";var _glutGet=e=>{switch(e){case 100:return 0;case 101:return 0;case 102:return Module.canvas.width;case 103:return Module.canvas.height;case 200:return Module.canvas.width;case 201:return Module.canvas.height;case 500:return 0;case 501:return 0;case 502:return GLUT.initWindowWidth;case 503:return GLUT.initWindowHeight;case 700:var t=Date.now();return t-GLUT.initTime;case 105:return Module.ctx.getContextAttributes().stencil?8:0;case 106:return Module.ctx.getContextAttributes().depth?8:0;case 110:return Module.ctx.getContextAttributes().alpha?8:0;case 120:return Module.ctx.getContextAttributes().antialias?1:0;default:throw"glutGet("+e+") not implemented yet"}};_glutGet.sig="ii";function _glutIdleFunc(e){e>>>=0;function t(){GLUT.idleFunc&&(getWasmTableEntry(GLUT.idleFunc)(),safeSetTimeout(t,4))}GLUT.idleFunc||safeSetTimeout(t,0),GLUT.idleFunc=e}_glutIdleFunc.sig="vp";var _glutTimerFunc=function(e,t,r){return t>>>=0,safeSetTimeout(()=>getWasmTableEntry(t)(r),e)};_glutTimerFunc.sig="vipi";function _glutDisplayFunc(e){e>>>=0,GLUT.displayFunc=e}_glutDisplayFunc.sig="vp";function _glutKeyboardFunc(e){e>>>=0,GLUT.keyboardFunc=e}_glutKeyboardFunc.sig="vp";function _glutKeyboardUpFunc(e){e>>>=0,GLUT.keyboardUpFunc=e}_glutKeyboardUpFunc.sig="vp";function _glutSpecialFunc(e){e>>>=0,GLUT.specialFunc=e}_glutSpecialFunc.sig="vp";function _glutSpecialUpFunc(e){e>>>=0,GLUT.specialUpFunc=e}_glutSpecialUpFunc.sig="vp";function _glutReshapeFunc(e){e>>>=0,GLUT.reshapeFunc=e}_glutReshapeFunc.sig="vp";function _glutMotionFunc(e){e>>>=0,GLUT.motionFunc=e}_glutMotionFunc.sig="vp";function _glutPassiveMotionFunc(e){e>>>=0,GLUT.passiveMotionFunc=e}_glutPassiveMotionFunc.sig="vp";function _glutMouseFunc(e){e>>>=0,GLUT.mouseFunc=e}_glutMouseFunc.sig="vp";var _glutSetCursor=e=>{var t="auto";switch(e){case 0:break;case 1:break;case 2:t="pointer";break;case 3:break;case 4:t="help";break;case 5:break;case 6:break;case 7:t="wait";break;case 8:t="text";break;case 9:case 102:t="crosshair";break;case 10:t="ns-resize";break;case 11:t="ew-resize";break;case 12:t="n-resize";break;case 13:t="s-resize";break;case 14:t="w-resize";break;case 15:t="e-resize";break;case 16:t="nw-resize";break;case 17:t="ne-resize";break;case 18:t="se-resize";break;case 19:t="sw-resize";break;case 100:break;case 101:t="none";break;default:throw"glutSetCursor: Unknown cursor type: "+e}Module.canvas.style.cursor=t};_glutSetCursor.sig="vi";function _glutCreateWindow(e){e>>>=0;var t={antialias:(GLUT.initDisplayMode&128)!=0,depth:(GLUT.initDisplayMode&16)!=0,stencil:(GLUT.initDisplayMode&32)!=0,alpha:(GLUT.initDisplayMode&8)!=0};return Module.ctx=Browser.createContext(Module.canvas,!0,!0,t),Module.ctx?1:0}_glutCreateWindow.sig="ip";var _glutDestroyWindow=e=>(delete Module.ctx,1);_glutDestroyWindow.sig="vi";var _glutReshapeWindow=(e,t)=>{Browser.exitFullscreen(),Browser.setCanvasSize(e,t,!0),GLUT.reshapeFunc&&getWasmTableEntry(GLUT.reshapeFunc)(e,t),_glutPostRedisplay()};_glutReshapeWindow.sig="vii";var _glutPositionWindow=(e,t)=>{Browser.exitFullscreen(),_glutPostRedisplay()};_glutPositionWindow.sig="vii";var _glutFullScreen=()=>{GLUT.windowX=0,GLUT.windowY=0,GLUT.windowWidth=Module.canvas.width,GLUT.windowHeight=Module.canvas.height,document.addEventListener("fullscreenchange",GLUT.onFullscreenEventChange,!0),document.addEventListener("mozfullscreenchange",GLUT.onFullscreenEventChange,!0),document.addEventListener("webkitfullscreenchange",GLUT.onFullscreenEventChange,!0),Browser.requestFullscreen(!1,!1)};_glutFullScreen.sig="v";var _glutInitDisplayMode=e=>GLUT.initDisplayMode=e;_glutInitDisplayMode.sig="vi";var _glutSwapBuffers=()=>{};_glutSwapBuffers.sig="v";var _glutMainLoop=()=>{throw _glutReshapeWindow(Module.canvas.width,Module.canvas.height),_glutPostRedisplay(),"unwind"};_glutMainLoop.sig="v";function _XOpenDisplay(e){return e>>>=0,1}_XOpenDisplay.sig="pp";function _XCreateWindow(e,t,r,n,a,o,l,u,_,d,f,p){return e>>>=0,t>>>=0,d>>>=0,f>>>=0,p>>>=0,Browser.setCanvasSize(a,o),2}_XCreateWindow.sig="pppiiiiiiippp";function _XChangeWindowAttributes(e,t,r,n){e>>>=0,t>>>=0,r>>>=0,n>>>=0}_XChangeWindowAttributes.sig="ipppp";function _XSetWMHints(e,t,r){e>>>=0,t>>>=0,r>>>=0}_XSetWMHints.sig="ippp";function _XMapWindow(e,t){e>>>=0,t>>>=0}_XMapWindow.sig="ipp";function _XStoreName(e,t,r){e>>>=0,t>>>=0,r>>>=0}_XStoreName.sig="ippp";function _XInternAtom(e,t,r){return e>>>=0,t>>>=0,0}_XInternAtom.sig="pppi";function _XSendEvent(e,t,r,n,a){e>>>=0,t>>>=0,n>>>=0,a>>>=0}_XSendEvent.sig="ippipp";function _XPending(e){return e>>>=0,0}_XPending.sig="ip";var EGL={errorCode:12288,defaultDisplayInitialized:!1,currentContext:0,currentReadSurface:0,currentDrawSurface:0,contextAttributes:{alpha:!1,depth:!1,stencil:!1,antialias:!1},stringCache:{},setErrorCode(e){EGL.errorCode=e},chooseConfig(e,t,r,n,a){if(e!=62e3)return EGL.setErrorCode(12296),0;if(t)for(;;){var o=HEAP32[t>>>2>>>0];if(o==12321){var l=HEAP32[t+4>>>2>>>0];EGL.contextAttributes.alpha=l>0}else if(o==12325){var u=HEAP32[t+4>>>2>>>0];EGL.contextAttributes.depth=u>0}else if(o==12326){var _=HEAP32[t+4>>>2>>>0];EGL.contextAttributes.stencil=_>0}else if(o==12337){var d=HEAP32[t+4>>>2>>>0];EGL.contextAttributes.antialias=d>0}else if(o==12338){var d=HEAP32[t+4>>>2>>>0];EGL.contextAttributes.antialias=d==1}else if(o==12544){var f=HEAP32[t+4>>>2>>>0];EGL.contextAttributes.lowLatency=f!=12547}else if(o==12344)break;t+=8}return(!r||!n)&&!a?(EGL.setErrorCode(12300),0):(a&&(HEAP32[a>>>2>>>0]=1),r&&n>0&&(HEAPU32[r>>>2>>>0]=62002),EGL.setErrorCode(12288),1)}};function _eglGetDisplay(e){return e>>>=0,EGL.setErrorCode(12288),e!=0&&e!=1?0:62e3}_eglGetDisplay.sig="pp";function _eglInitialize(e,t,r){return e>>>=0,t>>>=0,r>>>=0,e!=62e3?(EGL.setErrorCode(12296),0):(t&&(HEAP32[t>>>2>>>0]=1),r&&(HEAP32[r>>>2>>>0]=4),EGL.defaultDisplayInitialized=!0,EGL.setErrorCode(12288),1)}_eglInitialize.sig="ippp";function _eglTerminate(e){return e>>>=0,e!=62e3?(EGL.setErrorCode(12296),0):(EGL.currentContext=0,EGL.currentReadSurface=0,EGL.currentDrawSurface=0,EGL.defaultDisplayInitialized=!1,EGL.setErrorCode(12288),1)}_eglTerminate.sig="ip";function _eglGetConfigs(e,t,r,n){return e>>>=0,t>>>=0,n>>>=0,EGL.chooseConfig(e,0,t,r,n)}_eglGetConfigs.sig="ippip";function _eglChooseConfig(e,t,r,n,a){return e>>>=0,t>>>=0,r>>>=0,a>>>=0,EGL.chooseConfig(e,t,r,n,a)}_eglChooseConfig.sig="ipppip";function _eglGetConfigAttrib(e,t,r,n){if(e>>>=0,t>>>=0,n>>>=0,e!=62e3)return EGL.setErrorCode(12296),0;if(t!=62002)return EGL.setErrorCode(12293),0;if(!n)return EGL.setErrorCode(12300),0;switch(EGL.setErrorCode(12288),r){case 12320:return HEAP32[n>>>2>>>0]=EGL.contextAttributes.alpha?32:24,1;case 12321:return HEAP32[n>>>2>>>0]=EGL.contextAttributes.alpha?8:0,1;case 12322:return HEAP32[n>>>2>>>0]=8,1;case 12323:return HEAP32[n>>>2>>>0]=8,1;case 12324:return HEAP32[n>>>2>>>0]=8,1;case 12325:return HEAP32[n>>>2>>>0]=EGL.contextAttributes.depth?24:0,1;case 12326:return HEAP32[n>>>2>>>0]=EGL.contextAttributes.stencil?8:0,1;case 12327:return HEAP32[n>>>2>>>0]=12344,1;case 12328:return HEAP32[n>>>2>>>0]=62002,1;case 12329:return HEAP32[n>>>2>>>0]=0,1;case 12330:return HEAP32[n>>>2>>>0]=4096,1;case 12331:return HEAP32[n>>>2>>>0]=16777216,1;case 12332:return HEAP32[n>>>2>>>0]=4096,1;case 12333:return HEAP32[n>>>2>>>0]=0,1;case 12334:return HEAP32[n>>>2>>>0]=0,1;case 12335:return HEAP32[n>>>2>>>0]=12344,1;case 12337:return HEAP32[n>>>2>>>0]=EGL.contextAttributes.antialias?4:0,1;case 12338:return HEAP32[n>>>2>>>0]=EGL.contextAttributes.antialias?1:0,1;case 12339:return HEAP32[n>>>2>>>0]=4,1;case 12340:return HEAP32[n>>>2>>>0]=12344,1;case 12341:case 12342:case 12343:return HEAP32[n>>>2>>>0]=-1,1;case 12345:case 12346:return HEAP32[n>>>2>>>0]=0,1;case 12347:return HEAP32[n>>>2>>>0]=0,1;case 12348:return HEAP32[n>>>2>>>0]=1,1;case 12349:case 12350:return HEAP32[n>>>2>>>0]=0,1;case 12351:return HEAP32[n>>>2>>>0]=12430,1;case 12352:return HEAP32[n>>>2>>>0]=4,1;case 12354:return HEAP32[n>>>2>>>0]=0,1;default:return EGL.setErrorCode(12292),0}}_eglGetConfigAttrib.sig="ippip";function _eglCreateWindowSurface(e,t,r,n){return e>>>=0,t>>>=0,n>>>=0,e!=62e3?(EGL.setErrorCode(12296),0):t!=62002?(EGL.setErrorCode(12293),0):(EGL.setErrorCode(12288),62006)}_eglCreateWindowSurface.sig="pppip";function _eglDestroySurface(e,t){return e>>>=0,t>>>=0,e!=62e3?(EGL.setErrorCode(12296),0):t!=62006?(EGL.setErrorCode(12301),1):(EGL.currentReadSurface==t&&(EGL.currentReadSurface=0),EGL.currentDrawSurface==t&&(EGL.currentDrawSurface=0),EGL.setErrorCode(12288),1)}_eglDestroySurface.sig="ipp";function _eglCreateContext(e,t,r,n){if(e>>>=0,t>>>=0,r>>>=0,n>>>=0,e!=62e3)return EGL.setErrorCode(12296),0;for(var a=1;;){var o=HEAP32[n>>>2>>>0];if(o==12440)a=HEAP32[n+4>>>2>>>0];else{if(o==12344)break;return EGL.setErrorCode(12292),0}n+=8}return a!=2?(EGL.setErrorCode(12293),0):(EGL.contextAttributes.majorVersion=a-1,EGL.contextAttributes.minorVersion=0,EGL.context=GL.createContext(Module.canvas,EGL.contextAttributes),EGL.context!=0?(EGL.setErrorCode(12288),GL.makeContextCurrent(EGL.context),Browser.useWebGL=!0,Browser.moduleContextCreatedCallbacks.forEach(l=>l()),GL.makeContextCurrent(null),62004):(EGL.setErrorCode(12297),0))}_eglCreateContext.sig="ppppp";function _eglDestroyContext(e,t){return e>>>=0,t>>>=0,e!=62e3?(EGL.setErrorCode(12296),0):t!=62004?(EGL.setErrorCode(12294),0):(GL.deleteContext(EGL.context),EGL.setErrorCode(12288),EGL.currentContext==t&&(EGL.currentContext=0),1)}_eglDestroyContext.sig="ipp";function _eglQuerySurface(e,t,r,n){if(e>>>=0,t>>>=0,n>>>=0,e!=62e3)return EGL.setErrorCode(12296),0;if(t!=62006)return EGL.setErrorCode(12301),0;if(!n)return EGL.setErrorCode(12300),0;switch(EGL.setErrorCode(12288),r){case 12328:return HEAP32[n>>>2>>>0]=62002,1;case 12376:return 1;case 12375:return HEAP32[n>>>2>>>0]=Module.canvas.width,1;case 12374:return HEAP32[n>>>2>>>0]=Module.canvas.height,1;case 12432:return HEAP32[n>>>2>>>0]=-1,1;case 12433:return HEAP32[n>>>2>>>0]=-1,1;case 12434:return HEAP32[n>>>2>>>0]=-1,1;case 12422:return HEAP32[n>>>2>>>0]=12420,1;case 12441:return HEAP32[n>>>2>>>0]=12442,1;case 12435:return HEAP32[n>>>2>>>0]=12437,1;case 12416:case 12417:case 12418:case 12419:return 1;default:return EGL.setErrorCode(12292),0}}_eglQuerySurface.sig="ippip";function _eglQueryContext(e,t,r,n){if(e>>>=0,t>>>=0,n>>>=0,e!=62e3)return EGL.setErrorCode(12296),0;if(t!=62004)return EGL.setErrorCode(12294),0;if(!n)return EGL.setErrorCode(12300),0;switch(EGL.setErrorCode(12288),r){case 12328:return HEAP32[n>>>2>>>0]=62002,1;case 12439:return HEAP32[n>>>2>>>0]=12448,1;case 12440:return HEAP32[n>>>2>>>0]=EGL.contextAttributes.majorVersion+1,1;case 12422:return HEAP32[n>>>2>>>0]=12420,1;default:return EGL.setErrorCode(12292),0}}_eglQueryContext.sig="ippip";var _eglGetError=()=>EGL.errorCode;_eglGetError.sig="i";function _eglQueryString(e,t){if(e>>>=0,e!=62e3)return EGL.setErrorCode(12296),0;if(EGL.setErrorCode(12288),EGL.stringCache[t])return EGL.stringCache[t];var r;switch(t){case 12371:r=stringToNewUTF8("Emscripten");break;case 12372:r=stringToNewUTF8("1.4 Emscripten EGL");break;case 12373:r=stringToNewUTF8("");break;case 12429:r=stringToNewUTF8("OpenGL_ES");break;default:return EGL.setErrorCode(12300),0}return EGL.stringCache[t]=r,r}_eglQueryString.sig="ppi";var _eglBindAPI=e=>e==12448?(EGL.setErrorCode(12288),1):(EGL.setErrorCode(12300),0);_eglBindAPI.sig="ii";var _eglQueryAPI=()=>(EGL.setErrorCode(12288),12448);_eglQueryAPI.sig="i";var _eglWaitClient=()=>(EGL.setErrorCode(12288),1);_eglWaitClient.sig="i";var _eglWaitNative=e=>(EGL.setErrorCode(12288),1);_eglWaitNative.sig="ii";var _eglWaitGL=_eglWaitClient;_eglWaitGL.sig="i";function _eglSwapInterval(e,t){return e>>>=0,e!=62e3?(EGL.setErrorCode(12296),0):(t==0?_emscripten_set_main_loop_timing(0,0):_emscripten_set_main_loop_timing(1,t),EGL.setErrorCode(12288),1)}_eglSwapInterval.sig="ipi";function _eglMakeCurrent(e,t,r,n){return e>>>=0,t>>>=0,r>>>=0,n>>>=0,e!=62e3?(EGL.setErrorCode(12296),0):n!=0&&n!=62004?(EGL.setErrorCode(12294),0):r!=0&&r!=62006||t!=0&&t!=62006?(EGL.setErrorCode(12301),0):(GL.makeContextCurrent(n?EGL.context:null),EGL.currentContext=n,EGL.currentDrawSurface=t,EGL.currentReadSurface=r,EGL.setErrorCode(12288),1)}_eglMakeCurrent.sig="ipppp";function _eglGetCurrentContext(){return EGL.currentContext}_eglGetCurrentContext.sig="p";function _eglGetCurrentSurface(e){return e==12378?EGL.currentReadSurface:e==12377?EGL.currentDrawSurface:(EGL.setErrorCode(12300),0)}_eglGetCurrentSurface.sig="pi";function _eglGetCurrentDisplay(){return EGL.currentContext?62e3:0}_eglGetCurrentDisplay.sig="p";function _eglSwapBuffers(e,t){if(e>>>=0,t>>>=0,!EGL.defaultDisplayInitialized)EGL.setErrorCode(12289);else if(!Module.ctx)EGL.setErrorCode(12290);else if(Module.ctx.isContextLost())EGL.setErrorCode(12302);else return EGL.setErrorCode(12288),1;return 0}_eglSwapBuffers.sig="ipp";var _eglReleaseThread=()=>(EGL.currentContext=0,EGL.currentReadSurface=0,EGL.currentDrawSurface=0,EGL.setErrorCode(12288),1);_eglReleaseThread.sig="i";function _uuid_clear(e){return e>>>=0,zeroMemory(e,16)}_uuid_clear.sig="vp";function _uuid_compare(e,t){return e>>>=0,t>>>=0,_memcmp(e,t,16)}_uuid_compare.sig="ipp";function _uuid_copy(e,t){return e>>>=0,t>>>=0,_memcpy(e,t,16)}_uuid_copy.sig="vpp";function _uuid_generate(e){e>>>=0;var t=null;if(ENVIRONMENT_IS_NODE)try{var r=ki("crypto").randomBytes;t=r(16)}catch(l){}else ENVIRONMENT_IS_WEB&&typeof window.crypto<"u"&&typeof window.crypto.getRandomValues<"u"&&(t=new Uint8Array(16),window.crypto.getRandomValues(t));if(!t){t=new Array(16);for(var n=new Date().getTime(),a=0;a<16;a++){var o=(n+Math.random()*256)%256|0;n=n/256|0,t[a]=o}}t[6]=t[6]&15|64,t[8]=t[8]&63|128,writeArrayToMemory(t,e)}_uuid_generate.sig="vp";function _uuid_is_null(e){e>>>=0;for(var t=0;t<4;t++,e=e+4|0){var r=HEAP32[e>>>2>>>0];if(r)return 0}return 1}_uuid_is_null.sig="ip";function _uuid_parse(e,t){if(e>>>=0,t>>>=0,e=UTF8ToString(e),e.length===36){var r=0,n=new Array(16);return e.toLowerCase().replace(/[0-9a-f]{2}/g,function(a){r<16&&(n[r++]=parseInt(a,16))}),r<16?-1:(writeArrayToMemory(n,t),0)}return-1}_uuid_parse.sig="ipp";function _uuid_unparse(e,t,r){e>>>=0,t>>>=0;var n=0,a="xxxx-xx-xx-xx-xxxxxx".replace(/[x]/g,function(o){var l=r?HEAPU8[e+n>>>0].toString(16).toUpperCase():HEAPU8[e+n>>>0].toString(16);return l=l.length===1?"0"+l:l,n++,l});stringToUTF8(a,t,37)}_uuid_unparse.sig="vpp";function _uuid_unparse_lower(e,t){e>>>=0,t>>>=0,_uuid_unparse(e,t)}_uuid_unparse_lower.sig="vpp";function _uuid_unparse_upper(e,t){e>>>=0,t>>>=0,_uuid_unparse(e,t,!0)}_uuid_unparse_upper.sig="vpp";function _uuid_type(e){return e>>>=0,4}_uuid_type.sig="ip";function _uuid_variant(e){return e>>>=0,1}_uuid_variant.sig="ip";var GLEW={isLinaroFork:1,extensions:null,error:{0:null,1:null,2:null,3:null,4:null,5:null,6:null,7:null,8:null},version:{1:null,2:null,3:null,4:null},errorStringConstantFromCode(e){if(GLEW.isLinaroFork)switch(e){case 4:return"OpenGL ES lib expected, found OpenGL lib";case 5:return"OpenGL lib expected, found OpenGL ES lib";case 6:return"Missing EGL version";case 7:return"EGL 1.1 and up are supported";default:break}switch(e){case 0:return"No error";case 1:return"Missing GL version";case 2:return"GL 1.1 and up are supported";case 3:return"GLX 1.2 and up are supported";default:return null}},errorString(e){if(!GLEW.error[e]){var t=GLEW.errorStringConstantFromCode(e);t||(t="Unknown error",e=8),GLEW.error[e]=stringToNewUTF8(t)}return GLEW.error[e]},versionStringConstantFromCode(e){switch(e){case 1:return"1.10.0";case 2:return"1";case 3:return"10";case 4:return"0";default:return null}},versionString(e){if(!GLEW.version[e]){var t=GLEW.versionStringConstantFromCode(e);if(!t)return 0;GLEW.version[e]=stringToNewUTF8(t)}return GLEW.version[e]},extensionIsSupported(e){return GLEW.extensions||(GLEW.extensions=webglGetExtensions()),GLEW.extensions.includes(e)?1:GLEW.extensions.includes("GL_"+e)}},_glewInit=()=>0;_glewInit.sig="i";function _glewIsSupported(e){e>>>=0;for(var t=UTF8ToString(e).split(" "),r=0;r>>=0,GLEW.extensionIsSupported(UTF8ToString(e))}_glewGetExtension.sig="ip";function _glewGetErrorString(e){return GLEW.errorString(e)}_glewGetErrorString.sig="pi";function _glewGetString(e){return GLEW.versionString(e)}_glewGetString.sig="pi";var IDBStore={indexedDB(){if(typeof indexedDB<"u")return indexedDB;var e=null;return typeof window=="object"&&(e=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB),assert(e,"IDBStore used, but indexedDB not supported"),e},DB_VERSION:22,DB_STORE_NAME:"FILE_DATA",dbs:{},blobs:[0],getDB(e,t){var r=IDBStore.dbs[e];if(r)return t(null,r);var n;try{n=IDBStore.indexedDB().open(e,IDBStore.DB_VERSION)}catch(a){return t(a)}n.onupgradeneeded=a=>{var o=a.target.result,l=a.target.transaction,u;o.objectStoreNames.contains(IDBStore.DB_STORE_NAME)?u=l.objectStore(IDBStore.DB_STORE_NAME):u=o.createObjectStore(IDBStore.DB_STORE_NAME)},n.onsuccess=()=>{r=n.result,IDBStore.dbs[e]=r,t(null,r)},n.onerror=function(a){t(a.target.error||"unknown error"),a.preventDefault()}},getStore(e,t,r){IDBStore.getDB(e,(n,a)=>{if(n)return r(n);var o=a.transaction([IDBStore.DB_STORE_NAME],t);o.onerror=u=>{r(u.target.error||"unknown error"),u.preventDefault()};var l=o.objectStore(IDBStore.DB_STORE_NAME);r(null,l)})},getFile(e,t,r){IDBStore.getStore(e,"readonly",(n,a)=>{if(n)return r(n);var o=a.get(t);o.onsuccess=l=>{var u=l.target.result;return u?r(null,u):r("file ".concat(t," not found"))},o.onerror=r})},setFile(e,t,r,n){IDBStore.getStore(e,"readwrite",(a,o)=>{if(a)return n(a);var l=o.put(r,t);l.onsuccess=u=>n(),l.onerror=n})},deleteFile(e,t,r){IDBStore.getStore(e,"readwrite",(n,a)=>{if(n)return r(n);var o=a.delete(t);o.onsuccess=l=>r(),o.onerror=r})},existsFile(e,t,r){IDBStore.getStore(e,"readonly",(n,a)=>{if(n)return r(n);var o=a.count(t);o.onsuccess=l=>r(null,l.target.result>0),o.onerror=r})},clearStore(e,t){IDBStore.getStore(e,"readwrite",(r,n)=>{if(r)return t(r);var a=n.clear();a.onsuccess=o=>t(),a.onerror=t})}},_emscripten_idb_async_load=function(e,t,r,n,a){e>>>=0,t>>>=0,r>>>=0,n>>>=0,a>>>=0,IDBStore.getFile(UTF8ToString(e),UTF8ToString(t),(o,l)=>{callUserCallback(()=>{if(o){a&&getWasmTableEntry(a)(r);return}var u=_malloc(l.length);HEAPU8.set(l,u>>>0),getWasmTableEntry(n)(r,u,l.length),_free(u)})})};_emscripten_idb_async_load.sig="vppppp";var _emscripten_idb_async_store=function(e,t,r,n,a,o,l){e>>>=0,t>>>=0,r>>>=0,a>>>=0,o>>>=0,l>>>=0,IDBStore.setFile(UTF8ToString(e),UTF8ToString(t),new Uint8Array(HEAPU8.subarray(r>>>0,r+n>>>0)),u=>{callUserCallback(()=>{if(u){l&&getWasmTableEntry(l)(a);return}o&&getWasmTableEntry(o)(a)})})};_emscripten_idb_async_store.sig="vpppippp";var _emscripten_idb_async_delete=function(e,t,r,n,a){e>>>=0,t>>>=0,r>>>=0,n>>>=0,a>>>=0,IDBStore.deleteFile(UTF8ToString(e),UTF8ToString(t),o=>{callUserCallback(()=>{if(o){a&&getWasmTableEntry(a)(r);return}n&&getWasmTableEntry(n)(r)})})};_emscripten_idb_async_delete.sig="vppppp";var _emscripten_idb_async_exists=function(e,t,r,n,a){e>>>=0,t>>>=0,r>>>=0,n>>>=0,a>>>=0,IDBStore.existsFile(UTF8ToString(e),UTF8ToString(t),(o,l)=>{callUserCallback(()=>{if(o){a&&getWasmTableEntry(a)(r);return}n&&getWasmTableEntry(n)(r,l)})})};_emscripten_idb_async_exists.sig="vppppp";var _emscripten_idb_async_clear=function(e,t,r,n){e>>>=0,t>>>=0,r>>>=0,n>>>=0,IDBStore.clearStore(UTF8ToString(e),a=>{callUserCallback(()=>{if(a){n&&getWasmTableEntry(n)(t);return}r&&getWasmTableEntry(r)(t)})})};_emscripten_idb_async_clear.sig="vpppp";function _emscripten_idb_load(e,t,r,n,a){throw e>>>=0,t>>>=0,r>>>=0,n>>>=0,a>>>=0,"Please compile your program with async support in order to use synchronous operations like emscripten_idb_load, etc."}_emscripten_idb_load.sig="vppppp";function _emscripten_idb_store(e,t,r,n,a){throw e>>>=0,t>>>=0,r>>>=0,a>>>=0,"Please compile your program with async support in order to use synchronous operations like emscripten_idb_store, etc."}_emscripten_idb_store.sig="vpppip";function _emscripten_idb_delete(e,t,r){throw e>>>=0,t>>>=0,r>>>=0,"Please compile your program with async support in order to use synchronous operations like emscripten_idb_delete, etc."}_emscripten_idb_delete.sig="vppp";function _emscripten_idb_exists(e,t,r,n){throw e>>>=0,t>>>=0,r>>>=0,n>>>=0,"Please compile your program with async support in order to use synchronous operations like emscripten_idb_exists, etc."}_emscripten_idb_exists.sig="vpppp";function _emscripten_idb_clear(e,t){throw e>>>=0,t>>>=0,"Please compile your program with async support in order to use synchronous operations like emscripten_idb_clear, etc."}_emscripten_idb_clear.sig="vpp";var runAndAbortIfError=e=>{try{return e()}catch(t){abort(t)}},_emscripten_sleep=()=>{throw"Please compile your program with async support in order to use asynchronous operations like emscripten_sleep"};_emscripten_sleep.sig="vi";function _emscripten_wget(e,t){throw e>>>=0,t>>>=0,"Please compile your program with async support in order to use asynchronous operations like emscripten_wget"}Module._emscripten_wget=_emscripten_wget,_emscripten_wget.sig="ipp";function _emscripten_scan_registers(e){throw e>>>=0,"Please compile your program with async support in order to use asynchronous operations like emscripten_scan_registers"}_emscripten_scan_registers.sig="vp";function _emscripten_fiber_swap(e,t){throw e>>>=0,t>>>=0,"Please compile your program with async support in order to use asynchronous operations like emscripten_fiber_swap"}_emscripten_fiber_swap.sig="vpp";var _SDL_GetTicks=()=>Date.now()-SDL.startTime|0;_SDL_GetTicks.sig="i";function _SDL_LockSurface(e){e>>>=0;var t=SDL.surfaces[e];if(t.locked++,t.locked>1||(t.buffer||(t.buffer=_malloc(t.width*t.height*4),HEAPU32[e+20>>>2>>>0]=t.buffer),HEAPU32[e+20>>>2>>>0]=t.buffer,e==SDL.screen&&Module.screenIsReadOnly&&t.image))return 0;if(SDL.defaults.discardOnLock){if(t.image||(t.image=t.ctx.createImageData(t.width,t.height)),!SDL.defaults.opaqueFrontBuffer)return}else t.image=t.ctx.getImageData(0,0,t.width,t.height);if(e==SDL.screen&&SDL.defaults.opaqueFrontBuffer)for(var r=t.image.data,n=r.length,a=0;a>>0)}return 0}_SDL_LockSurface.sig="ip";var SDL={defaults:{width:320,height:200,copyOnLock:!0,discardOnLock:!1,opaqueFrontBuffer:!0},version:null,surfaces:{},canvasPool:[],events:[],fonts:[null],audios:[null],rwops:[null],music:{audio:null,volume:1},mixerFrequency:22050,mixerFormat:32784,mixerNumChannels:2,mixerChunkSize:1024,channelMinimumNumber:0,GL:!1,glAttributes:{0:3,1:3,2:2,3:0,4:0,5:1,6:16,7:0,8:0,9:0,10:0,11:0,12:0,13:0,14:0,15:1,16:0,17:0,18:0},keyboardState:null,keyboardMap:{},canRequestFullscreen:!1,isRequestingFullscreen:!1,textInput:!1,unicode:!1,ttfContext:null,audio:null,startTime:null,initFlags:0,buttonState:0,modState:0,DOMButtons:[0,0,0],DOMEventToSDLEvent:{},TOUCH_DEFAULT_ID:0,eventHandler:null,eventHandlerContext:null,eventHandlerTemp:0,keyCodes:{16:1249,17:1248,18:1250,20:1081,33:1099,34:1102,35:1101,36:1098,37:1104,38:1106,39:1103,40:1105,44:316,45:1097,46:127,91:1251,93:1125,96:1122,97:1113,98:1114,99:1115,100:1116,101:1117,102:1118,103:1119,104:1120,105:1121,106:1109,107:1111,109:1110,110:1123,111:1108,112:1082,113:1083,114:1084,115:1085,116:1086,117:1087,118:1088,119:1089,120:1090,121:1091,122:1092,123:1093,124:1128,125:1129,126:1130,127:1131,128:1132,129:1133,130:1134,131:1135,132:1136,133:1137,134:1138,135:1139,144:1107,160:94,161:33,162:34,163:35,164:36,165:37,166:38,167:95,168:40,169:41,170:42,171:43,172:124,173:45,174:123,175:125,176:126,181:127,182:129,183:128,188:44,190:46,191:47,192:96,219:91,220:92,221:93,222:39,224:1251},scanCodes:{8:42,9:43,13:40,27:41,32:44,35:204,39:53,44:54,46:55,47:56,48:39,49:30,50:31,51:32,52:33,53:34,54:35,55:36,56:37,57:38,58:203,59:51,61:46,91:47,92:49,93:48,96:52,97:4,98:5,99:6,100:7,101:8,102:9,103:10,104:11,105:12,106:13,107:14,108:15,109:16,110:17,111:18,112:19,113:20,114:21,115:22,116:23,117:24,118:25,119:26,120:27,121:28,122:29,127:76,305:224,308:226,316:70},loadRect(e){return{x:HEAP32[e>>>2>>>0],y:HEAP32[e+4>>>2>>>0],w:HEAP32[e+8>>>2>>>0],h:HEAP32[e+12>>>2>>>0]}},updateRect(e,t){HEAP32[e>>>2>>>0]=t.x,HEAP32[e+4>>>2>>>0]=t.y,HEAP32[e+8>>>2>>>0]=t.w,HEAP32[e+12>>>2>>>0]=t.h},intersectionOfRects(e,t){var r=Math.max(e.x,t.x),n=Math.max(e.y,t.y),a=Math.min(e.x+e.w,t.x+t.w),o=Math.min(e.y+e.h,t.y+t.h);return{x:r,y:n,w:Math.max(r,a)-r,h:Math.max(n,o)-n}},checkPixelFormat(e){},loadColorToCSSRGB(e){var t=HEAP32[e>>>2>>>0];return"rgb("+(t&255)+","+(t>>8&255)+","+(t>>16&255)+")"},loadColorToCSSRGBA(e){var t=HEAP32[e>>>2>>>0];return"rgba("+(t&255)+","+(t>>8&255)+","+(t>>16&255)+","+(t>>24&255)/255+")"},translateColorToCSSRGBA:e=>"rgba("+(e&255)+","+(e>>8&255)+","+(e>>16&255)+","+(e>>>24)/255+")",translateRGBAToCSSRGBA:(e,t,r,n)=>"rgba("+(e&255)+","+(t&255)+","+(r&255)+","+(n&255)/255+")",translateRGBAToColor:(e,t,r,n)=>e|t<<8|r<<16|n<<24,makeSurface(e,t,r,n,a,o,l,u,_){var d=r&1,f=r&2097152,p=r&67108864,m=_malloc(60),h=_malloc(44),g=f?1:4,v=0;!d&&!p&&(v=_malloc(e*t*4)),HEAP32[m>>>2>>>0]=r,HEAPU32[m+4>>>2>>>0]=h,HEAP32[m+8>>>2>>>0]=e,HEAP32[m+12>>>2>>>0]=t,HEAP32[m+16>>>2>>>0]=e*g,HEAPU32[m+20>>>2>>>0]=v,HEAP32[m+36>>>2>>>0]=0,HEAP32[m+40>>>2>>>0]=0,HEAP32[m+44>>>2>>>0]=Module.canvas.width,HEAP32[m+48>>>2>>>0]=Module.canvas.height,HEAP32[m+56>>>2>>>0]=1,HEAP32[h>>>2>>>0]=-2042224636,HEAP32[h+4>>>2>>>0]=0,HEAP8[h+8>>>0]=g*8,HEAP8[h+9>>>0]=g,HEAP32[h+12>>>2>>>0]=o||255,HEAP32[h+16>>>2>>>0]=l||65280,HEAP32[h+20>>>2>>>0]=u||16711680,HEAP32[h+24>>>2>>>0]=_||4278190080,SDL.GL=SDL.GL||p;var b;n?b=Module.canvas:(SDL.canvasPool.length>0?b=SDL.canvasPool.pop():b=document.createElement("canvas"),b.width=e,b.height=t);var S={antialias:SDL.glAttributes[13]!=0&&SDL.glAttributes[14]>1,depth:SDL.glAttributes[6]>0,stencil:SDL.glAttributes[7]>0,alpha:SDL.glAttributes[3]>0},L=Browser.createContext(b,p,n,S);return SDL.surfaces[m]={width:e,height:t,canvas:b,ctx:L,surf:m,buffer:v,pixelFormat:h,alpha:255,flags:r,locked:0,usePageCanvas:n,source:a,isFlagSet:x=>r&x},m},copyIndexedColorData(e,t,r,n,a){if(e.colors){var o=Module.canvas.width,l=Module.canvas.height,u=t||0,_=r||0,d=(n||o-u)+u,f=(a||l-_)+_,p=e.buffer;e.image.data32||(e.image.data32=new Uint32Array(e.image.data.buffer));for(var m=e.image.data32,h=e.colors32,g=_;g>>0]]}},freeSurface(e){var t=e+56,r=HEAP32[t>>>2>>>0];if(r>1){HEAP32[t>>>2>>>0]=r-1;return}var n=SDL.surfaces[e];!n.usePageCanvas&&n.canvas&&SDL.canvasPool.push(n.canvas),n.buffer&&_free(n.buffer),_free(n.pixelFormat),_free(e),SDL.surfaces[e]=null,e===SDL.screen&&(SDL.screen=null)},blitSurface(e,t,r,n,a){var o=SDL.surfaces[e],l=SDL.surfaces[r],u,_;if(t?u=SDL.loadRect(t):u={x:0,y:0,w:o.width,h:o.height},n?_=SDL.loadRect(n):_={x:0,y:0,w:o.width,h:o.height},l.clipRect){var d=!a||u.w===0?1:u.w/_.w,f=!a||u.h===0?1:u.h/_.h;_=SDL.intersectionOfRects(l.clipRect,_),u.w=_.w*d,u.h=_.h*f,n&&SDL.updateRect(n,_)}var p,m;if(a?(p=_.w,m=_.h):(p=u.w,m=u.h),u.w===0||u.h===0||p===0||m===0)return 0;var h=l.ctx.globalAlpha;return l.ctx.globalAlpha=o.alpha/255,l.ctx.drawImage(o.canvas,u.x,u.y,u.w,u.h,_.x,_.y,p,m),l.ctx.globalAlpha=h,r!=SDL.screen&&(warnOnce("WARNING: copying canvas data to memory for compatibility"),_SDL_LockSurface(r),l.locked--),0},downFingers:{},savedKeydown:null,receiveEvent(e){function t(){for(var f in SDL.keyboardMap)SDL.events.push({type:"keyup",keyCode:SDL.keyboardMap[f]})}switch(e.type){case"touchstart":case"touchmove":{e.preventDefault();var r=[];if(e.type==="touchstart")for(var n=0;n0?Math.max(_,1):Math.min(_,-1);var d=_>0?3:4;SDL.events.push({type:"mousedown",button:d,pageX:e.pageX,pageY:e.pageY}),SDL.events.push({type:"mouseup",button:d,pageX:e.pageX,pageY:e.pageY}),SDL.events.push({type:"wheel",deltaX:0,deltaY:_}),e.preventDefault();break;case"mousemove":if(SDL.DOMButtons[0]===1&&SDL.events.push({type:"touchmove",touch:{identifier:0,deviceID:-1,pageX:e.pageX,pageY:e.pageY}}),Browser.pointerLock&&("mozMovementX"in e&&(e.movementX=e.mozMovementX,e.movementY=e.mozMovementY),e.movementX==0&&e.movementY==0)){e.preventDefault();return}case"keydown":case"keyup":case"keypress":case"mousedown":case"mouseup":if((e.type!=="keydown"||!SDL.unicode&&!SDL.textInput||e.keyCode===8||e.keyCode===9)&&e.preventDefault(),e.type=="mousedown")SDL.DOMButtons[e.button]=1,SDL.events.push({type:"touchstart",touch:{identifier:0,deviceID:-1,pageX:e.pageX,pageY:e.pageY}});else if(e.type=="mouseup"){if(!SDL.DOMButtons[e.button])return;SDL.events.push({type:"touchend",touch:{identifier:0,deviceID:-1,pageX:e.pageX,pageY:e.pageY}}),SDL.DOMButtons[e.button]=0}e.type==="keydown"||e.type==="mousedown"?SDL.canRequestFullscreen=!0:(e.type==="keyup"||e.type==="mouseup")&&(SDL.isRequestingFullscreen&&(Module.requestFullscreen(!0,!0),SDL.isRequestingFullscreen=!1),SDL.canRequestFullscreen=!1),e.type==="keypress"&&SDL.savedKeydown?(SDL.savedKeydown.keypressCharCode=e.charCode,SDL.savedKeydown=null):e.type==="keydown"&&(SDL.savedKeydown=e),(e.type!=="keypress"||SDL.textInput)&&SDL.events.push(e);break;case"mouseout":for(var n=0;n<3;n++)SDL.DOMButtons[n]&&(SDL.events.push({type:"mouseup",button:n,pageX:e.pageX,pageY:e.pageY}),SDL.DOMButtons[n]=0);e.preventDefault();break;case"focus":SDL.events.push(e),e.preventDefault();break;case"blur":SDL.events.push(e),t(),e.preventDefault();break;case"visibilitychange":SDL.events.push({type:"visibilitychange",visible:!document.hidden}),t(),e.preventDefault();break;case"unload":MainLoop.runner&&(SDL.events.push(e),MainLoop.runner());return;case"resize":SDL.events.push(e),e.preventDefault&&e.preventDefault();break}SDL.events.length>=1e4&&(err("SDL event queue full, dropping events"),SDL.events=SDL.events.slice(0,1e4)),SDL.flushEventsToHandler()},lookupKeyCodeForEvent(e){var t=e.keyCode;return t>=65&&t<=90?t+=32:(t=SDL.keyCodes[e.keyCode]||e.keyCode,e.location===2&&t>=1248&&t<=1251&&(t+=4)),t},handleEvent(e){if(!e.handled)switch(e.handled=!0,e.type){case"touchstart":case"touchend":case"touchmove":{Browser.calculateMouseEvent(e);break}case"keydown":case"keyup":{var t=e.type==="keydown",r=SDL.lookupKeyCodeForEvent(e);HEAP8[SDL.keyboardState+r>>>0]=t,SDL.modState=(HEAP8[SDL.keyboardState+1248>>>0]?64:0)|(HEAP8[SDL.keyboardState+1249>>>0]?1:0)|(HEAP8[SDL.keyboardState+1250>>>0]?256:0)|(HEAP8[SDL.keyboardState+1252>>>0]?128:0)|(HEAP8[SDL.keyboardState+1253>>>0]?2:0)|(HEAP8[SDL.keyboardState+1254>>>0]?512:0),t?SDL.keyboardMap[r]=e.keyCode:delete SDL.keyboardMap[r];break}case"mousedown":case"mouseup":e.type=="mousedown"?SDL.buttonState|=1<0;)if(SDL.makeCEvent(SDL.events.shift(),e)!==!1)return 1;return 0}return SDL.events.length>0},makeCEvent(e,t){if(typeof e=="number"){_memcpy(t,e,28),_free(e);return}switch(SDL.handleEvent(e),e.type){case"keydown":case"keyup":{var r=e.type==="keydown",n=SDL.lookupKeyCodeForEvent(e),a;n>=1024?a=n-1024:a=SDL.scanCodes[n]||n,HEAP32[t>>>2>>>0]=SDL.DOMEventToSDLEvent[e.type],HEAP8[t+8>>>0]=r?1:0,HEAP8[t+9>>>0]=0,HEAP32[t+12>>>2>>>0]=a,HEAP32[t+16>>>2>>>0]=n,HEAP16[t+20>>>1>>>0]=SDL.modState,HEAP32[t+24>>>2>>>0]=e.keypressCharCode||n;break}case"keypress":{HEAP32[t>>>2>>>0]=SDL.DOMEventToSDLEvent[e.type];for(var o=intArrayFromString(String.fromCharCode(e.charCode)),l=0;l>>0]=o[l];break}case"mousedown":case"mouseup":case"mousemove":{if(e.type!="mousemove"){var r=e.type==="mousedown";HEAP32[t>>>2>>>0]=SDL.DOMEventToSDLEvent[e.type],HEAP32[t+4>>>2>>>0]=0,HEAP32[t+8>>>2>>>0]=0,HEAP32[t+12>>>2>>>0]=0,HEAP8[t+16>>>0]=e.button+1,HEAP8[t+17>>>0]=r?1:0,HEAP32[t+20>>>2>>>0]=Browser.mouseX,HEAP32[t+24>>>2>>>0]=Browser.mouseY}else HEAP32[t>>>2>>>0]=SDL.DOMEventToSDLEvent[e.type],HEAP32[t+4>>>2>>>0]=0,HEAP32[t+8>>>2>>>0]=0,HEAP32[t+12>>>2>>>0]=0,HEAP32[t+16>>>2>>>0]=SDL.buttonState,HEAP32[t+20>>>2>>>0]=Browser.mouseX,HEAP32[t+24>>>2>>>0]=Browser.mouseY,HEAP32[t+28>>>2>>>0]=Browser.mouseMovementX,HEAP32[t+32>>>2>>>0]=Browser.mouseMovementY;break}case"wheel":{HEAP32[t>>>2>>>0]=SDL.DOMEventToSDLEvent[e.type],HEAP32[t+16>>>2>>>0]=e.deltaX,HEAP32[t+20>>>2>>>0]=e.deltaY;break}case"touchstart":case"touchend":case"touchmove":{var u=e.touch;if(!Browser.touches[u.identifier])break;var _=Module.canvas.width,d=Module.canvas.height,f=Browser.touches[u.identifier].x/_,p=Browser.touches[u.identifier].y/d,m=Browser.lastTouches[u.identifier].x/_,h=Browser.lastTouches[u.identifier].y/d,g=f-m,v=p-h;if(u.deviceID===void 0&&(u.deviceID=SDL.TOUCH_DEFAULT_ID),g===0&&v===0&&e.type==="touchmove")return!1;HEAP32[t>>>2>>>0]=SDL.DOMEventToSDLEvent[e.type],HEAP32[t+4>>>2>>>0]=_SDL_GetTicks(),tempI64=[u.deviceID>>>0,(tempDouble=u.deviceID,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[t+8>>>2>>>0]=tempI64[0],HEAP32[t+12>>>2>>>0]=tempI64[1],tempI64=[u.identifier>>>0,(tempDouble=u.identifier,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[t+16>>>2>>>0]=tempI64[0],HEAP32[t+20>>>2>>>0]=tempI64[1],HEAPF32[t+24>>>2>>>0]=f,HEAPF32[t+28>>>2>>>0]=p,HEAPF32[t+32>>>2>>>0]=g,HEAPF32[t+36>>>2>>>0]=v,u.force!==void 0?HEAPF32[t+40>>>2>>>0]=u.force:HEAPF32[t+40>>>2>>>0]=e.type=="touchend"?0:1;break}case"unload":{HEAP32[t>>>2>>>0]=SDL.DOMEventToSDLEvent[e.type];break}case"resize":{HEAP32[t>>>2>>>0]=SDL.DOMEventToSDLEvent[e.type],HEAP32[t+4>>>2>>>0]=e.w,HEAP32[t+8>>>2>>>0]=e.h;break}case"joystick_button_up":case"joystick_button_down":{var b=e.type==="joystick_button_up"?0:1;HEAP32[t>>>2>>>0]=SDL.DOMEventToSDLEvent[e.type],HEAP8[t+4>>>0]=e.index,HEAP8[t+5>>>0]=e.button,HEAP8[t+6>>>0]=b;break}case"joystick_axis_motion":{HEAP32[t>>>2>>>0]=SDL.DOMEventToSDLEvent[e.type],HEAP8[t+4>>>0]=e.index,HEAP8[t+5>>>0]=e.axis,HEAP32[t+8>>>2>>>0]=SDL.joystickAxisValueConversion(e.value);break}case"focus":{var S=12;HEAP32[t>>>2>>>0]=SDL.DOMEventToSDLEvent[e.type],HEAP32[t+4>>>2>>>0]=0,HEAP8[t+8>>>0]=S;break}case"blur":{var L=13;HEAP32[t>>>2>>>0]=SDL.DOMEventToSDLEvent[e.type],HEAP32[t+4>>>2>>>0]=0,HEAP8[t+8>>>0]=L;break}case"visibilitychange":{var x=1,T=2,w=e.visible?x:T;HEAP32[t>>>2>>>0]=SDL.DOMEventToSDLEvent[e.type],HEAP32[t+4>>>2>>>0]=0,HEAP8[t+8>>>0]=w;break}default:throw"Unhandled SDL event: "+e.type}},makeFontString(e,t){return t.charAt(0)!="'"&&t.charAt(0)!='"'&&(t='"'+t+'"'),e+"px "+t+", serif"},estimateTextWidth(e,t){var r=e.size,n=SDL.makeFontString(r,e.name),a=SDL.ttfContext;a.font=n;var o=a.measureText(t).width|0;return o},allocateChannels(e){if(!(SDL.numChannels&&SDL.numChannels>=e&&e!=0)){SDL.numChannels=e,SDL.channels=[];for(var t=0;t{e.paused||SDL.playWebAudio(e)});return}e.webAudioNode=SDL.audioContext.createBufferSource(),e.webAudioNode.buffer=t.decodedBuffer,e.webAudioNode.loop=e.loop,e.webAudioNode.onended=e.onended,e.webAudioPannerNode=SDL.audioContext.createPanner(),e.webAudioPannerNode.setPosition(0,0,-.5),e.webAudioPannerNode.panningModel="equalpower",e.webAudioGainNode=SDL.audioContext.createGain(),e.webAudioGainNode.gain.value=e.volume,e.webAudioNode.connect(e.webAudioPannerNode),e.webAudioPannerNode.connect(e.webAudioGainNode),e.webAudioGainNode.connect(SDL.audioContext.destination),e.webAudioNode.start(0,e.currentPosition),e.startTime=SDL.audioContext.currentTime-e.currentPosition}catch(r){err("playWebAudio failed: ".concat(r))}},pauseWebAudio(e){if(e){if(e.webAudioNode)try{e.currentPosition=(SDL.audioContext.currentTime-e.startTime)%e.resource.webAudio.decodedBuffer.duration,e.webAudioNode.onended=void 0,e.webAudioNode.stop(0),e.webAudioNode=void 0}catch(t){err("pauseWebAudio failed: ".concat(t))}e.paused=!0}},openAudioContext(){SDL.audioContext||(typeof AudioContext<"u"?SDL.audioContext=new AudioContext:typeof webkitAudioContext<"u"&&(SDL.audioContext=new webkitAudioContext))},webAudioAvailable:()=>!!SDL.audioContext,fillWebAudioBufferFromHeap(e,t,r){for(var n=SDL.audio,a=n.channels,o=0;o>>1>>>0]/32768;else if(n.format==8)for(var u=0;u>>0];l[u]=(_>=0?_-128:_+128)/128}else if(n.format==33056)for(var u=0;u>>2>>>0];else throw"Invalid SDL audio format "+n.format+"!"}},joystickEventState:1,lastJoystickState:{},joystickNamePool:{},recordJoystickState(e,t){for(var r=new Array(t.buttons.length),n=0;n0},queryJoysticks(){for(var e in SDL.lastJoystickState){var t=SDL.getGamepad(e-1),r=SDL.lastJoystickState[e];if(typeof t>"u"||t===null)return;if(typeof t.timestamp!="number"||t.timestamp!=r.timestamp||!t.timestamp){var n;for(n=0;ne&&e>=0?t[e]:null}};function _SDL_Linked_Version(){return SDL.version===null&&(SDL.version=_malloc(3),HEAP8[SDL.version>>>0]=1,HEAP8[SDL.version+1>>>0]=3,HEAP8[SDL.version+2>>>0]=0),SDL.version}_SDL_Linked_Version.sig="p";var _SDL_Init=e=>{if(SDL.startTime=Date.now(),SDL.initFlags=e,!Module.doNotCaptureKeyboard){var t=Module.keyboardListeningElement||document;t.addEventListener("keydown",SDL.receiveEvent),t.addEventListener("keyup",SDL.receiveEvent),t.addEventListener("keypress",SDL.receiveEvent),window.addEventListener("focus",SDL.receiveEvent),window.addEventListener("blur",SDL.receiveEvent),document.addEventListener("visibilitychange",SDL.receiveEvent)}return window.addEventListener("unload",SDL.receiveEvent),SDL.keyboardState=_calloc(65536,1),SDL.DOMEventToSDLEvent.keydown=768,SDL.DOMEventToSDLEvent.keyup=769,SDL.DOMEventToSDLEvent.keypress=771,SDL.DOMEventToSDLEvent.mousedown=1025,SDL.DOMEventToSDLEvent.mouseup=1026,SDL.DOMEventToSDLEvent.mousemove=1024,SDL.DOMEventToSDLEvent.wheel=1027,SDL.DOMEventToSDLEvent.touchstart=1792,SDL.DOMEventToSDLEvent.touchend=1793,SDL.DOMEventToSDLEvent.touchmove=1794,SDL.DOMEventToSDLEvent.unload=256,SDL.DOMEventToSDLEvent.resize=28673,SDL.DOMEventToSDLEvent.visibilitychange=512,SDL.DOMEventToSDLEvent.focus=512,SDL.DOMEventToSDLEvent.blur=512,SDL.DOMEventToSDLEvent.joystick_axis_motion=1536,SDL.DOMEventToSDLEvent.joystick_button_down=1539,SDL.DOMEventToSDLEvent.joystick_button_up=1540,0};_SDL_Init.sig="ii";var _SDL_WasInit=e=>(SDL.startTime===null&&_SDL_Init(0),1);_SDL_WasInit.sig="ii";function _SDL_GetVideoInfo(){var e=_calloc(20,1);return HEAP32[e+12>>>2>>>0]=Module.canvas.width,HEAP32[e+16>>>2>>>0]=Module.canvas.height,e}_SDL_GetVideoInfo.sig="p";function _SDL_ListModes(e,t){return e>>>=0,-1}_SDL_ListModes.sig="ppi";var _SDL_VideoModeOK=(e,t,r,n)=>r;_SDL_VideoModeOK.sig="iiiii";function _SDL_VideoDriverName(e,t){if(e>>>=0,SDL.startTime===null)return 0;var r=[101,109,115,99,114,105,112,116,101,110,95,115,100,108,95,100,114,105,118,101,114],n=0,a=r.length;for(t<=a&&(a=t-1);n>>0]=o,n++}return HEAP8[e+n>>>0]=0,e}_SDL_VideoDriverName.sig="ppi";var _SDL_AudioDriverName=_SDL_VideoDriverName;_SDL_AudioDriverName.sig="ppi";var _SDL_SetVideoMode=function(e,t,r,n){["touchstart","touchend","touchmove","mousedown","mouseup","mousemove","mousewheel","wheel","mouseout","DOMMouseScroll"].forEach(o=>Module.canvas.addEventListener(o,SDL.receiveEvent,!0));var a=Module.canvas;return e==0&&t==0&&(e=a.width,t=a.height),SDL.addedResizeListener||(SDL.addedResizeListener=!0,Browser.resizeListeners.push((o,l)=>{SDL.settingVideoMode||SDL.receiveEvent({type:"resize",w:o,h:l})})),SDL.settingVideoMode=!0,Browser.setCanvasSize(e,t),SDL.settingVideoMode=!1,SDL.screen&&(SDL.freeSurface(SDL.screen),assert(!SDL.screen)),SDL.GL&&(n=n|67108864),SDL.screen=SDL.makeSurface(e,t,n,!0,"screen"),SDL.screen};_SDL_SetVideoMode.sig="piiii";function _SDL_GetVideoSurface(){return SDL.screen}_SDL_GetVideoSurface.sig="p";var _SDL_AudioQuit=()=>{for(var e=0;eout("SDL_VideoQuit called (and ignored)");_SDL_VideoQuit.sig="v";var _SDL_QuitSubSystem=e=>out("SDL_QuitSubSystem called (and ignored)");_SDL_QuitSubSystem.sig="vi";var _SDL_Quit=()=>{_SDL_AudioQuit(),out("SDL_Quit called (and ignored)")};_SDL_Quit.sig="v";function _SDL_UnlockSurface(e){e>>>=0,assert(!SDL.GL);var t=SDL.surfaces[e];if(!(!t.locked||--t.locked>0)){if(t.isFlagSet(2097152))SDL.copyIndexedColorData(t);else if(t.colors)for(var h=Module.canvas.width,g=Module.canvas.height,v=t.buffer,r=t.image.data,b=t.colors,S=0;S>>0]*4,T=L+x*4;r[T]=b[_],r[T+1]=b[_+1],r[T+2]=b[_+2]}v+=h*3}else{var r=t.image.data,n=t.buffer;assert(n%4==0,"Invalid buffer offset: "+n);var a=n>>>2,o=0,l=e==SDL.screen,u;if(typeof CanvasPixelArray<"u"&&r instanceof CanvasPixelArray)for(u=r.length;o>>0];r[o]=_&255,r[o+1]=_>>8&255,r[o+2]=_>>16&255,r[o+3]=l?255:_>>24&255,a++,o+=4}else{var d=new Uint32Array(r.buffer);if(l&&SDL.defaults.opaqueFrontBuffer){u=d.length,d.set(HEAP32.subarray(a>>>0,a+u>>>0));var f=new Uint8Array(r.buffer),p=3,m=p+4*u;if(u%8==0)for(;p>>0,a+d.length>>>0))}}t.ctx.putImageData(t.image,0,0)}}_SDL_UnlockSurface.sig="vp";function _SDL_Flip(e){e>>>=0}_SDL_Flip.sig="ip";function _SDL_UpdateRect(e,t,r,n,a){e>>>=0}_SDL_UpdateRect.sig="vpiiii";function _SDL_UpdateRects(e,t,r){e>>>=0,r>>>=0}_SDL_UpdateRects.sig="vpip";var _SDL_Delay=e=>{ENVIRONMENT_IS_WORKER||abort("SDL_Delay called on the main thread! Potential infinite loop, quitting. (consider building with async support like ASYNCIFY)");for(var t=Date.now();Date.now()-t>>=0,t>>>=0,e&&_emscripten_set_window_title(e),t&&(t=UTF8ToString(t))}_SDL_WM_SetCaption.sig="vpp";var _SDL_EnableKeyRepeat=(e,t)=>{};_SDL_EnableKeyRepeat.sig="iii";function _SDL_GetKeyboardState(e){return e>>>=0,e&&(HEAP32[e>>>2>>>0]=65536),SDL.keyboardState}_SDL_GetKeyboardState.sig="pp";var _SDL_GetKeyState=()=>_SDL_GetKeyboardState(0);function _SDL_GetKeyName(e){return SDL.keyName||(SDL.keyName=stringToNewUTF8("unknown key")),SDL.keyName}_SDL_GetKeyName.sig="pi";var _SDL_GetModState=()=>SDL.modState;_SDL_GetModState.sig="i";function _SDL_GetMouseState(e,t){return e>>>=0,t>>>=0,e&&(HEAP32[e>>>2>>>0]=Browser.mouseX),t&&(HEAP32[t>>>2>>>0]=Browser.mouseY),SDL.buttonState}_SDL_GetMouseState.sig="ipp";var _SDL_WarpMouse=(e,t)=>{};_SDL_WarpMouse.sig="vii";var _SDL_ShowCursor=e=>{switch(e){case 0:return Browser.isFullscreen?(Module.canvas.requestPointerLock(),0):1;case 1:return Module.canvas.exitPointerLock(),1;case-1:return!Browser.pointerLock;default:err("SDL_ShowCursor called with unknown toggle parameter value: ".concat(e));break}};_SDL_ShowCursor.sig="ii";function _SDL_GetError(){return SDL.errorMessage||(SDL.errorMessage=stringToNewUTF8("unknown SDL-emscripten error")),SDL.errorMessage}_SDL_GetError.sig="p";function _SDL_SetError(e,t){e>>>=0,t>>>=0}_SDL_SetError.sig="vpp";function _SDL_CreateRGBSurface(e,t,r,n,a,o,l,u){return SDL.makeSurface(t,r,e,!1,"CreateRGBSurface",a,o,l,u)}_SDL_CreateRGBSurface.sig="piiiiiiii";function _SDL_CreateRGBSurfaceFrom(e,t,r,n,a,o,l,u,_){e>>>=0;var d=SDL.makeSurface(t,r,0,!1,"CreateRGBSurfaceFrom",o,l,u,_);if(n!==32)return err("TODO: Partially unimplemented SDL_CreateRGBSurfaceFrom called!"),d;for(var f=SDL.surfaces[d],p=f.ctx.createImageData(t,r),m=t*4,h=0;h>>0];return f.ctx.putImageData(p,0,0),d}_SDL_CreateRGBSurfaceFrom.sig="ppiiiiiiii";function _SDL_ConvertSurface(e,t,r){e>>>=0,t>>>=0,t&&SDL.checkPixelFormat(t);var n=SDL.surfaces[e],a=SDL.makeSurface(n.width,n.height,n.flags,!1,"copy:"+n.source),o=SDL.surfaces[a];return o.ctx.globalCompositeOperation="copy",o.ctx.drawImage(n.canvas,0,0),o.ctx.globalCompositeOperation=n.ctx.globalCompositeOperation,a}_SDL_ConvertSurface.sig="pppi";function _SDL_DisplayFormatAlpha(e){return e>>>=0,_SDL_ConvertSurface(e,0,0)}_SDL_DisplayFormatAlpha.sig="pp";function _SDL_FreeSurface(e){e>>>=0,e&&SDL.freeSurface(e)}_SDL_FreeSurface.sig="vp";function _SDL_UpperBlit(e,t,r,n){return e>>>=0,t>>>=0,r>>>=0,n>>>=0,SDL.blitSurface(e,t,r,n,!1)}_SDL_UpperBlit.sig="ipppp";function _SDL_UpperBlitScaled(e,t,r,n){return e>>>=0,t>>>=0,r>>>=0,n>>>=0,SDL.blitSurface(e,t,r,n,!0)}_SDL_UpperBlitScaled.sig="ipppp";var _SDL_LowerBlit=_SDL_UpperBlit;_SDL_LowerBlit.sig="ipppp";var _SDL_LowerBlitScaled=_SDL_UpperBlitScaled;_SDL_LowerBlitScaled.sig="ipppp";function _SDL_GetClipRect(e,t){e>>>=0,t>>>=0,assert(t);var r=SDL.surfaces[e],n=r.clipRect||{x:0,y:0,w:r.width,h:r.height};SDL.updateRect(t,n)}_SDL_GetClipRect.sig="vpp";function _SDL_SetClipRect(e,t){e>>>=0,t>>>=0;var r=SDL.surfaces[e];t?r.clipRect=SDL.intersectionOfRects({x:0,y:0,w:r.width,h:r.height},SDL.loadRect(t)):delete r.clipRect}_SDL_SetClipRect.sig="ipp";function _SDL_FillRect(e,t,r){e>>>=0,t>>>=0;var n=SDL.surfaces[e];assert(!n.locked),n.isFlagSet(2097152)&&(r=n.colors32[r]);var a=t?SDL.loadRect(t):{x:0,y:0,w:n.width,h:n.height};return n.clipRect&&(a=SDL.intersectionOfRects(n.clipRect,a),t&&SDL.updateRect(t,a)),n.ctx.save(),n.ctx.fillStyle=SDL.translateColorToCSSRGBA(r),n.ctx.fillRect(a.x,a.y,a.w,a.h),n.ctx.restore(),0}_SDL_FillRect.sig="ippi";function _zoomSurface(e,t,r,n){e>>>=0;var a=SDL.surfaces[e],o=a.width*t,l=a.height*r,u=SDL.makeSurface(Math.abs(o),Math.abs(l),a.flags,!1,"zoomSurface"),_=SDL.surfaces[u];return t>=0&&r>=0?_.ctx.drawImage(a.canvas,0,0,o,l):(_.ctx.save(),_.ctx.scale(t<0?-1:1,r<0?-1:1),_.ctx.drawImage(a.canvas,o<0?o:0,l<0?l:0,Math.abs(o),Math.abs(l)),_.ctx.restore()),u}_zoomSurface.sig="ppddi";function _rotozoomSurface(e,t,r,n){if(e>>>=0,t%360===0)return _zoomSurface(e,r,r,n);var a=SDL.surfaces[e],o=a.width*r,l=a.height*r,u=Math.ceil(Math.sqrt(Math.pow(o,2)+Math.pow(l,2))),_=SDL.makeSurface(u,u,a.flags,!1,"rotozoomSurface"),d=SDL.surfaces[_];return d.ctx.translate(u/2,u/2),d.ctx.rotate(-t*Math.PI/180),d.ctx.drawImage(a.canvas,-o/2,-l/2,o,l),_}_rotozoomSurface.sig="ppddi";function _SDL_SetAlpha(e,t,r){e>>>=0;var n=SDL.surfaces[e];n.alpha=r,t&65536||(n.alpha=255)}_SDL_SetAlpha.sig="ipii";function _SDL_SetColorKey(e,t,r){return e>>>=0,warnOnce("SDL_SetColorKey is a no-op for performance reasons"),0}_SDL_SetColorKey.sig="ipii";function _SDL_PollEvent(e){return e>>>=0,SDL.pollEvent(e)}_SDL_PollEvent.sig="ip";function _SDL_PushEvent(e){e>>>=0;var t=_malloc(28);return _memcpy(t,e,28),SDL.events.push(t),0}_SDL_PushEvent.sig="ip";function _SDL_PeepEvents(e,t,r,n,a){switch(e>>>=0,r){case 2:{assert(t==1);for(var o=0,l=0;oSDL.events.forEach(SDL.handleEvent);_SDL_PumpEvents.sig="v";function _emscripten_SDL_SetEventHandler(e,t){e>>>=0,t>>>=0,SDL.eventHandler=e,SDL.eventHandlerContext=t,SDL.eventHandlerTemp||(SDL.eventHandlerTemp=_malloc(28))}_emscripten_SDL_SetEventHandler.sig="vpp";function _SDL_SetColors(e,t,r,n){e>>>=0,t>>>=0;var a=SDL.surfaces[e];if(!a.colors){var o=new ArrayBuffer(1024);a.colors=new Uint8Array(o),a.colors32=new Uint32Array(o)}for(var l=0;l>>0],a.colors[u+1]=HEAPU8[t+(l*4+1)>>>0],a.colors[u+2]=HEAPU8[t+(l*4+2)>>>0],a.colors[u+3]=255}return 1}_SDL_SetColors.sig="ippii";function _SDL_SetPalette(e,t,r,n,a){return e>>>=0,r>>>=0,_SDL_SetColors(e,r,n,a)}_SDL_SetPalette.sig="ipipii";function _SDL_MapRGB(e,t,r,n){return e>>>=0,SDL.checkPixelFormat(e),t&255|(r&255)<<8|(n&255)<<16|4278190080}_SDL_MapRGB.sig="ipiii";function _SDL_MapRGBA(e,t,r,n,a){return e>>>=0,SDL.checkPixelFormat(e),t&255|(r&255)<<8|(n&255)<<16|(a&255)<<24}_SDL_MapRGBA.sig="ipiiii";function _SDL_GetRGB(e,t,r,n,a){t>>>=0,r>>>=0,n>>>=0,a>>>=0,SDL.checkPixelFormat(t),r&&(HEAP8[r>>>0]=e&255),n&&(HEAP8[n>>>0]=e>>8&255),a&&(HEAP8[a>>>0]=e>>16&255)}_SDL_GetRGB.sig="vipppp";function _SDL_GetRGBA(e,t,r,n,a,o){t>>>=0,r>>>=0,n>>>=0,a>>>=0,o>>>=0,SDL.checkPixelFormat(t),r&&(HEAP8[r>>>0]=e&255),n&&(HEAP8[n>>>0]=e>>8&255),a&&(HEAP8[a>>>0]=e>>16&255),o&&(HEAP8[o>>>0]=e>>24&255)}_SDL_GetRGBA.sig="vippppp";var _SDL_GetAppState=()=>{var e=0;return Browser.pointerLock&&(e|=1),document.hasFocus()&&(e|=2),e|=4,e};_SDL_GetAppState.sig="i";var _SDL_WM_GrabInput=()=>{};_SDL_WM_GrabInput.sig="ii";function _SDL_WM_ToggleFullScreen(e){return e>>>=0,Browser.exitFullscreen()?1:SDL.canRequestFullscreen?(SDL.isRequestingFullscreen=!0,1):0}_SDL_WM_ToggleFullScreen.sig="ip";var _IMG_Init=e=>e;_IMG_Init.sig="ii";function _SDL_FreeRW(e){for(e>>>=0,SDL.rwops[e]=null;SDL.rwops.length>0&&SDL.rwops[SDL.rwops.length-1]===null;)SDL.rwops.pop()}_SDL_FreeRW.sig="vp";var _IMG_Load_RW=function(e,t){e>>>=0;var r=stackSave();try{var n=()=>{stackRestore(r),l&&t&&_SDL_FreeRW(e)},a=T=>{var w=n;n=()=>{w(),T()}},o=(T,w)=>{var F=stackAlloc(4),E=stackAlloc(4),A=stackAlloc(4),C=Module["_"+T](...w,F,E,A,0);return C?(a(()=>Module._stbi_image_free(C)),{rawData:!0,data:C,width:HEAP32[F>>>2>>>0],height:HEAP32[E>>>2>>>0],size:HEAP32[F>>>2>>>0]*HEAP32[E>>>2>>>0]*HEAP32[A>>>2>>>0],bpp:HEAP32[A>>>2>>>0]}):null},l=SDL.rwops[e];if(l===void 0)return 0;var u,_=l.filename;if(_===void 0)return warnOnce("Only file names that have been preloaded are supported for IMG_Load_RW. Consider using STB_IMAGE=1 if you want synchronous image decoding (see settings.js), or package files with --use-preload-plugins"),0;if(!u)if(_=PATH_FS.resolve(_),u=preloadedImages[_],u)Module.freePreloadedMediaOnUse&&(preloadedImages[_]=null);else return u===null&&err("Trying to reuse preloaded image, but freePreloadedMediaOnUse is set!"),warnOnce("Cannot find preloaded image "+_),warnOnce("Cannot find preloaded image "+_+". Consider using STB_IMAGE=1 if you want synchronous image decoding (see settings.js), or package files with --use-preload-plugins"),0;var d=SDL.makeSurface(u.width,u.height,0,!1,"load:"+_),f=SDL.surfaces[d];if(f.ctx.globalCompositeOperation="copy",!u.rawData)f.ctx.drawImage(u,0,0,u.width,u.height,0,0,u.width,u.height);else{var p=f.ctx.getImageData(0,0,f.width,f.height);if(u.bpp==4)p.data.set(HEAPU8.subarray(u.data>>>0,u.data+u.size>>>0));else if(u.bpp==3)for(var m=u.size/3,h=p.data,g=u.data,v=0,b=0;b>>0],h[v++]=HEAPU8[g++>>>0],h[v++]=HEAPU8[g++>>>0],h[v++]=255;else if(u.bpp==2)for(var m=u.size,h=p.data,g=u.data,v=0,b=0;b>>0],L=HEAPU8[g++>>>0];h[v++]=S,h[v++]=S,h[v++]=S,h[v++]=L}else if(u.bpp==1)for(var m=u.size,h=p.data,g=u.data,v=0,b=0;b>>0];h[v++]=x,h[v++]=x,h[v++]=x,h[v++]=255}else return err("cannot handle bpp ".concat(u.bpp)),0;f.ctx.putImageData(p,0,0)}return f.ctx.globalCompositeOperation="source-over",_SDL_LockSurface(d),f.locked--,SDL.GL&&(f.canvas=f.ctx=null),d}finally{n()}};_IMG_Load_RW.sig="ppi";var _SDL_LoadBMP_RW=_IMG_Load_RW;_SDL_LoadBMP_RW.sig="ppi";function _SDL_RWFromFile(e,t){e>>>=0,t>>>=0;var r=SDL.rwops.length,n=UTF8ToString(e);return SDL.rwops.push({filename:n,mimetype:Browser.getMimetype(n)}),r}_SDL_RWFromFile.sig="ppp";function _IMG_Load(e){e>>>=0;var t=_SDL_RWFromFile(e,0),r=_IMG_Load_RW(t,1);return r}_IMG_Load.sig="pp";var _IMG_Quit=()=>out("IMG_Quit called (and ignored)");_IMG_Quit.sig="v";function _SDL_OpenAudio(e,t){e>>>=0,t>>>=0;try{if(SDL.audio={freq:HEAPU32[e>>>2>>>0],format:HEAPU16[e+4>>>1>>>0],channels:HEAPU8[e+6>>>0],samples:HEAPU16[e+8>>>1>>>0],callback:HEAPU32[e+16>>>2>>>0],userdata:HEAPU32[e+20>>>2>>>0],paused:!0,timer:null},SDL.audio.format==8)SDL.audio.silence=128;else if(SDL.audio.format==32784)SDL.audio.silence=0;else if(SDL.audio.format==33056)SDL.audio.silence=0;else throw"Invalid SDL audio format "+SDL.audio.format+"!";if(SDL.audio.freq<=0)throw"Unsupported sound frequency "+SDL.audio.freq+"!";if(SDL.audio.freq<=22050)SDL.audio.freq=22050;else if(SDL.audio.freq<=32e3)SDL.audio.freq=32e3;else if(SDL.audio.freq<=44100)SDL.audio.freq=44100;else if(SDL.audio.freq<=48e3)SDL.audio.freq=48e3;else if(SDL.audio.freq<=96e3)SDL.audio.freq=96e3;else throw"Unsupported sound frequency ".concat(SDL.audio.freq,"!");if(SDL.audio.channels==0)SDL.audio.channels=1;else{if(SDL.audio.channels<0||SDL.audio.channels>32)throw"Unsupported number of audio channels for SDL audio: ".concat(SDL.audio.channels,"!");SDL.audio.channels!=1&&SDL.audio.channels!=2&&out("Warning: Using untested number of audio channels ".concat(SDL.audio.channels))}if(SDL.audio.samples<128||SDL.audio.samples>524288)throw"Unsupported audio callback buffer size ".concat(SDL.audio.samples,"!");if(SDL.audio.samples&SDL.audio.samples-1)throw"Audio callback buffer size ".concat(SDL.audio.samples," must be a power-of-two!");var r=SDL.audio.samples*SDL.audio.channels;if(SDL.audio.format==8)SDL.audio.bytesPerSample=1;else if(SDL.audio.format==32784)SDL.audio.bytesPerSample=2;else if(SDL.audio.format==33056)SDL.audio.bytesPerSample=4;else throw"Invalid SDL audio format ".concat(SDL.audio.format,"!");if(SDL.audio.bufferSize=r*SDL.audio.bytesPerSample,SDL.audio.bufferDurationSecs=SDL.audio.bufferSize/SDL.audio.bytesPerSample/SDL.audio.channels/SDL.audio.freq,SDL.audio.bufferingDelay=.05,SDL.audio.buffer=_malloc(SDL.audio.bufferSize),SDL.audio.numSimultaneouslyQueuedBuffers=Module.SDL_numSimultaneouslyQueuedBuffers||5,SDL.audio.queueNewAudioData=()=>{if(SDL.audio)for(var n=0;n=SDL.audio.bufferingDelay+SDL.audio.bufferDurationSecs*SDL.audio.numSimultaneouslyQueuedBuffers)return;getWasmTableEntry(SDL.audio.callback)(SDL.audio.userdata,SDL.audio.buffer,SDL.audio.bufferSize),SDL.audio.pushAudio(SDL.audio.buffer,SDL.audio.bufferSize)}},SDL.audio.caller=()=>{if(SDL.audio){--SDL.audio.numAudioTimersPending,SDL.audio.queueNewAudioData();var n=SDL.audio.nextPlayTime-SDL.audioContext.currentTime,a=SDL.audio.bufferDurationSecs/2;SDL.audio.numAudioTimersPending{try{if(SDL.audio.paused)return;var o=a/SDL.audio.bytesPerSample,l=o/SDL.audio.channels;if(l!=SDL.audio.samples)throw"Received mismatching audio buffer size!";var u=SDL.audioContext.createBufferSource(),_=SDL.audioContext.createBuffer(SDL.audio.channels,l,SDL.audio.freq);u.connect(SDL.audioContext.destination),SDL.fillWebAudioBufferFromHeap(n,l,_),u.buffer=_;var d=SDL.audioContext.currentTime,f=Math.max(d+SDL.audio.bufferingDelay,SDL.audio.nextPlayTime);typeof u.start<"u"?u.start(f):typeof u.noteOn<"u"&&u.noteOn(f),SDL.audio.nextPlayTime=f+SDL.audio.bufferDurationSecs}catch(p){err("Web Audio API error playing back audio: ".concat(p.toString()))}},t&&(HEAP32[t>>>2>>>0]=SDL.audio.freq,HEAP16[t+4>>>1>>>0]=SDL.audio.format,HEAP8[t+6>>>0]=SDL.audio.channels,HEAP8[t+7>>>0]=SDL.audio.silence,HEAP16[t+8>>>1>>>0]=SDL.audio.samples,HEAPU32[t+16>>>2>>>0]=SDL.audio.callback,HEAPU32[t+20>>>2>>>0]=SDL.audio.userdata),SDL.allocateChannels(32)}catch(n){err('Initializing SDL audio threw an exception: "'.concat(n.toString(),'"! Continuing without audio')),SDL.audio=null,SDL.allocateChannels(0),t&&(HEAP32[t>>>2>>>0]=0,HEAP16[t+4>>>1>>>0]=0,HEAP8[t+6>>>0]=0,HEAP8[t+7>>>0]=0,HEAP16[t+8>>>1>>>0]=0,HEAPU32[t+16>>>2>>>0]=0,HEAPU32[t+20>>>2>>>0]=0)}return SDL.audio?0:-1}_SDL_OpenAudio.sig="ipp";var _SDL_PauseAudio=e=>{SDL.audio&&(e?SDL.audio.timer!==void 0&&(clearTimeout(SDL.audio.timer),SDL.audio.numAudioTimersPending=0,SDL.audio.timer=void 0):SDL.audio.timer||(SDL.audio.numAudioTimersPending=1,SDL.audio.timer=safeSetTimeout(SDL.audio.caller,1)),SDL.audio.paused=e)};_SDL_PauseAudio.sig="vi";var _SDL_CloseAudio=()=>{SDL.audio&&(SDL.audio.callbackRemover&&(SDL.audio.callbackRemover(),SDL.audio.callbackRemover=null),_SDL_PauseAudio(1),_free(SDL.audio.buffer),SDL.audio=null,SDL.allocateChannels(0))};_SDL_CloseAudio.sig="v";var _SDL_LockAudio=()=>{};_SDL_LockAudio.sig="v";var _SDL_UnlockAudio=()=>{};_SDL_UnlockAudio.sig="v";function _SDL_CreateMutex(){return 0}_SDL_CreateMutex.sig="p";function _SDL_mutexP(e){return e>>>=0,0}_SDL_mutexP.sig="ip";function _SDL_mutexV(e){return e>>>=0,0}_SDL_mutexV.sig="ip";function _SDL_DestroyMutex(e){e>>>=0}_SDL_DestroyMutex.sig="vp";function _SDL_CreateCond(){return 0}_SDL_CreateCond.sig="p";function _SDL_CondSignal(e){e>>>=0}_SDL_CondSignal.sig="ip";function _SDL_CondWait(e,t){e>>>=0,t>>>=0}_SDL_CondWait.sig="ipp";function _SDL_DestroyCond(e){e>>>=0}_SDL_DestroyCond.sig="vp";var _SDL_StartTextInput=()=>{SDL.textInput=!0};_SDL_StartTextInput.sig="v";var _SDL_StopTextInput=()=>{SDL.textInput=!1};_SDL_StopTextInput.sig="v";var _Mix_Init=e=>e?8:0;_Mix_Init.sig="ii";var _Mix_Quit=()=>{};_Mix_Quit.sig="v";var _Mix_OpenAudio=(e,t,r,n)=>(SDL.openAudioContext(),autoResumeAudioContext(SDL.audioContext),SDL.allocateChannels(32),SDL.mixerFrequency=e,SDL.mixerFormat=t,SDL.mixerNumChannels=r,SDL.mixerChunkSize=n,0);_Mix_OpenAudio.sig="iiiii";var _Mix_CloseAudio=_SDL_CloseAudio;_Mix_CloseAudio.sig="v";var _Mix_AllocateChannels=e=>(SDL.allocateChannels(e),e);_Mix_AllocateChannels.sig="ii";function _Mix_ChannelFinished(e){e>>>=0,SDL.channelFinished=e}_Mix_ChannelFinished.sig="vp";var _Mix_Volume=(e,t)=>{if(e==-1){for(var r=0;r(t/=255,r/=255,SDL.setPannerPosition(SDL.channels[e],r-t,0,.1),1);_Mix_SetPanning.sig="iiii";function _Mix_LoadWAV_RW(e,t){e>>>=0;var r=SDL.rwops[e];if(r===void 0)return 0;var n="",a,o,l;if(r.filename!==void 0){n=PATH_FS.resolve(r.filename);var u=preloadedAudios[n];if(!u){u===null&&err("Trying to reuse preloaded audio, but freePreloadedMediaOnUse is set!"),Module.noAudioDecoding||warnOnce("Cannot find preloaded audio "+n);try{l=FS.readFile(n)}catch(g){return err("Couldn't find file for: ".concat(n)),0}}Module.freePreloadedMediaOnUse&&(preloadedAudios[n]=null),a=u}else if(r.bytes!==void 0)SDL.webAudioAvailable()?l=HEAPU8.buffer.slice(r.bytes,r.bytes+r.count):l=HEAPU8.subarray(r.bytes>>>0,r.bytes+r.count>>>0);else return 0;var _=l&&(l.buffer||l),d=Module.SDL_canPlayWithWebAudio===void 0||Module.SDL_canPlayWithWebAudio(n,_);if(l!==void 0&&SDL.webAudioAvailable()&&d){a=void 0,o={},o.onDecodeComplete=[];var f=g=>{o.decodedBuffer=g,o.onDecodeComplete.forEach(v=>v()),o.onDecodeComplete=void 0};SDL.audioContext.decodeAudioData(_,f)}else if(a===void 0&&l){var p=new Blob([l],{type:r.mimetype}),m=URL.createObjectURL(p);a=new Audio,a.src=m,a.mozAudioChannelType="content"}var h=SDL.audios.length;return SDL.audios.push({source:n,audio:a,webAudio:o}),h}_Mix_LoadWAV_RW.sig="ppi";function _Mix_LoadWAV(e){e>>>=0;var t=_SDL_RWFromFile(e,0),r=_Mix_LoadWAV_RW(t,0);return _SDL_FreeRW(t),r}_Mix_LoadWAV.sig="pp";function _Mix_QuickLoad_RAW(e,t){e>>>=0;for(var r,n,a=t>>1,o=new Float32Array(a),l=0;l>>1>>>0]/32768;SDL.webAudioAvailable()?(n={},n.decodedBuffer=o):(r=new Audio,r.mozAudioChannelType="content",r.numChannels=SDL.mixerNumChannels,r.frequency=SDL.mixerFrequency);var u=SDL.audios.length;return SDL.audios.push({source:"",audio:r,webAudio:n,buffer:o}),u}_Mix_QuickLoad_RAW.sig="ppi";function _Mix_FreeChunk(e){e>>>=0,SDL.audios[e]=null}_Mix_FreeChunk.sig="vp";var _Mix_ReserveChannels=e=>{SDL.channelMinimumNumber=e};_Mix_ReserveChannels.sig="ii";function _Mix_PlayChannelTimed(e,t,r,n){t>>>=0,assert(n==-1);var a=SDL.audios[t];if(!a||!a.audio&&!a.webAudio)return-1;if(e==-1){for(var o=SDL.channelMinimumNumber;o0;_Mix_FadingChannel.sig="ii";var _Mix_HaltChannel=e=>{function t(n){var a=SDL.channels[n];a.audio&&(a.audio.pause(),a.audio=null),SDL.channelFinished&&getWasmTableEntry(SDL.channelFinished)(n)}if(e!=-1)t(e);else for(var r=0;r{var e=SDL.music.audio;return e&&(e.src=e.src,e.currentPosition=0,e.pause()),SDL.music.audio=null,SDL.hookMusicFinished&&getWasmTableEntry(SDL.hookMusicFinished)(),0};_Mix_HaltMusic.sig="i";function _Mix_HookMusicFinished(e){e>>>=0,SDL.hookMusicFinished=e,SDL.music.audio&&(SDL.music.audio.onended=_Mix_HaltMusic)}_Mix_HookMusicFinished.sig="vp";var _Mix_VolumeMusic=e=>SDL.setGetVolume(SDL.music,e);_Mix_VolumeMusic.sig="ii";function _Mix_LoadMUS_RW(e){return e>>>=0,_Mix_LoadWAV_RW(e,0)}_Mix_LoadMUS_RW.sig="pp";function _Mix_LoadMUS(e){e>>>=0;var t=_SDL_RWFromFile(e,0),r=_Mix_LoadMUS_RW(t);return _SDL_FreeRW(t),r}_Mix_LoadMUS.sig="pp";var _Mix_FreeMusic=_Mix_FreeChunk;_Mix_FreeMusic.sig="vp";function _Mix_PlayMusic(e,t){e>>>=0,SDL.music.audio&&(SDL.music.audio.paused||err("Music is already playing. ".concat(SDL.music.source)),SDL.music.audio.pause());var r=SDL.audios[e],n;return r.webAudio?(n={},n.resource=r,n.paused=!1,n.currentPosition=0,n.play=function(){SDL.playWebAudio(this)},n.pause=function(){SDL.pauseWebAudio(this)}):r.audio&&(n=r.audio),n.onended=function(){SDL.music.audio==this&&_Mix_HaltMusic()},n.loop=t!=0&&t!=1,n.volume=SDL.music.volume,SDL.music.audio=n,n.play(),0}_Mix_PlayMusic.sig="ipi";var _Mix_PauseMusic=()=>{var e=SDL.music.audio;e==null||e.pause()};_Mix_PauseMusic.sig="v";var _Mix_ResumeMusic=()=>{var e=SDL.music.audio;e==null||e.play()};_Mix_ResumeMusic.sig="v";var _Mix_FadeInMusicPos=_Mix_PlayMusic;_Mix_FadeInMusicPos.sig="ipiid";var _Mix_FadeOutMusic=_Mix_HaltMusic;_Mix_FadeOutMusic.sig="ii";var _Mix_PlayingMusic=()=>SDL.music.audio&&!SDL.music.audio.paused?1:0;_Mix_PlayingMusic.sig="i";var _Mix_Playing=e=>{if(e===-1){for(var t=0,r=0;r{if(e===-1){for(var t=0;t{var a;if(e===-1){for(var t=0,r=0;r{var e;return(e=SDL.music.audio)!=null&&e.paused?1:0};_Mix_PausedMusic.sig="i";var _Mix_Resume=e=>{if(e===-1){for(var t=0;t{try{var e=new OffscreenCanvas(0,0);if(SDL.ttfContext=e.getContext("2d"),typeof SDL.ttfContext.measureText!="function")throw"bad context"}catch(r){var t=document.createElement("canvas");SDL.ttfContext=t.getContext("2d")}return 0};_TTF_Init.sig="i";function _TTF_OpenFont(e,t){e>>>=0,e=PATH.normalize(UTF8ToString(e));var r=SDL.fonts.length;return SDL.fonts.push({name:e,size:t}),r}_TTF_OpenFont.sig="ppi";function _TTF_CloseFont(e){e>>>=0,SDL.fonts[e]=null}_TTF_CloseFont.sig="vp";function _TTF_RenderText_Solid(e,t,r){e>>>=0,t>>>=0,r>>>=0,t=UTF8ToString(t)||" ";var n=SDL.fonts[e],a=SDL.estimateTextWidth(n,t),o=n.size;r=SDL.loadColorToCSSRGB(r);var l=SDL.makeFontString(o,n.name),u=SDL.makeSurface(a,o,0,!1,"text:"+t),_=SDL.surfaces[u];return _.ctx.save(),_.ctx.fillStyle=r,_.ctx.font=l,_.ctx.textBaseline="bottom",_.ctx.fillText(t,0,o|0),_.ctx.restore(),u}_TTF_RenderText_Solid.sig="pppp";var _TTF_RenderText_Blended=_TTF_RenderText_Solid;_TTF_RenderText_Blended.sig="pppp";var _TTF_RenderText_Shaded=_TTF_RenderText_Solid;_TTF_RenderText_Shaded.sig="ppppp";var _TTF_RenderUTF8_Solid=_TTF_RenderText_Solid;_TTF_RenderUTF8_Solid.sig="pppp";function _TTF_SizeText(e,t,r,n){e>>>=0,t>>>=0,r>>>=0,n>>>=0;var a=SDL.fonts[e];return r&&(HEAP32[r>>>2>>>0]=SDL.estimateTextWidth(a,UTF8ToString(t))),n&&(HEAP32[n>>>2>>>0]=a.size),0}_TTF_SizeText.sig="ipppp";var _TTF_SizeUTF8=_TTF_SizeText;_TTF_SizeUTF8.sig="ipppp";function _TTF_GlyphMetrics(e,t,r,n,a,o,l){e>>>=0,r>>>=0,n>>>=0,a>>>=0,o>>>=0,l>>>=0;var u=SDL.fonts[e],_=SDL.estimateTextWidth(u,String.fromCharCode(t));l&&(HEAP32[l>>>2>>>0]=_),r&&(HEAP32[r>>>2>>>0]=0),n&&(HEAP32[n>>>2>>>0]=_),a&&(HEAP32[a>>>2>>>0]=0),o&&(HEAP32[o>>>2>>>0]=u.size)}_TTF_GlyphMetrics.sig="ipippppp";function _TTF_FontAscent(e){e>>>=0;var t=SDL.fonts[e];return t.size*.98|0}_TTF_FontAscent.sig="ip";function _TTF_FontDescent(e){e>>>=0;var t=SDL.fonts[e];return t.size*.02|0}_TTF_FontDescent.sig="ip";function _TTF_FontHeight(e){e>>>=0;var t=SDL.fonts[e];return t.size}_TTF_FontHeight.sig="ip";var _TTF_FontLineSkip=_TTF_FontHeight;_TTF_FontLineSkip.sig="ip";var _TTF_Quit=()=>out("TTF_Quit called (and ignored)");_TTF_Quit.sig="v";var SDL_gfx={drawRectangle:(e,t,r,n,a,o,l)=>{t=t<<16>>16,r=r<<16>>16,n=n<<16>>16,a=a<<16>>16;var u=SDL.surfaces[e];assert(!u.locked);var _=t{t=t<<16>>16,r=r<<16>>16,n=n<<16>>16,a=a<<16>>16;var l=SDL.surfaces[e];assert(!l.locked),l.ctx.save(),l.ctx.strokeStyle=o,l.ctx.beginPath(),l.ctx.moveTo(t,r),l.ctx.lineTo(n,a),l.ctx.stroke(),l.ctx.restore()},drawEllipse:(e,t,r,n,a,o,l)=>{t=t<<16>>16,r=r<<16>>16,n=n<<16>>16,a=a<<16>>16;var u=SDL.surfaces[e];assert(!u.locked),u.ctx.save(),u.ctx.beginPath(),u.ctx.translate(t,r),u.ctx.scale(n,a),u.ctx.arc(0,0,1,0,2*Math.PI),u.ctx.restore(),u.ctx.save(),u.ctx[o+"Style"]=l,u.ctx[o](),u.ctx.restore()},translateColorToCSSRGBA:e=>"rgba(".concat(e>>>24,",").concat(e>>16&255,",").concat(e>>8&255,",").concat(e&255,")")};function _boxColor(e,t,r,n,a,o){return e>>>=0,SDL_gfx.drawRectangle(e,t,r,n,a,"fill",SDL_gfx.translateColorToCSSRGBA(o))}_boxColor.sig="ipiiiii";function _boxRGBA(e,t,r,n,a,o,l,u,_){return e>>>=0,SDL_gfx.drawRectangle(e,t,r,n,a,"fill",SDL.translateRGBAToCSSRGBA(o,l,u,_))}_boxRGBA.sig="ipiiiiiiii";function _rectangleColor(e,t,r,n,a,o){return e>>>=0,SDL_gfx.drawRectangle(e,t,r,n,a,"stroke",SDL_gfx.translateColorToCSSRGBA(o))}_rectangleColor.sig="ipiiiii";function _rectangleRGBA(e,t,r,n,a,o,l,u,_){return e>>>=0,SDL_gfx.drawRectangle(e,t,r,n,a,"stroke",SDL.translateRGBAToCSSRGBA(o,l,u,_))}_rectangleRGBA.sig="ipiiiiiiii";function _ellipseColor(e,t,r,n,a,o){return e>>>=0,SDL_gfx.drawEllipse(e,t,r,n,a,"stroke",SDL_gfx.translateColorToCSSRGBA(o))}_ellipseColor.sig="ipiiiii";function _ellipseRGBA(e,t,r,n,a,o,l,u,_){return e>>>=0,SDL_gfx.drawEllipse(e,t,r,n,a,"stroke",SDL.translateRGBAToCSSRGBA(o,l,u,_))}_ellipseRGBA.sig="ipiiiiiiii";function _filledEllipseColor(e,t,r,n,a,o){return e>>>=0,SDL_gfx.drawEllipse(e,t,r,n,a,"fill",SDL_gfx.translateColorToCSSRGBA(o))}_filledEllipseColor.sig="ipiiiii";function _filledEllipseRGBA(e,t,r,n,a,o,l,u,_){return e>>>=0,SDL_gfx.drawEllipse(e,t,r,n,a,"fill",SDL.translateRGBAToCSSRGBA(o,l,u,_))}_filledEllipseRGBA.sig="ipiiiiiiii";function _lineColor(e,t,r,n,a,o){return e>>>=0,SDL_gfx.drawLine(e,t,r,n,a,SDL_gfx.translateColorToCSSRGBA(o))}_lineColor.sig="ipiiiii";function _lineRGBA(e,t,r,n,a,o,l,u,_){return e>>>=0,SDL_gfx.drawLine(e,t,r,n,a,SDL.translateRGBAToCSSRGBA(o,l,u,_))}_lineRGBA.sig="ipiiiiiiii";function _pixelRGBA(e,t,r,n,a,o,l){return e>>>=0,_boxRGBA(e,t,r,t,r,n,a,o,l)}_pixelRGBA.sig="ipiiiiii";var _SDL_GL_SetAttribute=(e,t)=>{e in SDL.glAttributes||abort("Unknown SDL GL attribute ("+e+"). Please check if your SDL version is supported."),SDL.glAttributes[e]=t};_SDL_GL_SetAttribute.sig="iii";function _SDL_GL_GetAttribute(e,t){return t>>>=0,e in SDL.glAttributes||abort("Unknown SDL GL attribute ("+e+"). Please check if your SDL version is supported."),t&&(HEAP32[t>>>2>>>0]=SDL.glAttributes[e]),0}_SDL_GL_GetAttribute.sig="iip";var _SDL_GL_SwapBuffers=()=>{var e;(e=Browser.doSwapBuffers)==null||e.call(Browser)};_SDL_GL_SwapBuffers.sig="v";function _SDL_GL_ExtensionSupported(e){return e>>>=0,Module.ctx.getExtension(e)|0}_SDL_GL_ExtensionSupported.sig="ip";function _SDL_DestroyWindow(e){e>>>=0}_SDL_DestroyWindow.sig="vp";function _SDL_DestroyRenderer(e){e>>>=0}_SDL_DestroyRenderer.sig="vp";function _SDL_GetWindowFlags(e){return e>>>=0,Browser.isFullscreen?1:0}_SDL_GetWindowFlags.sig="ip";function _SDL_GL_SwapWindow(e){e>>>=0}_SDL_GL_SwapWindow.sig="vp";function _SDL_GL_MakeCurrent(e,t){e>>>=0,t>>>=0}_SDL_GL_MakeCurrent.sig="ipp";function _SDL_GL_DeleteContext(e){e>>>=0}_SDL_GL_DeleteContext.sig="vp";var _SDL_GL_GetSwapInterval=()=>MainLoop.timingMode==1?MainLoop.timingValue:0;_SDL_GL_GetSwapInterval.sig="i";var _SDL_GL_SetSwapInterval=e=>{_emscripten_set_main_loop_timing(1,e)};_SDL_GL_SetSwapInterval.sig="ii";function _SDL_SetWindowTitle(e,t){e>>>=0,t>>>=0,t&&(document.title=UTF8ToString(t))}_SDL_SetWindowTitle.sig="vpp";function _SDL_GetWindowSize(e,t,r){e>>>=0,t>>>=0,r>>>=0;var n=Module.canvas.width,a=Module.canvas.height;t&&(HEAP32[t>>>2>>>0]=n),r&&(HEAP32[r>>>2>>>0]=a)}_SDL_GetWindowSize.sig="vppp";function _SDL_LogSetOutputFunction(e,t){e>>>=0,t>>>=0}_SDL_LogSetOutputFunction.sig="vpp";function _SDL_SetWindowFullscreen(e,t){return e>>>=0,Browser.isFullscreen?(Module.canvas.exitFullscreen(),1):0}_SDL_SetWindowFullscreen.sig="ipi";var _SDL_ClearError=()=>{};_SDL_ClearError.sig="v";var _SDL_SetGamma=(e,t,r)=>-1;_SDL_SetGamma.sig="ifff";function _SDL_SetGammaRamp(e,t,r){return e>>>=0,t>>>=0,r>>>=0,-1}_SDL_SetGammaRamp.sig="ippp";var _SDL_NumJoysticks=()=>{for(var e=0,t=SDL.getGamepads(),r=0;rSDL.lastJoystickState.hasOwnProperty(e+1)?1:0;_SDL_JoystickOpened.sig="ii";function _SDL_JoystickIndex(e){return e>>>=0,e-1}_SDL_JoystickIndex.sig="ip";function _SDL_JoystickNumAxes(e){e>>>=0;var t=SDL.getGamepad(e-1);return t?t.axes.length:0}_SDL_JoystickNumAxes.sig="ip";function _SDL_JoystickNumBalls(e){return e>>>=0,0}_SDL_JoystickNumBalls.sig="ip";function _SDL_JoystickNumHats(e){return e>>>=0,0}_SDL_JoystickNumHats.sig="ip";function _SDL_JoystickNumButtons(e){e>>>=0;var t=SDL.getGamepad(e-1);return t?t.buttons.length:0}_SDL_JoystickNumButtons.sig="ip";var _SDL_JoystickUpdate=()=>SDL.queryJoysticks();_SDL_JoystickUpdate.sig="v";var _SDL_JoystickEventState=e=>e<0?SDL.joystickEventState:SDL.joystickEventState=e;_SDL_JoystickEventState.sig="ii";function _SDL_JoystickGetAxis(e,t){e>>>=0;var r=SDL.getGamepad(e-1);return r&&r.axes.length>t?SDL.joystickAxisValueConversion(r.axes[t]):0}_SDL_JoystickGetAxis.sig="ipi";function _SDL_JoystickGetHat(e,t){return e>>>=0,0}_SDL_JoystickGetHat.sig="ipi";function _SDL_JoystickGetBall(e,t,r,n){return e>>>=0,r>>>=0,n>>>=0,-1}_SDL_JoystickGetBall.sig="ipipp";function _SDL_JoystickGetButton(e,t){e>>>=0;var r=SDL.getGamepad(e-1);return r&&r.buttons.length>t&&SDL.getJoystickButtonState(r.buttons[t])?1:0}_SDL_JoystickGetButton.sig="ipi";function _SDL_JoystickClose(e){e>>>=0,delete SDL.lastJoystickState[e]}_SDL_JoystickClose.sig="vp";var _SDL_InitSubSystem=e=>0;_SDL_InitSubSystem.sig="ii";function _SDL_RWFromConstMem(e,t){e>>>=0;var r=SDL.rwops.length;return SDL.rwops.push({bytes:e,count:t}),r}_SDL_RWFromConstMem.sig="ppi";var _SDL_RWFromMem=_SDL_RWFromConstMem;_SDL_RWFromMem.sig="ppi";var _SDL_GetNumAudioDrivers=()=>1;_SDL_GetNumAudioDrivers.sig="i";function _SDL_GetCurrentAudioDriver(){return stringToNewUTF8("Emscripten Audio")}_SDL_GetCurrentAudioDriver.sig="p";var _SDL_GetScancodeFromKey=e=>SDL.scanCodes[e];_SDL_GetScancodeFromKey.sig="ii";function _SDL_GetAudioDriver(e){return _SDL_GetCurrentAudioDriver()}_SDL_GetAudioDriver.sig="pi";var _SDL_EnableUNICODE=e=>{var t=SDL.unicode||0;return SDL.unicode=e,t};_SDL_EnableUNICODE.sig="ii";var _SDL_AddTimer=function(e,t,r){return t>>>=0,r>>>=0,safeSetTimeout(()=>getWasmTableEntry(t)(e,r),e)};_SDL_AddTimer.sig="iipp";var _SDL_RemoveTimer=e=>(clearTimeout(e),!0);_SDL_RemoveTimer.sig="ii";function _SDL_CreateThread(e,t,r,n){throw e>>>=0,t>>>=0,"SDL threads cannot be supported in the web platform because they assume shared state. See emscripten_create_worker etc. for a message-passing concurrency model that does let you run code in another thread."}_SDL_CreateThread.sig="ppp";function _SDL_WaitThread(e,t){throw e>>>=0,t>>>=0,"SDL_WaitThread"}_SDL_WaitThread.sig="vpp";function _SDL_GetThreadID(e){throw e>>>=0,"SDL_GetThreadID"}_SDL_GetThreadID.sig="pp";function _SDL_ThreadID(){return 0}_SDL_ThreadID.sig="p";function _SDL_AllocRW(){throw"SDL_AllocRW: TODO"}_SDL_AllocRW.sig="p";function _SDL_CondBroadcast(e){throw e>>>=0,"SDL_CondBroadcast: TODO"}_SDL_CondBroadcast.sig="ip";function _SDL_CondWaitTimeout(e,t,r){throw e>>>=0,t>>>=0,"SDL_CondWaitTimeout: TODO"}_SDL_CondWaitTimeout.sig="ippi";var _SDL_WM_IconifyWindow=()=>{throw"SDL_WM_IconifyWindow TODO"};_SDL_WM_IconifyWindow.sig="i";function _Mix_SetPostMix(e,t){return e>>>=0,t>>>=0,warnOnce("Mix_SetPostMix: TODO")}_Mix_SetPostMix.sig="vpp";function _Mix_VolumeChunk(e,t){throw e>>>=0,"Mix_VolumeChunk: TODO"}_Mix_VolumeChunk.sig="ipi";var _Mix_SetPosition=(e,t,r)=>{throw"Mix_SetPosition: TODO"};_Mix_SetPosition.sig="iiii";function _Mix_QuerySpec(e,t,r){throw e>>>=0,t>>>=0,r>>>=0,"Mix_QuerySpec: TODO"}_Mix_QuerySpec.sig="ippp";function _Mix_FadeInChannelTimed(e,t,r,n,a){throw t>>>=0,"Mix_FadeInChannelTimed"}_Mix_FadeInChannelTimed.sig="iipiii";var _Mix_FadeOutChannel=()=>{throw"Mix_FadeOutChannel"};_Mix_FadeOutChannel.sig="iii";function _Mix_Linked_Version(){throw"Mix_Linked_Version: TODO"}_Mix_Linked_Version.sig="p";function _SDL_SaveBMP_RW(e,t,r){throw e>>>=0,t>>>=0,"SDL_SaveBMP_RW: TODO"}_SDL_SaveBMP_RW.sig="ippi";function _SDL_WM_SetIcon(e,t){e>>>=0,t>>>=0}_SDL_WM_SetIcon.sig="vpp";var _SDL_HasRDTSC=()=>0;_SDL_HasRDTSC.sig="i";var _SDL_HasMMX=()=>0;_SDL_HasMMX.sig="i";var _SDL_HasMMXExt=()=>0;_SDL_HasMMXExt.sig="i";var _SDL_Has3DNow=()=>0;_SDL_Has3DNow.sig="i";var _SDL_Has3DNowExt=()=>0;_SDL_Has3DNowExt.sig="i";var _SDL_HasSSE=()=>0;_SDL_HasSSE.sig="i";var _SDL_HasSSE2=()=>0;_SDL_HasSSE2.sig="i";var _SDL_HasAltiVec=()=>0;_SDL_HasAltiVec.sig="i";var ALLOC_NORMAL=0,ALLOC_STACK=1,allocate=(e,t)=>{var r;return t==ALLOC_STACK?r=stackAlloc(e.length):r=_malloc(e.length),!e.subarray&&!e.slice&&(e=new Uint8Array(e)),HEAPU8.set(e,r>>>0),r},writeStringToMemory=(e,t,r)=>{warnOnce("writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead!");var n,a;r&&(a=t+lengthBytesUTF8(e),n=HEAP8[a>>>0]),stringToUTF8(e,t,1/0),r&&(HEAP8[a>>>0]=n)},writeAsciiToMemory=(e,t,r)=>{for(var n=0;n>>0]=e.charCodeAt(n);r||(HEAP8[t>>>0]=0)},allocateUTF8=stringToNewUTF8,allocateUTF8OnStack=stringToUTF8OnStack,setErrNo=e=>(HEAP32[___errno_location()>>>2>>>0]=e,e),demangle=e=>(demangle.recursionGuard=(demangle.recursionGuard|0)+1,demangle.recursionGuard>1?e:withStackSave(()=>{try{var t=e;t.startsWith("__Z")&&(t=t.substr(1));var r=stringToUTF8OnStack(t),n=stackAlloc(4),a=___cxa_demangle(r,0,0,n);if(HEAP32[n>>>2>>>0]===0&&a)return UTF8ToString(a)}catch(o){}finally{_free(a),demangle.recursionGuard<2&&--demangle.recursionGuard}return e}));function stackTrace(){var e=jsStackTrace();return Module.extraStackTrace&&(e+="\n"+Module.extraStackTrace()),e}var print=out,printErr=err,_emscripten_is_main_browser_thread=()=>!ENVIRONMENT_IS_WORKER,tupleRegistrations={},structRegistrations={},getTypeName=e=>{var t=___getTypeName(e),r=readLatin1String(t);return _free(t),r},getFunctionName=e=>{e=e.trim();let t=e.indexOf("(");return t!==-1?e.substr(0,t):e},getFunctionArgsName=e=>{e=e.trim();let t=e.indexOf("(")+1;return t!==0?e.substr(t,e.length-t-1).replaceAll(" ","").split(",").filter(r=>r.length):[]},heap32VectorToArray=(e,t)=>{for(var r=[],n=0;n>>2>>>0]);return r},requireRegisteredType=(e,t)=>{var r=registeredTypes[e];return r===void 0&&throwBindingError("".concat(t," has unknown type ").concat(getTypeName(e))),r};function usesDestructorStack(e){for(var t=1;tr){var o=t==r?t:"".concat(t," to ").concat(r);a("function ".concat(n," called with ").concat(e," arguments, expected ").concat(o))}}function getRequiredArgCount(e){for(var t=e.length-2,r=e.length-1;r>=2&&e[r].optional;--r)t--;return t}function createJsInvoker(e,t,r,n){var a=usesDestructorStack(e),o=e.length-2,l=[],u=["fn"];t&&u.push("thisWired");for(var _=0;_Object.defineProperty(t,"name",{value:e}),extendError=(e,t)=>{var r=createNamedFunction(t,function(n){this.name=t,this.message=n;var a=new Error(n).stack;a!==void 0&&(this.stack=this.toString()+"\n"+a.replace(/^Error(:[^\n]*)?\n/,""))});return r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return this.message===void 0?this.name:"".concat(this.name,": ").concat(this.message)},r},UnboundTypeError,PureVirtualError,EmValOptionalType=Object.assign({optional:!0},EmValType),registeredInstances={},getInheritedInstanceCount=()=>Object.keys(registeredInstances).length,getLiveInheritedInstances=()=>{var e=[];for(var t in registeredInstances)registeredInstances.hasOwnProperty(t)&&e.push(registeredInstances[t]);return e},deletionQueue=[],flushPendingDeletes=()=>{for(;deletionQueue.length;){var e=deletionQueue.pop();e.$$.deleteScheduled=!1,e.delete()}},delayFunction,setDelayFunction=e=>{delayFunction=e,deletionQueue.length&&delayFunction&&delayFunction(flushPendingDeletes)},init_embind=()=>{Module.getInheritedInstanceCount=getInheritedInstanceCount,Module.getLiveInheritedInstances=getLiveInheritedInstances,Module.flushPendingDeletes=flushPendingDeletes,Module.setDelayFunction=setDelayFunction},throwUnboundTypeError=(e,t)=>{var r=[],n={};function a(o){if(!n[o]&&!registeredTypes[o]){if(typeDependencies[o]){typeDependencies[o].forEach(a);return}r.push(o),n[o]=!0}}throw t.forEach(a),new UnboundTypeError("".concat(e,": ")+r.map(getTypeName).join([", "]))},ensureOverloadTable=(e,t,r)=>{if(e[t].overloadTable===void 0){var n=e[t];e[t]=function(...a){return e[t].overloadTable.hasOwnProperty(a.length)||throwBindingError("Function '".concat(r,"' called with an invalid number of arguments (").concat(a.length,") - expects one of (").concat(e[t].overloadTable,")!")),e[t].overloadTable[a.length].apply(this,a)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}},exposePublicSymbol=(e,t,r)=>{Module.hasOwnProperty(e)?((r===void 0||Module[e].overloadTable!==void 0&&Module[e].overloadTable[r]!==void 0)&&throwBindingError("Cannot register public name '".concat(e,"' twice")),ensureOverloadTable(Module,e,e),Module.hasOwnProperty(r)&&throwBindingError("Cannot register multiple overloads of a function with the same number of arguments (".concat(r,")!")),Module[e].overloadTable[r]=t):(Module[e]=t,r!==void 0&&(Module[e].numArguments=r))},replacePublicSymbol=(e,t,r)=>{Module.hasOwnProperty(e)||throwInternalError("Replacing nonexistent public symbol"),Module[e].overloadTable!==void 0&&r!==void 0?Module[e].overloadTable[r]=t:(Module[e]=t,Module[e].argCount=r)},getBasestPointer=(e,t)=>{for(t===void 0&&throwBindingError("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t},registerInheritedInstance=(e,t,r)=>{t=getBasestPointer(e,t),registeredInstances.hasOwnProperty(t)?throwBindingError("Tried to register registered instance: ".concat(t)):registeredInstances[t]=r},unregisterInheritedInstance=(e,t)=>{t=getBasestPointer(e,t),registeredInstances.hasOwnProperty(t)?delete registeredInstances[t]:throwBindingError("Tried to unregister unregistered instance: ".concat(t))},getInheritedInstance=(e,t)=>(t=getBasestPointer(e,t),registeredInstances[t]),registeredPointers={},enumReadValueFromPointer=(e,t,r)=>{switch(t){case 1:return r?function(n){return this.fromWireType(HEAP8[n>>>0])}:function(n){return this.fromWireType(HEAPU8[n>>>0])};case 2:return r?function(n){return this.fromWireType(HEAP16[n>>>1>>>0])}:function(n){return this.fromWireType(HEAPU16[n>>>1>>>0])};case 4:return r?function(n){return this.fromWireType(HEAP32[n>>>2>>>0])}:function(n){return this.fromWireType(HEAPU32[n>>>2>>>0])};default:throw new TypeError("invalid integer width (".concat(t,"): ").concat(e))}};function __embind_register_user_type(e,t){e>>>=0,t>>>=0,__embind_register_emval(e)}__embind_register_user_type.sig="vpp";function __embind_register_optional(e,t){e>>>=0,t>>>=0,registerType(e,EmValOptionalType)}__embind_register_optional.sig="vpp";var runDestructors=e=>{for(;e.length;){var t=e.pop(),r=e.pop();r(t)}};function newFunc(e,t){if(!(e instanceof Function))throw new TypeError("new_ called with constructor type ".concat(typeof e," which is not a function"));var r=createNamedFunction(e.name||"unknownFunctionName",function(){});r.prototype=e.prototype;var n=new r,a=e.apply(n,t);return a instanceof Object?a:n}function craftInvokerFunction(e,t,r,n,a,o){var l=t.length;l<2&&throwBindingError("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var u=t[1]!==null&&r!==null,_=usesDestructorStack(t),d=t[0].name!=="void",f=l-2,p=[e,throwBindingError,n,a,runDestructors,t[0],t[1]],m=0;m{e=readLatin1String(e);function r(){return e.includes("j")||e.includes("p")?getDynCaller(e,t):getWasmTableEntry(t)}var n=r();return typeof n!="function"&&throwBindingError("unknown function pointer with signature ".concat(e,": ").concat(t)),n};function __embind_register_function(e,t,r,n,a,o,l,u){e>>>=0,r>>>=0,n>>>=0,a>>>=0,o>>>=0;var _=heap32VectorToArray(t,r);e=readLatin1String(e),e=getFunctionName(e),a=embind__requireFunction(n,a),exposePublicSymbol(e,function(){throwUnboundTypeError("Cannot call ".concat(e," due to unbound types"),_)},t-1),whenDependentTypesAreResolved([],_,d=>{var f=[d[0],null].concat(d.slice(1));return replacePublicSymbol(e,craftInvokerFunction(e,f,null,a,o,l),t-1),[]})}__embind_register_function.sig="vpippppii";function __embind_register_value_array(e,t,r,n,a,o){e>>>=0,t>>>=0,r>>>=0,n>>>=0,a>>>=0,o>>>=0,tupleRegistrations[e]={name:readLatin1String(t),rawConstructor:embind__requireFunction(r,n),rawDestructor:embind__requireFunction(a,o),elements:[]}}__embind_register_value_array.sig="vpppppp";function __embind_register_value_array_element(e,t,r,n,a,o,l,u,_){e>>>=0,t>>>=0,r>>>=0,n>>>=0,a>>>=0,o>>>=0,l>>>=0,u>>>=0,_>>>=0,tupleRegistrations[e].elements.push({getterReturnType:t,getter:embind__requireFunction(r,n),getterContext:a,setterArgumentType:o,setter:embind__requireFunction(l,u),setterContext:_})}__embind_register_value_array_element.sig="vppppppppp";var __embind_finalize_value_array=function(e){e>>>=0;var t=tupleRegistrations[e];delete tupleRegistrations[e];var r=t.elements,n=r.length,a=r.map(u=>u.getterReturnType).concat(r.map(u=>u.setterArgumentType)),o=t.rawConstructor,l=t.rawDestructor;whenDependentTypesAreResolved([e],a,u=>(r.forEach((_,d)=>{var f=u[d],p=_.getter,m=_.getterContext,h=u[d+n],g=_.setter,v=_.setterContext;_.read=b=>f.fromWireType(p(m,b)),_.write=(b,S)=>{var L=[];g(v,b,h.toWireType(L,S)),runDestructors(L)}}),[{name:t.name,fromWireType:_=>{for(var d=new Array(n),f=0;f{if(n!==d.length)throw new TypeError("Incorrect number of tuple elements for ".concat(t.name,": expected=").concat(n,", actual=").concat(d.length));for(var f=o(),p=0;p>>=0,t>>>=0,r>>>=0,n>>>=0,a>>>=0,o>>>=0,structRegistrations[e]={name:readLatin1String(t),rawConstructor:embind__requireFunction(r,n),rawDestructor:embind__requireFunction(a,o),fields:[]}}__embind_register_value_object.sig="vpppppp";function __embind_register_value_object_field(e,t,r,n,a,o,l,u,_,d){e>>>=0,t>>>=0,r>>>=0,n>>>=0,a>>>=0,o>>>=0,l>>>=0,u>>>=0,_>>>=0,d>>>=0,structRegistrations[e].fields.push({fieldName:readLatin1String(t),getterReturnType:r,getter:embind__requireFunction(n,a),getterContext:o,setterArgumentType:l,setter:embind__requireFunction(u,_),setterContext:d})}__embind_register_value_object_field.sig="vpppppppppp";var __embind_finalize_value_object=function(e){e>>>=0;var t=structRegistrations[e];delete structRegistrations[e];var r=t.rawConstructor,n=t.rawDestructor,a=t.fields,o=a.map(l=>l.getterReturnType).concat(a.map(l=>l.setterArgumentType));whenDependentTypesAreResolved([e],o,l=>{var u={};return a.forEach((_,d)=>{var f=_.fieldName,p=l[d],m=_.getter,h=_.getterContext,g=l[d+a.length],v=_.setter,b=_.setterContext;u[f]={read:S=>p.fromWireType(m(h,S)),write:(S,L)=>{var x=[];v(b,S,g.toWireType(x,L)),runDestructors(x)}}}),[{name:t.name,fromWireType:_=>{var d={};for(var f in u)d[f]=u[f].read(_);return n(_),d},toWireType:(_,d)=>{for(var f in u)if(!(f in d))throw new TypeError('Missing field: "'.concat(f,'"'));var p=r();for(f in u)u[f].write(p,d[f]);return _!==null&&_.push(n,p),p},argPackAdvance:GenericWireTypeSize,readValueFromPointer:readPointer,destructorFunction:n}]})};__embind_finalize_value_object.sig="vp";var upcastPointer=(e,t,r)=>{for(;t!==r;)t.upcast||throwBindingError("Expected null or instance of ".concat(r.name,", got an instance of ").concat(t.name)),e=t.upcast(e),t=t.baseClass;return e};function genericPointerToWireType(e,t){var r;if(t===null)return this.isReference&&throwBindingError("null is not a valid ".concat(this.name)),this.isSmartPointer?(r=this.rawConstructor(),e!==null&&e.push(this.rawDestructor,r),r):0;(!t||!t.$$)&&throwBindingError('Cannot pass "'.concat(embindRepr(t),'" as a ').concat(this.name)),t.$$.ptr||throwBindingError("Cannot pass deleted object as a pointer of type ".concat(this.name)),!this.isConst&&t.$$.ptrType.isConst&&throwBindingError("Cannot convert argument of type ".concat(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name," to parameter type ").concat(this.name));var n=t.$$.ptrType.registeredClass;if(r=upcastPointer(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(t.$$.smartPtr===void 0&&throwBindingError("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:throwBindingError("Cannot convert argument of type ".concat(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name," to parameter type ").concat(this.name));break;case 1:r=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)r=t.$$.smartPtr;else{var a=t.clone();r=this.rawShare(r,Emval.toHandle(()=>a.delete())),e!==null&&e.push(this.rawDestructor,r)}break;default:throwBindingError("Unsupporting sharing policy")}return r}function constNoSmartPtrRawPointerToWireType(e,t){if(t===null)return this.isReference&&throwBindingError("null is not a valid ".concat(this.name)),0;t.$$||throwBindingError('Cannot pass "'.concat(embindRepr(t),'" as a ').concat(this.name)),t.$$.ptr||throwBindingError("Cannot pass deleted object as a pointer of type ".concat(this.name));var r=t.$$.ptrType.registeredClass,n=upcastPointer(t.$$.ptr,r,this.registeredClass);return n}function nonConstNoSmartPtrRawPointerToWireType(e,t){if(t===null)return this.isReference&&throwBindingError("null is not a valid ".concat(this.name)),0;t.$$||throwBindingError('Cannot pass "'.concat(embindRepr(t),'" as a ').concat(this.name)),t.$$.ptr||throwBindingError("Cannot pass deleted object as a pointer of type ".concat(this.name)),t.$$.ptrType.isConst&&throwBindingError("Cannot convert argument of type ".concat(t.$$.ptrType.name," to parameter type ").concat(this.name));var r=t.$$.ptrType.registeredClass,n=upcastPointer(t.$$.ptr,r,this.registeredClass);return n}function RegisteredPointer(e,t,r,n,a,o,l,u,_,d,f){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=a,this.pointeeType=o,this.sharingPolicy=l,this.rawGetPointee=u,this.rawConstructor=_,this.rawShare=d,this.rawDestructor=f,!a&&t.baseClass===void 0?n?(this.toWireType=constNoSmartPtrRawPointerToWireType,this.destructorFunction=null):(this.toWireType=nonConstNoSmartPtrRawPointerToWireType,this.destructorFunction=null):this.toWireType=genericPointerToWireType}var downcastPointer=(e,t,r)=>{if(t===r)return e;if(r.baseClass===void 0)return null;var n=downcastPointer(e,t,r.baseClass);return n===null?null:r.downcast(n)},finalizationRegistry=!1,detachFinalizer=e=>{},runDestructor=e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)},releaseClassHandle=e=>{e.count.value-=1;var t=e.count.value===0;t&&runDestructor(e)},attachFinalizer=e=>typeof FinalizationRegistry>"u"?(attachFinalizer=t=>t,e):(finalizationRegistry=new FinalizationRegistry(t=>{releaseClassHandle(t.$$)}),attachFinalizer=t=>{var r=t.$$,n=!!r.smartPtr;if(n){var a={$$:r};finalizationRegistry.register(t,a,t)}return t},detachFinalizer=t=>finalizationRegistry.unregister(t),attachFinalizer(e)),makeClassHandle=(e,t)=>{(!t.ptrType||!t.ptr)&&throwInternalError("makeClassHandle requires ptr and ptrType");var r=!!t.smartPtrType,n=!!t.smartPtr;return r!==n&&throwInternalError("Both smartPtrType and smartPtr must be specified"),t.count={value:1},attachFinalizer(Object.create(e,{$$:{value:t,writable:!0}}))};function RegisteredPointer_fromWireType(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=getInheritedInstance(this.registeredClass,t);if(r!==void 0){if(r.$$.count.value===0)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var n=r.clone();return this.destructor(e),n}function a(){return this.isSmartPointer?makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var o=this.registeredClass.getActualType(t),l=registeredPointers[o];if(!l)return a.call(this);var u;this.isConst?u=l.constPointerType:u=l.pointerType;var _=downcastPointer(t,this.registeredClass,u.registeredClass);return _===null?a.call(this):this.isSmartPointer?makeClassHandle(u.registeredClass.instancePrototype,{ptrType:u,ptr:_,smartPtrType:this,smartPtr:e}):makeClassHandle(u.registeredClass.instancePrototype,{ptrType:u,ptr:_})}var init_RegisteredPointer=()=>{Object.assign(RegisteredPointer.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){var t;(t=this.rawDestructor)==null||t.call(this,e)},argPackAdvance:GenericWireTypeSize,readValueFromPointer:readPointer,fromWireType:RegisteredPointer_fromWireType})},detachFinalizer_deps=["$finalizationRegistry"];function ClassHandle(){}var shallowCopyInternalPointer=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),throwInstanceAlreadyDeleted=e=>{function t(r){return r.$$.ptrType.registeredClass.name}throwBindingError(t(e)+" instance already deleted")},init_ClassHandle=()=>{Object.assign(ClassHandle.prototype,{isAliasOf(e){if(!(this instanceof ClassHandle)||!(e instanceof ClassHandle))return!1;var t=this.$$.ptrType.registeredClass,r=this.$$.ptr;e.$$=e.$$;for(var n=e.$$.ptrType.registeredClass,a=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;n.baseClass;)a=n.upcast(a),n=n.baseClass;return t===n&&r===a},clone(){if(this.$$.ptr||throwInstanceAlreadyDeleted(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=attachFinalizer(Object.create(Object.getPrototypeOf(this),{$$:{value:shallowCopyInternalPointer(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e},delete(){this.$$.ptr||throwInstanceAlreadyDeleted(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&throwBindingError("Object already scheduled for deletion"),detachFinalizer(this),releaseClassHandle(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||throwInstanceAlreadyDeleted(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&throwBindingError("Object already scheduled for deletion"),deletionQueue.push(this),deletionQueue.length===1&&delayFunction&&delayFunction(flushPendingDeletes),this.$$.deleteScheduled=!0,this}})};function RegisteredClass(e,t,r,n,a,o,l,u){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=a,this.getActualType=o,this.upcast=l,this.downcast=u,this.pureVirtualFunctions=[]}var char_0=48,char_9=57,makeLegalFunctionName=e=>{if(e===void 0)return"_unknown";e=e.replace(/[^a-zA-Z0-9_]/g,"$");var t=e.charCodeAt(0);return t>=char_0&&t<=char_9?"_".concat(e):e};function __embind_register_class(e,t,r,n,a,o,l,u,_,d,f,p,m){e>>>=0,t>>>=0,r>>>=0,n>>>=0,a>>>=0,o>>>=0,l>>>=0,u>>>=0,_>>>=0,d>>>=0,f>>>=0,p>>>=0,m>>>=0,f=readLatin1String(f),o=embind__requireFunction(a,o),u&&(u=embind__requireFunction(l,u)),d&&(d=embind__requireFunction(_,d)),m=embind__requireFunction(p,m);var h=makeLegalFunctionName(f);exposePublicSymbol(h,function(){throwUnboundTypeError("Cannot construct ".concat(f," due to unbound types"),[n])}),whenDependentTypesAreResolved([e,t,r],n?[n]:[],g=>{var E,A;g=g[0];var v,b;n?(v=g.registeredClass,b=v.instancePrototype):b=ClassHandle.prototype;var S=createNamedFunction(f,function(...C){if(Object.getPrototypeOf(this)!==L)throw new BindingError("Use 'new' to construct "+f);if(x.constructor_body===void 0)throw new BindingError(f+" has no accessible constructor");var D=x.constructor_body[C.length];if(D===void 0)throw new BindingError("Tried to invoke ctor of ".concat(f," with invalid number of parameters (").concat(C.length,") - expected (").concat(Object.keys(x.constructor_body).toString(),") parameters instead!"));return D.apply(this,C)}),L=Object.create(b,{constructor:{value:S}});S.prototype=L;var x=new RegisteredClass(f,S,L,m,v,o,u,d);x.baseClass&&((A=(E=x.baseClass).__derivedClasses)!=null||(E.__derivedClasses=[]),x.baseClass.__derivedClasses.push(x));var T=new RegisteredPointer(f,x,!0,!1,!1),w=new RegisteredPointer(f+"*",x,!1,!1,!1),F=new RegisteredPointer(f+" const*",x,!1,!0,!1);return registeredPointers[e]={pointerType:w,constPointerType:F},replacePublicSymbol(h,S),[T,w,F]})}__embind_register_class.sig="vppppppppppppp";var __embind_register_class_constructor=function(e,t,r,n,a,o){e>>>=0,r>>>=0,n>>>=0,a>>>=0,o>>>=0;var l=heap32VectorToArray(t,r);a=embind__requireFunction(n,a);var u=[o],_=[];whenDependentTypesAreResolved([],[e],d=>{d=d[0];var f="constructor ".concat(d.name);if(d.registeredClass.constructor_body===void 0&&(d.registeredClass.constructor_body=[]),d.registeredClass.constructor_body[t-1]!==void 0)throw new BindingError("Cannot register multiple constructors with identical number of parameters (".concat(t-1,") for class '").concat(d.name,"'! Overload resolution is currently only performed using the parameter count, not actual type info!"));return d.registeredClass.constructor_body[t-1]=()=>{throwUnboundTypeError("Cannot construct ".concat(d.name," due to unbound types"),l)},whenDependentTypesAreResolved([],l,p=>(p.splice(1,0,null),d.registeredClass.constructor_body[t-1]=craftInvokerFunction(f,p,null,a,o),[])),[]})};__embind_register_class_constructor.sig="vpipppp";var validateThis=(e,t,r)=>(e instanceof Object||throwBindingError("".concat(r,' with invalid "this": ').concat(e)),e instanceof t.registeredClass.constructor||throwBindingError("".concat(r,' incompatible with "this" of type ').concat(e.constructor.name)),e.$$.ptr||throwBindingError("cannot call emscripten binding method ".concat(r," on deleted object")),upcastPointer(e.$$.ptr,e.$$.ptrType.registeredClass,t.registeredClass)),__embind_register_class_function=function(e,t,r,n,a,o,l,u,_,d){e>>>=0,t>>>=0,n>>>=0,a>>>=0,o>>>=0,l>>>=0;var f=heap32VectorToArray(r,n);t=readLatin1String(t),t=getFunctionName(t),o=embind__requireFunction(a,o),whenDependentTypesAreResolved([],[e],p=>{p=p[0];var m="".concat(p.name,".").concat(t);t.startsWith("@@")&&(t=Symbol[t.substring(2)]),u&&p.registeredClass.pureVirtualFunctions.push(t);function h(){throwUnboundTypeError("Cannot call ".concat(m," due to unbound types"),f)}var g=p.registeredClass.instancePrototype,v=g[t];return v===void 0||v.overloadTable===void 0&&v.className!==p.name&&v.argCount===r-2?(h.argCount=r-2,h.className=p.name,g[t]=h):(ensureOverloadTable(g,t,m),g[t].overloadTable[r-2]=h),whenDependentTypesAreResolved([],f,b=>{var S=craftInvokerFunction(m,b,p,o,l,_);return g[t].overloadTable===void 0?(S.argCount=r-2,g[t]=S):g[t].overloadTable[r-2]=S,[]}),[]})};__embind_register_class_function.sig="vppippppiii";var __embind_register_class_property=function(e,t,r,n,a,o,l,u,_,d){e>>>=0,t>>>=0,r>>>=0,n>>>=0,a>>>=0,o>>>=0,l>>>=0,u>>>=0,_>>>=0,d>>>=0,t=readLatin1String(t),a=embind__requireFunction(n,a),whenDependentTypesAreResolved([],[e],f=>{f=f[0];var p="".concat(f.name,".").concat(t),m={get(){throwUnboundTypeError("Cannot access ".concat(p," due to unbound types"),[r,l])},enumerable:!0,configurable:!0};return _?m.set=()=>throwUnboundTypeError("Cannot access ".concat(p," due to unbound types"),[r,l]):m.set=h=>throwBindingError(p+" is a read-only property"),Object.defineProperty(f.registeredClass.instancePrototype,t,m),whenDependentTypesAreResolved([],_?[r,l]:[r],h=>{var g=h[0],v={get(){var S=validateThis(this,f,p+" getter");return g.fromWireType(a(o,S))},enumerable:!0};if(_){_=embind__requireFunction(u,_);var b=h[1];v.set=function(S){var L=validateThis(this,f,p+" setter"),x=[];_(d,L,b.toWireType(x,S)),runDestructors(x)}}return Object.defineProperty(f.registeredClass.instancePrototype,t,v),[]}),[]})};__embind_register_class_property.sig="vpppppppppp";var __embind_register_class_class_function=function(e,t,r,n,a,o,l,u,_){e>>>=0,t>>>=0,n>>>=0,a>>>=0,o>>>=0,l>>>=0;var d=heap32VectorToArray(r,n);t=readLatin1String(t),t=getFunctionName(t),o=embind__requireFunction(a,o),whenDependentTypesAreResolved([],[e],f=>{f=f[0];var p="".concat(f.name,".").concat(t);function m(){throwUnboundTypeError("Cannot call ".concat(p," due to unbound types"),d)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]);var h=f.registeredClass.constructor;return h[t]===void 0?(m.argCount=r-1,h[t]=m):(ensureOverloadTable(h,t,p),h[t].overloadTable[r-1]=m),whenDependentTypesAreResolved([],d,g=>{var v=[g[0],null].concat(g.slice(1)),b=craftInvokerFunction(p,v,null,o,l,u);if(h[t].overloadTable===void 0?(b.argCount=r-1,h[t]=b):h[t].overloadTable[r-1]=b,f.registeredClass.__derivedClasses)for(let S of f.registeredClass.__derivedClasses)S.constructor.hasOwnProperty(t)||(S.constructor[t]=b);return[]}),[]})};__embind_register_class_class_function.sig="vppippppii";var __embind_register_class_class_property=function(e,t,r,n,a,o,l,u){e>>>=0,t>>>=0,r>>>=0,n>>>=0,a>>>=0,o>>>=0,l>>>=0,u>>>=0,t=readLatin1String(t),o=embind__requireFunction(a,o),whenDependentTypesAreResolved([],[e],_=>{_=_[0];var d="".concat(_.name,".").concat(t),f={get(){throwUnboundTypeError("Cannot access ".concat(d," due to unbound types"),[r])},enumerable:!0,configurable:!0};return u?f.set=()=>{throwUnboundTypeError("Cannot access ".concat(d," due to unbound types"),[r])}:f.set=p=>{throwBindingError("".concat(d," is a read-only property"))},Object.defineProperty(_.registeredClass.constructor,t,f),whenDependentTypesAreResolved([],[r],p=>{p=p[0];var m={get(){return p.fromWireType(o(n))},enumerable:!0};return u&&(u=embind__requireFunction(l,u),m.set=h=>{var g=[];u(n,p.toWireType(g,h)),runDestructors(g)}),Object.defineProperty(_.registeredClass.constructor,t,m),[]}),[]})};__embind_register_class_class_property.sig="vpppppppp";function __embind_create_inheriting_constructor(e,t,r){e>>>=0,t>>>=0,r>>>=0,e=readLatin1String(e),t=requireRegisteredType(t,"wrapper"),r=Emval.toValue(r);var n=t.registeredClass,a=n.instancePrototype,o=n.baseClass,l=o.instancePrototype,u=n.baseClass.constructor,_=createNamedFunction(e,function(...d){n.baseClass.pureVirtualFunctions.forEach((function(f){if(this[f]===l[f])throw new PureVirtualError("Pure virtual function ".concat(f," must be implemented in JavaScript"))}).bind(this)),Object.defineProperty(this,"__parent",{value:a}),this.__construct(...d)});return a.__construct=function(...f){this===a&&throwBindingError("Pass correct 'this' to __construct");var p=u.implement(this,...f);detachFinalizer(p);var m=p.$$;p.notifyOnDestruction(),m.preservePointerOnDelete=!0,Object.defineProperties(this,{$$:{value:m}}),attachFinalizer(this),registerInheritedInstance(n,m.ptr,this)},a.__destruct=function(){this===a&&throwBindingError("Pass correct 'this' to __destruct"),detachFinalizer(this),unregisterInheritedInstance(n,this.$$.ptr)},_.prototype=Object.create(a),Object.assign(_.prototype,r),Emval.toHandle(_)}__embind_create_inheriting_constructor.sig="pppp";var __embind_register_smart_ptr=function(e,t,r,n,a,o,l,u,_,d,f,p){e>>>=0,t>>>=0,r>>>=0,a>>>=0,o>>>=0,l>>>=0,u>>>=0,_>>>=0,d>>>=0,f>>>=0,p>>>=0,r=readLatin1String(r),o=embind__requireFunction(a,o),u=embind__requireFunction(l,u),d=embind__requireFunction(_,d),p=embind__requireFunction(f,p),whenDependentTypesAreResolved([e],[t],m=>{m=m[0];var h=new RegisteredPointer(r,m.registeredClass,!1,!1,!0,m,n,o,u,d,p);return[h]})};__embind_register_smart_ptr.sig="vpppipppppppp";function __embind_register_enum(e,t,r,n){e>>>=0,t>>>=0,r>>>=0,t=readLatin1String(t);function a(){}a.values={},registerType(e,{name:t,constructor:a,fromWireType:function(o){return this.constructor.values[o]},toWireType:(o,l)=>l.value,argPackAdvance:GenericWireTypeSize,readValueFromPointer:enumReadValueFromPointer(t,r,n),destructorFunction:null}),exposePublicSymbol(t,a)}__embind_register_enum.sig="vpppi";function __embind_register_enum_value(e,t,r){e>>>=0,t>>>=0;var n=requireRegisteredType(e,"enum");t=readLatin1String(t);var a=n.constructor,o=Object.create(n.constructor.prototype,{value:{value:r},constructor:{value:createNamedFunction("".concat(n.name,"_").concat(t),function(){})}});a.values[r]=o,a[t]=o}__embind_register_enum_value.sig="vppi";var __embind_register_constant=function(e,t,r){e>>>=0,t>>>=0,e=readLatin1String(e),whenDependentTypesAreResolved([],[t],n=>(n=n[0],Module[e]=n.fromWireType(r),[]))};__embind_register_constant.sig="vppd";var emval_symbols={};function __emval_register_symbol(e){e>>>=0,emval_symbols[e]=readLatin1String(e)}__emval_register_symbol.sig="vp";var getStringOrSymbol=e=>{var t=emval_symbols[e];return t===void 0?readLatin1String(e):t};function __emval_incref(e){e>>>=0,e>9&&(emval_handles[e+1]+=1)}__emval_incref.sig="vp";function __emval_run_destructors(e){e>>>=0;var t=Emval.toValue(e);runDestructors(t),__emval_decref(e)}__emval_run_destructors.sig="vp";function __emval_new_array(){return Emval.toHandle([])}__emval_new_array.sig="p";function __emval_new_array_from_memory_view(e){e>>>=0,e=Emval.toValue(e);for(var t=new Array(e.length),r=0;r>>=0,Emval.toHandle(getStringOrSymbol(e))}__emval_new_cstring.sig="pp";function __emval_new_u8string(e){return e>>>=0,Emval.toHandle(UTF8ToString(e))}__emval_new_u8string.sig="pp";function __emval_new_u16string(e){return e>>>=0,Emval.toHandle(UTF16ToString(e))}__emval_new_u16string.sig="pp";function __emval_take_value(e,t){e>>>=0,t>>>=0,e=requireRegisteredType(e,"_emval_take_value");var r=e.readValueFromPointer(t);return Emval.toHandle(r)}__emval_take_value.sig="ppp";var emval_get_global=()=>typeof globalThis=="object"?globalThis:function(){return Function}()("return this")();function __emval_get_global(e){return e>>>=0,e===0?Emval.toHandle(emval_get_global()):(e=getStringOrSymbol(e),Emval.toHandle(emval_get_global()[e]))}__emval_get_global.sig="pp";function __emval_get_module_property(e){return e>>>=0,e=getStringOrSymbol(e),Emval.toHandle(Module[e])}__emval_get_module_property.sig="pp";function __emval_get_property(e,t){return e>>>=0,t>>>=0,e=Emval.toValue(e),t=Emval.toValue(t),Emval.toHandle(e[t])}__emval_get_property.sig="ppp";function __emval_set_property(e,t,r){e>>>=0,t>>>=0,r>>>=0,e=Emval.toValue(e),t=Emval.toValue(t),r=Emval.toValue(r),e[t]=r}__emval_set_property.sig="vppp";var emval_returnValue=(e,t,r)=>{var n=[],a=e.toWireType(n,r);return n.length&&(HEAPU32[t>>>2>>>0]=Emval.toHandle(n)),a};function __emval_as(e,t,r){return e>>>=0,t>>>=0,r>>>=0,e=Emval.toValue(e),t=requireRegisteredType(t,"emval::as"),emval_returnValue(t,r,e)}__emval_as.sig="dppp";function __emval_as_int64(e,t){return e>>>=0,t>>>=0,e=Emval.toValue(e),t=requireRegisteredType(t,"emval::as"),t.toWireType(null,e)}__emval_as_int64.sig="ipp";function __emval_as_uint64(e,t){return e>>>=0,t>>>=0,e=Emval.toValue(e),t=requireRegisteredType(t,"emval::as"),t.toWireType(null,e)}__emval_as_uint64.sig="ipp";function __emval_equals(e,t){return e>>>=0,t>>>=0,e=Emval.toValue(e),t=Emval.toValue(t),e==t}__emval_equals.sig="ipp";function __emval_strictly_equals(e,t){return e>>>=0,t>>>=0,e=Emval.toValue(e),t=Emval.toValue(t),e===t}__emval_strictly_equals.sig="ipp";function __emval_greater_than(e,t){return e>>>=0,t>>>=0,e=Emval.toValue(e),t=Emval.toValue(t),e>t}__emval_greater_than.sig="ipp";function __emval_less_than(e,t){return e>>>=0,t>>>=0,e=Emval.toValue(e),t=Emval.toValue(t),e>>=0,e=Emval.toValue(e),!e}__emval_not.sig="ip";var emval_methodCallers=[];function __emval_call(e,t,r,n){return e>>>=0,t>>>=0,r>>>=0,n>>>=0,e=emval_methodCallers[e],t=Emval.toValue(t),e(null,t,r,n)}__emval_call.sig="dpppp";var emval_lookupTypes=(e,t)=>{for(var r=new Array(e),n=0;n>>2>>>0],"parameter "+n);return r},emval_addMethodCaller=e=>{var t=emval_methodCallers.length;return emval_methodCallers.push(e),t},reflectConstruct=Reflect.construct;function __emval_get_method_caller(e,t,r){t>>>=0;var n=emval_lookupTypes(e,t),a=n.shift();e--;var o="return function (obj, func, destructorsRef, args) {\n",l=0,u=[];r===0&&u.push("obj");for(var _=["retType"],d=[a],f=0;fg.name).join(", "),") => ").concat(a.name,">");return emval_addMethodCaller(createNamedFunction(h,m))}__emval_get_method_caller.sig="pipi";function __emval_call_method(e,t,r,n,a){return e>>>=0,t>>>=0,r>>>=0,n>>>=0,a>>>=0,e=emval_methodCallers[e],t=Emval.toValue(t),r=getStringOrSymbol(r),e(t,t[r],n,a)}__emval_call_method.sig="dppppp";function __emval_typeof(e){return e>>>=0,e=Emval.toValue(e),Emval.toHandle(typeof e)}__emval_typeof.sig="pp";function __emval_instanceof(e,t){return e>>>=0,t>>>=0,e=Emval.toValue(e),t=Emval.toValue(t),e instanceof t}__emval_instanceof.sig="ipp";function __emval_is_number(e){return e>>>=0,e=Emval.toValue(e),typeof e=="number"}__emval_is_number.sig="ip";function __emval_is_string(e){return e>>>=0,e=Emval.toValue(e),typeof e=="string"}__emval_is_string.sig="ip";function __emval_in(e,t){return e>>>=0,t>>>=0,e=Emval.toValue(e),t=Emval.toValue(t),e in t}__emval_in.sig="ipp";function __emval_delete(e,t){return e>>>=0,t>>>=0,e=Emval.toValue(e),t=Emval.toValue(t),delete e[t]}__emval_delete.sig="ipp";function __emval_throw(e){throw e>>>=0,e=Emval.toValue(e),e}__emval_throw.sig="ip";function __emval_iter_begin(e){return e>>>=0,e=Emval.toValue(e),Emval.toHandle(e[Symbol.iterator]())}__emval_iter_begin.sig="pp";function __emval_iter_next(e){e>>>=0,e=Emval.toValue(e);var t=e.next();return t.done?0:Emval.toHandle(t.value)}__emval_iter_next.sig="pp";var __emval_coro_suspend=function(e,t){e>>>=0,t>>>=0,Emval.toValue(e).then(r=>{__emval_coro_resume(t,Emval.toHandle(r))})};__emval_coro_suspend.sig="vpp";var __emval_coro_make_promise=function(e,t){return e>>>=0,t>>>=0,Emval.toHandle(new Promise((r,n)=>{let a=()=>{try{___cxa_rethrow()}catch(o){n(o)}};HEAPU32[e>>>2>>>0]=Emval.toHandle(r),HEAPU32[t>>>2>>>0]=Emval.toHandle(a)}))};__emval_coro_make_promise.sig="ppp";function _duckdb_web_fs_file_sync(e){return globalThis.DUCKDB_RUNTIME.syncFile(Module,e)}_duckdb_web_fs_file_sync.sig="vi";function _duckdb_web_fs_file_remove(e,t){return globalThis.DUCKDB_RUNTIME.removeFile(Module,e,t)}registerWasmPlugin(),FS.createPreloadedFile=FS_createPreloadedFile,FS.staticInit(),embind_init_charCodes(),BindingError=Module.BindingError=class extends Error{constructor(t){super(t),this.name="BindingError"}},InternalError=Module.InternalError=class extends Error{constructor(t){super(t),this.name="InternalError"}},init_emval(),Module.requestAnimationFrame=MainLoop.requestAnimationFrame,Module.pauseMainLoop=MainLoop.pause,Module.resumeMainLoop=MainLoop.resume,MainLoop.init();for(var i=0;i<32;++i)tempFixedLengthArray.push(new Array(i));for(var miniTempWebGLFloatBuffersStorage=new Float32Array(288),i=0;i<=288;++i)miniTempWebGLFloatBuffers[i]=miniTempWebGLFloatBuffersStorage.subarray(0,i);for(var miniTempWebGLIntBuffersStorage=new Int32Array(288),i=0;i<=288;++i)miniTempWebGLIntBuffers[i]=miniTempWebGLIntBuffersStorage.subarray(0,i);var emSetImmediate,emClearImmediate;if(typeof setImmediate<"u")emSetImmediate=setImmediateWrapped,emClearImmediate=clearImmediateWrapped;else if(typeof addEventListener=="function"){var __setImmediate_id_counter=0,__setImmediate_queue=[],__setImmediate_message_id="_si",__setImmediate_cb=e=>{e.data===__setImmediate_message_id&&(e.stopPropagation(),__setImmediate_queue.shift()(),++__setImmediate_id_counter)};addEventListener("message",__setImmediate_cb,!0),emSetImmediate=e=>(postMessage(__setImmediate_message_id,"*"),__setImmediate_id_counter+__setImmediate_queue.push(e)-1),emClearImmediate=e=>{var t=e-__setImmediate_id_counter;t>=0&&t<__setImmediate_queue.length&&(__setImmediate_queue[t]=()=>{})}}Module.requestFullscreen=Browser.requestFullscreen,Module.setCanvasSize=Browser.setCanvasSize,Module.getUserMedia=Browser.getUserMedia,Module.createContext=Browser.createContext;var preloadedImages={},preloadedAudios={};registerPostMainLoop(()=>{var e,t;return(t=(e=SDL.audio)==null?void 0:e.queueNewAudioData)==null?void 0:t.call(e)}),UnboundTypeError=Module.UnboundTypeError=extendError(Error,"UnboundTypeError"),PureVirtualError=Module.PureVirtualError=extendError(Error,"PureVirtualError"),init_embind(),init_RegisteredPointer(),init_ClassHandle();var wasmImports={IMG_Init:_IMG_Init,IMG_Load:_IMG_Load,IMG_Load_RW:_IMG_Load_RW,IMG_Quit:_IMG_Quit,Mix_AllocateChannels:_Mix_AllocateChannels,Mix_ChannelFinished:_Mix_ChannelFinished,Mix_CloseAudio:_Mix_CloseAudio,Mix_FadeInChannelTimed:_Mix_FadeInChannelTimed,Mix_FadeInMusicPos:_Mix_FadeInMusicPos,Mix_FadeOutChannel:_Mix_FadeOutChannel,Mix_FadeOutMusic:_Mix_FadeOutMusic,Mix_FadingChannel:_Mix_FadingChannel,Mix_FreeChunk:_Mix_FreeChunk,Mix_FreeMusic:_Mix_FreeMusic,Mix_HaltChannel:_Mix_HaltChannel,Mix_HaltMusic:_Mix_HaltMusic,Mix_HookMusicFinished:_Mix_HookMusicFinished,Mix_Init:_Mix_Init,Mix_Linked_Version:_Mix_Linked_Version,Mix_LoadMUS:_Mix_LoadMUS,Mix_LoadMUS_RW:_Mix_LoadMUS_RW,Mix_LoadWAV:_Mix_LoadWAV,Mix_LoadWAV_RW:_Mix_LoadWAV_RW,Mix_OpenAudio:_Mix_OpenAudio,Mix_Pause:_Mix_Pause,Mix_PauseMusic:_Mix_PauseMusic,Mix_Paused:_Mix_Paused,Mix_PausedMusic:_Mix_PausedMusic,Mix_PlayChannelTimed:_Mix_PlayChannelTimed,Mix_PlayMusic:_Mix_PlayMusic,Mix_Playing:_Mix_Playing,Mix_PlayingMusic:_Mix_PlayingMusic,Mix_QuerySpec:_Mix_QuerySpec,Mix_QuickLoad_RAW:_Mix_QuickLoad_RAW,Mix_Quit:_Mix_Quit,Mix_ReserveChannels:_Mix_ReserveChannels,Mix_Resume:_Mix_Resume,Mix_ResumeMusic:_Mix_ResumeMusic,Mix_SetPanning:_Mix_SetPanning,Mix_SetPosition:_Mix_SetPosition,Mix_SetPostMix:_Mix_SetPostMix,Mix_Volume:_Mix_Volume,Mix_VolumeChunk:_Mix_VolumeChunk,Mix_VolumeMusic:_Mix_VolumeMusic,SDL_AddTimer:_SDL_AddTimer,SDL_AllocRW:_SDL_AllocRW,SDL_AudioDriverName:_SDL_AudioDriverName,SDL_AudioQuit:_SDL_AudioQuit,SDL_ClearError:_SDL_ClearError,SDL_CloseAudio:_SDL_CloseAudio,SDL_CondBroadcast:_SDL_CondBroadcast,SDL_CondSignal:_SDL_CondSignal,SDL_CondWait:_SDL_CondWait,SDL_CondWaitTimeout:_SDL_CondWaitTimeout,SDL_ConvertSurface:_SDL_ConvertSurface,SDL_CreateCond:_SDL_CreateCond,SDL_CreateMutex:_SDL_CreateMutex,SDL_CreateRGBSurface:_SDL_CreateRGBSurface,SDL_CreateRGBSurfaceFrom:_SDL_CreateRGBSurfaceFrom,SDL_CreateThread:_SDL_CreateThread,SDL_Delay:_SDL_Delay,SDL_DestroyCond:_SDL_DestroyCond,SDL_DestroyMutex:_SDL_DestroyMutex,SDL_DestroyRenderer:_SDL_DestroyRenderer,SDL_DestroyWindow:_SDL_DestroyWindow,SDL_DisplayFormatAlpha:_SDL_DisplayFormatAlpha,SDL_EnableKeyRepeat:_SDL_EnableKeyRepeat,SDL_EnableUNICODE:_SDL_EnableUNICODE,SDL_FillRect:_SDL_FillRect,SDL_Flip:_SDL_Flip,SDL_FreeRW:_SDL_FreeRW,SDL_FreeSurface:_SDL_FreeSurface,SDL_GL_DeleteContext:_SDL_GL_DeleteContext,SDL_GL_ExtensionSupported:_SDL_GL_ExtensionSupported,SDL_GL_GetAttribute:_SDL_GL_GetAttribute,SDL_GL_GetSwapInterval:_SDL_GL_GetSwapInterval,SDL_GL_MakeCurrent:_SDL_GL_MakeCurrent,SDL_GL_SetAttribute:_SDL_GL_SetAttribute,SDL_GL_SetSwapInterval:_SDL_GL_SetSwapInterval,SDL_GL_SwapBuffers:_SDL_GL_SwapBuffers,SDL_GL_SwapWindow:_SDL_GL_SwapWindow,SDL_GetAppState:_SDL_GetAppState,SDL_GetAudioDriver:_SDL_GetAudioDriver,SDL_GetClipRect:_SDL_GetClipRect,SDL_GetCurrentAudioDriver:_SDL_GetCurrentAudioDriver,SDL_GetError:_SDL_GetError,SDL_GetKeyName:_SDL_GetKeyName,SDL_GetKeyState:_SDL_GetKeyState,SDL_GetKeyboardState:_SDL_GetKeyboardState,SDL_GetModState:_SDL_GetModState,SDL_GetMouseState:_SDL_GetMouseState,SDL_GetNumAudioDrivers:_SDL_GetNumAudioDrivers,SDL_GetRGB:_SDL_GetRGB,SDL_GetRGBA:_SDL_GetRGBA,SDL_GetScancodeFromKey:_SDL_GetScancodeFromKey,SDL_GetThreadID:_SDL_GetThreadID,SDL_GetTicks:_SDL_GetTicks,SDL_GetVideoInfo:_SDL_GetVideoInfo,SDL_GetVideoSurface:_SDL_GetVideoSurface,SDL_GetWindowFlags:_SDL_GetWindowFlags,SDL_GetWindowSize:_SDL_GetWindowSize,SDL_Has3DNow:_SDL_Has3DNow,SDL_Has3DNowExt:_SDL_Has3DNowExt,SDL_HasAltiVec:_SDL_HasAltiVec,SDL_HasMMX:_SDL_HasMMX,SDL_HasMMXExt:_SDL_HasMMXExt,SDL_HasRDTSC:_SDL_HasRDTSC,SDL_HasSSE:_SDL_HasSSE,SDL_HasSSE2:_SDL_HasSSE2,SDL_Init:_SDL_Init,SDL_InitSubSystem:_SDL_InitSubSystem,SDL_JoystickClose:_SDL_JoystickClose,SDL_JoystickEventState:_SDL_JoystickEventState,SDL_JoystickGetAxis:_SDL_JoystickGetAxis,SDL_JoystickGetBall:_SDL_JoystickGetBall,SDL_JoystickGetButton:_SDL_JoystickGetButton,SDL_JoystickGetHat:_SDL_JoystickGetHat,SDL_JoystickIndex:_SDL_JoystickIndex,SDL_JoystickName:_SDL_JoystickName,SDL_JoystickNumAxes:_SDL_JoystickNumAxes,SDL_JoystickNumBalls:_SDL_JoystickNumBalls,SDL_JoystickNumButtons:_SDL_JoystickNumButtons,SDL_JoystickNumHats:_SDL_JoystickNumHats,SDL_JoystickOpen:_SDL_JoystickOpen,SDL_JoystickOpened:_SDL_JoystickOpened,SDL_JoystickUpdate:_SDL_JoystickUpdate,SDL_Linked_Version:_SDL_Linked_Version,SDL_ListModes:_SDL_ListModes,SDL_LoadBMP_RW:_SDL_LoadBMP_RW,SDL_LockAudio:_SDL_LockAudio,SDL_LockSurface:_SDL_LockSurface,SDL_LogSetOutputFunction:_SDL_LogSetOutputFunction,SDL_LowerBlit:_SDL_LowerBlit,SDL_LowerBlitScaled:_SDL_LowerBlitScaled,SDL_MapRGB:_SDL_MapRGB,SDL_MapRGBA:_SDL_MapRGBA,SDL_NumJoysticks:_SDL_NumJoysticks,SDL_OpenAudio:_SDL_OpenAudio,SDL_PauseAudio:_SDL_PauseAudio,SDL_PeepEvents:_SDL_PeepEvents,SDL_PollEvent:_SDL_PollEvent,SDL_PumpEvents:_SDL_PumpEvents,SDL_PushEvent:_SDL_PushEvent,SDL_Quit:_SDL_Quit,SDL_QuitSubSystem:_SDL_QuitSubSystem,SDL_RWFromConstMem:_SDL_RWFromConstMem,SDL_RWFromFile:_SDL_RWFromFile,SDL_RWFromMem:_SDL_RWFromMem,SDL_RemoveTimer:_SDL_RemoveTimer,SDL_SaveBMP_RW:_SDL_SaveBMP_RW,SDL_SetAlpha:_SDL_SetAlpha,SDL_SetClipRect:_SDL_SetClipRect,SDL_SetColorKey:_SDL_SetColorKey,SDL_SetColors:_SDL_SetColors,SDL_SetError:_SDL_SetError,SDL_SetGamma:_SDL_SetGamma,SDL_SetGammaRamp:_SDL_SetGammaRamp,SDL_SetPalette:_SDL_SetPalette,SDL_SetVideoMode:_SDL_SetVideoMode,SDL_SetWindowFullscreen:_SDL_SetWindowFullscreen,SDL_SetWindowTitle:_SDL_SetWindowTitle,SDL_ShowCursor:_SDL_ShowCursor,SDL_StartTextInput:_SDL_StartTextInput,SDL_StopTextInput:_SDL_StopTextInput,SDL_ThreadID:_SDL_ThreadID,SDL_UnlockAudio:_SDL_UnlockAudio,SDL_UnlockSurface:_SDL_UnlockSurface,SDL_UpdateRect:_SDL_UpdateRect,SDL_UpdateRects:_SDL_UpdateRects,SDL_UpperBlit:_SDL_UpperBlit,SDL_UpperBlitScaled:_SDL_UpperBlitScaled,SDL_VideoDriverName:_SDL_VideoDriverName,SDL_VideoModeOK:_SDL_VideoModeOK,SDL_VideoQuit:_SDL_VideoQuit,SDL_WM_GrabInput:_SDL_WM_GrabInput,SDL_WM_IconifyWindow:_SDL_WM_IconifyWindow,SDL_WM_SetCaption:_SDL_WM_SetCaption,SDL_WM_SetIcon:_SDL_WM_SetIcon,SDL_WM_ToggleFullScreen:_SDL_WM_ToggleFullScreen,SDL_WaitThread:_SDL_WaitThread,SDL_WarpMouse:_SDL_WarpMouse,SDL_WasInit:_SDL_WasInit,SDL_mutexP:_SDL_mutexP,SDL_mutexV:_SDL_mutexV,TTF_CloseFont:_TTF_CloseFont,TTF_FontAscent:_TTF_FontAscent,TTF_FontDescent:_TTF_FontDescent,TTF_FontHeight:_TTF_FontHeight,TTF_FontLineSkip:_TTF_FontLineSkip,TTF_GlyphMetrics:_TTF_GlyphMetrics,TTF_Init:_TTF_Init,TTF_OpenFont:_TTF_OpenFont,TTF_Quit:_TTF_Quit,TTF_RenderText_Blended:_TTF_RenderText_Blended,TTF_RenderText_Shaded:_TTF_RenderText_Shaded,TTF_RenderText_Solid:_TTF_RenderText_Solid,TTF_RenderUTF8_Solid:_TTF_RenderUTF8_Solid,TTF_SizeText:_TTF_SizeText,TTF_SizeUTF8:_TTF_SizeUTF8,XChangeWindowAttributes:_XChangeWindowAttributes,XCreateWindow:_XCreateWindow,XInternAtom:_XInternAtom,XMapWindow:_XMapWindow,XOpenDisplay:_XOpenDisplay,XPending:_XPending,XSendEvent:_XSendEvent,XSetWMHints:_XSetWMHints,XStoreName:_XStoreName,_Unwind_Backtrace:__Unwind_Backtrace,_Unwind_DeleteException:__Unwind_DeleteException,_Unwind_FindEnclosingFunction:__Unwind_FindEnclosingFunction,_Unwind_GetIPInfo:__Unwind_GetIPInfo,_Unwind_RaiseException:__Unwind_RaiseException,_ZN18duckdb_skiplistlib9skip_list19_throw_exceeds_sizeEm:__ZN18duckdb_skiplistlib9skip_list19_throw_exceeds_sizeEm,__asctime_r:___asctime_r,__assert_fail:___assert_fail,__call_sighandler:___call_sighandler,__cxa_begin_catch:___cxa_begin_catch,__cxa_call_unexpected:___cxa_call_unexpected,__cxa_current_primary_exception:___cxa_current_primary_exception,__cxa_end_catch:___cxa_end_catch,__cxa_find_matching_catch_2:___cxa_find_matching_catch_2,__cxa_find_matching_catch_3:___cxa_find_matching_catch_3,__cxa_find_matching_catch_4:___cxa_find_matching_catch_4,__cxa_rethrow:___cxa_rethrow,__cxa_rethrow_primary_exception:___cxa_rethrow_primary_exception,__cxa_throw:___cxa_throw,__cxa_uncaught_exceptions:___cxa_uncaught_exceptions,__global_base:___global_base,__heap_base:___heap_base,__indirect_function_table:wasmTable,__memory_base:___memory_base,__resumeException:___resumeException,__stack_high:___stack_high,__stack_low:___stack_low,__stack_pointer:___stack_pointer,__syscall__newselect:___syscall__newselect,__syscall_accept4:___syscall_accept4,__syscall_bind:___syscall_bind,__syscall_chdir:___syscall_chdir,__syscall_chmod:___syscall_chmod,__syscall_connect:___syscall_connect,__syscall_dup:___syscall_dup,__syscall_dup3:___syscall_dup3,__syscall_faccessat:___syscall_faccessat,__syscall_fadvise64:___syscall_fadvise64,__syscall_fallocate:___syscall_fallocate,__syscall_fchdir:___syscall_fchdir,__syscall_fchmod:___syscall_fchmod,__syscall_fchmodat2:___syscall_fchmodat2,__syscall_fchown32:___syscall_fchown32,__syscall_fchownat:___syscall_fchownat,__syscall_fcntl64:___syscall_fcntl64,__syscall_fdatasync:___syscall_fdatasync,__syscall_fstat64:___syscall_fstat64,__syscall_fstatfs64:___syscall_fstatfs64,__syscall_ftruncate64:___syscall_ftruncate64,__syscall_getcwd:___syscall_getcwd,__syscall_getdents64:___syscall_getdents64,__syscall_getpeername:___syscall_getpeername,__syscall_getsockname:___syscall_getsockname,__syscall_getsockopt:___syscall_getsockopt,__syscall_ioctl:___syscall_ioctl,__syscall_listen:___syscall_listen,__syscall_lstat64:___syscall_lstat64,__syscall_mkdirat:___syscall_mkdirat,__syscall_mknodat:___syscall_mknodat,__syscall_newfstatat:___syscall_newfstatat,__syscall_openat:___syscall_openat,__syscall_pipe:___syscall_pipe,__syscall_poll:___syscall_poll,__syscall_readlinkat:___syscall_readlinkat,__syscall_recvfrom:___syscall_recvfrom,__syscall_recvmsg:___syscall_recvmsg,__syscall_renameat:___syscall_renameat,__syscall_rmdir:___syscall_rmdir,__syscall_sendmsg:___syscall_sendmsg,__syscall_sendto:___syscall_sendto,__syscall_socket:___syscall_socket,__syscall_stat64:___syscall_stat64,__syscall_statfs64:___syscall_statfs64,__syscall_symlink:___syscall_symlink,__syscall_symlinkat:___syscall_symlinkat,__syscall_truncate64:___syscall_truncate64,__syscall_unlinkat:___syscall_unlinkat,__syscall_utimensat:___syscall_utimensat,__table_base:___table_base,_abort_js:__abort_js,_dlopen_js:__dlopen_js,_dlsym_catchup_js:__dlsym_catchup_js,_dlsym_js:__dlsym_js,_embind_create_inheriting_constructor:__embind_create_inheriting_constructor,_embind_finalize_value_array:__embind_finalize_value_array,_embind_finalize_value_object:__embind_finalize_value_object,_embind_register_bigint:__embind_register_bigint,_embind_register_bool:__embind_register_bool,_embind_register_class:__embind_register_class,_embind_register_class_class_function:__embind_register_class_class_function,_embind_register_class_class_property:__embind_register_class_class_property,_embind_register_class_constructor:__embind_register_class_constructor,_embind_register_class_function:__embind_register_class_function,_embind_register_class_property:__embind_register_class_property,_embind_register_constant:__embind_register_constant,_embind_register_emval:__embind_register_emval,_embind_register_enum:__embind_register_enum,_embind_register_enum_value:__embind_register_enum_value,_embind_register_float:__embind_register_float,_embind_register_function:__embind_register_function,_embind_register_integer:__embind_register_integer,_embind_register_memory_view:__embind_register_memory_view,_embind_register_optional:__embind_register_optional,_embind_register_smart_ptr:__embind_register_smart_ptr,_embind_register_std_string:__embind_register_std_string,_embind_register_std_wstring:__embind_register_std_wstring,_embind_register_user_type:__embind_register_user_type,_embind_register_value_array:__embind_register_value_array,_embind_register_value_array_element:__embind_register_value_array_element,_embind_register_value_object:__embind_register_value_object,_embind_register_value_object_field:__embind_register_value_object_field,_embind_register_void:__embind_register_void,_emscripten_dlopen_js:__emscripten_dlopen_js,_emscripten_fs_load_embedded_files:__emscripten_fs_load_embedded_files,_emscripten_get_now_is_monotonic:__emscripten_get_now_is_monotonic,_emscripten_get_progname:__emscripten_get_progname,_emscripten_lookup_name:__emscripten_lookup_name,_emscripten_memcpy_js:__emscripten_memcpy_js,_emscripten_push_main_loop_blocker:__emscripten_push_main_loop_blocker,_emscripten_push_uncounted_main_loop_blocker:__emscripten_push_uncounted_main_loop_blocker,_emscripten_runtime_keepalive_clear:__emscripten_runtime_keepalive_clear,_emscripten_set_offscreencanvas_size:__emscripten_set_offscreencanvas_size,_emscripten_system:__emscripten_system,_emscripten_throw_longjmp:__emscripten_throw_longjmp,_emval_as:__emval_as,_emval_as_int64:__emval_as_int64,_emval_as_uint64:__emval_as_uint64,_emval_call:__emval_call,_emval_call_method:__emval_call_method,_emval_coro_make_promise:__emval_coro_make_promise,_emval_coro_suspend:__emval_coro_suspend,_emval_decref:__emval_decref,_emval_delete:__emval_delete,_emval_equals:__emval_equals,_emval_get_global:__emval_get_global,_emval_get_method_caller:__emval_get_method_caller,_emval_get_module_property:__emval_get_module_property,_emval_get_property:__emval_get_property,_emval_greater_than:__emval_greater_than,_emval_in:__emval_in,_emval_incref:__emval_incref,_emval_instanceof:__emval_instanceof,_emval_is_number:__emval_is_number,_emval_is_string:__emval_is_string,_emval_iter_begin:__emval_iter_begin,_emval_iter_next:__emval_iter_next,_emval_less_than:__emval_less_than,_emval_new_array:__emval_new_array,_emval_new_array_from_memory_view:__emval_new_array_from_memory_view,_emval_new_cstring:__emval_new_cstring,_emval_new_object:__emval_new_object,_emval_new_u16string:__emval_new_u16string,_emval_new_u8string:__emval_new_u8string,_emval_not:__emval_not,_emval_register_symbol:__emval_register_symbol,_emval_run_destructors:__emval_run_destructors,_emval_set_property:__emval_set_property,_emval_strictly_equals:__emval_strictly_equals,_emval_take_value:__emval_take_value,_emval_throw:__emval_throw,_emval_typeof:__emval_typeof,_glGetActiveAttribOrUniform:__glGetActiveAttribOrUniform,_gmtime_js:__gmtime_js,_localtime_js:__localtime_js,_mktime_js:__mktime_js,_mmap_js:__mmap_js,_msync_js:__msync_js,_munmap_js:__munmap_js,_setitimer_js:__setitimer_js,_timegm_js:__timegm_js,_tzset_js:__tzset_js,alBuffer3f:_alBuffer3f,alBuffer3i:_alBuffer3i,alBufferData:_alBufferData,alBufferf:_alBufferf,alBufferfv:_alBufferfv,alBufferi:_alBufferi,alBufferiv:_alBufferiv,alDeleteBuffers:_alDeleteBuffers,alDeleteSources:_alDeleteSources,alDisable:_alDisable,alDistanceModel:_alDistanceModel,alDopplerFactor:_alDopplerFactor,alDopplerVelocity:_alDopplerVelocity,alEnable:_alEnable,alGenBuffers:_alGenBuffers,alGenSources:_alGenSources,alGetBoolean:_alGetBoolean,alGetBooleanv:_alGetBooleanv,alGetBuffer3f:_alGetBuffer3f,alGetBuffer3i:_alGetBuffer3i,alGetBufferf:_alGetBufferf,alGetBufferfv:_alGetBufferfv,alGetBufferi:_alGetBufferi,alGetBufferiv:_alGetBufferiv,alGetDouble:_alGetDouble,alGetDoublev:_alGetDoublev,alGetEnumValue:_alGetEnumValue,alGetError:_alGetError,alGetFloat:_alGetFloat,alGetFloatv:_alGetFloatv,alGetInteger:_alGetInteger,alGetIntegerv:_alGetIntegerv,alGetListener3f:_alGetListener3f,alGetListener3i:_alGetListener3i,alGetListenerf:_alGetListenerf,alGetListenerfv:_alGetListenerfv,alGetListeneri:_alGetListeneri,alGetListeneriv:_alGetListeneriv,alGetSource3f:_alGetSource3f,alGetSource3i:_alGetSource3i,alGetSourcef:_alGetSourcef,alGetSourcefv:_alGetSourcefv,alGetSourcei:_alGetSourcei,alGetSourceiv:_alGetSourceiv,alGetString:_alGetString,alIsBuffer:_alIsBuffer,alIsEnabled:_alIsEnabled,alIsExtensionPresent:_alIsExtensionPresent,alIsSource:_alIsSource,alListener3f:_alListener3f,alListener3i:_alListener3i,alListenerf:_alListenerf,alListenerfv:_alListenerfv,alListeneri:_alListeneri,alListeneriv:_alListeneriv,alSource3f:_alSource3f,alSource3i:_alSource3i,alSourcePause:_alSourcePause,alSourcePausev:_alSourcePausev,alSourcePlay:_alSourcePlay,alSourcePlayv:_alSourcePlayv,alSourceQueueBuffers:_alSourceQueueBuffers,alSourceRewind:_alSourceRewind,alSourceRewindv:_alSourceRewindv,alSourceStop:_alSourceStop,alSourceStopv:_alSourceStopv,alSourceUnqueueBuffers:_alSourceUnqueueBuffers,alSourcef:_alSourcef,alSourcefv:_alSourcefv,alSourcei:_alSourcei,alSourceiv:_alSourceiv,alSpeedOfSound:_alSpeedOfSound,alcCaptureCloseDevice:_alcCaptureCloseDevice,alcCaptureOpenDevice:_alcCaptureOpenDevice,alcCaptureSamples:_alcCaptureSamples,alcCaptureStart:_alcCaptureStart,alcCaptureStop:_alcCaptureStop,alcCloseDevice:_alcCloseDevice,alcCreateContext:_alcCreateContext,alcDestroyContext:_alcDestroyContext,alcGetContextsDevice:_alcGetContextsDevice,alcGetCurrentContext:_alcGetCurrentContext,alcGetEnumValue:_alcGetEnumValue,alcGetError:_alcGetError,alcGetIntegerv:_alcGetIntegerv,alcGetString:_alcGetString,alcIsExtensionPresent:_alcIsExtensionPresent,alcMakeContextCurrent:_alcMakeContextCurrent,alcOpenDevice:_alcOpenDevice,alcProcessContext:_alcProcessContext,alcSuspendContext:_alcSuspendContext,boxColor:_boxColor,boxRGBA:_boxRGBA,clock_res_get:_clock_res_get,clock_time_get:_clock_time_get,duckdb_web_fs_directory_create:_duckdb_web_fs_directory_create,duckdb_web_fs_directory_exists:_duckdb_web_fs_directory_exists,duckdb_web_fs_directory_list_files:_duckdb_web_fs_directory_list_files,duckdb_web_fs_directory_remove:_duckdb_web_fs_directory_remove,duckdb_web_fs_file_close:_duckdb_web_fs_file_close,duckdb_web_fs_file_exists:_duckdb_web_fs_file_exists,duckdb_web_fs_file_get_last_modified_time:_duckdb_web_fs_file_get_last_modified_time,duckdb_web_fs_file_move:_duckdb_web_fs_file_move,duckdb_web_fs_file_open:_duckdb_web_fs_file_open,duckdb_web_fs_file_read:_duckdb_web_fs_file_read,duckdb_web_fs_file_remove:_duckdb_web_fs_file_remove,duckdb_web_fs_file_sync:_duckdb_web_fs_file_sync,duckdb_web_fs_file_truncate:_duckdb_web_fs_file_truncate,duckdb_web_fs_file_write:_duckdb_web_fs_file_write,duckdb_web_fs_get_default_data_protocol:_duckdb_web_fs_get_default_data_protocol,duckdb_web_fs_glob:_duckdb_web_fs_glob,duckdb_web_test_platform_feature:_duckdb_web_test_platform_feature,duckdb_web_udf_scalar_call:_duckdb_web_udf_scalar_call,eglBindAPI:_eglBindAPI,eglChooseConfig:_eglChooseConfig,eglCreateContext:_eglCreateContext,eglCreateWindowSurface:_eglCreateWindowSurface,eglDestroyContext:_eglDestroyContext,eglDestroySurface:_eglDestroySurface,eglGetConfigAttrib:_eglGetConfigAttrib,eglGetConfigs:_eglGetConfigs,eglGetCurrentContext:_eglGetCurrentContext,eglGetCurrentDisplay:_eglGetCurrentDisplay,eglGetCurrentSurface:_eglGetCurrentSurface,eglGetDisplay:_eglGetDisplay,eglGetError:_eglGetError,eglInitialize:_eglInitialize,eglMakeCurrent:_eglMakeCurrent,eglQueryAPI:_eglQueryAPI,eglQueryContext:_eglQueryContext,eglQueryString:_eglQueryString,eglQuerySurface:_eglQuerySurface,eglReleaseThread:_eglReleaseThread,eglSwapBuffers:_eglSwapBuffers,eglSwapInterval:_eglSwapInterval,eglTerminate:_eglTerminate,eglWaitClient:_eglWaitClient,eglWaitGL:_eglWaitGL,eglWaitNative:_eglWaitNative,ellipseColor:_ellipseColor,ellipseRGBA:_ellipseRGBA,emscripten_SDL_SetEventHandler:_emscripten_SDL_SetEventHandler,emscripten_alcDevicePauseSOFT:_emscripten_alcDevicePauseSOFT,emscripten_alcDeviceResumeSOFT:_emscripten_alcDeviceResumeSOFT,emscripten_alcGetStringiSOFT:_emscripten_alcGetStringiSOFT,emscripten_alcResetDeviceSOFT:_emscripten_alcResetDeviceSOFT,emscripten_asm_const_async_on_main_thread:_emscripten_asm_const_async_on_main_thread,emscripten_asm_const_double:_emscripten_asm_const_double,emscripten_asm_const_double_sync_on_main_thread:_emscripten_asm_const_double_sync_on_main_thread,emscripten_asm_const_int:_emscripten_asm_const_int,emscripten_asm_const_int_sync_on_main_thread:_emscripten_asm_const_int_sync_on_main_thread,emscripten_asm_const_ptr:_emscripten_asm_const_ptr,emscripten_asm_const_ptr_sync_on_main_thread:_emscripten_asm_const_ptr_sync_on_main_thread,emscripten_async_call:_emscripten_async_call,emscripten_async_load_script:_emscripten_async_load_script,emscripten_async_run_script:_emscripten_async_run_script,emscripten_async_wget:_emscripten_async_wget,emscripten_async_wget2:_emscripten_async_wget2,emscripten_async_wget2_abort:_emscripten_async_wget2_abort,emscripten_async_wget2_data:_emscripten_async_wget2_data,emscripten_async_wget_data:_emscripten_async_wget_data,emscripten_call_worker:_emscripten_call_worker,emscripten_cancel_animation_frame:_emscripten_cancel_animation_frame,emscripten_cancel_main_loop:_emscripten_cancel_main_loop,emscripten_clear_immediate:_emscripten_clear_immediate,emscripten_clear_interval:_emscripten_clear_interval,emscripten_clear_timeout:_emscripten_clear_timeout,emscripten_console_error:_emscripten_console_error,emscripten_console_log:_emscripten_console_log,emscripten_console_trace:_emscripten_console_trace,emscripten_console_warn:_emscripten_console_warn,emscripten_create_worker:_emscripten_create_worker,emscripten_date_now:_emscripten_date_now,emscripten_debugger:_emscripten_debugger,emscripten_destroy_worker:_emscripten_destroy_worker,emscripten_enter_soft_fullscreen:_emscripten_enter_soft_fullscreen,emscripten_err:_emscripten_err,emscripten_errn:_emscripten_errn,emscripten_exit_fullscreen:_emscripten_exit_fullscreen,emscripten_exit_pointerlock:_emscripten_exit_pointerlock,emscripten_exit_soft_fullscreen:_emscripten_exit_soft_fullscreen,emscripten_exit_with_live_runtime:_emscripten_exit_with_live_runtime,emscripten_fiber_swap:_emscripten_fiber_swap,emscripten_force_exit:_emscripten_force_exit,emscripten_get_battery_status:_emscripten_get_battery_status,emscripten_get_callstack:_emscripten_get_callstack,emscripten_get_canvas_element_size:_emscripten_get_canvas_element_size,emscripten_get_canvas_size:_emscripten_get_canvas_size,emscripten_get_compiler_setting:_emscripten_get_compiler_setting,emscripten_get_device_pixel_ratio:_emscripten_get_device_pixel_ratio,emscripten_get_devicemotion_status:_emscripten_get_devicemotion_status,emscripten_get_deviceorientation_status:_emscripten_get_deviceorientation_status,emscripten_get_element_css_size:_emscripten_get_element_css_size,emscripten_get_fullscreen_status:_emscripten_get_fullscreen_status,emscripten_get_gamepad_status:_emscripten_get_gamepad_status,emscripten_get_heap_max:_emscripten_get_heap_max,emscripten_get_main_loop_timing:_emscripten_get_main_loop_timing,emscripten_get_mouse_status:_emscripten_get_mouse_status,emscripten_get_now:_emscripten_get_now,emscripten_get_now_res:_emscripten_get_now_res,emscripten_get_num_gamepads:_emscripten_get_num_gamepads,emscripten_get_orientation_status:_emscripten_get_orientation_status,emscripten_get_pointerlock_status:_emscripten_get_pointerlock_status,emscripten_get_preloaded_image_data:_emscripten_get_preloaded_image_data,emscripten_get_preloaded_image_data_from_FILE:_emscripten_get_preloaded_image_data_from_FILE,emscripten_get_screen_size:_emscripten_get_screen_size,emscripten_get_visibility_status:_emscripten_get_visibility_status,emscripten_get_window_title:_emscripten_get_window_title,emscripten_get_worker_queue_size:_emscripten_get_worker_queue_size,emscripten_glActiveTexture:_emscripten_glActiveTexture,emscripten_glAttachShader:_emscripten_glAttachShader,emscripten_glBegin:_emscripten_glBegin,emscripten_glBeginQueryEXT:_emscripten_glBeginQueryEXT,emscripten_glBindAttribLocation:_emscripten_glBindAttribLocation,emscripten_glBindBuffer:_emscripten_glBindBuffer,emscripten_glBindFramebuffer:_emscripten_glBindFramebuffer,emscripten_glBindRenderbuffer:_emscripten_glBindRenderbuffer,emscripten_glBindTexture:_emscripten_glBindTexture,emscripten_glBindVertexArray:_emscripten_glBindVertexArray,emscripten_glBindVertexArrayOES:_emscripten_glBindVertexArrayOES,emscripten_glBlendColor:_emscripten_glBlendColor,emscripten_glBlendEquation:_emscripten_glBlendEquation,emscripten_glBlendEquationSeparate:_emscripten_glBlendEquationSeparate,emscripten_glBlendFunc:_emscripten_glBlendFunc,emscripten_glBlendFuncSeparate:_emscripten_glBlendFuncSeparate,emscripten_glBufferData:_emscripten_glBufferData,emscripten_glBufferSubData:_emscripten_glBufferSubData,emscripten_glCheckFramebufferStatus:_emscripten_glCheckFramebufferStatus,emscripten_glClear:_emscripten_glClear,emscripten_glClearColor:_emscripten_glClearColor,emscripten_glClearDepth:_emscripten_glClearDepth,emscripten_glClearDepthf:_emscripten_glClearDepthf,emscripten_glClearStencil:_emscripten_glClearStencil,emscripten_glClipControlEXT:_emscripten_glClipControlEXT,emscripten_glColorMask:_emscripten_glColorMask,emscripten_glCompileShader:_emscripten_glCompileShader,emscripten_glCompressedTexImage2D:_emscripten_glCompressedTexImage2D,emscripten_glCompressedTexSubImage2D:_emscripten_glCompressedTexSubImage2D,emscripten_glCopyTexImage2D:_emscripten_glCopyTexImage2D,emscripten_glCopyTexSubImage2D:_emscripten_glCopyTexSubImage2D,emscripten_glCreateProgram:_emscripten_glCreateProgram,emscripten_glCreateShader:_emscripten_glCreateShader,emscripten_glCullFace:_emscripten_glCullFace,emscripten_glDeleteBuffers:_emscripten_glDeleteBuffers,emscripten_glDeleteFramebuffers:_emscripten_glDeleteFramebuffers,emscripten_glDeleteProgram:_emscripten_glDeleteProgram,emscripten_glDeleteQueriesEXT:_emscripten_glDeleteQueriesEXT,emscripten_glDeleteRenderbuffers:_emscripten_glDeleteRenderbuffers,emscripten_glDeleteShader:_emscripten_glDeleteShader,emscripten_glDeleteTextures:_emscripten_glDeleteTextures,emscripten_glDeleteVertexArrays:_emscripten_glDeleteVertexArrays,emscripten_glDeleteVertexArraysOES:_emscripten_glDeleteVertexArraysOES,emscripten_glDepthFunc:_emscripten_glDepthFunc,emscripten_glDepthMask:_emscripten_glDepthMask,emscripten_glDepthRange:_emscripten_glDepthRange,emscripten_glDepthRangef:_emscripten_glDepthRangef,emscripten_glDetachShader:_emscripten_glDetachShader,emscripten_glDisable:_emscripten_glDisable,emscripten_glDisableVertexAttribArray:_emscripten_glDisableVertexAttribArray,emscripten_glDrawArrays:_emscripten_glDrawArrays,emscripten_glDrawArraysInstanced:_emscripten_glDrawArraysInstanced,emscripten_glDrawArraysInstancedANGLE:_emscripten_glDrawArraysInstancedANGLE,emscripten_glDrawArraysInstancedARB:_emscripten_glDrawArraysInstancedARB,emscripten_glDrawArraysInstancedEXT:_emscripten_glDrawArraysInstancedEXT,emscripten_glDrawArraysInstancedNV:_emscripten_glDrawArraysInstancedNV,emscripten_glDrawBuffers:_emscripten_glDrawBuffers,emscripten_glDrawBuffersEXT:_emscripten_glDrawBuffersEXT,emscripten_glDrawBuffersWEBGL:_emscripten_glDrawBuffersWEBGL,emscripten_glDrawElements:_emscripten_glDrawElements,emscripten_glDrawElementsInstanced:_emscripten_glDrawElementsInstanced,emscripten_glDrawElementsInstancedANGLE:_emscripten_glDrawElementsInstancedANGLE,emscripten_glDrawElementsInstancedARB:_emscripten_glDrawElementsInstancedARB,emscripten_glDrawElementsInstancedEXT:_emscripten_glDrawElementsInstancedEXT,emscripten_glDrawElementsInstancedNV:_emscripten_glDrawElementsInstancedNV,emscripten_glEnable:_emscripten_glEnable,emscripten_glEnableVertexAttribArray:_emscripten_glEnableVertexAttribArray,emscripten_glEndQueryEXT:_emscripten_glEndQueryEXT,emscripten_glFinish:_emscripten_glFinish,emscripten_glFlush:_emscripten_glFlush,emscripten_glFramebufferRenderbuffer:_emscripten_glFramebufferRenderbuffer,emscripten_glFramebufferTexture2D:_emscripten_glFramebufferTexture2D,emscripten_glFrontFace:_emscripten_glFrontFace,emscripten_glGenBuffers:_emscripten_glGenBuffers,emscripten_glGenFramebuffers:_emscripten_glGenFramebuffers,emscripten_glGenQueriesEXT:_emscripten_glGenQueriesEXT,emscripten_glGenRenderbuffers:_emscripten_glGenRenderbuffers,emscripten_glGenTextures:_emscripten_glGenTextures,emscripten_glGenVertexArrays:_emscripten_glGenVertexArrays,emscripten_glGenVertexArraysOES:_emscripten_glGenVertexArraysOES,emscripten_glGenerateMipmap:_emscripten_glGenerateMipmap,emscripten_glGetActiveAttrib:_emscripten_glGetActiveAttrib,emscripten_glGetActiveUniform:_emscripten_glGetActiveUniform,emscripten_glGetAttachedShaders:_emscripten_glGetAttachedShaders,emscripten_glGetAttribLocation:_emscripten_glGetAttribLocation,emscripten_glGetBooleanv:_emscripten_glGetBooleanv,emscripten_glGetBufferParameteriv:_emscripten_glGetBufferParameteriv,emscripten_glGetError:_emscripten_glGetError,emscripten_glGetFloatv:_emscripten_glGetFloatv,emscripten_glGetFramebufferAttachmentParameteriv:_emscripten_glGetFramebufferAttachmentParameteriv,emscripten_glGetIntegerv:_emscripten_glGetIntegerv,emscripten_glGetProgramInfoLog:_emscripten_glGetProgramInfoLog,emscripten_glGetProgramiv:_emscripten_glGetProgramiv,emscripten_glGetQueryObjecti64vEXT:_emscripten_glGetQueryObjecti64vEXT,emscripten_glGetQueryObjectivEXT:_emscripten_glGetQueryObjectivEXT,emscripten_glGetQueryObjectui64vEXT:_emscripten_glGetQueryObjectui64vEXT,emscripten_glGetQueryObjectuivEXT:_emscripten_glGetQueryObjectuivEXT,emscripten_glGetQueryivEXT:_emscripten_glGetQueryivEXT,emscripten_glGetRenderbufferParameteriv:_emscripten_glGetRenderbufferParameteriv,emscripten_glGetShaderInfoLog:_emscripten_glGetShaderInfoLog,emscripten_glGetShaderPrecisionFormat:_emscripten_glGetShaderPrecisionFormat,emscripten_glGetShaderSource:_emscripten_glGetShaderSource,emscripten_glGetShaderiv:_emscripten_glGetShaderiv,emscripten_glGetString:_emscripten_glGetString,emscripten_glGetTexParameterfv:_emscripten_glGetTexParameterfv,emscripten_glGetTexParameteriv:_emscripten_glGetTexParameteriv,emscripten_glGetUniformLocation:_emscripten_glGetUniformLocation,emscripten_glGetUniformfv:_emscripten_glGetUniformfv,emscripten_glGetUniformiv:_emscripten_glGetUniformiv,emscripten_glGetVertexAttribPointerv:_emscripten_glGetVertexAttribPointerv,emscripten_glGetVertexAttribfv:_emscripten_glGetVertexAttribfv,emscripten_glGetVertexAttribiv:_emscripten_glGetVertexAttribiv,emscripten_glHint:_emscripten_glHint,emscripten_glIsBuffer:_emscripten_glIsBuffer,emscripten_glIsEnabled:_emscripten_glIsEnabled,emscripten_glIsFramebuffer:_emscripten_glIsFramebuffer,emscripten_glIsProgram:_emscripten_glIsProgram,emscripten_glIsQueryEXT:_emscripten_glIsQueryEXT,emscripten_glIsRenderbuffer:_emscripten_glIsRenderbuffer,emscripten_glIsShader:_emscripten_glIsShader,emscripten_glIsTexture:_emscripten_glIsTexture,emscripten_glIsVertexArray:_emscripten_glIsVertexArray,emscripten_glIsVertexArrayOES:_emscripten_glIsVertexArrayOES,emscripten_glLineWidth:_emscripten_glLineWidth,emscripten_glLinkProgram:_emscripten_glLinkProgram,emscripten_glLoadIdentity:_emscripten_glLoadIdentity,emscripten_glMatrixMode:_emscripten_glMatrixMode,emscripten_glMultiDrawArrays:_emscripten_glMultiDrawArrays,emscripten_glMultiDrawArraysANGLE:_emscripten_glMultiDrawArraysANGLE,emscripten_glMultiDrawArraysInstancedANGLE:_emscripten_glMultiDrawArraysInstancedANGLE,emscripten_glMultiDrawArraysInstancedWEBGL:_emscripten_glMultiDrawArraysInstancedWEBGL,emscripten_glMultiDrawArraysWEBGL:_emscripten_glMultiDrawArraysWEBGL,emscripten_glMultiDrawElements:_emscripten_glMultiDrawElements,emscripten_glMultiDrawElementsANGLE:_emscripten_glMultiDrawElementsANGLE,emscripten_glMultiDrawElementsInstancedANGLE:_emscripten_glMultiDrawElementsInstancedANGLE,emscripten_glMultiDrawElementsInstancedWEBGL:_emscripten_glMultiDrawElementsInstancedWEBGL,emscripten_glMultiDrawElementsWEBGL:_emscripten_glMultiDrawElementsWEBGL,emscripten_glPixelStorei:_emscripten_glPixelStorei,emscripten_glPolygonModeWEBGL:_emscripten_glPolygonModeWEBGL,emscripten_glPolygonOffset:_emscripten_glPolygonOffset,emscripten_glPolygonOffsetClampEXT:_emscripten_glPolygonOffsetClampEXT,emscripten_glQueryCounterEXT:_emscripten_glQueryCounterEXT,emscripten_glReadPixels:_emscripten_glReadPixels,emscripten_glReleaseShaderCompiler:_emscripten_glReleaseShaderCompiler,emscripten_glRenderbufferStorage:_emscripten_glRenderbufferStorage,emscripten_glSampleCoverage:_emscripten_glSampleCoverage,emscripten_glScissor:_emscripten_glScissor,emscripten_glShaderBinary:_emscripten_glShaderBinary,emscripten_glShaderSource:_emscripten_glShaderSource,emscripten_glStencilFunc:_emscripten_glStencilFunc,emscripten_glStencilFuncSeparate:_emscripten_glStencilFuncSeparate,emscripten_glStencilMask:_emscripten_glStencilMask,emscripten_glStencilMaskSeparate:_emscripten_glStencilMaskSeparate,emscripten_glStencilOp:_emscripten_glStencilOp,emscripten_glStencilOpSeparate:_emscripten_glStencilOpSeparate,emscripten_glTexImage2D:_emscripten_glTexImage2D,emscripten_glTexParameterf:_emscripten_glTexParameterf,emscripten_glTexParameterfv:_emscripten_glTexParameterfv,emscripten_glTexParameteri:_emscripten_glTexParameteri,emscripten_glTexParameteriv:_emscripten_glTexParameteriv,emscripten_glTexSubImage2D:_emscripten_glTexSubImage2D,emscripten_glUniform1f:_emscripten_glUniform1f,emscripten_glUniform1fv:_emscripten_glUniform1fv,emscripten_glUniform1i:_emscripten_glUniform1i,emscripten_glUniform1iv:_emscripten_glUniform1iv,emscripten_glUniform2f:_emscripten_glUniform2f,emscripten_glUniform2fv:_emscripten_glUniform2fv,emscripten_glUniform2i:_emscripten_glUniform2i,emscripten_glUniform2iv:_emscripten_glUniform2iv,emscripten_glUniform3f:_emscripten_glUniform3f,emscripten_glUniform3fv:_emscripten_glUniform3fv,emscripten_glUniform3i:_emscripten_glUniform3i,emscripten_glUniform3iv:_emscripten_glUniform3iv,emscripten_glUniform4f:_emscripten_glUniform4f,emscripten_glUniform4fv:_emscripten_glUniform4fv,emscripten_glUniform4i:_emscripten_glUniform4i,emscripten_glUniform4iv:_emscripten_glUniform4iv,emscripten_glUniformMatrix2fv:_emscripten_glUniformMatrix2fv,emscripten_glUniformMatrix3fv:_emscripten_glUniformMatrix3fv,emscripten_glUniformMatrix4fv:_emscripten_glUniformMatrix4fv,emscripten_glUseProgram:_emscripten_glUseProgram,emscripten_glValidateProgram:_emscripten_glValidateProgram,emscripten_glVertexAttrib1f:_emscripten_glVertexAttrib1f,emscripten_glVertexAttrib1fv:_emscripten_glVertexAttrib1fv,emscripten_glVertexAttrib2f:_emscripten_glVertexAttrib2f,emscripten_glVertexAttrib2fv:_emscripten_glVertexAttrib2fv,emscripten_glVertexAttrib3f:_emscripten_glVertexAttrib3f,emscripten_glVertexAttrib3fv:_emscripten_glVertexAttrib3fv,emscripten_glVertexAttrib4f:_emscripten_glVertexAttrib4f,emscripten_glVertexAttrib4fv:_emscripten_glVertexAttrib4fv,emscripten_glVertexAttribDivisor:_emscripten_glVertexAttribDivisor,emscripten_glVertexAttribDivisorANGLE:_emscripten_glVertexAttribDivisorANGLE,emscripten_glVertexAttribDivisorARB:_emscripten_glVertexAttribDivisorARB,emscripten_glVertexAttribDivisorEXT:_emscripten_glVertexAttribDivisorEXT,emscripten_glVertexAttribDivisorNV:_emscripten_glVertexAttribDivisorNV,emscripten_glVertexAttribPointer:_emscripten_glVertexAttribPointer,emscripten_glVertexPointer:_emscripten_glVertexPointer,emscripten_glViewport:_emscripten_glViewport,emscripten_has_asyncify:_emscripten_has_asyncify,emscripten_hide_mouse:_emscripten_hide_mouse,emscripten_html5_remove_all_event_listeners:_emscripten_html5_remove_all_event_listeners,emscripten_idb_async_clear:_emscripten_idb_async_clear,emscripten_idb_async_delete:_emscripten_idb_async_delete,emscripten_idb_async_exists:_emscripten_idb_async_exists,emscripten_idb_async_load:_emscripten_idb_async_load,emscripten_idb_async_store:_emscripten_idb_async_store,emscripten_idb_clear:_emscripten_idb_clear,emscripten_idb_delete:_emscripten_idb_delete,emscripten_idb_exists:_emscripten_idb_exists,emscripten_idb_load:_emscripten_idb_load,emscripten_idb_store:_emscripten_idb_store,emscripten_is_main_browser_thread:_emscripten_is_main_browser_thread,emscripten_is_webgl_context_lost:_emscripten_is_webgl_context_lost,emscripten_lock_orientation:_emscripten_lock_orientation,emscripten_log:_emscripten_log,emscripten_math_acos:_emscripten_math_acos,emscripten_math_acosh:_emscripten_math_acosh,emscripten_math_asin:_emscripten_math_asin,emscripten_math_asinh:_emscripten_math_asinh,emscripten_math_atan:_emscripten_math_atan,emscripten_math_atan2:_emscripten_math_atan2,emscripten_math_atanh:_emscripten_math_atanh,emscripten_math_cbrt:_emscripten_math_cbrt,emscripten_math_cos:_emscripten_math_cos,emscripten_math_cosh:_emscripten_math_cosh,emscripten_math_exp:_emscripten_math_exp,emscripten_math_expm1:_emscripten_math_expm1,emscripten_math_fmod:_emscripten_math_fmod,emscripten_math_hypot:_emscripten_math_hypot,emscripten_math_log:_emscripten_math_log,emscripten_math_log10:_emscripten_math_log10,emscripten_math_log1p:_emscripten_math_log1p,emscripten_math_log2:_emscripten_math_log2,emscripten_math_pow:_emscripten_math_pow,emscripten_math_random:_emscripten_math_random,emscripten_math_round:_emscripten_math_round,emscripten_math_sign:_emscripten_math_sign,emscripten_math_sin:_emscripten_math_sin,emscripten_math_sinh:_emscripten_math_sinh,emscripten_math_sqrt:_emscripten_math_sqrt,emscripten_math_tan:_emscripten_math_tan,emscripten_math_tanh:_emscripten_math_tanh,emscripten_notify_memory_growth:_emscripten_notify_memory_growth,emscripten_out:_emscripten_out,emscripten_outn:_emscripten_outn,emscripten_pause_main_loop:_emscripten_pause_main_loop,emscripten_pc_get_column:_emscripten_pc_get_column,emscripten_pc_get_file:_emscripten_pc_get_file,emscripten_pc_get_function:_emscripten_pc_get_function,emscripten_pc_get_line:_emscripten_pc_get_line,emscripten_performance_now:_emscripten_performance_now,emscripten_print_double:_emscripten_print_double,emscripten_promise_all:_emscripten_promise_all,emscripten_promise_all_settled:_emscripten_promise_all_settled,emscripten_promise_any:_emscripten_promise_any,emscripten_promise_await:_emscripten_promise_await,emscripten_promise_create:_emscripten_promise_create,emscripten_promise_destroy:_emscripten_promise_destroy,emscripten_promise_race:_emscripten_promise_race,emscripten_promise_resolve:_emscripten_promise_resolve,emscripten_promise_then:_emscripten_promise_then,emscripten_random:_emscripten_random,emscripten_request_animation_frame:_emscripten_request_animation_frame,emscripten_request_animation_frame_loop:_emscripten_request_animation_frame_loop,emscripten_request_fullscreen:_emscripten_request_fullscreen,emscripten_request_fullscreen_strategy:_emscripten_request_fullscreen_strategy,emscripten_request_pointerlock:_emscripten_request_pointerlock,emscripten_resize_heap:_emscripten_resize_heap,emscripten_resume_main_loop:_emscripten_resume_main_loop,emscripten_return_address:_emscripten_return_address,emscripten_run_preload_plugins:_emscripten_run_preload_plugins,emscripten_run_preload_plugins_data:_emscripten_run_preload_plugins_data,emscripten_run_script:_emscripten_run_script,emscripten_run_script_int:_emscripten_run_script_int,emscripten_run_script_string:_emscripten_run_script_string,emscripten_runtime_keepalive_check:_emscripten_runtime_keepalive_check,emscripten_runtime_keepalive_pop:_emscripten_runtime_keepalive_pop,emscripten_runtime_keepalive_push:_emscripten_runtime_keepalive_push,emscripten_sample_gamepad_data:_emscripten_sample_gamepad_data,emscripten_scan_registers:_emscripten_scan_registers,emscripten_set_batterychargingchange_callback_on_thread:_emscripten_set_batterychargingchange_callback_on_thread,emscripten_set_batterylevelchange_callback_on_thread:_emscripten_set_batterylevelchange_callback_on_thread,emscripten_set_beforeunload_callback_on_thread:_emscripten_set_beforeunload_callback_on_thread,emscripten_set_blur_callback_on_thread:_emscripten_set_blur_callback_on_thread,emscripten_set_canvas_element_size:_emscripten_set_canvas_element_size,emscripten_set_canvas_size:_emscripten_set_canvas_size,emscripten_set_click_callback_on_thread:_emscripten_set_click_callback_on_thread,emscripten_set_dblclick_callback_on_thread:_emscripten_set_dblclick_callback_on_thread,emscripten_set_devicemotion_callback_on_thread:_emscripten_set_devicemotion_callback_on_thread,emscripten_set_deviceorientation_callback_on_thread:_emscripten_set_deviceorientation_callback_on_thread,emscripten_set_element_css_size:_emscripten_set_element_css_size,emscripten_set_focus_callback_on_thread:_emscripten_set_focus_callback_on_thread,emscripten_set_focusin_callback_on_thread:_emscripten_set_focusin_callback_on_thread,emscripten_set_focusout_callback_on_thread:_emscripten_set_focusout_callback_on_thread,emscripten_set_fullscreenchange_callback_on_thread:_emscripten_set_fullscreenchange_callback_on_thread,emscripten_set_gamepadconnected_callback_on_thread:_emscripten_set_gamepadconnected_callback_on_thread,emscripten_set_gamepaddisconnected_callback_on_thread:_emscripten_set_gamepaddisconnected_callback_on_thread,emscripten_set_immediate:_emscripten_set_immediate,emscripten_set_immediate_loop:_emscripten_set_immediate_loop,emscripten_set_interval:_emscripten_set_interval,emscripten_set_keydown_callback_on_thread:_emscripten_set_keydown_callback_on_thread,emscripten_set_keypress_callback_on_thread:_emscripten_set_keypress_callback_on_thread,emscripten_set_keyup_callback_on_thread:_emscripten_set_keyup_callback_on_thread,emscripten_set_main_loop:_emscripten_set_main_loop,emscripten_set_main_loop_arg:_emscripten_set_main_loop_arg,emscripten_set_main_loop_expected_blockers:_emscripten_set_main_loop_expected_blockers,emscripten_set_main_loop_timing:_emscripten_set_main_loop_timing,emscripten_set_mousedown_callback_on_thread:_emscripten_set_mousedown_callback_on_thread,emscripten_set_mouseenter_callback_on_thread:_emscripten_set_mouseenter_callback_on_thread,emscripten_set_mouseleave_callback_on_thread:_emscripten_set_mouseleave_callback_on_thread,emscripten_set_mousemove_callback_on_thread:_emscripten_set_mousemove_callback_on_thread,emscripten_set_mouseout_callback_on_thread:_emscripten_set_mouseout_callback_on_thread,emscripten_set_mouseover_callback_on_thread:_emscripten_set_mouseover_callback_on_thread,emscripten_set_mouseup_callback_on_thread:_emscripten_set_mouseup_callback_on_thread,emscripten_set_orientationchange_callback_on_thread:_emscripten_set_orientationchange_callback_on_thread,emscripten_set_pointerlockchange_callback_on_thread:_emscripten_set_pointerlockchange_callback_on_thread,emscripten_set_pointerlockerror_callback_on_thread:_emscripten_set_pointerlockerror_callback_on_thread,emscripten_set_resize_callback_on_thread:_emscripten_set_resize_callback_on_thread,emscripten_set_scroll_callback_on_thread:_emscripten_set_scroll_callback_on_thread,emscripten_set_socket_close_callback:_emscripten_set_socket_close_callback,emscripten_set_socket_connection_callback:_emscripten_set_socket_connection_callback,emscripten_set_socket_error_callback:_emscripten_set_socket_error_callback,emscripten_set_socket_listen_callback:_emscripten_set_socket_listen_callback,emscripten_set_socket_message_callback:_emscripten_set_socket_message_callback,emscripten_set_socket_open_callback:_emscripten_set_socket_open_callback,emscripten_set_timeout:_emscripten_set_timeout,emscripten_set_timeout_loop:_emscripten_set_timeout_loop,emscripten_set_touchcancel_callback_on_thread:_emscripten_set_touchcancel_callback_on_thread,emscripten_set_touchend_callback_on_thread:_emscripten_set_touchend_callback_on_thread,emscripten_set_touchmove_callback_on_thread:_emscripten_set_touchmove_callback_on_thread,emscripten_set_touchstart_callback_on_thread:_emscripten_set_touchstart_callback_on_thread,emscripten_set_visibilitychange_callback_on_thread:_emscripten_set_visibilitychange_callback_on_thread,emscripten_set_webglcontextlost_callback_on_thread:_emscripten_set_webglcontextlost_callback_on_thread,emscripten_set_webglcontextrestored_callback_on_thread:_emscripten_set_webglcontextrestored_callback_on_thread,emscripten_set_wheel_callback_on_thread:_emscripten_set_wheel_callback_on_thread,emscripten_set_window_title:_emscripten_set_window_title,emscripten_sleep:_emscripten_sleep,emscripten_stack_snapshot:_emscripten_stack_snapshot,emscripten_stack_unwind_buffer:_emscripten_stack_unwind_buffer,emscripten_supports_offscreencanvas:_emscripten_supports_offscreencanvas,emscripten_throw_number:_emscripten_throw_number,emscripten_throw_string:_emscripten_throw_string,emscripten_unlock_orientation:_emscripten_unlock_orientation,emscripten_unwind_to_js_event_loop:_emscripten_unwind_to_js_event_loop,emscripten_vibrate:_emscripten_vibrate,emscripten_vibrate_pattern:_emscripten_vibrate_pattern,emscripten_webgl_commit_frame:_emscripten_webgl_commit_frame,emscripten_webgl_create_context:_emscripten_webgl_create_context,emscripten_webgl_destroy_context:_emscripten_webgl_destroy_context,emscripten_webgl_do_commit_frame:_emscripten_webgl_do_commit_frame,emscripten_webgl_do_create_context:_emscripten_webgl_do_create_context,emscripten_webgl_do_get_current_context:_emscripten_webgl_do_get_current_context,emscripten_webgl_enable_ANGLE_instanced_arrays:_emscripten_webgl_enable_ANGLE_instanced_arrays,emscripten_webgl_enable_EXT_clip_control:_emscripten_webgl_enable_EXT_clip_control,emscripten_webgl_enable_EXT_polygon_offset_clamp:_emscripten_webgl_enable_EXT_polygon_offset_clamp,emscripten_webgl_enable_OES_vertex_array_object:_emscripten_webgl_enable_OES_vertex_array_object,emscripten_webgl_enable_WEBGL_draw_buffers:_emscripten_webgl_enable_WEBGL_draw_buffers,emscripten_webgl_enable_WEBGL_multi_draw:_emscripten_webgl_enable_WEBGL_multi_draw,emscripten_webgl_enable_WEBGL_polygon_mode:_emscripten_webgl_enable_WEBGL_polygon_mode,emscripten_webgl_enable_extension:_emscripten_webgl_enable_extension,emscripten_webgl_get_context_attributes:_emscripten_webgl_get_context_attributes,emscripten_webgl_get_current_context:_emscripten_webgl_get_current_context,emscripten_webgl_get_drawing_buffer_size:_emscripten_webgl_get_drawing_buffer_size,emscripten_webgl_get_parameter_d:_emscripten_webgl_get_parameter_d,emscripten_webgl_get_parameter_i64v:_emscripten_webgl_get_parameter_i64v,emscripten_webgl_get_parameter_o:_emscripten_webgl_get_parameter_o,emscripten_webgl_get_parameter_utf8:_emscripten_webgl_get_parameter_utf8,emscripten_webgl_get_parameter_v:_emscripten_webgl_get_parameter_v,emscripten_webgl_get_program_info_log_utf8:_emscripten_webgl_get_program_info_log_utf8,emscripten_webgl_get_program_parameter_d:_emscripten_webgl_get_program_parameter_d,emscripten_webgl_get_shader_info_log_utf8:_emscripten_webgl_get_shader_info_log_utf8,emscripten_webgl_get_shader_parameter_d:_emscripten_webgl_get_shader_parameter_d,emscripten_webgl_get_shader_source_utf8:_emscripten_webgl_get_shader_source_utf8,emscripten_webgl_get_supported_extensions:_emscripten_webgl_get_supported_extensions,emscripten_webgl_get_uniform_d:_emscripten_webgl_get_uniform_d,emscripten_webgl_get_uniform_v:_emscripten_webgl_get_uniform_v,emscripten_webgl_get_vertex_attrib_d:_emscripten_webgl_get_vertex_attrib_d,emscripten_webgl_get_vertex_attrib_o:_emscripten_webgl_get_vertex_attrib_o,emscripten_webgl_get_vertex_attrib_v:_emscripten_webgl_get_vertex_attrib_v,emscripten_webgl_make_context_current:_emscripten_webgl_make_context_current,emscripten_wget_data:_emscripten_wget_data,endprotoent:_endprotoent,environ_get:_environ_get,environ_sizes_get:_environ_sizes_get,exit:_exit,fd_close:_fd_close,fd_fdstat_get:_fd_fdstat_get,fd_pread:_fd_pread,fd_pwrite:_fd_pwrite,fd_read:_fd_read,fd_seek:_fd_seek,fd_sync:_fd_sync,fd_write:_fd_write,filledEllipseColor:_filledEllipseColor,filledEllipseRGBA:_filledEllipseRGBA,getaddrinfo:_getaddrinfo,getentropy:_getentropy,getnameinfo:_getnameinfo,getprotobyname:_getprotobyname,getprotobynumber:_getprotobynumber,getprotoent:_getprotoent,glActiveTexture:_glActiveTexture,glAttachShader:_glAttachShader,glBegin:_glBegin,glBeginQueryEXT:_glBeginQueryEXT,glBindAttribLocation:_glBindAttribLocation,glBindBuffer:_glBindBuffer,glBindFramebuffer:_glBindFramebuffer,glBindRenderbuffer:_glBindRenderbuffer,glBindTexture:_glBindTexture,glBindVertexArray:_glBindVertexArray,glBindVertexArrayOES:_glBindVertexArrayOES,glBlendColor:_glBlendColor,glBlendEquation:_glBlendEquation,glBlendEquationSeparate:_glBlendEquationSeparate,glBlendFunc:_glBlendFunc,glBlendFuncSeparate:_glBlendFuncSeparate,glBufferData:_glBufferData,glBufferSubData:_glBufferSubData,glCheckFramebufferStatus:_glCheckFramebufferStatus,glClear:_glClear,glClearColor:_glClearColor,glClearDepth:_glClearDepth,glClearDepthf:_glClearDepthf,glClearStencil:_glClearStencil,glClipControlEXT:_glClipControlEXT,glColorMask:_glColorMask,glCompileShader:_glCompileShader,glCompressedTexImage2D:_glCompressedTexImage2D,glCompressedTexSubImage2D:_glCompressedTexSubImage2D,glCopyTexImage2D:_glCopyTexImage2D,glCopyTexSubImage2D:_glCopyTexSubImage2D,glCreateProgram:_glCreateProgram,glCreateShader:_glCreateShader,glCullFace:_glCullFace,glDeleteBuffers:_glDeleteBuffers,glDeleteFramebuffers:_glDeleteFramebuffers,glDeleteProgram:_glDeleteProgram,glDeleteQueriesEXT:_glDeleteQueriesEXT,glDeleteRenderbuffers:_glDeleteRenderbuffers,glDeleteShader:_glDeleteShader,glDeleteTextures:_glDeleteTextures,glDeleteVertexArrays:_glDeleteVertexArrays,glDeleteVertexArraysOES:_glDeleteVertexArraysOES,glDepthFunc:_glDepthFunc,glDepthMask:_glDepthMask,glDepthRange:_glDepthRange,glDepthRangef:_glDepthRangef,glDetachShader:_glDetachShader,glDisable:_glDisable,glDisableVertexAttribArray:_glDisableVertexAttribArray,glDrawArrays:_glDrawArrays,glDrawArraysInstanced:_glDrawArraysInstanced,glDrawArraysInstancedANGLE:_glDrawArraysInstancedANGLE,glDrawArraysInstancedARB:_glDrawArraysInstancedARB,glDrawArraysInstancedEXT:_glDrawArraysInstancedEXT,glDrawArraysInstancedNV:_glDrawArraysInstancedNV,glDrawBuffers:_glDrawBuffers,glDrawBuffersEXT:_glDrawBuffersEXT,glDrawBuffersWEBGL:_glDrawBuffersWEBGL,glDrawElements:_glDrawElements,glDrawElementsInstanced:_glDrawElementsInstanced,glDrawElementsInstancedANGLE:_glDrawElementsInstancedANGLE,glDrawElementsInstancedARB:_glDrawElementsInstancedARB,glDrawElementsInstancedEXT:_glDrawElementsInstancedEXT,glDrawElementsInstancedNV:_glDrawElementsInstancedNV,glEnable:_glEnable,glEnableVertexAttribArray:_glEnableVertexAttribArray,glEndQueryEXT:_glEndQueryEXT,glFinish:_glFinish,glFlush:_glFlush,glFramebufferRenderbuffer:_glFramebufferRenderbuffer,glFramebufferTexture2D:_glFramebufferTexture2D,glFrontFace:_glFrontFace,glGenBuffers:_glGenBuffers,glGenFramebuffers:_glGenFramebuffers,glGenQueriesEXT:_glGenQueriesEXT,glGenRenderbuffers:_glGenRenderbuffers,glGenTextures:_glGenTextures,glGenVertexArrays:_glGenVertexArrays,glGenVertexArraysOES:_glGenVertexArraysOES,glGenerateMipmap:_glGenerateMipmap,glGetActiveAttrib:_glGetActiveAttrib,glGetActiveUniform:_glGetActiveUniform,glGetAttachedShaders:_glGetAttachedShaders,glGetAttribLocation:_glGetAttribLocation,glGetBooleanv:_glGetBooleanv,glGetBufferParameteriv:_glGetBufferParameteriv,glGetError:_glGetError,glGetFloatv:_glGetFloatv,glGetFramebufferAttachmentParameteriv:_glGetFramebufferAttachmentParameteriv,glGetIntegerv:_glGetIntegerv,glGetProgramInfoLog:_glGetProgramInfoLog,glGetProgramiv:_glGetProgramiv,glGetQueryObjecti64vEXT:_glGetQueryObjecti64vEXT,glGetQueryObjectivEXT:_glGetQueryObjectivEXT,glGetQueryObjectui64vEXT:_glGetQueryObjectui64vEXT,glGetQueryObjectuivEXT:_glGetQueryObjectuivEXT,glGetQueryivEXT:_glGetQueryivEXT,glGetRenderbufferParameteriv:_glGetRenderbufferParameteriv,glGetShaderInfoLog:_glGetShaderInfoLog,glGetShaderPrecisionFormat:_glGetShaderPrecisionFormat,glGetShaderSource:_glGetShaderSource,glGetShaderiv:_glGetShaderiv,glGetString:_glGetString,glGetTexParameterfv:_glGetTexParameterfv,glGetTexParameteriv:_glGetTexParameteriv,glGetUniformLocation:_glGetUniformLocation,glGetUniformfv:_glGetUniformfv,glGetUniformiv:_glGetUniformiv,glGetVertexAttribPointerv:_glGetVertexAttribPointerv,glGetVertexAttribfv:_glGetVertexAttribfv,glGetVertexAttribiv:_glGetVertexAttribiv,glHint:_glHint,glIsBuffer:_glIsBuffer,glIsEnabled:_glIsEnabled,glIsFramebuffer:_glIsFramebuffer,glIsProgram:_glIsProgram,glIsQueryEXT:_glIsQueryEXT,glIsRenderbuffer:_glIsRenderbuffer,glIsShader:_glIsShader,glIsTexture:_glIsTexture,glIsVertexArray:_glIsVertexArray,glIsVertexArrayOES:_glIsVertexArrayOES,glLineWidth:_glLineWidth,glLinkProgram:_glLinkProgram,glLoadIdentity:_glLoadIdentity,glMatrixMode:_glMatrixMode,glMultiDrawArrays:_glMultiDrawArrays,glMultiDrawArraysANGLE:_glMultiDrawArraysANGLE,glMultiDrawArraysInstancedANGLE:_glMultiDrawArraysInstancedANGLE,glMultiDrawArraysInstancedWEBGL:_glMultiDrawArraysInstancedWEBGL,glMultiDrawArraysWEBGL:_glMultiDrawArraysWEBGL,glMultiDrawElements:_glMultiDrawElements,glMultiDrawElementsANGLE:_glMultiDrawElementsANGLE,glMultiDrawElementsInstancedANGLE:_glMultiDrawElementsInstancedANGLE,glMultiDrawElementsInstancedWEBGL:_glMultiDrawElementsInstancedWEBGL,glMultiDrawElementsWEBGL:_glMultiDrawElementsWEBGL,glPixelStorei:_glPixelStorei,glPolygonModeWEBGL:_glPolygonModeWEBGL,glPolygonOffset:_glPolygonOffset,glPolygonOffsetClampEXT:_glPolygonOffsetClampEXT,glQueryCounterEXT:_glQueryCounterEXT,glReadPixels:_glReadPixels,glReleaseShaderCompiler:_glReleaseShaderCompiler,glRenderbufferStorage:_glRenderbufferStorage,glSampleCoverage:_glSampleCoverage,glScissor:_glScissor,glShaderBinary:_glShaderBinary,glShaderSource:_glShaderSource,glStencilFunc:_glStencilFunc,glStencilFuncSeparate:_glStencilFuncSeparate,glStencilMask:_glStencilMask,glStencilMaskSeparate:_glStencilMaskSeparate,glStencilOp:_glStencilOp,glStencilOpSeparate:_glStencilOpSeparate,glTexImage2D:_glTexImage2D,glTexParameterf:_glTexParameterf,glTexParameterfv:_glTexParameterfv,glTexParameteri:_glTexParameteri,glTexParameteriv:_glTexParameteriv,glTexSubImage2D:_glTexSubImage2D,glUniform1f:_glUniform1f,glUniform1fv:_glUniform1fv,glUniform1i:_glUniform1i,glUniform1iv:_glUniform1iv,glUniform2f:_glUniform2f,glUniform2fv:_glUniform2fv,glUniform2i:_glUniform2i,glUniform2iv:_glUniform2iv,glUniform3f:_glUniform3f,glUniform3fv:_glUniform3fv,glUniform3i:_glUniform3i,glUniform3iv:_glUniform3iv,glUniform4f:_glUniform4f,glUniform4fv:_glUniform4fv,glUniform4i:_glUniform4i,glUniform4iv:_glUniform4iv,glUniformMatrix2fv:_glUniformMatrix2fv,glUniformMatrix3fv:_glUniformMatrix3fv,glUniformMatrix4fv:_glUniformMatrix4fv,glUseProgram:_glUseProgram,glValidateProgram:_glValidateProgram,glVertexAttrib1f:_glVertexAttrib1f,glVertexAttrib1fv:_glVertexAttrib1fv,glVertexAttrib2f:_glVertexAttrib2f,glVertexAttrib2fv:_glVertexAttrib2fv,glVertexAttrib3f:_glVertexAttrib3f,glVertexAttrib3fv:_glVertexAttrib3fv,glVertexAttrib4f:_glVertexAttrib4f,glVertexAttrib4fv:_glVertexAttrib4fv,glVertexAttribDivisor:_glVertexAttribDivisor,glVertexAttribDivisorANGLE:_glVertexAttribDivisorANGLE,glVertexAttribDivisorARB:_glVertexAttribDivisorARB,glVertexAttribDivisorEXT:_glVertexAttribDivisorEXT,glVertexAttribDivisorNV:_glVertexAttribDivisorNV,glVertexAttribPointer:_glVertexAttribPointer,glVertexPointer:_glVertexPointer,glViewport:_glViewport,glewGetErrorString:_glewGetErrorString,glewGetExtension:_glewGetExtension,glewGetString:_glewGetString,glewInit:_glewInit,glewIsSupported:_glewIsSupported,glutCreateWindow:_glutCreateWindow,glutDestroyWindow:_glutDestroyWindow,glutDisplayFunc:_glutDisplayFunc,glutFullScreen:_glutFullScreen,glutGet:_glutGet,glutGetModifiers:_glutGetModifiers,glutIdleFunc:_glutIdleFunc,glutInit:_glutInit,glutInitDisplayMode:_glutInitDisplayMode,glutInitWindowPosition:_glutInitWindowPosition,glutInitWindowSize:_glutInitWindowSize,glutKeyboardFunc:_glutKeyboardFunc,glutKeyboardUpFunc:_glutKeyboardUpFunc,glutMainLoop:_glutMainLoop,glutMotionFunc:_glutMotionFunc,glutMouseFunc:_glutMouseFunc,glutPassiveMotionFunc:_glutPassiveMotionFunc,glutPositionWindow:_glutPositionWindow,glutPostRedisplay:_glutPostRedisplay,glutReshapeFunc:_glutReshapeFunc,glutReshapeWindow:_glutReshapeWindow,glutSetCursor:_glutSetCursor,glutSpecialFunc:_glutSpecialFunc,glutSpecialUpFunc:_glutSpecialUpFunc,glutSwapBuffers:_glutSwapBuffers,glutTimerFunc:_glutTimerFunc,invoke_dd,invoke_di,invoke_dii,invoke_diii,invoke_diiid,invoke_diiii,invoke_diiiid,invoke_diiiiid,invoke_diiji,invoke_dij,invoke_dijjjj,invoke_dijjjjij,invoke_dj,invoke_ff,invoke_fi,invoke_fiii,invoke_fiiii,invoke_fiiji,invoke_fijjjj,invoke_fijjjjij,invoke_i,invoke_id,invoke_idd,invoke_idi,invoke_idii,invoke_idiii,invoke_idiiii,invoke_if,invoke_iff,invoke_ifi,invoke_ifii,invoke_ii,invoke_iid,invoke_iidi,invoke_iidii,invoke_iidiii,invoke_iidiiii,invoke_iidj,invoke_iif,invoke_iifii,invoke_iii,invoke_iiid,invoke_iiidi,invoke_iiidj,invoke_iiii,invoke_iiiid,invoke_iiiidjj,invoke_iiiii,invoke_iiiiid,invoke_iiiiii,invoke_iiiiiid,invoke_iiiiiii,invoke_iiiiiiii,invoke_iiiiiiiii,invoke_iiiiiiiiii,invoke_iiiiiiiiiii,invoke_iiiiiiiiiiii,invoke_iiiiiiiiiiiii,invoke_iiiiiiiiiiiiii,invoke_iiiiiiiiiiiiiiiii,invoke_iiiiiiiiiiiiiiiiii,invoke_iiiiiiiiiijii,invoke_iiiiiiiiiijiiiiiii,invoke_iiiiiiiiiji,invoke_iiiiiiiij,invoke_iiiiiiij,invoke_iiiiiiiji,invoke_iiiiiiijii,invoke_iiiiiiijj,invoke_iiiiiiijjjjjjii,invoke_iiiiiij,invoke_iiiiiiji,invoke_iiiiiijji,invoke_iiiiiijjiiiiiii,invoke_iiiiiijjiijjji,invoke_iiiiij,invoke_iiiiiji,invoke_iiiiijii,invoke_iiiiijiii,invoke_iiiiijiiii,invoke_iiiiijij,invoke_iiiiijj,invoke_iiiij,invoke_iiiiji,invoke_iiiijii,invoke_iiiijiii,invoke_iiiijiijjiii,invoke_iiiijj,invoke_iiiijji,invoke_iiiijjii,invoke_iiiijjiii,invoke_iiiijjj,invoke_iiiijjjj,invoke_iiij,invoke_iiiji,invoke_iiijii,invoke_iiijiii,invoke_iiijiiiii,invoke_iiijiiiij,invoke_iiijiiiijj,invoke_iiijiiij,invoke_iiijiiiji,invoke_iiijiiijj,invoke_iiijiij,invoke_iiijiijj,invoke_iiijij,invoke_iiijijj,invoke_iiijj,invoke_iiijji,invoke_iiijjii,invoke_iiijjiii,invoke_iiijjijj,invoke_iiijjijjiii,invoke_iiijjj,invoke_iiijjji,invoke_iiijjjj,invoke_iij,invoke_iiji,invoke_iijii,invoke_iijiii,invoke_iijiiii,invoke_iijiiiiiij,invoke_iijiiijj,invoke_iijiiji,invoke_iijiijj,invoke_iijij,invoke_iijiji,invoke_iijj,invoke_iijji,invoke_iijjii,invoke_iijjiii,invoke_iijjiiiii,invoke_iijjj,invoke_iijjjj,invoke_ij,invoke_iji,invoke_ijii,invoke_ijji,invoke_ijjiii,invoke_ijjj,invoke_j,invoke_jd,invoke_jf,invoke_ji,invoke_jii,invoke_jiii,invoke_jiiii,invoke_jiiiii,invoke_jiiiiii,invoke_jiiiiiii,invoke_jiiiiijiiii,invoke_jiiiij,invoke_jiiiiji,invoke_jiiiijii,invoke_jiiiijiiii,invoke_jiiiijiiiii,invoke_jiiij,invoke_jiiiji,invoke_jiiijii,invoke_jiiijiii,invoke_jiiijiijiii,invoke_jiiijj,invoke_jiiijjj,invoke_jiij,invoke_jiiji,invoke_jiijiiii,invoke_jiijj,invoke_jiijjjii,invoke_jij,invoke_jiji,invoke_jijij,invoke_jijj,invoke_jijjij,invoke_jijjjj,invoke_jj,invoke_jji,invoke_jjj,invoke_jjjd,invoke_jjjji,invoke_v,invoke_vi,invoke_vid,invoke_viddddi,invoke_vidi,invoke_vidii,invoke_vif,invoke_vifi,invoke_vifii,invoke_vii,invoke_viid,invoke_viiddji,invoke_viif,invoke_viii,invoke_viiid,invoke_viiidi,invoke_viiidii,invoke_viiifi,invoke_viiii,invoke_viiiii,invoke_viiiiii,invoke_viiiiiii,invoke_viiiiiiii,invoke_viiiiiiiii,invoke_viiiiiiiiii,invoke_viiiiiiiiiii,invoke_viiiiiiiiiiii,invoke_viiiiiiiiiiiii,invoke_viiiiiiiiiiiiiii,invoke_viiiiiiij,invoke_viiiiiiijjjji,invoke_viiiiiij,invoke_viiiiiijii,invoke_viiiiij,invoke_viiiiiji,invoke_viiiiijii,invoke_viiiiijiii,invoke_viiiiijiiii,invoke_viiiiijiijii,invoke_viiiiijj,invoke_viiiiijjii,invoke_viiiiijjji,invoke_viiiij,invoke_viiiiji,invoke_viiiijii,invoke_viiiijiii,invoke_viiiijiiii,invoke_viiiijiiiii,invoke_viiiijiiiiiiii,invoke_viiiijiijjii,invoke_viiiijijji,invoke_viiiijijjj,invoke_viiiijj,invoke_viiiijji,invoke_viiiijjij,invoke_viiij,invoke_viiijd,invoke_viiiji,invoke_viiijii,invoke_viiijiii,invoke_viiijiiii,invoke_viiijiiiijjj,invoke_viiijiiijii,invoke_viiijiij,invoke_viiijij,invoke_viiijijij,invoke_viiijijj,invoke_viiijijjj,invoke_viiijj,invoke_viiijji,invoke_viiijjii,invoke_viiijjiii,invoke_viiijjij,invoke_viiijjijj,invoke_viiijjj,invoke_viiijjjj,invoke_viij,invoke_viijd,invoke_viiji,invoke_viijii,invoke_viijiii,invoke_viijiiii,invoke_viijiiiii,invoke_viijiiiiii,invoke_viijiiiij,invoke_viijiiij,invoke_viijiiijj,invoke_viijiij,invoke_viijiiji,invoke_viijiijj,invoke_viijiijji,invoke_viijij,invoke_viijiji,invoke_viijijiiii,invoke_viijijiiiijjj,invoke_viijijj,invoke_viijj,invoke_viijji,invoke_viijjii,invoke_viijjj,invoke_viijjji,invoke_viijjjji,invoke_vij,invoke_viji,invoke_vijii,invoke_vijiii,invoke_vijiiii,invoke_vijiiiii,invoke_vijiiiiii,invoke_vijiiiiji,invoke_vijiiiji,invoke_vijiij,invoke_vijiji,invoke_vijijiiiijjj,invoke_vijijiij,invoke_vijijj,invoke_vijijjji,invoke_vijj,invoke_vijji,invoke_vijjiii,invoke_vijjij,invoke_vijjj,invoke_vijjji,invoke_vijjjiiji,invoke_vijjjj,invoke_vj,invoke_vji,invoke_vjii,invoke_vjiii,invoke_vjiiii,invoke_vjiiij,invoke_vjjii,invoke_vjjijij,lineColor:_lineColor,lineRGBA:_lineRGBA,llvm_eh_typeid_for:_llvm_eh_typeid_for,memory:wasmMemory,pixelRGBA:_pixelRGBA,proc_exit:_proc_exit,pthread_kill:_pthread_kill,random_get:_random_get,rectangleColor:_rectangleColor,rectangleRGBA:_rectangleRGBA,rotozoomSurface:_rotozoomSurface,setNetworkCallback:_setNetworkCallback,setprotoent:_setprotoent,stackAlloc:_stackAlloc,stackRestore:_stackRestore,stackSave:_stackSave,strptime:_strptime,strptime_l:_strptime_l,uuid_clear:_uuid_clear,uuid_compare:_uuid_compare,uuid_copy:_uuid_copy,uuid_generate:_uuid_generate,uuid_is_null:_uuid_is_null,uuid_parse:_uuid_parse,uuid_type:_uuid_type,uuid_unparse:_uuid_unparse,uuid_unparse_lower:_uuid_unparse_lower,uuid_unparse_upper:_uuid_unparse_upper,uuid_variant:_uuid_variant,zoomSurface:_zoomSurface},wasmExports=createWasm(),__emval_coro_resume=(e,t)=>(__emval_coro_resume=wasmExports._emval_coro_resume)(e,t),_main=Module._main=(e,t)=>(_main=Module._main=wasmExports.main)(e,t),_duckdb_web_fs_glob_add_path=Module._duckdb_web_fs_glob_add_path=e=>(_duckdb_web_fs_glob_add_path=Module._duckdb_web_fs_glob_add_path=wasmExports.duckdb_web_fs_glob_add_path)(e),_duckdb_web_clear_response=Module._duckdb_web_clear_response=()=>(_duckdb_web_clear_response=Module._duckdb_web_clear_response=wasmExports.duckdb_web_clear_response)(),_duckdb_web_fail_with=Module._duckdb_web_fail_with=e=>(_duckdb_web_fail_with=Module._duckdb_web_fail_with=wasmExports.duckdb_web_fail_with)(e),_duckdb_web_reset=Module._duckdb_web_reset=e=>(_duckdb_web_reset=Module._duckdb_web_reset=wasmExports.duckdb_web_reset)(e),_duckdb_web_connect=Module._duckdb_web_connect=()=>(_duckdb_web_connect=Module._duckdb_web_connect=wasmExports.duckdb_web_connect)(),_duckdb_web_disconnect=Module._duckdb_web_disconnect=e=>(_duckdb_web_disconnect=Module._duckdb_web_disconnect=wasmExports.duckdb_web_disconnect)(e),_duckdb_web_flush_files=Module._duckdb_web_flush_files=()=>(_duckdb_web_flush_files=Module._duckdb_web_flush_files=wasmExports.duckdb_web_flush_files)(),_duckdb_web_flush_file=Module._duckdb_web_flush_file=e=>(_duckdb_web_flush_file=Module._duckdb_web_flush_file=wasmExports.duckdb_web_flush_file)(e),_duckdb_web_open=Module._duckdb_web_open=(e,t)=>(_duckdb_web_open=Module._duckdb_web_open=wasmExports.duckdb_web_open)(e,t),_duckdb_web_get_global_file_info=Module._duckdb_web_get_global_file_info=(e,t)=>(_duckdb_web_get_global_file_info=Module._duckdb_web_get_global_file_info=wasmExports.duckdb_web_get_global_file_info)(e,t),_duckdb_web_collect_file_stats=Module._duckdb_web_collect_file_stats=(e,t,r)=>(_duckdb_web_collect_file_stats=Module._duckdb_web_collect_file_stats=wasmExports.duckdb_web_collect_file_stats)(e,t,r),_duckdb_web_export_file_stats=Module._duckdb_web_export_file_stats=(e,t)=>(_duckdb_web_export_file_stats=Module._duckdb_web_export_file_stats=wasmExports.duckdb_web_export_file_stats)(e,t),_duckdb_web_fs_drop_file=Module._duckdb_web_fs_drop_file=(e,t)=>(_duckdb_web_fs_drop_file=Module._duckdb_web_fs_drop_file=wasmExports.duckdb_web_fs_drop_file)(e,t),_duckdb_web_fs_drop_files=Module._duckdb_web_fs_drop_files=e=>(_duckdb_web_fs_drop_files=Module._duckdb_web_fs_drop_files=wasmExports.duckdb_web_fs_drop_files)(e),_duckdb_web_fs_glob_file_infos=Module._duckdb_web_fs_glob_file_infos=(e,t)=>(_duckdb_web_fs_glob_file_infos=Module._duckdb_web_fs_glob_file_infos=wasmExports.duckdb_web_fs_glob_file_infos)(e,t),_duckdb_web_fs_get_file_info_by_id=Module._duckdb_web_fs_get_file_info_by_id=(e,t,r)=>(_duckdb_web_fs_get_file_info_by_id=Module._duckdb_web_fs_get_file_info_by_id=wasmExports.duckdb_web_fs_get_file_info_by_id)(e,t,r),_duckdb_web_fs_get_file_info_by_name=Module._duckdb_web_fs_get_file_info_by_name=(e,t,r)=>(_duckdb_web_fs_get_file_info_by_name=Module._duckdb_web_fs_get_file_info_by_name=wasmExports.duckdb_web_fs_get_file_info_by_name)(e,t,r),_duckdb_web_fs_register_file_url=Module._duckdb_web_fs_register_file_url=(e,t,r,n,a)=>(_duckdb_web_fs_register_file_url=Module._duckdb_web_fs_register_file_url=wasmExports.duckdb_web_fs_register_file_url)(e,t,r,n,a),_duckdb_web_fs_register_file_buffer=Module._duckdb_web_fs_register_file_buffer=(e,t,r,n)=>(_duckdb_web_fs_register_file_buffer=Module._duckdb_web_fs_register_file_buffer=wasmExports.duckdb_web_fs_register_file_buffer)(e,t,r,n),_duckdb_web_copy_file_to_buffer=Module._duckdb_web_copy_file_to_buffer=(e,t)=>(_duckdb_web_copy_file_to_buffer=Module._duckdb_web_copy_file_to_buffer=wasmExports.duckdb_web_copy_file_to_buffer)(e,t),_duckdb_web_copy_file_to_path=Module._duckdb_web_copy_file_to_path=(e,t,r)=>(_duckdb_web_copy_file_to_path=Module._duckdb_web_copy_file_to_path=wasmExports.duckdb_web_copy_file_to_path)(e,t,r),_duckdb_web_get_version=Module._duckdb_web_get_version=e=>(_duckdb_web_get_version=Module._duckdb_web_get_version=wasmExports.duckdb_web_get_version)(e),_duckdb_web_get_feature_flags=Module._duckdb_web_get_feature_flags=()=>(_duckdb_web_get_feature_flags=Module._duckdb_web_get_feature_flags=wasmExports.duckdb_web_get_feature_flags)(),_duckdb_web_tokenize=Module._duckdb_web_tokenize=(e,t)=>(_duckdb_web_tokenize=Module._duckdb_web_tokenize=wasmExports.duckdb_web_tokenize)(e,t),_duckdb_web_udf_scalar_create=Module._duckdb_web_udf_scalar_create=(e,t,r)=>(_duckdb_web_udf_scalar_create=Module._duckdb_web_udf_scalar_create=wasmExports.duckdb_web_udf_scalar_create)(e,t,r),_duckdb_web_prepared_create=Module._duckdb_web_prepared_create=(e,t,r)=>(_duckdb_web_prepared_create=Module._duckdb_web_prepared_create=wasmExports.duckdb_web_prepared_create)(e,t,r),_duckdb_web_prepared_close=Module._duckdb_web_prepared_close=(e,t,r)=>(_duckdb_web_prepared_close=Module._duckdb_web_prepared_close=wasmExports.duckdb_web_prepared_close)(e,t,r),_duckdb_web_prepared_run=Module._duckdb_web_prepared_run=(e,t,r,n)=>(_duckdb_web_prepared_run=Module._duckdb_web_prepared_run=wasmExports.duckdb_web_prepared_run)(e,t,r,n),_duckdb_web_prepared_send=Module._duckdb_web_prepared_send=(e,t,r,n)=>(_duckdb_web_prepared_send=Module._duckdb_web_prepared_send=wasmExports.duckdb_web_prepared_send)(e,t,r,n),_duckdb_web_query_run=Module._duckdb_web_query_run=(e,t,r)=>(_duckdb_web_query_run=Module._duckdb_web_query_run=wasmExports.duckdb_web_query_run)(e,t,r),_duckdb_web_query_run_buffer=Module._duckdb_web_query_run_buffer=(e,t,r,n)=>(_duckdb_web_query_run_buffer=Module._duckdb_web_query_run_buffer=wasmExports.duckdb_web_query_run_buffer)(e,t,r,n),_duckdb_web_pending_query_start=Module._duckdb_web_pending_query_start=(e,t,r)=>(_duckdb_web_pending_query_start=Module._duckdb_web_pending_query_start=wasmExports.duckdb_web_pending_query_start)(e,t,r),_duckdb_web_pending_query_poll=Module._duckdb_web_pending_query_poll=(e,t,r)=>(_duckdb_web_pending_query_poll=Module._duckdb_web_pending_query_poll=wasmExports.duckdb_web_pending_query_poll)(e,t,r),_duckdb_web_pending_query_cancel=Module._duckdb_web_pending_query_cancel=(e,t)=>(_duckdb_web_pending_query_cancel=Module._duckdb_web_pending_query_cancel=wasmExports.duckdb_web_pending_query_cancel)(e,t),_duckdb_web_query_fetch_results=Module._duckdb_web_query_fetch_results=(e,t)=>(_duckdb_web_query_fetch_results=Module._duckdb_web_query_fetch_results=wasmExports.duckdb_web_query_fetch_results)(e,t),_duckdb_web_get_tablenames=Module._duckdb_web_get_tablenames=(e,t,r)=>(_duckdb_web_get_tablenames=Module._duckdb_web_get_tablenames=wasmExports.duckdb_web_get_tablenames)(e,t,r),_duckdb_web_insert_arrow_from_ipc_stream=Module._duckdb_web_insert_arrow_from_ipc_stream=(e,t,r,n,a)=>(_duckdb_web_insert_arrow_from_ipc_stream=Module._duckdb_web_insert_arrow_from_ipc_stream=wasmExports.duckdb_web_insert_arrow_from_ipc_stream)(e,t,r,n,a),_duckdb_web_insert_csv_from_path=Module._duckdb_web_insert_csv_from_path=(e,t,r,n)=>(_duckdb_web_insert_csv_from_path=Module._duckdb_web_insert_csv_from_path=wasmExports.duckdb_web_insert_csv_from_path)(e,t,r,n),_duckdb_web_insert_json_from_path=Module._duckdb_web_insert_json_from_path=(e,t,r,n)=>(_duckdb_web_insert_json_from_path=Module._duckdb_web_insert_json_from_path=wasmExports.duckdb_web_insert_json_from_path)(e,t,r,n),___dl_seterr=(e,t)=>(___dl_seterr=wasmExports.__dl_seterr)(e,t),__emscripten_timeout=(e,t)=>(__emscripten_timeout=wasmExports._emscripten_timeout)(e,t),_malloc=Module._malloc=e=>(_malloc=Module._malloc=wasmExports.malloc)(e),_free=Module._free=e=>(_free=Module._free=wasmExports.free)(e),_calloc=Module._calloc=(e,t)=>(_calloc=Module._calloc=wasmExports.calloc)(e,t),_emscripten_builtin_memalign=(e,t)=>(_emscripten_builtin_memalign=wasmExports.emscripten_builtin_memalign)(e,t),__emscripten_tempret_set=e=>(__emscripten_tempret_set=wasmExports._emscripten_tempret_set)(e),__emscripten_tempret_get=()=>(__emscripten_tempret_get=wasmExports._emscripten_tempret_get)(),__emscripten_stack_restore=e=>(__emscripten_stack_restore=wasmExports._emscripten_stack_restore)(e),__emscripten_stack_alloc=e=>(__emscripten_stack_alloc=wasmExports._emscripten_stack_alloc)(e),_emscripten_stack_get_current=()=>(_emscripten_stack_get_current=wasmExports.emscripten_stack_get_current)();function invoke_ii(e,t){var r=stackSave();try{return getWasmTableEntry(e)(t)}catch(n){if(stackRestore(r),n!==n+0)throw n;_setThrew(1,0)}}function invoke_vii(e,t,r){var n=stackSave();try{getWasmTableEntry(e)(t,r)}catch(a){if(stackRestore(n),a!==a+0)throw a;_setThrew(1,0)}}function invoke_viii(e,t,r,n){var a=stackSave();try{getWasmTableEntry(e)(t,r,n)}catch(o){if(stackRestore(a),o!==o+0)throw o;_setThrew(1,0)}}function invoke_viiii(e,t,r,n,a){var o=stackSave();try{getWasmTableEntry(e)(t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_iii(e,t,r){var n=stackSave();try{return getWasmTableEntry(e)(t,r)}catch(a){if(stackRestore(n),a!==a+0)throw a;_setThrew(1,0)}}function invoke_viiiiii(e,t,r,n,a,o,l){var u=stackSave();try{getWasmTableEntry(e)(t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_dii(e,t,r){var n=stackSave();try{return getWasmTableEntry(e)(t,r)}catch(a){if(stackRestore(n),a!==a+0)throw a;_setThrew(1,0)}}function invoke_viiiiiii(e,t,r,n,a,o,l,u){var _=stackSave();try{getWasmTableEntry(e)(t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_vi(e,t){var r=stackSave();try{getWasmTableEntry(e)(t)}catch(n){if(stackRestore(r),n!==n+0)throw n;_setThrew(1,0)}}function invoke_iiiii(e,t,r,n,a){var o=stackSave();try{return getWasmTableEntry(e)(t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_viiiii(e,t,r,n,a,o){var l=stackSave();try{getWasmTableEntry(e)(t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_iiiiiii(e,t,r,n,a,o,l){var u=stackSave();try{return getWasmTableEntry(e)(t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_iiiiiiii(e,t,r,n,a,o,l,u){var _=stackSave();try{return getWasmTableEntry(e)(t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_viiiiiiii(e,t,r,n,a,o,l,u,_){var d=stackSave();try{getWasmTableEntry(e)(t,r,n,a,o,l,u,_)}catch(f){if(stackRestore(d),f!==f+0)throw f;_setThrew(1,0)}}function invoke_iiii(e,t,r,n){var a=stackSave();try{return getWasmTableEntry(e)(t,r,n)}catch(o){if(stackRestore(a),o!==o+0)throw o;_setThrew(1,0)}}function invoke_v(e){var t=stackSave();try{getWasmTableEntry(e)()}catch(r){if(stackRestore(t),r!==r+0)throw r;_setThrew(1,0)}}function invoke_i(e){var t=stackSave();try{return getWasmTableEntry(e)()}catch(r){if(stackRestore(t),r!==r+0)throw r;_setThrew(1,0)}}function invoke_iiiiiiiii(e,t,r,n,a,o,l,u,_){var d=stackSave();try{return getWasmTableEntry(e)(t,r,n,a,o,l,u,_)}catch(f){if(stackRestore(d),f!==f+0)throw f;_setThrew(1,0)}}function invoke_iiiiii(e,t,r,n,a,o){var l=stackSave();try{return getWasmTableEntry(e)(t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_viif(e,t,r,n){var a=stackSave();try{getWasmTableEntry(e)(t,r,n)}catch(o){if(stackRestore(a),o!==o+0)throw o;_setThrew(1,0)}}function invoke_viid(e,t,r,n){var a=stackSave();try{getWasmTableEntry(e)(t,r,n)}catch(o){if(stackRestore(a),o!==o+0)throw o;_setThrew(1,0)}}function invoke_iid(e,t,r){var n=stackSave();try{return getWasmTableEntry(e)(t,r)}catch(a){if(stackRestore(n),a!==a+0)throw a;_setThrew(1,0)}}function invoke_diiii(e,t,r,n,a){var o=stackSave();try{return getWasmTableEntry(e)(t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_iiiiiid(e,t,r,n,a,o,l){var u=stackSave();try{return getWasmTableEntry(e)(t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_viiiiiiiiii(e,t,r,n,a,o,l,u,_,d,f){var p=stackSave();try{getWasmTableEntry(e)(t,r,n,a,o,l,u,_,d,f)}catch(m){if(stackRestore(p),m!==m+0)throw m;_setThrew(1,0)}}function invoke_viiiiiiiiiii(e,t,r,n,a,o,l,u,_,d,f,p){var m=stackSave();try{getWasmTableEntry(e)(t,r,n,a,o,l,u,_,d,f,p)}catch(h){if(stackRestore(m),h!==h+0)throw h;_setThrew(1,0)}}function invoke_di(e,t){var r=stackSave();try{return getWasmTableEntry(e)(t)}catch(n){if(stackRestore(r),n!==n+0)throw n;_setThrew(1,0)}}function invoke_id(e,t){var r=stackSave();try{return getWasmTableEntry(e)(t)}catch(n){if(stackRestore(r),n!==n+0)throw n;_setThrew(1,0)}}function invoke_vid(e,t,r){var n=stackSave();try{getWasmTableEntry(e)(t,r)}catch(a){if(stackRestore(n),a!==a+0)throw a;_setThrew(1,0)}}function invoke_vif(e,t,r){var n=stackSave();try{getWasmTableEntry(e)(t,r)}catch(a){if(stackRestore(n),a!==a+0)throw a;_setThrew(1,0)}}function invoke_iiiiiiiiiii(e,t,r,n,a,o,l,u,_,d,f){var p=stackSave();try{return getWasmTableEntry(e)(t,r,n,a,o,l,u,_,d,f)}catch(m){if(stackRestore(p),m!==m+0)throw m;_setThrew(1,0)}}function invoke_iiiiiiiiii(e,t,r,n,a,o,l,u,_,d){var f=stackSave();try{return getWasmTableEntry(e)(t,r,n,a,o,l,u,_,d)}catch(p){if(stackRestore(f),p!==p+0)throw p;_setThrew(1,0)}}function invoke_iiid(e,t,r,n){var a=stackSave();try{return getWasmTableEntry(e)(t,r,n)}catch(o){if(stackRestore(a),o!==o+0)throw o;_setThrew(1,0)}}function invoke_viiid(e,t,r,n,a){var o=stackSave();try{getWasmTableEntry(e)(t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_iiiiiiiiiiiiiiiiii(e,t,r,n,a,o,l,u,_,d,f,p,m,h,g,v,b,S){var L=stackSave();try{return getWasmTableEntry(e)(t,r,n,a,o,l,u,_,d,f,p,m,h,g,v,b,S)}catch(x){if(stackRestore(L),x!==x+0)throw x;_setThrew(1,0)}}function invoke_iidii(e,t,r,n,a){var o=stackSave();try{return getWasmTableEntry(e)(t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_iiiiiiiiiiiiiiiii(e,t,r,n,a,o,l,u,_,d,f,p,m,h,g,v,b){var S=stackSave();try{return getWasmTableEntry(e)(t,r,n,a,o,l,u,_,d,f,p,m,h,g,v,b)}catch(L){if(stackRestore(S),L!==L+0)throw L;_setThrew(1,0)}}function invoke_fi(e,t){var r=stackSave();try{return getWasmTableEntry(e)(t)}catch(n){if(stackRestore(r),n!==n+0)throw n;_setThrew(1,0)}}function invoke_vifi(e,t,r,n){var a=stackSave();try{getWasmTableEntry(e)(t,r,n)}catch(o){if(stackRestore(a),o!==o+0)throw o;_setThrew(1,0)}}function invoke_vidi(e,t,r,n){var a=stackSave();try{getWasmTableEntry(e)(t,r,n)}catch(o){if(stackRestore(a),o!==o+0)throw o;_setThrew(1,0)}}function invoke_ff(e,t){var r=stackSave();try{return getWasmTableEntry(e)(t)}catch(n){if(stackRestore(r),n!==n+0)throw n;_setThrew(1,0)}}function invoke_dd(e,t){var r=stackSave();try{return getWasmTableEntry(e)(t)}catch(n){if(stackRestore(r),n!==n+0)throw n;_setThrew(1,0)}}function invoke_iiiiiiiiiiiiii(e,t,r,n,a,o,l,u,_,d,f,p,m,h){var g=stackSave();try{return getWasmTableEntry(e)(t,r,n,a,o,l,u,_,d,f,p,m,h)}catch(v){if(stackRestore(g),v!==v+0)throw v;_setThrew(1,0)}}function invoke_iiiiiiiiiiiii(e,t,r,n,a,o,l,u,_,d,f,p,m){var h=stackSave();try{return getWasmTableEntry(e)(t,r,n,a,o,l,u,_,d,f,p,m)}catch(g){if(stackRestore(h),g!==g+0)throw g;_setThrew(1,0)}}function invoke_viddddi(e,t,r,n,a,o,l){var u=stackSave();try{getWasmTableEntry(e)(t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_diiiiid(e,t,r,n,a,o,l){var u=stackSave();try{return getWasmTableEntry(e)(t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_iiiid(e,t,r,n,a){var o=stackSave();try{return getWasmTableEntry(e)(t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_idiii(e,t,r,n,a){var o=stackSave();try{return getWasmTableEntry(e)(t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_iiidi(e,t,r,n,a){var o=stackSave();try{return getWasmTableEntry(e)(t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_viiidii(e,t,r,n,a,o,l){var u=stackSave();try{getWasmTableEntry(e)(t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_viiiiiiiiiiiii(e,t,r,n,a,o,l,u,_,d,f,p,m,h){var g=stackSave();try{getWasmTableEntry(e)(t,r,n,a,o,l,u,_,d,f,p,m,h)}catch(v){if(stackRestore(g),v!==v+0)throw v;_setThrew(1,0)}}function invoke_viiiiiiiii(e,t,r,n,a,o,l,u,_,d){var f=stackSave();try{getWasmTableEntry(e)(t,r,n,a,o,l,u,_,d)}catch(p){if(stackRestore(f),p!==p+0)throw p;_setThrew(1,0)}}function invoke_iff(e,t,r){var n=stackSave();try{return getWasmTableEntry(e)(t,r)}catch(a){if(stackRestore(n),a!==a+0)throw a;_setThrew(1,0)}}function invoke_idd(e,t,r){var n=stackSave();try{return getWasmTableEntry(e)(t,r)}catch(a){if(stackRestore(n),a!==a+0)throw a;_setThrew(1,0)}}function invoke_diiiid(e,t,r,n,a,o){var l=stackSave();try{return getWasmTableEntry(e)(t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_viiiiiiiiiiii(e,t,r,n,a,o,l,u,_,d,f,p,m){var h=stackSave();try{getWasmTableEntry(e)(t,r,n,a,o,l,u,_,d,f,p,m)}catch(g){if(stackRestore(h),g!==g+0)throw g;_setThrew(1,0)}}function invoke_iiiiiiiiiiii(e,t,r,n,a,o,l,u,_,d,f,p){var m=stackSave();try{return getWasmTableEntry(e)(t,r,n,a,o,l,u,_,d,f,p)}catch(h){if(stackRestore(m),h!==h+0)throw h;_setThrew(1,0)}}function invoke_if(e,t){var r=stackSave();try{return getWasmTableEntry(e)(t)}catch(n){if(stackRestore(r),n!==n+0)throw n;_setThrew(1,0)}}function invoke_ifii(e,t,r,n){var a=stackSave();try{return getWasmTableEntry(e)(t,r,n)}catch(o){if(stackRestore(a),o!==o+0)throw o;_setThrew(1,0)}}function invoke_idii(e,t,r,n){var a=stackSave();try{return getWasmTableEntry(e)(t,r,n)}catch(o){if(stackRestore(a),o!==o+0)throw o;_setThrew(1,0)}}function invoke_ifi(e,t,r){var n=stackSave();try{return getWasmTableEntry(e)(t,r)}catch(a){if(stackRestore(n),a!==a+0)throw a;_setThrew(1,0)}}function invoke_idi(e,t,r){var n=stackSave();try{return getWasmTableEntry(e)(t,r)}catch(a){if(stackRestore(n),a!==a+0)throw a;_setThrew(1,0)}}function invoke_idiiii(e,t,r,n,a,o){var l=stackSave();try{return getWasmTableEntry(e)(t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_diii(e,t,r,n){var a=stackSave();try{return getWasmTableEntry(e)(t,r,n)}catch(o){if(stackRestore(a),o!==o+0)throw o;_setThrew(1,0)}}function invoke_diiid(e,t,r,n,a){var o=stackSave();try{return getWasmTableEntry(e)(t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_iifii(e,t,r,n,a){var o=stackSave();try{return getWasmTableEntry(e)(t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_iidiii(e,t,r,n,a,o){var l=stackSave();try{return getWasmTableEntry(e)(t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_iidiiii(e,t,r,n,a,o,l){var u=stackSave();try{return getWasmTableEntry(e)(t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_iidi(e,t,r,n){var a=stackSave();try{return getWasmTableEntry(e)(t,r,n)}catch(o){if(stackRestore(a),o!==o+0)throw o;_setThrew(1,0)}}function invoke_vifii(e,t,r,n,a){var o=stackSave();try{getWasmTableEntry(e)(t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_vidii(e,t,r,n,a){var o=stackSave();try{getWasmTableEntry(e)(t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_iif(e,t,r){var n=stackSave();try{return getWasmTableEntry(e)(t,r)}catch(a){if(stackRestore(n),a!==a+0)throw a;_setThrew(1,0)}}function invoke_fiiii(e,t,r,n,a){var o=stackSave();try{return getWasmTableEntry(e)(t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_viiifi(e,t,r,n,a,o){var l=stackSave();try{getWasmTableEntry(e)(t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_viiidi(e,t,r,n,a,o){var l=stackSave();try{getWasmTableEntry(e)(t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_iiiiid(e,t,r,n,a,o){var l=stackSave();try{return getWasmTableEntry(e)(t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_fiii(e,t,r,n){var a=stackSave();try{return getWasmTableEntry(e)(t,r,n)}catch(o){if(stackRestore(a),o!==o+0)throw o;_setThrew(1,0)}}function invoke_viiiiiiiiiiiiiii(e,t,r,n,a,o,l,u,_,d,f,p,m,h,g,v){var b=stackSave();try{getWasmTableEntry(e)(t,r,n,a,o,l,u,_,d,f,p,m,h,g,v)}catch(S){if(stackRestore(b),S!==S+0)throw S;_setThrew(1,0)}}function invoke_viji(e,t,r,n,a){var o=stackSave();try{Module.dynCall_viji(e,t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_ji(e,t){var r=stackSave();try{return Module.dynCall_ji(e,t)}catch(n){if(stackRestore(r),n!==n+0)throw n;_setThrew(1,0)}}function invoke_viijii(e,t,r,n,a,o,l){var u=stackSave();try{Module.dynCall_viijii(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_iij(e,t,r,n){var a=stackSave();try{return Module.dynCall_iij(e,t,r,n)}catch(o){if(stackRestore(a),o!==o+0)throw o;_setThrew(1,0)}}function invoke_iiijiijj(e,t,r,n,a,o,l,u,_,d,f){var p=stackSave();try{return Module.dynCall_iiijiijj(e,t,r,n,a,o,l,u,_,d,f)}catch(m){if(stackRestore(p),m!==m+0)throw m;_setThrew(1,0)}}function invoke_viij(e,t,r,n,a){var o=stackSave();try{Module.dynCall_viij(e,t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_iiijj(e,t,r,n,a,o,l){var u=stackSave();try{return Module.dynCall_iiijj(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_viiijj(e,t,r,n,a,o,l,u){var _=stackSave();try{Module.dynCall_viiijj(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_jii(e,t,r){var n=stackSave();try{return Module.dynCall_jii(e,t,r)}catch(a){if(stackRestore(n),a!==a+0)throw a;_setThrew(1,0)}}function invoke_vij(e,t,r,n){var a=stackSave();try{Module.dynCall_vij(e,t,r,n)}catch(o){if(stackRestore(a),o!==o+0)throw o;_setThrew(1,0)}}function invoke_iiijii(e,t,r,n,a,o,l){var u=stackSave();try{return Module.dynCall_iiijii(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_iiij(e,t,r,n,a){var o=stackSave();try{return Module.dynCall_iiij(e,t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_viiij(e,t,r,n,a,o){var l=stackSave();try{Module.dynCall_viiij(e,t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_viiji(e,t,r,n,a,o){var l=stackSave();try{Module.dynCall_viiji(e,t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_viijijj(e,t,r,n,a,o,l,u,_,d){var f=stackSave();try{Module.dynCall_viijijj(e,t,r,n,a,o,l,u,_,d)}catch(p){if(stackRestore(f),p!==p+0)throw p;_setThrew(1,0)}}function invoke_viijiijj(e,t,r,n,a,o,l,u,_,d,f){var p=stackSave();try{Module.dynCall_viijiijj(e,t,r,n,a,o,l,u,_,d,f)}catch(m){if(stackRestore(p),m!==m+0)throw m;_setThrew(1,0)}}function invoke_iiiij(e,t,r,n,a,o){var l=stackSave();try{return Module.dynCall_iiiij(e,t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_viijiii(e,t,r,n,a,o,l,u){var _=stackSave();try{Module.dynCall_viijiii(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_iiiji(e,t,r,n,a,o){var l=stackSave();try{return Module.dynCall_iiiji(e,t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_iiji(e,t,r,n,a){var o=stackSave();try{return Module.dynCall_iiji(e,t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_jiiij(e,t,r,n,a,o){var l=stackSave();try{return Module.dynCall_jiiij(e,t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_viiiji(e,t,r,n,a,o,l){var u=stackSave();try{Module.dynCall_viiiji(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_jj(e,t,r){var n=stackSave();try{return Module.dynCall_jj(e,t,r)}catch(a){if(stackRestore(n),a!==a+0)throw a;_setThrew(1,0)}}function invoke_iijji(e,t,r,n,a,o,l){var u=stackSave();try{return Module.dynCall_iijji(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_iiiiij(e,t,r,n,a,o,l){var u=stackSave();try{return Module.dynCall_iiiiij(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_iiijjj(e,t,r,n,a,o,l,u,_){var d=stackSave();try{return Module.dynCall_iiijjj(e,t,r,n,a,o,l,u,_)}catch(f){if(stackRestore(d),f!==f+0)throw f;_setThrew(1,0)}}function invoke_viiijjj(e,t,r,n,a,o,l,u,_,d){var f=stackSave();try{Module.dynCall_viiijjj(e,t,r,n,a,o,l,u,_,d)}catch(p){if(stackRestore(f),p!==p+0)throw p;_setThrew(1,0)}}function invoke_iiiiiij(e,t,r,n,a,o,l,u){var _=stackSave();try{return Module.dynCall_iiiiiij(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_jiiiii(e,t,r,n,a,o){var l=stackSave();try{return Module.dynCall_jiiiii(e,t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_iijiii(e,t,r,n,a,o,l){var u=stackSave();try{return Module.dynCall_iijiii(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_dij(e,t,r,n){var a=stackSave();try{return Module.dynCall_dij(e,t,r,n)}catch(o){if(stackRestore(a),o!==o+0)throw o;_setThrew(1,0)}}function invoke_iijii(e,t,r,n,a,o){var l=stackSave();try{return Module.dynCall_iijii(e,t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_vijji(e,t,r,n,a,o,l){var u=stackSave();try{Module.dynCall_vijji(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_iiiiijj(e,t,r,n,a,o,l,u,_){var d=stackSave();try{return Module.dynCall_iiiiijj(e,t,r,n,a,o,l,u,_)}catch(f){if(stackRestore(d),f!==f+0)throw f;_setThrew(1,0)}}function invoke_viiiij(e,t,r,n,a,o,l){var u=stackSave();try{Module.dynCall_viiiij(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_viiijii(e,t,r,n,a,o,l,u){var _=stackSave();try{Module.dynCall_viiijii(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_iiiijii(e,t,r,n,a,o,l,u){var _=stackSave();try{return Module.dynCall_iiiijii(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_viiiijii(e,t,r,n,a,o,l,u,_){var d=stackSave();try{Module.dynCall_viiiijii(e,t,r,n,a,o,l,u,_)}catch(f){if(stackRestore(d),f!==f+0)throw f;_setThrew(1,0)}}function invoke_jij(e,t,r,n){var a=stackSave();try{return Module.dynCall_jij(e,t,r,n)}catch(o){if(stackRestore(a),o!==o+0)throw o;_setThrew(1,0)}}function invoke_iiiijj(e,t,r,n,a,o,l,u){var _=stackSave();try{return Module.dynCall_iiiijj(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_iiiiijii(e,t,r,n,a,o,l,u,_){var d=stackSave();try{return Module.dynCall_iiiiijii(e,t,r,n,a,o,l,u,_)}catch(f){if(stackRestore(d),f!==f+0)throw f;_setThrew(1,0)}}function invoke_iijiiii(e,t,r,n,a,o,l,u){var _=stackSave();try{return Module.dynCall_iijiiii(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_vijiii(e,t,r,n,a,o,l){var u=stackSave();try{Module.dynCall_vijiii(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_iijjiiiii(e,t,r,n,a,o,l,u,_,d,f){var p=stackSave();try{return Module.dynCall_iijjiiiii(e,t,r,n,a,o,l,u,_,d,f)}catch(m){if(stackRestore(p),m!==m+0)throw m;_setThrew(1,0)}}function invoke_iiijjiii(e,t,r,n,a,o,l,u,_,d){var f=stackSave();try{return Module.dynCall_iiijjiii(e,t,r,n,a,o,l,u,_,d)}catch(p){if(stackRestore(f),p!==p+0)throw p;_setThrew(1,0)}}function invoke_iiijjii(e,t,r,n,a,o,l,u,_){var d=stackSave();try{return Module.dynCall_iiijjii(e,t,r,n,a,o,l,u,_)}catch(f){if(stackRestore(d),f!==f+0)throw f;_setThrew(1,0)}}function invoke_jiii(e,t,r,n){var a=stackSave();try{return Module.dynCall_jiii(e,t,r,n)}catch(o){if(stackRestore(a),o!==o+0)throw o;_setThrew(1,0)}}function invoke_vjjii(e,t,r,n,a,o,l){var u=stackSave();try{Module.dynCall_vjjii(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_viiiiijii(e,t,r,n,a,o,l,u,_,d){var f=stackSave();try{Module.dynCall_viiiiijii(e,t,r,n,a,o,l,u,_,d)}catch(p){if(stackRestore(f),p!==p+0)throw p;_setThrew(1,0)}}function invoke_iiiiiiij(e,t,r,n,a,o,l,u,_){var d=stackSave();try{return Module.dynCall_iiiiiiij(e,t,r,n,a,o,l,u,_)}catch(f){if(stackRestore(d),f!==f+0)throw f;_setThrew(1,0)}}function invoke_viiiijj(e,t,r,n,a,o,l,u,_){var d=stackSave();try{Module.dynCall_viiiijj(e,t,r,n,a,o,l,u,_)}catch(f){if(stackRestore(d),f!==f+0)throw f;_setThrew(1,0)}}function invoke_vijiiiiii(e,t,r,n,a,o,l,u,_,d){var f=stackSave();try{Module.dynCall_vijiiiiii(e,t,r,n,a,o,l,u,_,d)}catch(p){if(stackRestore(f),p!==p+0)throw p;_setThrew(1,0)}}function invoke_vijiiii(e,t,r,n,a,o,l,u){var _=stackSave();try{Module.dynCall_vijiiii(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_vijiiiii(e,t,r,n,a,o,l,u,_){var d=stackSave();try{Module.dynCall_vijiiiii(e,t,r,n,a,o,l,u,_)}catch(f){if(stackRestore(d),f!==f+0)throw f;_setThrew(1,0)}}function invoke_iijjiii(e,t,r,n,a,o,l,u,_){var d=stackSave();try{return Module.dynCall_iijjiii(e,t,r,n,a,o,l,u,_)}catch(f){if(stackRestore(d),f!==f+0)throw f;_setThrew(1,0)}}function invoke_ij(e,t,r){var n=stackSave();try{return Module.dynCall_ij(e,t,r)}catch(a){if(stackRestore(n),a!==a+0)throw a;_setThrew(1,0)}}function invoke_vijj(e,t,r,n,a,o){var l=stackSave();try{Module.dynCall_vijj(e,t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_iiiiji(e,t,r,n,a,o,l){var u=stackSave();try{return Module.dynCall_iiiiji(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_ijji(e,t,r,n,a,o){var l=stackSave();try{return Module.dynCall_ijji(e,t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_viijd(e,t,r,n,a,o){var l=stackSave();try{Module.dynCall_viijd(e,t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_viiijd(e,t,r,n,a,o,l){var u=stackSave();try{Module.dynCall_viiijd(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_iiiiiiiji(e,t,r,n,a,o,l,u,_,d){var f=stackSave();try{return Module.dynCall_iiiiiiiji(e,t,r,n,a,o,l,u,_,d)}catch(p){if(stackRestore(f),p!==p+0)throw p;_setThrew(1,0)}}function invoke_iiiiiji(e,t,r,n,a,o,l,u){var _=stackSave();try{return Module.dynCall_iiiiiji(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_vj(e,t,r){var n=stackSave();try{Module.dynCall_vj(e,t,r)}catch(a){if(stackRestore(n),a!==a+0)throw a;_setThrew(1,0)}}function invoke_viiiiiij(e,t,r,n,a,o,l,u,_){var d=stackSave();try{Module.dynCall_viiiiiij(e,t,r,n,a,o,l,u,_)}catch(f){if(stackRestore(d),f!==f+0)throw f;_setThrew(1,0)}}function invoke_viiiijiiiii(e,t,r,n,a,o,l,u,_,d,f,p){var m=stackSave();try{Module.dynCall_viiiijiiiii(e,t,r,n,a,o,l,u,_,d,f,p)}catch(h){if(stackRestore(m),h!==h+0)throw h;_setThrew(1,0)}}function invoke_viiiijiiii(e,t,r,n,a,o,l,u,_,d,f){var p=stackSave();try{Module.dynCall_viiiijiiii(e,t,r,n,a,o,l,u,_,d,f)}catch(m){if(stackRestore(p),m!==m+0)throw m;_setThrew(1,0)}}function invoke_vijii(e,t,r,n,a,o){var l=stackSave();try{Module.dynCall_vijii(e,t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_dj(e,t,r){var n=stackSave();try{return Module.dynCall_dj(e,t,r)}catch(a){if(stackRestore(n),a!==a+0)throw a;_setThrew(1,0)}}function invoke_viijji(e,t,r,n,a,o,l,u){var _=stackSave();try{Module.dynCall_viijji(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_viijj(e,t,r,n,a,o,l){var u=stackSave();try{Module.dynCall_viijj(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_viiiiijiiii(e,t,r,n,a,o,l,u,_,d,f,p){var m=stackSave();try{Module.dynCall_viiiiijiiii(e,t,r,n,a,o,l,u,_,d,f,p)}catch(h){if(stackRestore(m),h!==h+0)throw h;_setThrew(1,0)}}function invoke_viijiiiii(e,t,r,n,a,o,l,u,_,d){var f=stackSave();try{Module.dynCall_viijiiiii(e,t,r,n,a,o,l,u,_,d)}catch(p){if(stackRestore(f),p!==p+0)throw p;_setThrew(1,0)}}function invoke_vijiji(e,t,r,n,a,o,l,u){var _=stackSave();try{Module.dynCall_vijiji(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_vijjij(e,t,r,n,a,o,l,u,_){var d=stackSave();try{Module.dynCall_vijjij(e,t,r,n,a,o,l,u,_)}catch(f){if(stackRestore(d),f!==f+0)throw f;_setThrew(1,0)}}function invoke_jijij(e,t,r,n,a,o,l){var u=stackSave();try{return Module.dynCall_jijij(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_ijjj(e,t,r,n,a,o,l){var u=stackSave();try{return Module.dynCall_ijjj(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_jjjd(e,t,r,n,a,o){var l=stackSave();try{return Module.dynCall_jjjd(e,t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_vjii(e,t,r,n,a){var o=stackSave();try{Module.dynCall_vjii(e,t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_vjiiii(e,t,r,n,a,o,l){var u=stackSave();try{Module.dynCall_vjiiii(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_jiiii(e,t,r,n,a){var o=stackSave();try{return Module.dynCall_jiiii(e,t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_viiiiijiii(e,t,r,n,a,o,l,u,_,d,f){var p=stackSave();try{Module.dynCall_viiiiijiii(e,t,r,n,a,o,l,u,_,d,f)}catch(m){if(stackRestore(p),m!==m+0)throw m;_setThrew(1,0)}}function invoke_viiiijiiiiiiii(e,t,r,n,a,o,l,u,_,d,f,p,m,h,g){var v=stackSave();try{Module.dynCall_viiiijiiiiiiii(e,t,r,n,a,o,l,u,_,d,f,p,m,h,g)}catch(b){if(stackRestore(v),b!==b+0)throw b;_setThrew(1,0)}}function invoke_jjj(e,t,r,n,a){var o=stackSave();try{return Module.dynCall_jjj(e,t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_jjjji(e,t,r,n,a,o,l,u){var _=stackSave();try{return Module.dynCall_jjjji(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_viijij(e,t,r,n,a,o,l,u){var _=stackSave();try{Module.dynCall_viijij(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_iijjjj(e,t,r,n,a,o,l,u,_,d){var f=stackSave();try{return Module.dynCall_iijjjj(e,t,r,n,a,o,l,u,_,d)}catch(p){if(stackRestore(f),p!==p+0)throw p;_setThrew(1,0)}}function invoke_viijjj(e,t,r,n,a,o,l,u,_){var d=stackSave();try{Module.dynCall_viijjj(e,t,r,n,a,o,l,u,_)}catch(f){if(stackRestore(d),f!==f+0)throw f;_setThrew(1,0)}}function invoke_viijiiiiii(e,t,r,n,a,o,l,u,_,d,f){var p=stackSave();try{Module.dynCall_viijiiiiii(e,t,r,n,a,o,l,u,_,d,f)}catch(m){if(stackRestore(p),m!==m+0)throw m;_setThrew(1,0)}}function invoke_j(e){var t=stackSave();try{return Module.dynCall_j(e)}catch(r){if(stackRestore(t),r!==r+0)throw r;_setThrew(1,0)}}function invoke_jji(e,t,r,n){var a=stackSave();try{return Module.dynCall_jji(e,t,r,n)}catch(o){if(stackRestore(a),o!==o+0)throw o;_setThrew(1,0)}}function invoke_fijjjj(e,t,r,n,a,o,l,u,_,d){var f=stackSave();try{return Module.dynCall_fijjjj(e,t,r,n,a,o,l,u,_,d)}catch(p){if(stackRestore(f),p!==p+0)throw p;_setThrew(1,0)}}function invoke_dijjjj(e,t,r,n,a,o,l,u,_,d){var f=stackSave();try{return Module.dynCall_dijjjj(e,t,r,n,a,o,l,u,_,d)}catch(p){if(stackRestore(f),p!==p+0)throw p;_setThrew(1,0)}}function invoke_fijjjjij(e,t,r,n,a,o,l,u,_,d,f,p,m){var h=stackSave();try{return Module.dynCall_fijjjjij(e,t,r,n,a,o,l,u,_,d,f,p,m)}catch(g){if(stackRestore(h),g!==g+0)throw g;_setThrew(1,0)}}function invoke_dijjjjij(e,t,r,n,a,o,l,u,_,d,f,p,m){var h=stackSave();try{return Module.dynCall_dijjjjij(e,t,r,n,a,o,l,u,_,d,f,p,m)}catch(g){if(stackRestore(h),g!==g+0)throw g;_setThrew(1,0)}}function invoke_jiiiij(e,t,r,n,a,o,l){var u=stackSave();try{return Module.dynCall_jiiiij(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_ijjiii(e,t,r,n,a,o,l,u){var _=stackSave();try{return Module.dynCall_ijjiii(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_iiiiiiijii(e,t,r,n,a,o,l,u,_,d,f){var p=stackSave();try{return Module.dynCall_iiiiiiijii(e,t,r,n,a,o,l,u,_,d,f)}catch(m){if(stackRestore(p),m!==m+0)throw m;_setThrew(1,0)}}function invoke_jiiji(e,t,r,n,a,o){var l=stackSave();try{return Module.dynCall_jiiji(e,t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_fiiji(e,t,r,n,a,o){var l=stackSave();try{return Module.dynCall_fiiji(e,t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_diiji(e,t,r,n,a,o){var l=stackSave();try{return Module.dynCall_diiji(e,t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_viijjji(e,t,r,n,a,o,l,u,_,d){var f=stackSave();try{Module.dynCall_viijjji(e,t,r,n,a,o,l,u,_,d)}catch(p){if(stackRestore(f),p!==p+0)throw p;_setThrew(1,0)}}function invoke_viiddji(e,t,r,n,a,o,l,u){var _=stackSave();try{Module.dynCall_viiddji(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_iji(e,t,r,n){var a=stackSave();try{return Module.dynCall_iji(e,t,r,n)}catch(o){if(stackRestore(a),o!==o+0)throw o;_setThrew(1,0)}}function invoke_viiiijijjj(e,t,r,n,a,o,l,u,_,d,f,p,m,h){var g=stackSave();try{Module.dynCall_viiiijijjj(e,t,r,n,a,o,l,u,_,d,f,p,m,h)}catch(v){if(stackRestore(g),v!==v+0)throw v;_setThrew(1,0)}}function invoke_viiiiij(e,t,r,n,a,o,l,u){var _=stackSave();try{Module.dynCall_viiiiij(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_viiiiji(e,t,r,n,a,o,l,u){var _=stackSave();try{Module.dynCall_viiiiji(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_iijiji(e,t,r,n,a,o,l,u){var _=stackSave();try{return Module.dynCall_iijiji(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_vijjji(e,t,r,n,a,o,l,u,_){var d=stackSave();try{Module.dynCall_vijjji(e,t,r,n,a,o,l,u,_)}catch(f){if(stackRestore(d),f!==f+0)throw f;_setThrew(1,0)}}function invoke_vjiiij(e,t,r,n,a,o,l,u){var _=stackSave();try{Module.dynCall_vjiiij(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_viijjjji(e,t,r,n,a,o,l,u,_,d,f,p){var m=stackSave();try{Module.dynCall_viijjjji(e,t,r,n,a,o,l,u,_,d,f,p)}catch(h){if(stackRestore(m),h!==h+0)throw h;_setThrew(1,0)}}function invoke_viiijijj(e,t,r,n,a,o,l,u,_,d,f){var p=stackSave();try{Module.dynCall_viiijijj(e,t,r,n,a,o,l,u,_,d,f)}catch(m){if(stackRestore(p),m!==m+0)throw m;_setThrew(1,0)}}function invoke_viiijijij(e,t,r,n,a,o,l,u,_,d,f,p){var m=stackSave();try{Module.dynCall_viiijijij(e,t,r,n,a,o,l,u,_,d,f,p)}catch(h){if(stackRestore(m),h!==h+0)throw h;_setThrew(1,0)}}function invoke_viiijij(e,t,r,n,a,o,l,u,_){var d=stackSave();try{Module.dynCall_viiijij(e,t,r,n,a,o,l,u,_)}catch(f){if(stackRestore(d),f!==f+0)throw f;_setThrew(1,0)}}function invoke_jiij(e,t,r,n,a){var o=stackSave();try{return Module.dynCall_jiij(e,t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_viiiiiji(e,t,r,n,a,o,l,u,_){var d=stackSave();try{Module.dynCall_viiiiiji(e,t,r,n,a,o,l,u,_)}catch(f){if(stackRestore(d),f!==f+0)throw f;_setThrew(1,0)}}function invoke_iiiiijiii(e,t,r,n,a,o,l,u,_,d){var f=stackSave();try{return Module.dynCall_iiiiijiii(e,t,r,n,a,o,l,u,_,d)}catch(p){if(stackRestore(f),p!==p+0)throw p;_setThrew(1,0)}}function invoke_jiiiiii(e,t,r,n,a,o,l){var u=stackSave();try{return Module.dynCall_jiiiiii(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_iiiijiii(e,t,r,n,a,o,l,u,_){var d=stackSave();try{return Module.dynCall_iiiijiii(e,t,r,n,a,o,l,u,_)}catch(f){if(stackRestore(d),f!==f+0)throw f;_setThrew(1,0)}}function invoke_viiiiiiij(e,t,r,n,a,o,l,u,_,d){var f=stackSave();try{Module.dynCall_viiiiiiij(e,t,r,n,a,o,l,u,_,d)}catch(p){if(stackRestore(f),p!==p+0)throw p;_setThrew(1,0)}}function invoke_iiijiii(e,t,r,n,a,o,l,u){var _=stackSave();try{return Module.dynCall_iiijiii(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_iiiiiiiij(e,t,r,n,a,o,l,u,_,d){var f=stackSave();try{return Module.dynCall_iiiiiiiij(e,t,r,n,a,o,l,u,_,d)}catch(p){if(stackRestore(f),p!==p+0)throw p;_setThrew(1,0)}}function invoke_iijj(e,t,r,n,a,o){var l=stackSave();try{return Module.dynCall_iijj(e,t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_viiijjij(e,t,r,n,a,o,l,u,_,d,f){var p=stackSave();try{Module.dynCall_viiijjij(e,t,r,n,a,o,l,u,_,d,f)}catch(m){if(stackRestore(p),m!==m+0)throw m;_setThrew(1,0)}}function invoke_vijijiij(e,t,r,n,a,o,l,u,_,d,f){var p=stackSave();try{Module.dynCall_vijijiij(e,t,r,n,a,o,l,u,_,d,f)}catch(m){if(stackRestore(p),m!==m+0)throw m;_setThrew(1,0)}}function invoke_viijiiiij(e,t,r,n,a,o,l,u,_,d,f){var p=stackSave();try{Module.dynCall_viijiiiij(e,t,r,n,a,o,l,u,_,d,f)}catch(m){if(stackRestore(p),m!==m+0)throw m;_setThrew(1,0)}}function invoke_viiijiiiijjj(e,t,r,n,a,o,l,u,_,d,f,p,m,h,g,v){var b=stackSave();try{Module.dynCall_viiijiiiijjj(e,t,r,n,a,o,l,u,_,d,f,p,m,h,g,v)}catch(S){if(stackRestore(b),S!==S+0)throw S;_setThrew(1,0)}}function invoke_viijijiiiijjj(e,t,r,n,a,o,l,u,_,d,f,p,m,h,g,v,b,S){var L=stackSave();try{Module.dynCall_viijijiiiijjj(e,t,r,n,a,o,l,u,_,d,f,p,m,h,g,v,b,S)}catch(x){if(stackRestore(L),x!==x+0)throw x;_setThrew(1,0)}}function invoke_viiijiij(e,t,r,n,a,o,l,u,_,d){var f=stackSave();try{Module.dynCall_viiijiij(e,t,r,n,a,o,l,u,_,d)}catch(p){if(stackRestore(f),p!==p+0)throw p;_setThrew(1,0)}}function invoke_jiiijiijiii(e,t,r,n,a,o,l,u,_,d,f,p,m){var h=stackSave();try{return Module.dynCall_jiiijiijiii(e,t,r,n,a,o,l,u,_,d,f,p,m)}catch(g){if(stackRestore(h),g!==g+0)throw g;_setThrew(1,0)}}function invoke_viijijiiii(e,t,r,n,a,o,l,u,_,d,f,p){var m=stackSave();try{Module.dynCall_viijijiiii(e,t,r,n,a,o,l,u,_,d,f,p)}catch(h){if(stackRestore(m),h!==h+0)throw h;_setThrew(1,0)}}function invoke_jiiijiii(e,t,r,n,a,o,l,u,_){var d=stackSave();try{return Module.dynCall_jiiijiii(e,t,r,n,a,o,l,u,_)}catch(f){if(stackRestore(d),f!==f+0)throw f;_setThrew(1,0)}}function invoke_jiiijii(e,t,r,n,a,o,l,u){var _=stackSave();try{return Module.dynCall_jiiijii(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_iijjj(e,t,r,n,a,o,l,u){var _=stackSave();try{return Module.dynCall_iijjj(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_iiijji(e,t,r,n,a,o,l,u){var _=stackSave();try{return Module.dynCall_iiijji(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_vijijiiiijjj(e,t,r,n,a,o,l,u,_,d,f,p,m,h,g,v,b){var S=stackSave();try{Module.dynCall_vijijiiiijjj(e,t,r,n,a,o,l,u,_,d,f,p,m,h,g,v,b)}catch(L){if(stackRestore(S),L!==L+0)throw L;_setThrew(1,0)}}function invoke_viiiiijj(e,t,r,n,a,o,l,u,_,d){var f=stackSave();try{Module.dynCall_viiiiijj(e,t,r,n,a,o,l,u,_,d)}catch(p){if(stackRestore(f),p!==p+0)throw p;_setThrew(1,0)}}function invoke_jiiiiji(e,t,r,n,a,o,l,u){var _=stackSave();try{return Module.dynCall_jiiiiji(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_viiiijijji(e,t,r,n,a,o,l,u,_,d,f,p,m){var h=stackSave();try{Module.dynCall_viiiijijji(e,t,r,n,a,o,l,u,_,d,f,p,m)}catch(g){if(stackRestore(h),g!==g+0)throw g;_setThrew(1,0)}}function invoke_viiiijjij(e,t,r,n,a,o,l,u,_,d,f,p){var m=stackSave();try{Module.dynCall_viiiijjij(e,t,r,n,a,o,l,u,_,d,f,p)}catch(h){if(stackRestore(m),h!==h+0)throw h;_setThrew(1,0)}}function invoke_viiijiiii(e,t,r,n,a,o,l,u,_,d){var f=stackSave();try{Module.dynCall_viiijiiii(e,t,r,n,a,o,l,u,_,d)}catch(p){if(stackRestore(f),p!==p+0)throw p;_setThrew(1,0)}}function invoke_viiijiiijii(e,t,r,n,a,o,l,u,_,d,f,p,m){var h=stackSave();try{Module.dynCall_viiijiiijii(e,t,r,n,a,o,l,u,_,d,f,p,m)}catch(g){if(stackRestore(h),g!==g+0)throw g;_setThrew(1,0)}}function invoke_vijjj(e,t,r,n,a,o,l,u){var _=stackSave();try{Module.dynCall_vijjj(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_vijijj(e,t,r,n,a,o,l,u,_){var d=stackSave();try{Module.dynCall_vijijj(e,t,r,n,a,o,l,u,_)}catch(f){if(stackRestore(d),f!==f+0)throw f;_setThrew(1,0)}}function invoke_viiijjjj(e,t,r,n,a,o,l,u,_,d,f,p){var m=stackSave();try{Module.dynCall_viiijjjj(e,t,r,n,a,o,l,u,_,d,f,p)}catch(h){if(stackRestore(m),h!==h+0)throw h;_setThrew(1,0)}}function invoke_jd(e,t){var r=stackSave();try{return Module.dynCall_jd(e,t)}catch(n){if(stackRestore(r),n!==n+0)throw n;_setThrew(1,0)}}function invoke_jf(e,t){var r=stackSave();try{return Module.dynCall_jf(e,t)}catch(n){if(stackRestore(r),n!==n+0)throw n;_setThrew(1,0)}}function invoke_viiiiijjii(e,t,r,n,a,o,l,u,_,d,f,p){var m=stackSave();try{Module.dynCall_viiiiijjii(e,t,r,n,a,o,l,u,_,d,f,p)}catch(h){if(stackRestore(m),h!==h+0)throw h;_setThrew(1,0)}}function invoke_viiiiiijii(e,t,r,n,a,o,l,u,_,d,f){var p=stackSave();try{Module.dynCall_viiiiiijii(e,t,r,n,a,o,l,u,_,d,f)}catch(m){if(stackRestore(p),m!==m+0)throw m;_setThrew(1,0)}}function invoke_viiiiiiijjjji(e,t,r,n,a,o,l,u,_,d,f,p,m,h,g,v,b){var S=stackSave();try{Module.dynCall_viiiiiiijjjji(e,t,r,n,a,o,l,u,_,d,f,p,m,h,g,v,b)}catch(L){if(stackRestore(S),L!==L+0)throw L;_setThrew(1,0)}}function invoke_vji(e,t,r,n){var a=stackSave();try{Module.dynCall_vji(e,t,r,n)}catch(o){if(stackRestore(a),o!==o+0)throw o;_setThrew(1,0)}}function invoke_viiijjiii(e,t,r,n,a,o,l,u,_,d,f){var p=stackSave();try{Module.dynCall_viiijjiii(e,t,r,n,a,o,l,u,_,d,f)}catch(m){if(stackRestore(p),m!==m+0)throw m;_setThrew(1,0)}}function invoke_jiijj(e,t,r,n,a,o,l){var u=stackSave();try{return Module.dynCall_jiijj(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_jiiiiijiiii(e,t,r,n,a,o,l,u,_,d,f,p){var m=stackSave();try{return Module.dynCall_jiiiiijiiii(e,t,r,n,a,o,l,u,_,d,f,p)}catch(h){if(stackRestore(m),h!==h+0)throw h;_setThrew(1,0)}}function invoke_jiiiijii(e,t,r,n,a,o,l,u,_){var d=stackSave();try{return Module.dynCall_jiiiijii(e,t,r,n,a,o,l,u,_)}catch(f){if(stackRestore(d),f!==f+0)throw f;_setThrew(1,0)}}function invoke_jiijiiii(e,t,r,n,a,o,l,u,_){var d=stackSave();try{return Module.dynCall_jiijiiii(e,t,r,n,a,o,l,u,_)}catch(f){if(stackRestore(d),f!==f+0)throw f;_setThrew(1,0)}}function invoke_viijjii(e,t,r,n,a,o,l,u,_){var d=stackSave();try{Module.dynCall_viijjii(e,t,r,n,a,o,l,u,_)}catch(f){if(stackRestore(d),f!==f+0)throw f;_setThrew(1,0)}}function invoke_iiiijjiii(e,t,r,n,a,o,l,u,_,d,f){var p=stackSave();try{return Module.dynCall_iiiijjiii(e,t,r,n,a,o,l,u,_,d,f)}catch(m){if(stackRestore(p),m!==m+0)throw m;_setThrew(1,0)}}function invoke_iiijijj(e,t,r,n,a,o,l,u,_,d){var f=stackSave();try{return Module.dynCall_iiijijj(e,t,r,n,a,o,l,u,_,d)}catch(p){if(stackRestore(f),p!==p+0)throw p;_setThrew(1,0)}}function invoke_iiiiiiji(e,t,r,n,a,o,l,u,_){var d=stackSave();try{return Module.dynCall_iiiiiiji(e,t,r,n,a,o,l,u,_)}catch(f){if(stackRestore(d),f!==f+0)throw f;_setThrew(1,0)}}function invoke_iiiijjjj(e,t,r,n,a,o,l,u,_,d,f,p){var m=stackSave();try{return Module.dynCall_iiiijjjj(e,t,r,n,a,o,l,u,_,d,f,p)}catch(h){if(stackRestore(m),h!==h+0)throw h;_setThrew(1,0)}}function invoke_iiijiij(e,t,r,n,a,o,l,u,_){var d=stackSave();try{return Module.dynCall_iiijiij(e,t,r,n,a,o,l,u,_)}catch(f){if(stackRestore(d),f!==f+0)throw f;_setThrew(1,0)}}function invoke_iijiiiiiij(e,t,r,n,a,o,l,u,_,d,f,p){var m=stackSave();try{return Module.dynCall_iijiiiiiij(e,t,r,n,a,o,l,u,_,d,f,p)}catch(h){if(stackRestore(m),h!==h+0)throw h;_setThrew(1,0)}}function invoke_viijiijji(e,t,r,n,a,o,l,u,_,d,f,p){var m=stackSave();try{Module.dynCall_viijiijji(e,t,r,n,a,o,l,u,_,d,f,p)}catch(h){if(stackRestore(m),h!==h+0)throw h;_setThrew(1,0)}}function invoke_viiiijiijjii(e,t,r,n,a,o,l,u,_,d,f,p,m,h,g){var v=stackSave();try{Module.dynCall_viiiijiijjii(e,t,r,n,a,o,l,u,_,d,f,p,m,h,g)}catch(b){if(stackRestore(v),b!==b+0)throw b;_setThrew(1,0)}}function invoke_viijiiji(e,t,r,n,a,o,l,u,_,d){var f=stackSave();try{Module.dynCall_viijiiji(e,t,r,n,a,o,l,u,_,d)}catch(p){if(stackRestore(f),p!==p+0)throw p;_setThrew(1,0)}}function invoke_iiiiiijjiiiiiii(e,t,r,n,a,o,l,u,_,d,f,p,m,h,g,v,b){var S=stackSave();try{return Module.dynCall_iiiiiijjiiiiiii(e,t,r,n,a,o,l,u,_,d,f,p,m,h,g,v,b)}catch(L){if(stackRestore(S),L!==L+0)throw L;_setThrew(1,0)}}function invoke_iiiiijiiii(e,t,r,n,a,o,l,u,_,d,f){var p=stackSave();try{return Module.dynCall_iiiiijiiii(e,t,r,n,a,o,l,u,_,d,f)}catch(m){if(stackRestore(p),m!==m+0)throw m;_setThrew(1,0)}}function invoke_iiiijiijjiii(e,t,r,n,a,o,l,u,_,d,f,p,m,h,g){var v=stackSave();try{return Module.dynCall_iiiijiijjiii(e,t,r,n,a,o,l,u,_,d,f,p,m,h,g)}catch(b){if(stackRestore(v),b!==b+0)throw b;_setThrew(1,0)}}function invoke_iiidj(e,t,r,n,a,o){var l=stackSave();try{return Module.dynCall_iiidj(e,t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_iiiiiiiiiijii(e,t,r,n,a,o,l,u,_,d,f,p,m,h){var g=stackSave();try{return Module.dynCall_iiiiiiiiiijii(e,t,r,n,a,o,l,u,_,d,f,p,m,h)}catch(v){if(stackRestore(g),v!==v+0)throw v;_setThrew(1,0)}}function invoke_iiiiiiijj(e,t,r,n,a,o,l,u,_,d,f){var p=stackSave();try{return Module.dynCall_iiiiiiijj(e,t,r,n,a,o,l,u,_,d,f)}catch(m){if(stackRestore(p),m!==m+0)throw m;_setThrew(1,0)}}function invoke_iiiijji(e,t,r,n,a,o,l,u,_){var d=stackSave();try{return Module.dynCall_iiiijji(e,t,r,n,a,o,l,u,_)}catch(f){if(stackRestore(d),f!==f+0)throw f;_setThrew(1,0)}}function invoke_jiiijjj(e,t,r,n,a,o,l,u,_,d){var f=stackSave();try{return Module.dynCall_jiiijjj(e,t,r,n,a,o,l,u,_,d)}catch(p){if(stackRestore(f),p!==p+0)throw p;_setThrew(1,0)}}function invoke_iiiiijij(e,t,r,n,a,o,l,u,_,d){var f=stackSave();try{return Module.dynCall_iiiiijij(e,t,r,n,a,o,l,u,_,d)}catch(p){if(stackRestore(f),p!==p+0)throw p;_setThrew(1,0)}}function invoke_jiiiiiii(e,t,r,n,a,o,l,u){var _=stackSave();try{return Module.dynCall_jiiiiiii(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_viiijiii(e,t,r,n,a,o,l,u,_){var d=stackSave();try{Module.dynCall_viiijiii(e,t,r,n,a,o,l,u,_)}catch(f){if(stackRestore(d),f!==f+0)throw f;_setThrew(1,0)}}function invoke_iiiiiijji(e,t,r,n,a,o,l,u,_,d,f){var p=stackSave();try{return Module.dynCall_iiiiiijji(e,t,r,n,a,o,l,u,_,d,f)}catch(m){if(stackRestore(p),m!==m+0)throw m;_setThrew(1,0)}}function invoke_iiiiiiiiiijiiiiiii(e,t,r,n,a,o,l,u,_,d,f,p,m,h,g,v,b,S,L){var x=stackSave();try{return Module.dynCall_iiiiiiiiiijiiiiiii(e,t,r,n,a,o,l,u,_,d,f,p,m,h,g,v,b,S,L)}catch(T){if(stackRestore(x),T!==T+0)throw T;_setThrew(1,0)}}function invoke_iiiidjj(e,t,r,n,a,o,l,u,_){var d=stackSave();try{return Module.dynCall_iiiidjj(e,t,r,n,a,o,l,u,_)}catch(f){if(stackRestore(d),f!==f+0)throw f;_setThrew(1,0)}}function invoke_iiiijjj(e,t,r,n,a,o,l,u,_,d){var f=stackSave();try{return Module.dynCall_iiiijjj(e,t,r,n,a,o,l,u,_,d)}catch(p){if(stackRestore(f),p!==p+0)throw p;_setThrew(1,0)}}function invoke_iiiiiiiiiji(e,t,r,n,a,o,l,u,_,d,f,p){var m=stackSave();try{return Module.dynCall_iiiiiiiiiji(e,t,r,n,a,o,l,u,_,d,f,p)}catch(h){if(stackRestore(m),h!==h+0)throw h;_setThrew(1,0)}}function invoke_iiijiiiij(e,t,r,n,a,o,l,u,_,d,f){var p=stackSave();try{return Module.dynCall_iiijiiiij(e,t,r,n,a,o,l,u,_,d,f)}catch(m){if(stackRestore(p),m!==m+0)throw m;_setThrew(1,0)}}function invoke_iiijiiij(e,t,r,n,a,o,l,u,_,d){var f=stackSave();try{return Module.dynCall_iiijiiij(e,t,r,n,a,o,l,u,_,d)}catch(p){if(stackRestore(f),p!==p+0)throw p;_setThrew(1,0)}}function invoke_iijjii(e,t,r,n,a,o,l,u){var _=stackSave();try{return Module.dynCall_iijjii(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_viiijji(e,t,r,n,a,o,l,u,_){var d=stackSave();try{Module.dynCall_viiijji(e,t,r,n,a,o,l,u,_)}catch(f){if(stackRestore(d),f!==f+0)throw f;_setThrew(1,0)}}function invoke_jiiiijiiii(e,t,r,n,a,o,l,u,_,d,f){var p=stackSave();try{return Module.dynCall_jiiiijiiii(e,t,r,n,a,o,l,u,_,d,f)}catch(m){if(stackRestore(p),m!==m+0)throw m;_setThrew(1,0)}}function invoke_jiiiijiiiii(e,t,r,n,a,o,l,u,_,d,f,p){var m=stackSave();try{return Module.dynCall_jiiiijiiiii(e,t,r,n,a,o,l,u,_,d,f,p)}catch(h){if(stackRestore(m),h!==h+0)throw h;_setThrew(1,0)}}function invoke_jiijjjii(e,t,r,n,a,o,l,u,_,d,f){var p=stackSave();try{return Module.dynCall_jiijjjii(e,t,r,n,a,o,l,u,_,d,f)}catch(m){if(stackRestore(p),m!==m+0)throw m;_setThrew(1,0)}}function invoke_viiiijji(e,t,r,n,a,o,l,u,_,d){var f=stackSave();try{Module.dynCall_viiiijji(e,t,r,n,a,o,l,u,_,d)}catch(p){if(stackRestore(f),p!==p+0)throw p;_setThrew(1,0)}}function invoke_ijii(e,t,r,n,a){var o=stackSave();try{return Module.dynCall_ijii(e,t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_iiiiiiijjjjjjii(e,t,r,n,a,o,l,u,_,d,f,p,m,h,g,v,b,S,L,x,T){var w=stackSave();try{return Module.dynCall_iiiiiiijjjjjjii(e,t,r,n,a,o,l,u,_,d,f,p,m,h,g,v,b,S,L,x,T)}catch(F){if(stackRestore(w),F!==F+0)throw F;_setThrew(1,0)}}function invoke_iiijjijj(e,t,r,n,a,o,l,u,_,d,f,p){var m=stackSave();try{return Module.dynCall_iiijjijj(e,t,r,n,a,o,l,u,_,d,f,p)}catch(h){if(stackRestore(m),h!==h+0)throw h;_setThrew(1,0)}}function invoke_viiijjijj(e,t,r,n,a,o,l,u,_,d,f,p,m){var h=stackSave();try{Module.dynCall_viiijjijj(e,t,r,n,a,o,l,u,_,d,f,p,m)}catch(g){if(stackRestore(h),g!==g+0)throw g;_setThrew(1,0)}}function invoke_iijij(e,t,r,n,a,o,l){var u=stackSave();try{return Module.dynCall_iijij(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_vjiii(e,t,r,n,a,o){var l=stackSave();try{Module.dynCall_vjiii(e,t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_jiiijj(e,t,r,n,a,o,l,u){var _=stackSave();try{return Module.dynCall_jiiijj(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_iiijij(e,t,r,n,a,o,l,u){var _=stackSave();try{return Module.dynCall_iiijij(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_iidj(e,t,r,n,a){var o=stackSave();try{return Module.dynCall_iidj(e,t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_vjjijij(e,t,r,n,a,o,l,u,_,d,f){var p=stackSave();try{Module.dynCall_vjjijij(e,t,r,n,a,o,l,u,_,d,f)}catch(m){if(stackRestore(p),m!==m+0)throw m;_setThrew(1,0)}}function invoke_jiiiji(e,t,r,n,a,o,l){var u=stackSave();try{return Module.dynCall_jiiiji(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_iiiiiijjiijjji(e,t,r,n,a,o,l,u,_,d,f,p,m,h,g,v,b,S,L){var x=stackSave();try{return Module.dynCall_iiiiiijjiijjji(e,t,r,n,a,o,l,u,_,d,f,p,m,h,g,v,b,S,L)}catch(T){if(stackRestore(x),T!==T+0)throw T;_setThrew(1,0)}}function invoke_iiijjijjiii(e,t,r,n,a,o,l,u,_,d,f,p,m,h,g){var v=stackSave();try{return Module.dynCall_iiijjijjiii(e,t,r,n,a,o,l,u,_,d,f,p,m,h,g)}catch(b){if(stackRestore(v),b!==b+0)throw b;_setThrew(1,0)}}function invoke_iiiijjii(e,t,r,n,a,o,l,u,_,d){var f=stackSave();try{return Module.dynCall_iiiijjii(e,t,r,n,a,o,l,u,_,d)}catch(p){if(stackRestore(f),p!==p+0)throw p;_setThrew(1,0)}}function invoke_viiijjii(e,t,r,n,a,o,l,u,_,d){var f=stackSave();try{Module.dynCall_viiijjii(e,t,r,n,a,o,l,u,_,d)}catch(p){if(stackRestore(f),p!==p+0)throw p;_setThrew(1,0)}}function invoke_iiijjjj(e,t,r,n,a,o,l,u,_,d,f){var p=stackSave();try{return Module.dynCall_iiijjjj(e,t,r,n,a,o,l,u,_,d,f)}catch(m){if(stackRestore(p),m!==m+0)throw m;_setThrew(1,0)}}function invoke_viijiiij(e,t,r,n,a,o,l,u,_,d){var f=stackSave();try{Module.dynCall_viijiiij(e,t,r,n,a,o,l,u,_,d)}catch(p){if(stackRestore(f),p!==p+0)throw p;_setThrew(1,0)}}function invoke_vijiiiji(e,t,r,n,a,o,l,u,_,d){var f=stackSave();try{Module.dynCall_vijiiiji(e,t,r,n,a,o,l,u,_,d)}catch(p){if(stackRestore(f),p!==p+0)throw p;_setThrew(1,0)}}function invoke_jijjij(e,t,r,n,a,o,l,u,_){var d=stackSave();try{return Module.dynCall_jijjij(e,t,r,n,a,o,l,u,_)}catch(f){if(stackRestore(d),f!==f+0)throw f;_setThrew(1,0)}}function invoke_viijiij(e,t,r,n,a,o,l,u,_){var d=stackSave();try{Module.dynCall_viijiij(e,t,r,n,a,o,l,u,_)}catch(f){if(stackRestore(d),f!==f+0)throw f;_setThrew(1,0)}}function invoke_iiijiiiji(e,t,r,n,a,o,l,u,_,d,f){var p=stackSave();try{return Module.dynCall_iiijiiiji(e,t,r,n,a,o,l,u,_,d,f)}catch(m){if(stackRestore(p),m!==m+0)throw m;_setThrew(1,0)}}function invoke_iijiiji(e,t,r,n,a,o,l,u,_){var d=stackSave();try{return Module.dynCall_iijiiji(e,t,r,n,a,o,l,u,_)}catch(f){if(stackRestore(d),f!==f+0)throw f;_setThrew(1,0)}}function invoke_iijiijj(e,t,r,n,a,o,l,u,_,d){var f=stackSave();try{return Module.dynCall_iijiijj(e,t,r,n,a,o,l,u,_,d)}catch(p){if(stackRestore(f),p!==p+0)throw p;_setThrew(1,0)}}function invoke_vijjjj(e,t,r,n,a,o,l,u,_,d){var f=stackSave();try{Module.dynCall_vijjjj(e,t,r,n,a,o,l,u,_,d)}catch(p){if(stackRestore(f),p!==p+0)throw p;_setThrew(1,0)}}function invoke_viiiiijiijii(e,t,r,n,a,o,l,u,_,d,f,p,m,h){var g=stackSave();try{Module.dynCall_viiiiijiijii(e,t,r,n,a,o,l,u,_,d,f,p,m,h)}catch(v){if(stackRestore(g),v!==v+0)throw v;_setThrew(1,0)}}function invoke_jijj(e,t,r,n,a,o){var l=stackSave();try{return Module.dynCall_jijj(e,t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_viiiiijjji(e,t,r,n,a,o,l,u,_,d,f,p,m){var h=stackSave();try{Module.dynCall_viiiiijjji(e,t,r,n,a,o,l,u,_,d,f,p,m)}catch(g){if(stackRestore(h),g!==g+0)throw g;_setThrew(1,0)}}function invoke_iiijiiijj(e,t,r,n,a,o,l,u,_,d,f,p){var m=stackSave();try{return Module.dynCall_iiijiiijj(e,t,r,n,a,o,l,u,_,d,f,p)}catch(h){if(stackRestore(m),h!==h+0)throw h;_setThrew(1,0)}}function invoke_viiijijjj(e,t,r,n,a,o,l,u,_,d,f,p,m){var h=stackSave();try{Module.dynCall_viiijijjj(e,t,r,n,a,o,l,u,_,d,f,p,m)}catch(g){if(stackRestore(h),g!==g+0)throw g;_setThrew(1,0)}}function invoke_vijijjji(e,t,r,n,a,o,l,u,_,d,f,p){var m=stackSave();try{Module.dynCall_vijijjji(e,t,r,n,a,o,l,u,_,d,f,p)}catch(h){if(stackRestore(m),h!==h+0)throw h;_setThrew(1,0)}}function invoke_vijiij(e,t,r,n,a,o,l,u){var _=stackSave();try{Module.dynCall_vijiij(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_jijjjj(e,t,r,n,a,o,l,u,_,d){var f=stackSave();try{return Module.dynCall_jijjjj(e,t,r,n,a,o,l,u,_,d)}catch(p){if(stackRestore(f),p!==p+0)throw p;_setThrew(1,0)}}function invoke_iiijiiiijj(e,t,r,n,a,o,l,u,_,d,f,p,m){var h=stackSave();try{return Module.dynCall_iiijiiiijj(e,t,r,n,a,o,l,u,_,d,f,p,m)}catch(g){if(stackRestore(h),g!==g+0)throw g;_setThrew(1,0)}}function invoke_iijiiijj(e,t,r,n,a,o,l,u,_,d,f){var p=stackSave();try{return Module.dynCall_iijiiijj(e,t,r,n,a,o,l,u,_,d,f)}catch(m){if(stackRestore(p),m!==m+0)throw m;_setThrew(1,0)}}function invoke_iiijiiiii(e,t,r,n,a,o,l,u,_,d){var f=stackSave();try{return Module.dynCall_iiijiiiii(e,t,r,n,a,o,l,u,_,d)}catch(p){if(stackRestore(f),p!==p+0)throw p;_setThrew(1,0)}}function invoke_vijjjiiji(e,t,r,n,a,o,l,u,_,d,f,p,m){var h=stackSave();try{Module.dynCall_vijjjiiji(e,t,r,n,a,o,l,u,_,d,f,p,m)}catch(g){if(stackRestore(h),g!==g+0)throw g;_setThrew(1,0)}}function invoke_viijiji(e,t,r,n,a,o,l,u,_){var d=stackSave();try{Module.dynCall_viijiji(e,t,r,n,a,o,l,u,_)}catch(f){if(stackRestore(d),f!==f+0)throw f;_setThrew(1,0)}}function invoke_vijiiiiji(e,t,r,n,a,o,l,u,_,d,f){var p=stackSave();try{Module.dynCall_vijiiiiji(e,t,r,n,a,o,l,u,_,d,f)}catch(m){if(stackRestore(p),m!==m+0)throw m;_setThrew(1,0)}}function invoke_viiiijiii(e,t,r,n,a,o,l,u,_,d){var f=stackSave();try{Module.dynCall_viiiijiii(e,t,r,n,a,o,l,u,_,d)}catch(p){if(stackRestore(f),p!==p+0)throw p;_setThrew(1,0)}}function invoke_viijiiii(e,t,r,n,a,o,l,u,_){var d=stackSave();try{Module.dynCall_viijiiii(e,t,r,n,a,o,l,u,_)}catch(f){if(stackRestore(d),f!==f+0)throw f;_setThrew(1,0)}}function invoke_vijjiii(e,t,r,n,a,o,l,u,_){var d=stackSave();try{Module.dynCall_vijjiii(e,t,r,n,a,o,l,u,_)}catch(f){if(stackRestore(d),f!==f+0)throw f;_setThrew(1,0)}}function invoke_iiijjji(e,t,r,n,a,o,l,u,_,d){var f=stackSave();try{return Module.dynCall_iiijjji(e,t,r,n,a,o,l,u,_,d)}catch(p){if(stackRestore(f),p!==p+0)throw p;_setThrew(1,0)}}function invoke_viijiiijj(e,t,r,n,a,o,l,u,_,d,f,p){var m=stackSave();try{Module.dynCall_viijiiijj(e,t,r,n,a,o,l,u,_,d,f,p)}catch(h){if(stackRestore(m),h!==h+0)throw h;_setThrew(1,0)}}function invoke_jiji(e,t,r,n,a){var o=stackSave();try{return Module.dynCall_jiji(e,t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function applySignatureConversions(e){e=Object.assign({},e);var t=u=>_=>u(_)>>>0,r=u=>()=>u()>>>0,n=u=>(_,d,f)=>u(_,d,f)>>>0,a=u=>(_,d)=>u(_,d)>>>0,o=u=>_=>u(_)>>>0,l=u=>_=>u(_)>>>0;return e.__getTypeName=t(e.__getTypeName),e.pthread_self=r(e.pthread_self),e.memcpy=n(e.memcpy),e.malloc=t(e.malloc),e.calloc=a(e.calloc),e.__errno_location=r(e.__errno_location),e.strerror=o(e.strerror),e.emscripten_builtin_malloc=t(e.emscripten_builtin_malloc),e.emscripten_stack_get_base=r(e.emscripten_stack_get_base),e.emscripten_stack_get_end=r(e.emscripten_stack_get_end),e.emscripten_builtin_memalign=a(e.emscripten_builtin_memalign),e.emscripten_stack_get_current=r(e.emscripten_stack_get_current),e.emscripten_main_runtime_thread_id=r(e.emscripten_main_runtime_thread_id),e.sbrk=l(e.sbrk),e.memalign=a(e.memalign),e.emscripten_builtin_calloc=a(e.emscripten_builtin_calloc),e._emscripten_stack_alloc=t(e._emscripten_stack_alloc),e.__cxa_get_exception_ptr=t(e.__cxa_get_exception_ptr),e}Module.stackSave=stackSave,Module.stackRestore=stackRestore,Module.stackAlloc=stackAlloc,Module.ccall=ccall;var calledRun;dependenciesFulfilled=function e(){calledRun||run(),calledRun||(dependenciesFulfilled=e)};function callMain(e=[]){var t=resolveGlobalSymbol("main").sym;if(t){e.unshift(thisProgram);var r=e.length,n=stackAlloc((r+1)*4),a=n;e.forEach(l=>{HEAPU32[a>>>2>>>0]=stringToUTF8OnStack(l),a+=4}),HEAPU32[a>>>2>>>0]=0;try{var o=t(r,n);return exitJS(o,!0),o}catch(l){return handleException(l)}}}function run(e=arguments_){if(runDependencies>0||(preRun(),runDependencies>0))return;function t(){var r;calledRun||(calledRun=!0,Module.calledRun=!0,!ABORT&&(initRuntime(),preMain(),readyPromiseResolve(Module),(r=Module.onRuntimeInitialized)==null||r.call(Module),shouldRunNow&&callMain(e),postRun()))}Module.setStatus?(Module.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>Module.setStatus(""),1),t()},1)):t()}if(Module.preInit)for(typeof Module.preInit=="function"&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;return Module.noInitialRun&&(shouldRunNow=!1),run(),moduleRtn=readyPromise,moduleRtn}})();typeof exports=="object"&&typeof module=="object"?module.exports=DuckDB:typeof define=="function"&&define.amd&&define([],()=>DuckDB)});var Rl=fr(()=>{});var Gl=fr(()=>{});var Ul=fr((IS,ha)=>{(function(){"use strict";var c="input is invalid type",e=typeof window=="object",t=e?window:{};t.JS_SHA256_NO_WINDOW&&(e=!1);var r=!e&&typeof self=="object",n=!t.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;n?t=global:r&&(t=self);var a=!t.JS_SHA256_NO_COMMON_JS&&typeof ha=="object"&&ha.exports,o=typeof define=="function"&&define.amd,l=!t.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",u="0123456789abcdef".split(""),_=[-2147483648,8388608,32768,128],d=[24,16,8,0],f=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],p=["hex","array","digest","arrayBuffer"],m=[];(t.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(w){return Object.prototype.toString.call(w)==="[object Array]"}),l&&(t.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(w){return typeof w=="object"&&w.buffer&&w.buffer.constructor===ArrayBuffer});var h=function(w,F){return function(E){return new L(F,!0).update(E)[w]()}},g=function(w){var F=h("hex",w);n&&(F=v(F,w)),F.create=function(){return new L(w)},F.update=function(C){return F.create().update(C)};for(var E=0;E>>2]|=w[C]<>>2]|=A<>>2]|=(192|A>>>6)<>>2]|=(128|A&63)<=57344?(k[D>>>2]|=(224|A>>>12)<>>2]|=(128|A>>>6&63)<>>2]|=(128|A&63)<>>2]|=(240|A>>>18)<>>2]|=(128|A>>>12&63)<>>2]|=(128|A>>>6&63)<>>2]|=(128|A&63)<=64?(this.block=k[16],this.start=D-64,this.hash(),this.hashed=!0):this.start=D}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},L.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var w=this.blocks,F=this.lastByteIndex;w[16]=this.block,w[F>>>2]|=_[F&3],this.block=w[16],F>=56&&(this.hashed||this.hash(),w[0]=this.block,w[16]=w[1]=w[2]=w[3]=w[4]=w[5]=w[6]=w[7]=w[8]=w[9]=w[10]=w[11]=w[12]=w[13]=w[14]=w[15]=0),w[14]=this.hBytes<<3|this.bytes>>>29,w[15]=this.bytes<<3,this.hash()}},L.prototype.hash=function(){var w=this.h0,F=this.h1,E=this.h2,A=this.h3,C=this.h4,D=this.h5,P=this.h6,k=this.h7,M=this.blocks,I,X,Z,oe,Q,Ie,we,ke,Zr,Cr,dr;for(I=16;I<64;++I)Q=M[I-15],X=(Q>>>7|Q<<25)^(Q>>>18|Q<<14)^Q>>>3,Q=M[I-2],Z=(Q>>>17|Q<<15)^(Q>>>19|Q<<13)^Q>>>10,M[I]=M[I-16]+X+M[I-7]+Z<<0;for(dr=F&E,I=0;I<64;I+=4)this.first?(this.is224?(ke=300032,Q=M[0]-1413257819,k=Q-150054599<<0,A=Q+24177077<<0):(ke=704751109,Q=M[0]-210244248,k=Q-1521486534<<0,A=Q+143694565<<0),this.first=!1):(X=(w>>>2|w<<30)^(w>>>13|w<<19)^(w>>>22|w<<10),Z=(C>>>6|C<<26)^(C>>>11|C<<21)^(C>>>25|C<<7),ke=w&F,oe=ke^w&E^dr,we=C&D^~C&P,Q=k+Z+we+f[I]+M[I],Ie=X+oe,k=A+Q<<0,A=Q+Ie<<0),X=(A>>>2|A<<30)^(A>>>13|A<<19)^(A>>>22|A<<10),Z=(k>>>6|k<<26)^(k>>>11|k<<21)^(k>>>25|k<<7),Zr=A&w,oe=Zr^A&F^ke,we=k&C^~k&D,Q=P+Z+we+f[I+1]+M[I+1],Ie=X+oe,P=E+Q<<0,E=Q+Ie<<0,X=(E>>>2|E<<30)^(E>>>13|E<<19)^(E>>>22|E<<10),Z=(P>>>6|P<<26)^(P>>>11|P<<21)^(P>>>25|P<<7),Cr=E&A,oe=Cr^E&w^Zr,we=P&k^~P&C,Q=D+Z+we+f[I+2]+M[I+2],Ie=X+oe,D=F+Q<<0,F=Q+Ie<<0,X=(F>>>2|F<<30)^(F>>>13|F<<19)^(F>>>22|F<<10),Z=(D>>>6|D<<26)^(D>>>11|D<<21)^(D>>>25|D<<7),dr=F&E,oe=dr^F&A^Cr,we=D&P^~D&k,Q=C+Z+we+f[I+3]+M[I+3],Ie=X+oe,C=w+Q<<0,w=Q+Ie<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+w<<0,this.h1=this.h1+F<<0,this.h2=this.h2+E<<0,this.h3=this.h3+A<<0,this.h4=this.h4+C<<0,this.h5=this.h5+D<<0,this.h6=this.h6+P<<0,this.h7=this.h7+k<<0},L.prototype.hex=function(){this.finalize();var w=this.h0,F=this.h1,E=this.h2,A=this.h3,C=this.h4,D=this.h5,P=this.h6,k=this.h7,M=u[w>>>28&15]+u[w>>>24&15]+u[w>>>20&15]+u[w>>>16&15]+u[w>>>12&15]+u[w>>>8&15]+u[w>>>4&15]+u[w&15]+u[F>>>28&15]+u[F>>>24&15]+u[F>>>20&15]+u[F>>>16&15]+u[F>>>12&15]+u[F>>>8&15]+u[F>>>4&15]+u[F&15]+u[E>>>28&15]+u[E>>>24&15]+u[E>>>20&15]+u[E>>>16&15]+u[E>>>12&15]+u[E>>>8&15]+u[E>>>4&15]+u[E&15]+u[A>>>28&15]+u[A>>>24&15]+u[A>>>20&15]+u[A>>>16&15]+u[A>>>12&15]+u[A>>>8&15]+u[A>>>4&15]+u[A&15]+u[C>>>28&15]+u[C>>>24&15]+u[C>>>20&15]+u[C>>>16&15]+u[C>>>12&15]+u[C>>>8&15]+u[C>>>4&15]+u[C&15]+u[D>>>28&15]+u[D>>>24&15]+u[D>>>20&15]+u[D>>>16&15]+u[D>>>12&15]+u[D>>>8&15]+u[D>>>4&15]+u[D&15]+u[P>>>28&15]+u[P>>>24&15]+u[P>>>20&15]+u[P>>>16&15]+u[P>>>12&15]+u[P>>>8&15]+u[P>>>4&15]+u[P&15];return this.is224||(M+=u[k>>>28&15]+u[k>>>24&15]+u[k>>>20&15]+u[k>>>16&15]+u[k>>>12&15]+u[k>>>8&15]+u[k>>>4&15]+u[k&15]),M},L.prototype.toString=L.prototype.hex,L.prototype.digest=function(){this.finalize();var w=this.h0,F=this.h1,E=this.h2,A=this.h3,C=this.h4,D=this.h5,P=this.h6,k=this.h7,M=[w>>>24&255,w>>>16&255,w>>>8&255,w&255,F>>>24&255,F>>>16&255,F>>>8&255,F&255,E>>>24&255,E>>>16&255,E>>>8&255,E&255,A>>>24&255,A>>>16&255,A>>>8&255,A&255,C>>>24&255,C>>>16&255,C>>>8&255,C&255,D>>>24&255,D>>>16&255,D>>>8&255,D&255,P>>>24&255,P>>>16&255,P>>>8&255,P&255];return this.is224||M.push(k>>>24&255,k>>>16&255,k>>>8&255,k&255),M},L.prototype.array=L.prototype.digest,L.prototype.arrayBuffer=function(){this.finalize();var w=new ArrayBuffer(this.is224?28:32),F=new DataView(w);return F.setUint32(0,this.h0),F.setUint32(4,this.h1),F.setUint32(8,this.h2),F.setUint32(12,this.h3),F.setUint32(16,this.h4),F.setUint32(20,this.h5),F.setUint32(24,this.h6),this.is224||F.setUint32(28,this.h7),w};function x(w,F,E){var A,C=typeof w;if(C==="string"){var D=[],P=w.length,k=0,M;for(A=0;A>>6,D[k++]=128|M&63):M<55296||M>=57344?(D[k++]=224|M>>>12,D[k++]=128|M>>>6&63,D[k++]=128|M&63):(M=65536+((M&1023)<<10|w.charCodeAt(++A)&1023),D[k++]=240|M>>>18,D[k++]=128|M>>>12&63,D[k++]=128|M>>>6&63,D[k++]=128|M&63);w=D}else if(C==="object"){if(w===null)throw new Error(c);if(l&&w.constructor===ArrayBuffer)w=new Uint8Array(w);else if(!Array.isArray(w)&&(!l||!ArrayBuffer.isView(w)))throw new Error(c)}else throw new Error(c);w.length>64&&(w=new L(F,!0).update(w).array());var I=[],X=[];for(A=0;A<64;++A){var Z=w[A]||0;I[A]=92^Z,X[A]=54^Z}L.call(this,F,E),this.update(X),this.oKeyPad=I,this.inner=!0,this.sharedMemory=E}x.prototype=new L,x.prototype.finalize=function(){if(L.prototype.finalize.call(this),this.inner){this.inner=!1;var w=this.array();L.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(w),L.prototype.finalize.call(this)}};var T=g();T.sha256=T,T.sha224=g(!0),T.sha256.hmac=S(),T.sha224.hmac=S(!0),a?ha.exports=T:(t.sha256=T.sha256,t.sha224=T.sha224,o&&define(function(){return T}))})()});var wd={};pr(wd,{registerWorker:()=>Nl});function Bo(c,e){var t={};for(var r in c)Object.prototype.hasOwnProperty.call(c,r)&&e.indexOf(r)<0&&(t[r]=c[r]);if(c!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(c);n=c.length&&(c=void 0),{value:c&&c[r++],done:!c}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function ee(c){return this instanceof ee?(this.v=c,this):new ee(c)}function Qe(c,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t.apply(c,e||[]),n,a=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(p){r[p]&&(n[p]=function(m){return new Promise(function(h,g){a.push([p,m,h,g])>1||l(p,m)})})}function l(p,m){try{u(r[p](m))}catch(h){f(a[0][3],h)}}function u(p){p.value instanceof ee?Promise.resolve(p.value.v).then(_,d):f(a[0][2],p)}function _(p){l("next",p)}function d(p){l("throw",p)}function f(p,m){p(m),a.shift(),a.length&&l(a[0][0],a[0][1])}}function ei(c){var e,t;return e={},r("next"),r("throw",function(n){throw n}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(n,a){e[n]=c[n]?function(o){return(t=!t)?{value:ee(c[n](o)),done:!1}:a?a(o):o}:a}}function ut(c){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=c[Symbol.asyncIterator],t;return e?e.call(c):(c=typeof Io=="function"?Io(c):c[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(a){t[a]=c[a]&&function(o){return new Promise(function(l,u){o=c[a](o),n(l,u,o.done,o.value)})}}function n(a,o,l,u){Promise.resolve(u).then(function(_){a({value:_,done:l})},o)}}var Ea={};pr(Ea,{compareArrayLike:()=>wa,joinUint8Arrays:()=>Ye,memcpy:()=>xi,rebaseValueOffsets:()=>Rn,toArrayBufferView:()=>re,toArrayBufferViewAsyncIterator:()=>ft,toArrayBufferViewIterator:()=>xt,toBigInt64Array:()=>Bn,toBigUint64Array:()=>nu,toFloat32Array:()=>su,toFloat32ArrayAsyncIterator:()=>Su,toFloat32ArrayIterator:()=>fu,toFloat64Array:()=>au,toFloat64ArrayAsyncIterator:()=>wu,toFloat64ArrayIterator:()=>pu,toInt16Array:()=>tu,toInt16ArrayAsyncIterator:()=>gu,toInt16ArrayIterator:()=>lu,toInt32Array:()=>Pr,toInt32ArrayAsyncIterator:()=>vu,toInt32ArrayIterator:()=>uu,toInt8Array:()=>eu,toInt8ArrayAsyncIterator:()=>hu,toInt8ArrayIterator:()=>cu,toUint16Array:()=>ru,toUint16ArrayAsyncIterator:()=>yu,toUint16ArrayIterator:()=>_u,toUint32Array:()=>iu,toUint32ArrayAsyncIterator:()=>bu,toUint32ArrayIterator:()=>du,toUint8Array:()=>z,toUint8ArrayAsyncIterator:()=>Sa,toUint8ArrayIterator:()=>ba,toUint8ClampedArray:()=>ou,toUint8ClampedArrayAsyncIterator:()=>Eu,toUint8ClampedArrayIterator:()=>mu});var Yl=new TextDecoder("utf-8"),Ti=c=>Yl.decode(c),Jl=new TextEncoder,Ft=c=>Jl.encode(c);var Kl=c=>typeof c=="number",Ro=c=>typeof c=="boolean",xe=c=>typeof c=="function",Oe=c=>c!=null&&Object(c)===c,_t=c=>Oe(c)&&xe(c.then);var dt=c=>Oe(c)&&xe(c[Symbol.iterator]),rt=c=>Oe(c)&&xe(c[Symbol.asyncIterator]),Fn=c=>Oe(c)&&Oe(c.schema);var xn=c=>Oe(c)&&"done"in c&&"value"in c;var Cn=c=>Oe(c)&&xe(c.stat)&&Kl(c.fd);var Mn=c=>Oe(c)&&Fi(c.body),Pn=c=>"_getDOMStream"in c&&"_getNodeStream"in c,Go=c=>Oe(c)&&xe(c.abort)&&xe(c.getWriter)&&!Pn(c),Fi=c=>Oe(c)&&xe(c.cancel)&&xe(c.getReader)&&!Pn(c),Uo=c=>Oe(c)&&xe(c.end)&&xe(c.write)&&Ro(c.writable)&&!Pn(c),In=c=>Oe(c)&&xe(c.read)&&xe(c.pipe)&&Ro(c.readable)&&!Pn(c),jo=c=>Oe(c)&&xe(c.clear)&&xe(c.bytes)&&xe(c.position)&&xe(c.setPosition)&&xe(c.capacity)&&xe(c.getBufferIdentifier)&&xe(c.createLong);var ya=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function Zl(c){let e=c[0]?[c[0]]:[],t,r,n,a;for(let o,l,u=0,_=0,d=c.length;++ud+f.byteLength,0),n,a,o,l=0,u=-1,_=Math.min(e||Number.POSITIVE_INFINITY,r);for(let d=t.length;++ure(Int8Array,c),tu=c=>re(Int16Array,c),Pr=c=>re(Int32Array,c),Bn=c=>re(BigInt64Array,c),z=c=>re(Uint8Array,c),ru=c=>re(Uint16Array,c),iu=c=>re(Uint32Array,c),nu=c=>re(BigUint64Array,c),su=c=>re(Float32Array,c),au=c=>re(Float64Array,c),ou=c=>re(Uint8ClampedArray,c),va=c=>(c.next(),c);function*xt(c,e){let t=function*(n){yield n},r=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof ya?t(e):dt(e)?e:t(e);return yield*Mr(va(function*(n){let a=null;do a=n.next(yield re(c,a));while(!a.done)}(r[Symbol.iterator]()))),new c}var cu=c=>xt(Int8Array,c),lu=c=>xt(Int16Array,c),uu=c=>xt(Int32Array,c),ba=c=>xt(Uint8Array,c),_u=c=>xt(Uint16Array,c),du=c=>xt(Uint32Array,c),fu=c=>xt(Float32Array,c),pu=c=>xt(Float64Array,c),mu=c=>xt(Uint8ClampedArray,c);function ft(c,e){return Qe(this,arguments,function*(){if(_t(e))return yield ee(yield ee(yield*Mr(ei(ut(ft(c,yield ee(e)))))));let r=function(o){return Qe(this,arguments,function*(){yield yield ee(yield ee(o))})},n=function(o){return Qe(this,arguments,function*(){yield ee(yield*Mr(ei(ut(va(function*(l){let u=null;do u=l.next(yield u==null?void 0:u.value);while(!u.done)}(o[Symbol.iterator]()))))))})},a=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof ya?r(e):dt(e)?n(e):rt(e)?e:r(e);return yield ee(yield*Mr(ei(ut(va(function(o){return Qe(this,arguments,function*(){let l=null;do l=yield ee(o.next(yield yield ee(re(c,l))));while(!l.done)})}(a[Symbol.asyncIterator]())))))),yield ee(new c)})}var hu=c=>ft(Int8Array,c),gu=c=>ft(Int16Array,c),vu=c=>ft(Int32Array,c),Sa=c=>ft(Uint8Array,c),yu=c=>ft(Uint16Array,c),bu=c=>ft(Uint32Array,c),Su=c=>ft(Float32Array,c),wu=c=>ft(Float64Array,c),Eu=c=>ft(Uint8ClampedArray,c);function Rn(c,e,t){if(c!==0){t=t.slice(0,e);for(let r=-1,n=t.length;++r0)do if(c[t]!==e[t])return!1;while(++t(c.next(),c);function*Lu(c){let e,t=!1,r=[],n,a,o,l=0;function u(){return a==="peek"?Ye(r,o)[0]:([n,r,l]=Ye(r,o),n)}({cmd:a,size:o}=(yield null)||{cmd:"read",size:0});let _=ba(c)[Symbol.iterator]();try{do if({done:e,value:n}=Number.isNaN(o-l)?_.next():_.next(o-l),!e&&n.byteLength>0&&(r.push(n),l+=n.byteLength),e||o<=l)do({cmd:a,size:o}=yield u());while(o0&&(n.push(a),u+=a.byteLength),t||l<=u)do({cmd:o,size:l}=yield yield ee(_()));while(l0&&(n.push(z(a)),u+=a.byteLength),t||l<=u)do({cmd:o,size:l}=yield yield ee(_()));while(l{})}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=null}cancel(e){return B(this,void 0,void 0,function*(){let{reader:t,source:r}=this;t&&(yield t.cancel(e).catch(()=>{})),r&&r.locked&&this.releaseLock()})}read(e){return B(this,void 0,void 0,function*(){if(e===0)return{done:this.reader==null,value:new Uint8Array(0)};let t=yield this.reader.read();return!t.done&&(t.value=z(t)),t})}},La=(c,e)=>{let t=n=>r([e,n]),r;return[e,t,new Promise(n=>(r=n)&&c.once(e,t))]};function ku(c){return Qe(this,arguments,function*(){let t=[],r="error",n=!1,a=null,o,l,u=0,_=[],d;function f(){return o==="peek"?Ye(_,l)[0]:([d,_,u]=Ye(_,l),d)}if({cmd:o,size:l}=(yield yield ee(null))||{cmd:"read",size:0},c.isTTY)return yield yield ee(new Uint8Array(0)),yield ee(null);try{t[0]=La(c,"end"),t[1]=La(c,"error");do{if(t[2]=La(c,"readable"),[r,a]=yield ee(Promise.race(t.map(m=>m[2]))),r==="error")break;if((n=r==="end")||(Number.isFinite(l-u)?(d=z(c.read(l-u)),d.byteLength0&&(_.push(d),u+=d.byteLength)),n||l<=u)do({cmd:o,size:l}=yield yield ee(f()));while(l{for(let[b,S]of m)c.off(b,S);try{let b=c.destroy;b&&b.call(c,h),h=void 0}catch(b){h=b||h}finally{h!=null?v(h):g()}})}})}var ue;(function(c){c[c.V1=0]="V1",c[c.V2=1]="V2",c[c.V3=2]="V3",c[c.V4=3]="V4",c[c.V5=4]="V5"})(ue||(ue={}));var he;(function(c){c[c.Sparse=0]="Sparse",c[c.Dense=1]="Dense"})(he||(he={}));var pe;(function(c){c[c.HALF=0]="HALF",c[c.SINGLE=1]="SINGLE",c[c.DOUBLE=2]="DOUBLE"})(pe||(pe={}));var Ae;(function(c){c[c.DAY=0]="DAY",c[c.MILLISECOND=1]="MILLISECOND"})(Ae||(Ae={}));var G;(function(c){c[c.SECOND=0]="SECOND",c[c.MILLISECOND=1]="MILLISECOND",c[c.MICROSECOND=2]="MICROSECOND",c[c.NANOSECOND=3]="NANOSECOND"})(G||(G={}));var Ce;(function(c){c[c.YEAR_MONTH=0]="YEAR_MONTH",c[c.DAY_TIME=1]="DAY_TIME",c[c.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(Ce||(Ce={}));var Ct=new Int32Array(2),Un=new Float32Array(Ct.buffer),jn=new Float64Array(Ct.buffer),ti=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var Ci;(function(c){c[c.UTF8_BYTES=1]="UTF8_BYTES",c[c.UTF16_STRING=2]="UTF16_STRING"})(Ci||(Ci={}));var Je=class c{constructor(e){this.bytes_=e,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(e){return new c(new Uint8Array(e))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(e){this.position_=e}capacity(){return this.bytes_.length}readInt8(e){return this.readUint8(e)<<24>>24}readUint8(e){return this.bytes_[e]}readInt16(e){return this.readUint16(e)<<16>>16}readUint16(e){return this.bytes_[e]|this.bytes_[e+1]<<8}readInt32(e){return this.bytes_[e]|this.bytes_[e+1]<<8|this.bytes_[e+2]<<16|this.bytes_[e+3]<<24}readUint32(e){return this.readInt32(e)>>>0}readInt64(e){return BigInt.asIntN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<>8}writeUint16(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8}writeInt32(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}writeUint32(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}writeInt64(e,t){this.writeInt32(e,Number(BigInt.asIntN(32,t))),this.writeInt32(e+4,Number(BigInt.asIntN(32,t>>BigInt(32))))}writeUint64(e,t){this.writeUint32(e,Number(BigInt.asUintN(32,t))),this.writeUint32(e+4,Number(BigInt.asUintN(32,t>>BigInt(32))))}writeFloat32(e,t){Un[0]=t,this.writeInt32(e,Ct[0])}writeFloat64(e,t){jn[0]=t,this.writeInt32(e,Ct[ti?0:1]),this.writeInt32(e+4,Ct[ti?1:0])}getBufferIdentifier(){if(this.bytes_.lengththis.minalign&&(this.minalign=e);let r=~(this.bb.capacity()-this.space+t)+1&e-1;for(;this.space=0&&this.vtable[t]==0;t--);let r=t+1;for(;t>=0;t--)this.addInt16(this.vtable[t]!=0?e-this.vtable[t]:0);let n=2;this.addInt16(e-this.object_start);let a=(r+n)*2;this.addInt16(a);let o=0,l=this.space;e:for(t=0;t=0;o--)this.writeInt8(a.charCodeAt(o))}this.prep(this.minalign,4+n),this.addOffset(e),n&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(e,t){this.finish(e,t,!0)}requiredField(e,t){let r=this.bb.capacity()-e,n=r-this.bb.readInt32(r);if(!(t=0;r--)e.addInt32(t[r]);return e.endVector()}static startTypeIdsVector(e,t){e.startVector(4,t,4)}static endUnion(e){return e.endObject()}static createUnion(e,t,r){return c.startUnion(e),c.addMode(e,t),c.addTypeIds(e,r),c.endUnion(e)}};var Ni=class c{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsUtf8(e,t){return(t||new c).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUtf8(e,t){return e.setPosition(e.position()+4),(t||new c).__init(e.readInt32(e.position())+e.position(),e)}static startUtf8(e){e.startObject(0)}static endUtf8(e){return e.endObject()}static createUtf8(e){return c.startUtf8(e),c.endUtf8(e)}};var ge;(function(c){c[c.NONE=0]="NONE",c[c.Null=1]="Null",c[c.Int=2]="Int",c[c.FloatingPoint=3]="FloatingPoint",c[c.Binary=4]="Binary",c[c.Utf8=5]="Utf8",c[c.Bool=6]="Bool",c[c.Decimal=7]="Decimal",c[c.Date=8]="Date",c[c.Time=9]="Time",c[c.Timestamp=10]="Timestamp",c[c.Interval=11]="Interval",c[c.List=12]="List",c[c.Struct_=13]="Struct_",c[c.Union=14]="Union",c[c.FixedSizeBinary=15]="FixedSizeBinary",c[c.FixedSizeList=16]="FixedSizeList",c[c.Map=17]="Map",c[c.Duration=18]="Duration",c[c.LargeBinary=19]="LargeBinary",c[c.LargeUtf8=20]="LargeUtf8",c[c.LargeList=21]="LargeList",c[c.RunEndEncoded=22]="RunEndEncoded"})(ge||(ge={}));var je=class c{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsField(e,t){return(t||new c).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsField(e,t){return e.setPosition(e.position()+4),(t||new c).__init(e.readInt32(e.position())+e.position(),e)}name(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}nullable(){let e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}typeType(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readUint8(this.bb_pos+e):ge.NONE}type(e){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__union(e,this.bb_pos+t):null}dictionary(e){let t=this.bb.__offset(this.bb_pos,12);return t?(e||new Mt).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}children(e,t){let r=this.bb.__offset(this.bb_pos,14);return r?(t||new c).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+e*4),this.bb):null}childrenLength(){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let r=this.bb.__offset(this.bb_pos,16);return r?(t||new Me).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.__vector_len(this.bb_pos+e):0}static startField(e){e.startObject(7)}static addName(e,t){e.addFieldOffset(0,t,0)}static addNullable(e,t){e.addFieldInt8(1,+t,0)}static addTypeType(e,t){e.addFieldInt8(2,t,ge.NONE)}static addType(e,t){e.addFieldOffset(3,t,0)}static addDictionary(e,t){e.addFieldOffset(4,t,0)}static addChildren(e,t){e.addFieldOffset(5,t,0)}static createChildrenVector(e,t){e.startVector(4,t.length,4);for(let r=t.length-1;r>=0;r--)e.addOffset(t[r]);return e.endVector()}static startChildrenVector(e,t){e.startVector(4,t,4)}static addCustomMetadata(e,t){e.addFieldOffset(6,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let r=t.length-1;r>=0;r--)e.addOffset(t[r]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endField(e){return e.endObject()}};var Ve=class c{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSchema(e,t){return(t||new c).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSchema(e,t){return e.setPosition(e.position()+4),(t||new c).__init(e.readInt32(e.position())+e.position(),e)}endianness(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):mr.Little}fields(e,t){let r=this.bb.__offset(this.bb_pos,6);return r?(t||new je).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+e*4),this.bb):null}fieldsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let r=this.bb.__offset(this.bb_pos,8);return r?(t||new Me).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}features(e){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb.__vector(this.bb_pos+t)+e*8):BigInt(0)}featuresLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}static startSchema(e){e.startObject(4)}static addEndianness(e,t){e.addFieldInt16(0,t,mr.Little)}static addFields(e,t){e.addFieldOffset(1,t,0)}static createFieldsVector(e,t){e.startVector(4,t.length,4);for(let r=t.length-1;r>=0;r--)e.addOffset(t[r]);return e.endVector()}static startFieldsVector(e,t){e.startVector(4,t,4)}static addCustomMetadata(e,t){e.addFieldOffset(2,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let r=t.length-1;r>=0;r--)e.addOffset(t[r]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static addFeatures(e,t){e.addFieldOffset(3,t,0)}static createFeaturesVector(e,t){e.startVector(8,t.length,8);for(let r=t.length-1;r>=0;r--)e.addInt64(t[r]);return e.endVector()}static startFeaturesVector(e,t){e.startVector(8,t,8)}static endSchema(e){return e.endObject()}static finishSchemaBuffer(e,t){e.finish(t)}static finishSizePrefixedSchemaBuffer(e,t){e.finish(t,void 0,!0)}static createSchema(e,t,r,n,a){return c.startSchema(e),c.addEndianness(e,t),c.addFields(e,r),c.addCustomMetadata(e,n),c.addFeatures(e,a),c.endSchema(e)}};var ne;(function(c){c[c.NONE=0]="NONE",c[c.Schema=1]="Schema",c[c.DictionaryBatch=2]="DictionaryBatch",c[c.RecordBatch=3]="RecordBatch",c[c.Tensor=4]="Tensor",c[c.SparseTensor=5]="SparseTensor"})(ne||(ne={}));var y;(function(c){c[c.NONE=0]="NONE",c[c.Null=1]="Null",c[c.Int=2]="Int",c[c.Float=3]="Float",c[c.Binary=4]="Binary",c[c.Utf8=5]="Utf8",c[c.Bool=6]="Bool",c[c.Decimal=7]="Decimal",c[c.Date=8]="Date",c[c.Time=9]="Time",c[c.Timestamp=10]="Timestamp",c[c.Interval=11]="Interval",c[c.List=12]="List",c[c.Struct=13]="Struct",c[c.Union=14]="Union",c[c.FixedSizeBinary=15]="FixedSizeBinary",c[c.FixedSizeList=16]="FixedSizeList",c[c.Map=17]="Map",c[c.Duration=18]="Duration",c[c.LargeBinary=19]="LargeBinary",c[c.LargeUtf8=20]="LargeUtf8",c[c.Dictionary=-1]="Dictionary",c[c.Int8=-2]="Int8",c[c.Int16=-3]="Int16",c[c.Int32=-4]="Int32",c[c.Int64=-5]="Int64",c[c.Uint8=-6]="Uint8",c[c.Uint16=-7]="Uint16",c[c.Uint32=-8]="Uint32",c[c.Uint64=-9]="Uint64",c[c.Float16=-10]="Float16",c[c.Float32=-11]="Float32",c[c.Float64=-12]="Float64",c[c.DateDay=-13]="DateDay",c[c.DateMillisecond=-14]="DateMillisecond",c[c.TimestampSecond=-15]="TimestampSecond",c[c.TimestampMillisecond=-16]="TimestampMillisecond",c[c.TimestampMicrosecond=-17]="TimestampMicrosecond",c[c.TimestampNanosecond=-18]="TimestampNanosecond",c[c.TimeSecond=-19]="TimeSecond",c[c.TimeMillisecond=-20]="TimeMillisecond",c[c.TimeMicrosecond=-21]="TimeMicrosecond",c[c.TimeNanosecond=-22]="TimeNanosecond",c[c.DenseUnion=-23]="DenseUnion",c[c.SparseUnion=-24]="SparseUnion",c[c.IntervalDayTime=-25]="IntervalDayTime",c[c.IntervalYearMonth=-26]="IntervalYearMonth",c[c.DurationSecond=-27]="DurationSecond",c[c.DurationMillisecond=-28]="DurationMillisecond",c[c.DurationMicrosecond=-29]="DurationMicrosecond",c[c.DurationNanosecond=-30]="DurationNanosecond"})(y||(y={}));var nt;(function(c){c[c.OFFSET=0]="OFFSET",c[c.DATA=1]="DATA",c[c.VALIDITY=2]="VALIDITY",c[c.TYPE=3]="TYPE"})(nt||(nt={}));var za={};pr(za,{clampRange:()=>$i,createElementComparator:()=>Dr,wrapIndex:()=>Br});var Da={};pr(Da,{valueToString:()=>gt});function gt(c){if(c===null)return"null";if(c===void 0)return"undefined";switch(typeof c){case"number":return"".concat(c);case"bigint":return"".concat(c);case"string":return'"'.concat(c,'"')}return typeof c[Symbol.toPrimitive]=="function"?c[Symbol.toPrimitive]("string"):ArrayBuffer.isView(c)?c instanceof BigInt64Array||c instanceof BigUint64Array?"[".concat([...c].map(e=>gt(e)),"]"):"[".concat(c,"]"):ArrayBuffer.isView(c)?"[".concat(c,"]"):JSON.stringify(c,(e,t)=>typeof t=="bigint"?"".concat(t):t)}var xa={};pr(xa,{BN:()=>Vi,bigNumToBigInt:()=>Ho,bigNumToNumber:()=>Fa,bigNumToString:()=>ai,isArrowBigNumSymbol:()=>Oo});function ae(c){if(typeof c=="bigint"&&(cNumber.MAX_SAFE_INTEGER))throw new TypeError("".concat(c," is not safe to convert to a number."));return Number(c)}function ka(c,e){return ae(c/e)+ae(c%e)/ae(e)}var Oo=Symbol.for("isArrowBigNum");function vt(c,...e){return e.length===0?Object.setPrototypeOf(re(this.TypedArray,c),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(c,...e),this.constructor.prototype)}vt.prototype[Oo]=!0;vt.prototype.toJSON=function(){return'"'.concat(ai(this),'"')};vt.prototype.valueOf=function(c){return Fa(this,c)};vt.prototype.toString=function(){return ai(this)};vt.prototype[Symbol.toPrimitive]=function(c="default"){switch(c){case"number":return Fa(this);case"string":return ai(this);case"default":return Ho(this)}return ai(this)};function ni(...c){return vt.apply(this,c)}function si(...c){return vt.apply(this,c)}function Wi(...c){return vt.apply(this,c)}Object.setPrototypeOf(ni.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(si.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(Wi.prototype,Object.create(Uint32Array.prototype));Object.assign(ni.prototype,vt.prototype,{constructor:ni,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(si.prototype,vt.prototype,{constructor:si,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(Wi.prototype,vt.prototype,{constructor:Wi,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});var Tu=BigInt(4294967296)*BigInt(4294967296),Fu=Tu-BigInt(1);function Fa(c,e){let{buffer:t,byteOffset:r,byteLength:n,signed:a}=c,o=new BigUint64Array(t,r,n/8),l=a&&o.at(-1)&BigInt(1)<=0)return Ta(c);e=e.slice();let r=1;for(let a=0;a(c.children=null,c.ArrayType=Array,c.OffsetArrayType=Int32Array,c[Symbol.toStringTag]="DataType"))(R.prototype);var He=class extends R{constructor(){super(y.Null)}toString(){return"Null"}};Wo=Symbol.toStringTag;He[Wo]=(c=>c[Symbol.toStringTag]="Null")(He.prototype);var Pe=class extends R{constructor(e,t){super(y.Int),this.isSigned=e,this.bitWidth=t}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw new Error("Unrecognized ".concat(this[Symbol.toStringTag]," type"))}toString(){return"".concat(this.isSigned?"I":"Ui","nt").concat(this.bitWidth)}};Vo=Symbol.toStringTag;Pe[Vo]=(c=>(c.isSigned=null,c.bitWidth=null,c[Symbol.toStringTag]="Int"))(Pe.prototype);var Nn=class extends Pe{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},Wn=class extends Pe{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},It=class extends Pe{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},Vn=class extends Pe{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},zn=class extends Pe{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},$n=class extends Pe{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},qn=class extends Pe{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},Xn=class extends Pe{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(Nn.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(Wn.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(It.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(Vn.prototype,"ArrayType",{value:BigInt64Array});Object.defineProperty(zn.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty($n.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(qn.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(Xn.prototype,"ArrayType",{value:BigUint64Array});var st=class extends R{constructor(e){super(y.Float),this.precision=e}get ArrayType(){switch(this.precision){case pe.HALF:return Uint16Array;case pe.SINGLE:return Float32Array;case pe.DOUBLE:return Float64Array}throw new Error("Unrecognized ".concat(this[Symbol.toStringTag]," type"))}toString(){return"Float".concat(this.precision<<5||16)}};zo=Symbol.toStringTag;st[zo]=(c=>(c.precision=null,c[Symbol.toStringTag]="Float"))(st.prototype);var Qn=class extends st{constructor(){super(pe.HALF)}},Yn=class extends st{constructor(){super(pe.SINGLE)}},Jn=class extends st{constructor(){super(pe.DOUBLE)}};Object.defineProperty(Qn.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(Yn.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(Jn.prototype,"ArrayType",{value:Float64Array});var Wt=class extends R{constructor(){super(y.Binary)}toString(){return"Binary"}};$o=Symbol.toStringTag;Wt[$o]=(c=>(c.ArrayType=Uint8Array,c[Symbol.toStringTag]="Binary"))(Wt.prototype);var Vt=class extends R{constructor(){super(y.LargeBinary)}toString(){return"LargeBinary"}};qo=Symbol.toStringTag;Vt[qo]=(c=>(c.ArrayType=Uint8Array,c.OffsetArrayType=BigInt64Array,c[Symbol.toStringTag]="LargeBinary"))(Vt.prototype);var zt=class extends R{constructor(){super(y.Utf8)}toString(){return"Utf8"}};Xo=Symbol.toStringTag;zt[Xo]=(c=>(c.ArrayType=Uint8Array,c[Symbol.toStringTag]="Utf8"))(zt.prototype);var $t=class extends R{constructor(){super(y.LargeUtf8)}toString(){return"LargeUtf8"}};Qo=Symbol.toStringTag;$t[Qo]=(c=>(c.ArrayType=Uint8Array,c.OffsetArrayType=BigInt64Array,c[Symbol.toStringTag]="LargeUtf8"))($t.prototype);var qt=class extends R{constructor(){super(y.Bool)}toString(){return"Bool"}};Yo=Symbol.toStringTag;qt[Yo]=(c=>(c.ArrayType=Uint8Array,c[Symbol.toStringTag]="Bool"))(qt.prototype);var Xt=class extends R{constructor(e,t,r=128){super(y.Decimal),this.scale=e,this.precision=t,this.bitWidth=r}toString(){return"Decimal[".concat(this.precision,"e").concat(this.scale>0?"+":"").concat(this.scale,"]")}};Jo=Symbol.toStringTag;Xt[Jo]=(c=>(c.scale=null,c.precision=null,c.ArrayType=Uint32Array,c[Symbol.toStringTag]="Decimal"))(Xt.prototype);var Qt=class extends R{constructor(e){super(y.Date),this.unit=e}toString(){return"Date".concat((this.unit+1)*32,"<").concat(Ae[this.unit],">")}get ArrayType(){return this.unit===Ae.DAY?Int32Array:BigInt64Array}};Ko=Symbol.toStringTag;Qt[Ko]=(c=>(c.unit=null,c[Symbol.toStringTag]="Date"))(Qt.prototype);var Yt=class extends R{constructor(e,t){super(y.Time),this.unit=e,this.bitWidth=t}toString(){return"Time".concat(this.bitWidth,"<").concat(G[this.unit],">")}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error("Unrecognized ".concat(this[Symbol.toStringTag]," type"))}};Zo=Symbol.toStringTag;Yt[Zo]=(c=>(c.unit=null,c.bitWidth=null,c[Symbol.toStringTag]="Time"))(Yt.prototype);var Jt=class extends R{constructor(e,t){super(y.Timestamp),this.unit=e,this.timezone=t}toString(){return"Timestamp<".concat(G[this.unit]).concat(this.timezone?", ".concat(this.timezone):"",">")}};ec=Symbol.toStringTag;Jt[ec]=(c=>(c.unit=null,c.timezone=null,c.ArrayType=BigInt64Array,c[Symbol.toStringTag]="Timestamp"))(Jt.prototype);var Kt=class extends R{constructor(e){super(y.Interval),this.unit=e}toString(){return"Interval<".concat(Ce[this.unit],">")}};tc=Symbol.toStringTag;Kt[tc]=(c=>(c.unit=null,c.ArrayType=Int32Array,c[Symbol.toStringTag]="Interval"))(Kt.prototype);var Zt=class extends R{constructor(e){super(y.Duration),this.unit=e}toString(){return"Duration<".concat(G[this.unit],">")}};rc=Symbol.toStringTag;Zt[rc]=(c=>(c.unit=null,c.ArrayType=BigInt64Array,c[Symbol.toStringTag]="Duration"))(Zt.prototype);var yt=class extends R{constructor(e){super(y.List),this.children=[e]}toString(){return"List<".concat(this.valueType,">")}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};ic=Symbol.toStringTag;yt[ic]=(c=>(c.children=null,c[Symbol.toStringTag]="List"))(yt.prototype);var ve=class extends R{constructor(e){super(y.Struct),this.children=e}toString(){return"Struct<{".concat(this.children.map(e=>"".concat(e.name,":").concat(e.type)).join(", "),"}>")}};nc=Symbol.toStringTag;ve[nc]=(c=>(c.children=null,c[Symbol.toStringTag]="Struct"))(ve.prototype);var bt=class extends R{constructor(e,t,r){super(y.Union),this.mode=e,this.children=r,this.typeIds=t=Int32Array.from(t),this.typeIdToChildIndex=t.reduce((n,a,o)=>(n[a]=o)&&n||n,Object.create(null))}toString(){return"".concat(this[Symbol.toStringTag],"<").concat(this.children.map(e=>"".concat(e.type)).join(" | "),">")}};sc=Symbol.toStringTag;bt[sc]=(c=>(c.mode=null,c.typeIds=null,c.children=null,c.typeIdToChildIndex=null,c.ArrayType=Int8Array,c[Symbol.toStringTag]="Union"))(bt.prototype);var er=class extends R{constructor(e){super(y.FixedSizeBinary),this.byteWidth=e}toString(){return"FixedSizeBinary[".concat(this.byteWidth,"]")}};ac=Symbol.toStringTag;er[ac]=(c=>(c.byteWidth=null,c.ArrayType=Uint8Array,c[Symbol.toStringTag]="FixedSizeBinary"))(er.prototype);var St=class extends R{constructor(e,t){super(y.FixedSizeList),this.listSize=e,this.children=[t]}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return"FixedSizeList[".concat(this.listSize,"]<").concat(this.valueType,">")}};oc=Symbol.toStringTag;St[oc]=(c=>(c.children=null,c.listSize=null,c[Symbol.toStringTag]="FixedSizeList"))(St.prototype);var wt=class extends R{constructor(e,t=!1){var r,n,a;if(super(y.Map),this.children=[e],this.keysSorted=t,e&&(e.name="entries",!((r=e==null?void 0:e.type)===null||r===void 0)&&r.children)){let o=(n=e==null?void 0:e.type)===null||n===void 0?void 0:n.children[0];o&&(o.name="key");let l=(a=e==null?void 0:e.type)===null||a===void 0?void 0:a.children[1];l&&(l.name="value")}}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return"Map<{".concat(this.children[0].type.children.map(e=>"".concat(e.name,":").concat(e.type)).join(", "),"}>")}};cc=Symbol.toStringTag;wt[cc]=(c=>(c.children=null,c.keysSorted=null,c[Symbol.toStringTag]="Map_"))(wt.prototype);var xu=(c=>()=>++c)(-1),Ze=class extends R{constructor(e,t,r,n){super(y.Dictionary),this.indices=t,this.dictionary=e,this.isOrdered=n||!1,this.id=r==null?xu():ae(r)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return"Dictionary<".concat(this.indices,", ").concat(this.dictionary,">")}};lc=Symbol.toStringTag;Ze[lc]=(c=>(c.id=null,c.indices=null,c.isOrdered=null,c.dictionary=null,c[Symbol.toStringTag]="Dictionary"))(Ze.prototype);function et(c){let e=c;switch(c.typeId){case y.Decimal:return c.bitWidth/32;case y.Interval:return 1+e.unit;case y.FixedSizeList:return e.listSize;case y.FixedSizeBinary:return e.byteWidth;default:return 1}}var j=class{visitMany(e,...t){return e.map((r,n)=>this.visit(r,...t.map(a=>a[n])))}visit(...e){return this.getVisitFn(e[0],!1).apply(this,e)}getVisitFn(e,t=!0){return Cu(this,e,t)}getVisitFnByTypeId(e,t=!0){return oi(this,e,t)}visitNull(e,...t){return null}visitBool(e,...t){return null}visitInt(e,...t){return null}visitFloat(e,...t){return null}visitUtf8(e,...t){return null}visitLargeUtf8(e,...t){return null}visitBinary(e,...t){return null}visitLargeBinary(e,...t){return null}visitFixedSizeBinary(e,...t){return null}visitDate(e,...t){return null}visitTimestamp(e,...t){return null}visitTime(e,...t){return null}visitDecimal(e,...t){return null}visitList(e,...t){return null}visitStruct(e,...t){return null}visitUnion(e,...t){return null}visitDictionary(e,...t){return null}visitInterval(e,...t){return null}visitDuration(e,...t){return null}visitFixedSizeList(e,...t){return null}visitMap(e,...t){return null}};function Cu(c,e,t=!0){return typeof e=="number"?oi(c,e,t):typeof e=="string"&&e in y?oi(c,y[e],t):e&&e instanceof R?oi(c,uc(e),t):e!=null&&e.type&&e.type instanceof R?oi(c,uc(e.type),t):oi(c,y.NONE,t)}function oi(c,e,t=!0){let r=null;switch(e){case y.Null:r=c.visitNull;break;case y.Bool:r=c.visitBool;break;case y.Int:r=c.visitInt;break;case y.Int8:r=c.visitInt8||c.visitInt;break;case y.Int16:r=c.visitInt16||c.visitInt;break;case y.Int32:r=c.visitInt32||c.visitInt;break;case y.Int64:r=c.visitInt64||c.visitInt;break;case y.Uint8:r=c.visitUint8||c.visitInt;break;case y.Uint16:r=c.visitUint16||c.visitInt;break;case y.Uint32:r=c.visitUint32||c.visitInt;break;case y.Uint64:r=c.visitUint64||c.visitInt;break;case y.Float:r=c.visitFloat;break;case y.Float16:r=c.visitFloat16||c.visitFloat;break;case y.Float32:r=c.visitFloat32||c.visitFloat;break;case y.Float64:r=c.visitFloat64||c.visitFloat;break;case y.Utf8:r=c.visitUtf8;break;case y.LargeUtf8:r=c.visitLargeUtf8;break;case y.Binary:r=c.visitBinary;break;case y.LargeBinary:r=c.visitLargeBinary;break;case y.FixedSizeBinary:r=c.visitFixedSizeBinary;break;case y.Date:r=c.visitDate;break;case y.DateDay:r=c.visitDateDay||c.visitDate;break;case y.DateMillisecond:r=c.visitDateMillisecond||c.visitDate;break;case y.Timestamp:r=c.visitTimestamp;break;case y.TimestampSecond:r=c.visitTimestampSecond||c.visitTimestamp;break;case y.TimestampMillisecond:r=c.visitTimestampMillisecond||c.visitTimestamp;break;case y.TimestampMicrosecond:r=c.visitTimestampMicrosecond||c.visitTimestamp;break;case y.TimestampNanosecond:r=c.visitTimestampNanosecond||c.visitTimestamp;break;case y.Time:r=c.visitTime;break;case y.TimeSecond:r=c.visitTimeSecond||c.visitTime;break;case y.TimeMillisecond:r=c.visitTimeMillisecond||c.visitTime;break;case y.TimeMicrosecond:r=c.visitTimeMicrosecond||c.visitTime;break;case y.TimeNanosecond:r=c.visitTimeNanosecond||c.visitTime;break;case y.Decimal:r=c.visitDecimal;break;case y.List:r=c.visitList;break;case y.Struct:r=c.visitStruct;break;case y.Union:r=c.visitUnion;break;case y.DenseUnion:r=c.visitDenseUnion||c.visitUnion;break;case y.SparseUnion:r=c.visitSparseUnion||c.visitUnion;break;case y.Dictionary:r=c.visitDictionary;break;case y.Interval:r=c.visitInterval;break;case y.IntervalDayTime:r=c.visitIntervalDayTime||c.visitInterval;break;case y.IntervalYearMonth:r=c.visitIntervalYearMonth||c.visitInterval;break;case y.Duration:r=c.visitDuration;break;case y.DurationSecond:r=c.visitDurationSecond||c.visitDuration;break;case y.DurationMillisecond:r=c.visitDurationMillisecond||c.visitDuration;break;case y.DurationMicrosecond:r=c.visitDurationMicrosecond||c.visitDuration;break;case y.DurationNanosecond:r=c.visitDurationNanosecond||c.visitDuration;break;case y.FixedSizeList:r=c.visitFixedSizeList;break;case y.Map:r=c.visitMap;break}if(typeof r=="function")return r;if(!t)return()=>null;throw new Error("Unrecognized type '".concat(y[e],"'"))}function uc(c){switch(c.typeId){case y.Null:return y.Null;case y.Int:{let{bitWidth:e,isSigned:t}=c;switch(e){case 8:return t?y.Int8:y.Uint8;case 16:return t?y.Int16:y.Uint16;case 32:return t?y.Int32:y.Uint32;case 64:return t?y.Int64:y.Uint64}return y.Int}case y.Float:switch(c.precision){case pe.HALF:return y.Float16;case pe.SINGLE:return y.Float32;case pe.DOUBLE:return y.Float64}return y.Float;case y.Binary:return y.Binary;case y.LargeBinary:return y.LargeBinary;case y.Utf8:return y.Utf8;case y.LargeUtf8:return y.LargeUtf8;case y.Bool:return y.Bool;case y.Decimal:return y.Decimal;case y.Time:switch(c.unit){case G.SECOND:return y.TimeSecond;case G.MILLISECOND:return y.TimeMillisecond;case G.MICROSECOND:return y.TimeMicrosecond;case G.NANOSECOND:return y.TimeNanosecond}return y.Time;case y.Timestamp:switch(c.unit){case G.SECOND:return y.TimestampSecond;case G.MILLISECOND:return y.TimestampMillisecond;case G.MICROSECOND:return y.TimestampMicrosecond;case G.NANOSECOND:return y.TimestampNanosecond}return y.Timestamp;case y.Date:switch(c.unit){case Ae.DAY:return y.DateDay;case Ae.MILLISECOND:return y.DateMillisecond}return y.Date;case y.Interval:switch(c.unit){case Ce.DAY_TIME:return y.IntervalDayTime;case Ce.YEAR_MONTH:return y.IntervalYearMonth}return y.Interval;case y.Duration:switch(c.unit){case G.SECOND:return y.DurationSecond;case G.MILLISECOND:return y.DurationMillisecond;case G.MICROSECOND:return y.DurationMicrosecond;case G.NANOSECOND:return y.DurationNanosecond}return y.Duration;case y.Map:return y.Map;case y.List:return y.List;case y.Struct:return y.Struct;case y.Union:switch(c.mode){case he.Dense:return y.DenseUnion;case he.Sparse:return y.SparseUnion}return y.Union;case y.FixedSizeBinary:return y.FixedSizeBinary;case y.FixedSizeList:return y.FixedSizeList;case y.Dictionary:return y.Dictionary}throw new Error("Unrecognized type '".concat(y[c.typeId],"'"))}j.prototype.visitInt8=null;j.prototype.visitInt16=null;j.prototype.visitInt32=null;j.prototype.visitInt64=null;j.prototype.visitUint8=null;j.prototype.visitUint16=null;j.prototype.visitUint32=null;j.prototype.visitUint64=null;j.prototype.visitFloat16=null;j.prototype.visitFloat32=null;j.prototype.visitFloat64=null;j.prototype.visitDateDay=null;j.prototype.visitDateMillisecond=null;j.prototype.visitTimestampSecond=null;j.prototype.visitTimestampMillisecond=null;j.prototype.visitTimestampMicrosecond=null;j.prototype.visitTimestampNanosecond=null;j.prototype.visitTimeSecond=null;j.prototype.visitTimeMillisecond=null;j.prototype.visitTimeMicrosecond=null;j.prototype.visitTimeNanosecond=null;j.prototype.visitDenseUnion=null;j.prototype.visitSparseUnion=null;j.prototype.visitIntervalDayTime=null;j.prototype.visitIntervalYearMonth=null;j.prototype.visitDuration=null;j.prototype.visitDurationSecond=null;j.prototype.visitDurationMillisecond=null;j.prototype.visitDurationMicrosecond=null;j.prototype.visitDurationNanosecond=null;var Ca={};pr(Ca,{float64ToUint16:()=>zi,uint16ToFloat64:()=>Kn});var _c=new Float64Array(1),ci=new Uint32Array(_c.buffer);function Kn(c){let e=(c&31744)>>10,t=(c&1023)/1024,r=Math.pow(-1,(c&32768)>>15);switch(e){case 31:return r*(t?Number.NaN:1/0);case 0:return r*(t?6103515625e-14*t:0)}return r*Math.pow(2,e-15)*(1+t)}function zi(c){if(c!==c)return 32256;_c[0]=c;let e=(ci[1]&2147483648)>>16&65535,t=ci[1]&2146435072,r=0;return t>=1089470464?ci[0]>0?t=31744:(t=(t&2080374784)>>16,r=(ci[1]&1048575)>>10):t<=1056964608?(r=1048576+(ci[1]&1048575),r=1048576+(r<<(t>>20)-998)>>21,t=0):(t=t-1056964608>>10,r=(ci[1]&1048575)+512>>10),e|t|r&65535}var V=class extends j{};function Y(c){return(e,t,r)=>{if(e.setValid(t,r!=null))return c(e,t,r)}}var Mu=(c,e,t)=>{c[e]=Math.floor(t/864e5)},dc=(c,e,t,r)=>{if(t+1{let n=c+t;r?e[n>>3]|=1<>3]&=~(1<{c[e]=t},Ma=({values:c},e,t)=>{c[e]=t},fc=({values:c},e,t)=>{c[e]=zi(t)},Iu=(c,e,t)=>{switch(c.type.precision){case pe.HALF:return fc(c,e,t);case pe.SINGLE:case pe.DOUBLE:return Ma(c,e,t)}},Zn=({values:c},e,t)=>{Mu(c,e,t.valueOf())},es=({values:c},e,t)=>{c[e]=BigInt(t)},Pa=({stride:c,values:e},t,r)=>{e.set(r.subarray(0,c),c*t)},pc=({values:c,valueOffsets:e},t,r)=>dc(c,e,t,r),mc=({values:c,valueOffsets:e},t,r)=>dc(c,e,t,Ft(r)),Ia=(c,e,t)=>{c.type.unit===Ae.DAY?Zn(c,e,t):es(c,e,t)},ts=({values:c},e,t)=>{c[e]=BigInt(t/1e3)},rs=({values:c},e,t)=>{c[e]=BigInt(t)},is=({values:c},e,t)=>{c[e]=BigInt(t*1e3)},ns=({values:c},e,t)=>{c[e]=BigInt(t*1e6)},Ba=(c,e,t)=>{switch(c.type.unit){case G.SECOND:return ts(c,e,t);case G.MILLISECOND:return rs(c,e,t);case G.MICROSECOND:return is(c,e,t);case G.NANOSECOND:return ns(c,e,t)}},ss=({values:c},e,t)=>{c[e]=t},as=({values:c},e,t)=>{c[e]=t},os=({values:c},e,t)=>{c[e]=t},cs=({values:c},e,t)=>{c[e]=t},Ra=(c,e,t)=>{switch(c.type.unit){case G.SECOND:return ss(c,e,t);case G.MILLISECOND:return as(c,e,t);case G.MICROSECOND:return os(c,e,t);case G.NANOSECOND:return cs(c,e,t)}},Ga=({values:c,stride:e},t,r)=>{c.set(r.subarray(0,e),e*t)},Bu=(c,e,t)=>{let r=c.children[0],n=c.valueOffsets,a=Re.getVisitFn(r);if(Array.isArray(t))for(let o=-1,l=n[e],u=n[e+1];l{let r=c.children[0],{valueOffsets:n}=c,a=Re.getVisitFn(r),{[e]:o,[e+1]:l}=n,u=t instanceof Map?t.entries():Object.entries(t);for(let _ of u)if(a(r,o,_),++o>=l)break},Gu=(c,e)=>(t,r,n,a)=>r&&t(r,c,e[a]),Uu=(c,e)=>(t,r,n,a)=>r&&t(r,c,e.get(a)),ju=(c,e)=>(t,r,n,a)=>r&&t(r,c,e.get(n.name)),Ou=(c,e)=>(t,r,n,a)=>r&&t(r,c,e[n.name]),Hu=(c,e,t)=>{let r=c.type.children.map(a=>Re.getVisitFn(a.type)),n=t instanceof Map?ju(e,t):t instanceof se?Uu(e,t):Array.isArray(t)?Gu(e,t):Ou(e,t);c.type.children.forEach((a,o)=>n(r[o],c.children[o],a,o))},Nu=(c,e,t)=>{c.type.mode===he.Dense?hc(c,e,t):gc(c,e,t)},hc=(c,e,t)=>{let r=c.type.typeIdToChildIndex[c.typeIds[e]],n=c.children[r];Re.visit(n,c.valueOffsets[e],t)},gc=(c,e,t)=>{let r=c.type.typeIdToChildIndex[c.typeIds[e]],n=c.children[r];Re.visit(n,e,t)},Wu=(c,e,t)=>{var r;(r=c.dictionary)===null||r===void 0||r.set(c.values[e],t)},Ua=(c,e,t)=>{c.type.unit===Ce.DAY_TIME?ls(c,e,t):us(c,e,t)},ls=({values:c},e,t)=>{c.set(t.subarray(0,2),2*e)},us=({values:c},e,t)=>{c[e]=t[0]*12+t[1]%12},_s=({values:c},e,t)=>{c[e]=t},ds=({values:c},e,t)=>{c[e]=t},ps=({values:c},e,t)=>{c[e]=t},ms=({values:c},e,t)=>{c[e]=t},ja=(c,e,t)=>{switch(c.type.unit){case G.SECOND:return _s(c,e,t);case G.MILLISECOND:return ds(c,e,t);case G.MICROSECOND:return ps(c,e,t);case G.NANOSECOND:return ms(c,e,t)}},Vu=(c,e,t)=>{let{stride:r}=c,n=c.children[0],a=Re.getVisitFn(n);if(Array.isArray(t))for(let o=-1,l=e*r;++o"".concat(gt(e),": ").concat(gt(t))).join(", "),"}")}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new Oa(this[Et],this[li])}},Oa=class{constructor(e,t){this.childIndex=0,this.children=e.children,this.rowIndex=t,this.childFields=e.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){let e=this.childIndex;return et.name)}has(e,t){return e[Et].type.children.findIndex(r=>r.name===t)!==-1}getOwnPropertyDescriptor(e,t){if(e[Et].type.children.findIndex(r=>r.name===t)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let r=e[Et].type.children.findIndex(n=>n.name===t);if(r!==-1){let n=Te.visit(e[Et].children[r],e[li]);return Reflect.set(e,t,n),n}}set(e,t,r){let n=e[Et].type.children.findIndex(a=>a.name===t);return n!==-1?(Re.visit(e[Et].children[n],e[li],r),Reflect.set(e,t,r)):Reflect.has(e,t)||typeof t=="symbol"?Reflect.set(e,t,r):!1}};var O=class extends j{};function $(c){return(e,t)=>e.getValid(t)?c(e,t):null}var zu=(c,e)=>864e5*c[e],$u=(c,e)=>null,vc=(c,e,t)=>{if(t+1>=e.length)return null;let r=ae(e[t]),n=ae(e[t+1]);return c.subarray(r,n)},qu=({offset:c,values:e},t)=>{let r=c+t;return(e[r>>3]&1<zu(c,e),bc=({values:c},e)=>ae(c[e]),Lr=({stride:c,values:e},t)=>e[c*t],Xu=({stride:c,values:e},t)=>Kn(e[c*t]),Sc=({values:c},e)=>c[e],Qu=({stride:c,values:e},t)=>e.subarray(c*t,c*(t+1)),wc=({values:c,valueOffsets:e},t)=>vc(c,e,t),Ec=({values:c,valueOffsets:e},t)=>{let r=vc(c,e,t);return r!==null?Ti(r):null},Yu=({values:c},e)=>c[e],Ju=({type:c,values:e},t)=>c.precision!==pe.HALF?e[t]:Kn(e[t]),Ku=(c,e)=>c.type.unit===Ae.DAY?yc(c,e):bc(c,e),Lc=({values:c},e)=>1e3*ae(c[e]),Ac=({values:c},e)=>ae(c[e]),Dc=({values:c},e)=>ka(c[e],BigInt(1e3)),kc=({values:c},e)=>ka(c[e],BigInt(1e6)),Zu=(c,e)=>{switch(c.type.unit){case G.SECOND:return Lc(c,e);case G.MILLISECOND:return Ac(c,e);case G.MICROSECOND:return Dc(c,e);case G.NANOSECOND:return kc(c,e)}},Tc=({values:c},e)=>c[e],Fc=({values:c},e)=>c[e],xc=({values:c},e)=>c[e],Cc=({values:c},e)=>c[e],e_=(c,e)=>{switch(c.type.unit){case G.SECOND:return Tc(c,e);case G.MILLISECOND:return Fc(c,e);case G.MICROSECOND:return xc(c,e);case G.NANOSECOND:return Cc(c,e)}},t_=({values:c,stride:e},t)=>Vi.decimal(c.subarray(e*t,e*(t+1))),r_=(c,e)=>{let{valueOffsets:t,stride:r,children:n}=c,{[e*r]:a,[e*r+1]:o}=t,u=n[0].slice(a,o-a);return new se([u])},i_=(c,e)=>{let{valueOffsets:t,children:r}=c,{[e]:n,[e+1]:a}=t,o=r[0];return new Bt(o.slice(n,a-n))},n_=(c,e)=>new Er(c,e),s_=(c,e)=>c.type.mode===he.Dense?Mc(c,e):Pc(c,e),Mc=(c,e)=>{let t=c.type.typeIdToChildIndex[c.typeIds[e]],r=c.children[t];return Te.visit(r,c.valueOffsets[e])},Pc=(c,e)=>{let t=c.type.typeIdToChildIndex[c.typeIds[e]],r=c.children[t];return Te.visit(r,e)},a_=(c,e)=>{var t;return(t=c.dictionary)===null||t===void 0?void 0:t.get(c.values[e])},o_=(c,e)=>c.type.unit===Ce.DAY_TIME?Ic(c,e):Bc(c,e),Ic=({values:c},e)=>c.subarray(2*e,2*(e+1)),Bc=({values:c},e)=>{let t=c[e],r=new Int32Array(2);return r[0]=Math.trunc(t/12),r[1]=Math.trunc(t%12),r},Rc=({values:c},e)=>c[e],Gc=({values:c},e)=>c[e],Uc=({values:c},e)=>c[e],jc=({values:c},e)=>c[e],c_=(c,e)=>{switch(c.type.unit){case G.SECOND:return Rc(c,e);case G.MILLISECOND:return Gc(c,e);case G.MICROSECOND:return Uc(c,e);case G.NANOSECOND:return jc(c,e)}},l_=(c,e)=>{let{stride:t,children:r}=c,a=r[0].slice(e*t,t);return new se([a])};O.prototype.visitNull=$($u);O.prototype.visitBool=$(qu);O.prototype.visitInt=$(Yu);O.prototype.visitInt8=$(Lr);O.prototype.visitInt16=$(Lr);O.prototype.visitInt32=$(Lr);O.prototype.visitInt64=$(Sc);O.prototype.visitUint8=$(Lr);O.prototype.visitUint16=$(Lr);O.prototype.visitUint32=$(Lr);O.prototype.visitUint64=$(Sc);O.prototype.visitFloat=$(Ju);O.prototype.visitFloat16=$(Xu);O.prototype.visitFloat32=$(Lr);O.prototype.visitFloat64=$(Lr);O.prototype.visitUtf8=$(Ec);O.prototype.visitLargeUtf8=$(Ec);O.prototype.visitBinary=$(wc);O.prototype.visitLargeBinary=$(wc);O.prototype.visitFixedSizeBinary=$(Qu);O.prototype.visitDate=$(Ku);O.prototype.visitDateDay=$(yc);O.prototype.visitDateMillisecond=$(bc);O.prototype.visitTimestamp=$(Zu);O.prototype.visitTimestampSecond=$(Lc);O.prototype.visitTimestampMillisecond=$(Ac);O.prototype.visitTimestampMicrosecond=$(Dc);O.prototype.visitTimestampNanosecond=$(kc);O.prototype.visitTime=$(e_);O.prototype.visitTimeSecond=$(Tc);O.prototype.visitTimeMillisecond=$(Fc);O.prototype.visitTimeMicrosecond=$(xc);O.prototype.visitTimeNanosecond=$(Cc);O.prototype.visitDecimal=$(t_);O.prototype.visitList=$(r_);O.prototype.visitStruct=$(n_);O.prototype.visitUnion=$(s_);O.prototype.visitDenseUnion=$(Mc);O.prototype.visitSparseUnion=$(Pc);O.prototype.visitDictionary=$(a_);O.prototype.visitInterval=$(o_);O.prototype.visitIntervalDayTime=$(Ic);O.prototype.visitIntervalYearMonth=$(Bc);O.prototype.visitDuration=$(c_);O.prototype.visitDurationSecond=$(Rc);O.prototype.visitDurationMillisecond=$(Gc);O.prototype.visitDurationMicrosecond=$(Uc);O.prototype.visitDurationNanosecond=$(jc);O.prototype.visitFixedSizeList=$(l_);O.prototype.visitMap=$(i_);var Te=new O;var Ar=Symbol.for("keys"),_i=Symbol.for("vals"),ui=Symbol.for("kKeysAsStrings"),Na=Symbol.for("_kKeysAsStrings"),Bt=class{constructor(e){return this[Ar]=new se([e.children[0]]).memoize(),this[_i]=e.children[1],new Proxy(this,new Va)}get[ui](){return this[Na]||(this[Na]=Array.from(this[Ar].toArray(),String))}[Symbol.iterator](){return new Wa(this[Ar],this[_i])}get size(){return this[Ar].length}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[Ar],t=this[_i],r={};for(let n=-1,a=e.length;++n"".concat(gt(e),": ").concat(gt(t))).join(", "),"}")}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},Wa=class{constructor(e,t){this.keys=e,this.vals=t,this.keyIndex=0,this.numKeys=e.length}[Symbol.iterator](){return this}next(){let e=this.keyIndex;return e===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(e),Te.visit(this.vals,e)]})}},Va=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[ui]}has(e,t){return e[ui].includes(t)}getOwnPropertyDescriptor(e,t){if(e[ui].indexOf(t)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let r=e[ui].indexOf(t);if(r!==-1){let n=Te.visit(Reflect.get(e,_i),r);return Reflect.set(e,t,n),n}}set(e,t,r){let n=e[ui].indexOf(t);return n!==-1?(Re.visit(Reflect.get(e,_i),n,r),Reflect.set(e,t,r)):Reflect.has(e,t)?Reflect.set(e,t,r):!1}};Object.defineProperties(Bt.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Ar]:{writable:!0,enumerable:!1,configurable:!1,value:null},[_i]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Na]:{writable:!0,enumerable:!1,configurable:!1,value:null}});var Oc;function $i(c,e,t,r){let{length:n=0}=c,a=typeof e!="number"?0:e,o=typeof t!="number"?n:t;return a<0&&(a=(a%n+n)%n),o<0&&(o=(o%n+n)%n),on&&(o=n),r?r(c,a,o):[a,o]}var Br=(c,e)=>c<0?e+c:c,Hc=c=>c!==c;function Dr(c){if(typeof c!=="object"||c===null)return Hc(c)?Hc:t=>t===c;if(c instanceof Date){let t=c.valueOf();return r=>r instanceof Date?r.valueOf()===t:!1}return ArrayBuffer.isView(c)?t=>t?wa(c,t):!1:c instanceof Map?__(c):Array.isArray(c)?u_(c):c instanceof se?d_(c):f_(c,!0)}function u_(c){let e=[];for(let t=-1,r=c.length;++t!1;let r=[];for(let n=-1,a=t.length;++n{if(!t||typeof t!="object")return!1;switch(t.constructor){case Array:return p_(c,t);case Map:return Nc(c,t,t.keys());case Bt:case Er:case Object:case void 0:return Nc(c,t,e||Object.keys(t))}return t instanceof se?m_(c,t):!1}}function p_(c,e){let t=c.length;if(e.length!==t)return!1;for(let r=-1;++rRr,getBit:()=>Wc,getBool:()=>vs,packBools:()=>Ur,popcnt_array:()=>Vc,popcnt_bit_range:()=>qi,popcnt_uint32:()=>gs,setBool:()=>h_,truncateBitmap:()=>Gr});function vs(c,e,t,r){return(t&1<>r}function h_(c,e,t){return t?!!(c[e>>3]|=1<>3]&=~(1<0||t.byteLength>3):Ur(new Rr(t,c,e,null,vs)).subarray(0,r)),n}return t}function Ur(c){let e=[],t=0,r=0,n=0;for(let o of c)o&&(n|=1<0)&&(e[t++]=n);let a=new Uint8Array(e.length+7&-8);return a.set(e),a}var Rr=class{constructor(e,t,r,n,a){this.bytes=e,this.length=r,this.context=n,this.get=a,this.bit=t%8,this.byteIndex=t>>3,this.byte=e[this.byteIndex++],this.index=0}next(){return this.index>3<<3,n=e+(e%8===0?0:8-e%8);return qi(c,e,n)+qi(c,r,t)+Vc(c,n>>3,r-n>>3)}function Vc(c,e,t){let r=0,n=Math.trunc(e),a=new DataView(c.buffer,c.byteOffset,c.byteLength),o=t===void 0?c.byteLength:n+t;for(;o-n>=4;)r+=gs(a.getUint32(n)),n+=4;for(;o-n>=2;)r+=gs(a.getUint16(n)),n+=2;for(;o-n>=1;)r+=gs(a.getUint8(n)),n+=1;return r}function gs(c){let e=Math.trunc(c);return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),(e+(e>>>4)&252645135)*16843009>>>24}var g_=-1,le=class c{get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){let{type:e}=this;return R.isSparseUnion(e)?this.children.some(t=>t.nullable):R.isDenseUnion(e)?this.children.some(t=>t.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let e=0,{valueOffsets:t,values:r,nullBitmap:n,typeIds:a}=this;return t&&(e+=t.byteLength),r&&(e+=r.byteLength),n&&(e+=n.byteLength),a&&(e+=a.byteLength),this.children.reduce((o,l)=>o+l.byteLength,e)}get nullCount(){if(R.isUnion(this.type))return this.children.reduce((r,n)=>r+n.nullCount,0);let e=this._nullCount,t;return e<=g_&&(t=this.nullBitmap)&&(this._nullCount=e=t.length===0?0:this.length-qi(t,this.offset,this.offset+this.length)),e}constructor(e,t,r,n,a,o=[],l){this.type=e,this.children=o,this.dictionary=l,this.offset=Math.floor(Math.max(t||0,0)),this.length=Math.floor(Math.max(r||0,0)),this._nullCount=Math.floor(Math.max(n||0,-1));let u;a instanceof c?(this.stride=a.stride,this.values=a.values,this.typeIds=a.typeIds,this.nullBitmap=a.nullBitmap,this.valueOffsets=a.valueOffsets):(this.stride=et(e),a&&((u=a[0])&&(this.valueOffsets=u),(u=a[1])&&(this.values=u),(u=a[2])&&(this.nullBitmap=u),(u=a[3])&&(this.typeIds=u)))}getValid(e){let{type:t}=this;if(R.isUnion(t)){let r=t,n=this.children[r.typeIdToChildIndex[this.typeIds[e]]],a=r.mode===he.Dense?this.valueOffsets[e]:e;return n.getValid(a)}if(this.nullable&&this.nullCount>0){let r=this.offset+e;return(this.nullBitmap[r>>3]&1<>3;(!a||a.byteLength<=d)&&(a=new Uint8Array((o+l+63&-64)>>3).fill(255),this.nullCount>0?(a.set(Gr(o,l,this.nullBitmap),0),Object.assign(this,{nullBitmap:a})):Object.assign(this,{nullBitmap:a,_nullCount:0}));let f=a[d];r=(f&_)!==0,a[d]=t?f|_:f&~_}return r!==!!t&&(this._nullCount=this.nullCount+(t?-1:1)),t}clone(e=this.type,t=this.offset,r=this.length,n=this._nullCount,a=this,o=this.children){return new c(e,t,r,n,a,o,this.dictionary)}slice(e,t){let{stride:r,typeId:n,children:a}=this,o=+(this._nullCount===0)-1,l=n===16?r:1,u=this._sliceBuffers(e,t,r,n);return this.clone(this.type,this.offset+e,t,o,u,a.length===0||this.valueOffsets?a:this._sliceChildren(a,l*e,l*t))}_changeLengthAndBackfillNullBitmap(e){if(this.typeId===y.Null)return this.clone(this.type,0,e,0);let{length:t,nullCount:r}=this,n=new Uint8Array((e+63&-64)>>3).fill(255,0,t>>3);n[t>>3]=(1<0&&n.set(Gr(this.offset,t,this.nullBitmap),0);let a=this.buffers;return a[nt.VALIDITY]=n,this.clone(this.type,0,e,r+(e-t),a)}_sliceBuffers(e,t,r,n){let a,{buffers:o}=this;return(a=o[nt.TYPE])&&(o[nt.TYPE]=a.subarray(e,e+t)),(a=o[nt.OFFSET])&&(o[nt.OFFSET]=a.subarray(e,e+t+1))||(a=o[nt.DATA])&&(o[nt.DATA]=n===6?a:a.subarray(r*e,r*(e+t))),o}_sliceChildren(e,t,r){return e.map(n=>n.slice(t,r))}};le.prototype.children=Object.freeze([]);var qa=class c extends j{visit(e){return this.getVisitFn(e.type).call(this,e)}visitNull(e){let{["type"]:t,["offset"]:r=0,["length"]:n=0}=e;return new le(t,r,n,n)}visitBool(e){let{["type"]:t,["offset"]:r=0}=e,n=z(e.nullBitmap),a=re(t.ArrayType,e.data),{["length"]:o=a.length>>3,["nullCount"]:l=e.nullBitmap?-1:0}=e;return new le(t,r,o,l,[void 0,a,n])}visitInt(e){let{["type"]:t,["offset"]:r=0}=e,n=z(e.nullBitmap),a=re(t.ArrayType,e.data),{["length"]:o=a.length,["nullCount"]:l=e.nullBitmap?-1:0}=e;return new le(t,r,o,l,[void 0,a,n])}visitFloat(e){let{["type"]:t,["offset"]:r=0}=e,n=z(e.nullBitmap),a=re(t.ArrayType,e.data),{["length"]:o=a.length,["nullCount"]:l=e.nullBitmap?-1:0}=e;return new le(t,r,o,l,[void 0,a,n])}visitUtf8(e){let{["type"]:t,["offset"]:r=0}=e,n=z(e.data),a=z(e.nullBitmap),o=Pr(e.valueOffsets),{["length"]:l=o.length-1,["nullCount"]:u=e.nullBitmap?-1:0}=e;return new le(t,r,l,u,[o,n,a])}visitLargeUtf8(e){let{["type"]:t,["offset"]:r=0}=e,n=z(e.data),a=z(e.nullBitmap),o=Bn(e.valueOffsets),{["length"]:l=o.length-1,["nullCount"]:u=e.nullBitmap?-1:0}=e;return new le(t,r,l,u,[o,n,a])}visitBinary(e){let{["type"]:t,["offset"]:r=0}=e,n=z(e.data),a=z(e.nullBitmap),o=Pr(e.valueOffsets),{["length"]:l=o.length-1,["nullCount"]:u=e.nullBitmap?-1:0}=e;return new le(t,r,l,u,[o,n,a])}visitLargeBinary(e){let{["type"]:t,["offset"]:r=0}=e,n=z(e.data),a=z(e.nullBitmap),o=Bn(e.valueOffsets),{["length"]:l=o.length-1,["nullCount"]:u=e.nullBitmap?-1:0}=e;return new le(t,r,l,u,[o,n,a])}visitFixedSizeBinary(e){let{["type"]:t,["offset"]:r=0}=e,n=z(e.nullBitmap),a=re(t.ArrayType,e.data),{["length"]:o=a.length/et(t),["nullCount"]:l=e.nullBitmap?-1:0}=e;return new le(t,r,o,l,[void 0,a,n])}visitDate(e){let{["type"]:t,["offset"]:r=0}=e,n=z(e.nullBitmap),a=re(t.ArrayType,e.data),{["length"]:o=a.length/et(t),["nullCount"]:l=e.nullBitmap?-1:0}=e;return new le(t,r,o,l,[void 0,a,n])}visitTimestamp(e){let{["type"]:t,["offset"]:r=0}=e,n=z(e.nullBitmap),a=re(t.ArrayType,e.data),{["length"]:o=a.length/et(t),["nullCount"]:l=e.nullBitmap?-1:0}=e;return new le(t,r,o,l,[void 0,a,n])}visitTime(e){let{["type"]:t,["offset"]:r=0}=e,n=z(e.nullBitmap),a=re(t.ArrayType,e.data),{["length"]:o=a.length/et(t),["nullCount"]:l=e.nullBitmap?-1:0}=e;return new le(t,r,o,l,[void 0,a,n])}visitDecimal(e){let{["type"]:t,["offset"]:r=0}=e,n=z(e.nullBitmap),a=re(t.ArrayType,e.data),{["length"]:o=a.length/et(t),["nullCount"]:l=e.nullBitmap?-1:0}=e;return new le(t,r,o,l,[void 0,a,n])}visitList(e){let{["type"]:t,["offset"]:r=0,["child"]:n}=e,a=z(e.nullBitmap),o=Pr(e.valueOffsets),{["length"]:l=o.length-1,["nullCount"]:u=e.nullBitmap?-1:0}=e;return new le(t,r,l,u,[o,void 0,a],[n])}visitStruct(e){let{["type"]:t,["offset"]:r=0,["children"]:n=[]}=e,a=z(e.nullBitmap),{length:o=n.reduce((u,{length:_})=>Math.max(u,_),0),nullCount:l=e.nullBitmap?-1:0}=e;return new le(t,r,o,l,[void 0,void 0,a],n)}visitUnion(e){let{["type"]:t,["offset"]:r=0,["children"]:n=[]}=e,a=re(t.ArrayType,e.typeIds),{["length"]:o=a.length,["nullCount"]:l=-1}=e;if(R.isSparseUnion(t))return new le(t,r,o,l,[void 0,void 0,void 0,a],n);let u=Pr(e.valueOffsets);return new le(t,r,o,l,[u,void 0,void 0,a],n)}visitDictionary(e){let{["type"]:t,["offset"]:r=0}=e,n=z(e.nullBitmap),a=re(t.indices.ArrayType,e.data),{["dictionary"]:o=new se([new c().visit({type:t.dictionary})])}=e,{["length"]:l=a.length,["nullCount"]:u=e.nullBitmap?-1:0}=e;return new le(t,r,l,u,[void 0,a,n],[],o)}visitInterval(e){let{["type"]:t,["offset"]:r=0}=e,n=z(e.nullBitmap),a=re(t.ArrayType,e.data),{["length"]:o=a.length/et(t),["nullCount"]:l=e.nullBitmap?-1:0}=e;return new le(t,r,o,l,[void 0,a,n])}visitDuration(e){let{["type"]:t,["offset"]:r=0}=e,n=z(e.nullBitmap),a=re(t.ArrayType,e.data),{["length"]:o=a.length,["nullCount"]:l=e.nullBitmap?-1:0}=e;return new le(t,r,o,l,[void 0,a,n])}visitFixedSizeList(e){let{["type"]:t,["offset"]:r=0,["child"]:n=new c().visit({type:t.valueType})}=e,a=z(e.nullBitmap),{["length"]:o=n.length/et(t),["nullCount"]:l=e.nullBitmap?-1:0}=e;return new le(t,r,o,l,[void 0,void 0,a],[n])}visitMap(e){let{["type"]:t,["offset"]:r=0,["child"]:n=new c().visit({type:t.childType})}=e,a=z(e.nullBitmap),o=Pr(e.valueOffsets),{["length"]:l=o.length-1,["nullCount"]:u=e.nullBitmap?-1:0}=e;return new le(t,r,l,u,[o,void 0,a],[n])}},v_=new qa;function J(c){return v_.visit(c)}var Xi=class{constructor(e=0,t){this.numChunks=e,this.getChunkIterator=t,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndexe.nullable)}function ys(c){return c.reduce((e,t)=>e+t.nullCount,0)}function bs(c){return c.reduce((e,t,r)=>(e[r+1]=e[r]+t.length,e),new Uint32Array(c.length+1))}function Ss(c,e,t,r){let n=[];for(let a=-1,o=c.length;++a=r)break;if(t>=u+_)continue;if(u>=t&&u+_<=r){n.push(l);continue}let d=Math.max(0,t-u),f=Math.min(r-u,_);n.push(l.slice(d,f-d))}return n.length===0&&n.push(c[0].slice(0,0)),n}function Xa(c,e,t,r){let n=0,a=0,o=e.length-1;do{if(n>=o-1)return t0?0:-1}function b_(c,e){let{nullBitmap:t}=c;if(!t||c.nullCount<=0)return-1;let r=0;for(let n of new Rr(t,c.offset+(e||0),c.length,t,vs)){if(!n)return r;++r}return-1}function K(c,e,t){if(e===void 0)return-1;if(e===null)switch(c.typeId){case y.Union:break;case y.Dictionary:break;default:return b_(c,t)}let r=Te.getVisitFn(c),n=Dr(e);for(let a=(t||0)-1,o=c.length;++a{let n=c.data[r];return n.values.subarray(0,n.length)[Symbol.iterator]()});let t=0;return new Xi(c.data.length,r=>{let a=c.data[r].length,o=c.slice(t,t+a);return t+=a,new Qa(o)})}var Qa=class{constructor(e){this.vector=e,this.index=0}next(){return this.indexl.data):e;if(a.length===0||a.some(l=>!(l instanceof le)))throw new TypeError("Vector constructor expects an Array of Data instances.");let o=(t=a[0])===null||t===void 0?void 0:t.type;switch(a.length){case 0:this._offsets=[0];break;case 1:{let{get:l,set:u,indexOf:_}=Xc[o.typeId],d=a[0];this.isValid=f=>Qi(d,f),this.get=f=>l(d,f),this.set=(f,p)=>u(d,f,p),this.indexOf=f=>_(d,f),this._offsets=[0,d.length];break}default:Object.setPrototypeOf(this,Qc[o.typeId]),this._offsets=bs(a);break}this.data=a,this.type=o,this.stride=et(o),this.numChildren=(n=(r=o.children)===null||r===void 0?void 0:r.length)!==null&&n!==void 0?n:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((e,t)=>e+t.byteLength,0)}get nullable(){return zc(this.data)}get nullCount(){return ys(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return"".concat(this.VectorName,"<").concat(this.type[Symbol.toStringTag],">")}get VectorName(){return"".concat(y[this.type.typeId],"Vector")}isValid(e){return!1}get(e){return null}at(e){return this.get(Br(e,this.length))}set(e,t){}indexOf(e,t){return-1}includes(e,t){return this.indexOf(e,t)>-1}[Symbol.iterator](){return fi.visit(this)}concat(...e){return new c(this.data.concat(e.flatMap(t=>t.data).flat(Number.POSITIVE_INFINITY)))}slice(e,t){return new c($i(this,e,t,({data:r,_offsets:n},a,o)=>Ss(r,n,a,o)))}toJSON(){return[...this]}toArray(){let{type:e,data:t,length:r,stride:n,ArrayType:a}=this;switch(e.typeId){case y.Int:case y.Float:case y.Decimal:case y.Time:case y.Timestamp:switch(t.length){case 0:return new a;case 1:return t[0].values.subarray(0,r*n);default:return t.reduce((o,{values:l,length:u})=>(o.array.set(l.subarray(0,u*n),o.offset),o.offset+=u*n,o),{array:new a(r*n),offset:0}).array}}return[...this]}toString(){return"[".concat([...this].join(","),"]")}getChild(e){var t;return this.getChildAt((t=this.type.children)===null||t===void 0?void 0:t.findIndex(r=>r.name===e))}getChildAt(e){return e>-1&&et[e])):null}get isMemoized(){return R.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(R.isDictionary(this.type)){let e=new Ls(this.data[0].dictionary),t=this.data.map(r=>{let n=r.clone();return n.dictionary=e,n});return new c(t)}return new Ls(this)}unmemoize(){if(R.isDictionary(this.type)&&this.isMemoized){let e=this.data[0].dictionary.unmemoize(),t=this.data.map(r=>{let n=r.clone();return n.dictionary=e,n});return new c(t)}return this}};qc=Symbol.toStringTag;se[qc]=(c=>{c.type=R.prototype,c.data=[],c.length=0,c.stride=1,c.numChildren=0,c._offsets=new Uint32Array([0]),c[Symbol.isConcatSpreadable]=!0;let e=Object.keys(y).map(t=>y[t]).filter(t=>typeof t=="number"&&t!==y.NONE);for(let t of e){let r=Te.getVisitFnByTypeId(t),n=Re.getVisitFnByTypeId(t),a=jr.getVisitFnByTypeId(t);Xc[t]={get:r,set:n,indexOf:a},Qc[t]=Object.create(c,{isValid:{value:di(Qi)},get:{value:di(Te.getVisitFnByTypeId(t))},set:{value:ws(Re.getVisitFnByTypeId(t))},indexOf:{value:Es(jr.getVisitFnByTypeId(t))}})}return"Vector"})(se.prototype);var Ls=class c extends se{constructor(e){super(e.data);let t=this.get,r=this.set,n=this.slice,a=new Array(this.length);Object.defineProperty(this,"get",{value(o){let l=a[o];if(l!==void 0)return l;let u=t.call(this,o);return a[o]=u,u}}),Object.defineProperty(this,"set",{value(o,l){r.call(this,o,l),a[o]=l}}),Object.defineProperty(this,"slice",{value:(o,l)=>new c(n.call(this,o,l))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new se(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}};function Yc(c){if(!c||c.length<=0)return function(n){return!0};let e="",t=c.filter(r=>r===r);return t.length>0&&(e="\n switch (x) {".concat(t.map(r=>"\n case ".concat(S_(r),":")).join(""),"\n return false;\n }")),c.length!==t.length&&(e="if (x !== x) return false;\n".concat(e)),new Function("x","".concat(e,"\nreturn true;"))}function S_(c){return typeof c!="bigint"?gt(c):"".concat(gt(c),"n")}function Ya(c,e){let t=Math.ceil(c)*e-1;return(t-t%64+64||64)/e}function Jc(c,e=0){return c.length>=e?c.subarray(0,e):xi(new c.constructor(e),c,0)}var Lt=class{constructor(e,t=0,r=1){this.length=Math.ceil(t/r),this.buffer=new e(this.length),this.stride=r,this.BYTES_PER_ELEMENT=e.BYTES_PER_ELEMENT,this.ArrayType=e}get byteLength(){return Math.ceil(this.length*this.stride)*this.BYTES_PER_ELEMENT}get reservedLength(){return this.buffer.length/this.stride}get reservedByteLength(){return this.buffer.byteLength}set(e,t){return this}append(e){return this.set(this.length,e)}reserve(e){if(e>0){this.length+=e;let t=this.stride,r=this.length*t,n=this.buffer.length;r>=n&&this._resize(n===0?Ya(r*1,this.BYTES_PER_ELEMENT):Ya(r*2,this.BYTES_PER_ELEMENT))}return this}flush(e=this.length){e=Ya(e*this.stride,this.BYTES_PER_ELEMENT);let t=Jc(this.buffer,e);return this.clear(),t}clear(){return this.length=0,this.buffer=new this.ArrayType,this}_resize(e){return this.buffer=Jc(this.buffer,e)}},rr=class extends Lt{last(){return this.get(this.length-1)}get(e){return this.buffer[e]}set(e,t){return this.reserve(e-this.length+1),this.buffer[e*this.stride]=t,this}},pi=class extends rr{constructor(){super(Uint8Array,0,1/8),this.numValid=0}get numInvalid(){return this.length-this.numValid}get(e){return this.buffer[e>>3]>>e%8&1}set(e,t){let{buffer:r}=this.reserve(e-this.length+1),n=e>>3,a=e%8,o=r[n]>>a&1;return t?o===0&&(r[n]|=1<=0&&n.fill(n[r],r,e),n[e]=n[e-1]+t,this}flush(e=this.length-1){return e>this.length&&this.set(e-1,this.BYTES_PER_ELEMENT>4?BigInt(0):0),super.flush(e+1)}};var Se=class{static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e){throw new Error('"throughDOM" not available in this environment')}constructor({type:e,nullValues:t}){this.length=0,this.finished=!1,this.type=e,this.children=[],this.nullValues=t,this.stride=et(e),this._nulls=new pi,t&&t.length>0&&(this._isValid=Yc(t))}toVector(){return new se([this.flush()])}get ArrayType(){return this.type.ArrayType}get nullCount(){return this._nulls.numInvalid}get numChildren(){return this.children.length}get byteLength(){let e=0,{_offsets:t,_values:r,_nulls:n,_typeIds:a,children:o}=this;return t&&(e+=t.byteLength),r&&(e+=r.byteLength),n&&(e+=n.byteLength),a&&(e+=a.byteLength),o.reduce((l,u)=>l+u.byteLength,e)}get reservedLength(){return this._nulls.reservedLength}get reservedByteLength(){let e=0;return this._offsets&&(e+=this._offsets.reservedByteLength),this._values&&(e+=this._values.reservedByteLength),this._nulls&&(e+=this._nulls.reservedByteLength),this._typeIds&&(e+=this._typeIds.reservedByteLength),this.children.reduce((t,r)=>t+r.reservedByteLength,e)}get valueOffsets(){return this._offsets?this._offsets.buffer:null}get values(){return this._values?this._values.buffer:null}get nullBitmap(){return this._nulls?this._nulls.buffer:null}get typeIds(){return this._typeIds?this._typeIds.buffer:null}append(e){return this.set(this.length,e)}isValid(e){return this._isValid(e)}set(e,t){return this.setValid(e,this.isValid(t))&&this.setValue(e,t),this}setValue(e,t){this._setValue(this,e,t)}setValid(e,t){return this.length=this._nulls.set(e,+t).length,t}addChild(e,t="".concat(this.numChildren)){throw new Error('Cannot append children to non-nested type "'.concat(this.type,'"'))}getChildAt(e){return this.children[e]||null}flush(){let e,t,r,n,{type:a,length:o,nullCount:l,_typeIds:u,_offsets:_,_values:d,_nulls:f}=this;(t=u==null?void 0:u.flush(o))?n=_==null?void 0:_.flush(o):(n=_==null?void 0:_.flush(o))?e=d==null?void 0:d.flush(_.last()):e=d==null?void 0:d.flush(o),l>0&&(r=f==null?void 0:f.flush(o));let p=this.children.map(m=>m.flush());return this.clear(),J({type:a,length:o,nullCount:l,children:p,child:p[0],data:e,typeIds:t,nullBitmap:r,valueOffsets:n})}finish(){this.finished=!0;for(let e of this.children)e.finish();return this}clear(){var e,t,r,n;this.length=0,(e=this._nulls)===null||e===void 0||e.clear(),(t=this._values)===null||t===void 0||t.clear(),(r=this._offsets)===null||r===void 0||r.clear(),(n=this._typeIds)===null||n===void 0||n.clear();for(let a of this.children)a.clear();return this}};Se.prototype.length=1;Se.prototype.stride=1;Se.prototype.children=null;Se.prototype.finished=!1;Se.prototype.nullValues=null;Se.prototype._isValid=()=>!0;var Fe=class extends Se{constructor(e){super(e),this._values=new rr(this.ArrayType,0,this.stride)}setValue(e,t){let r=this._values;return r.reserve(e-r.length+1),super.setValue(e,t)}},ze=class extends Se{constructor(e){super(e),this._pendingLength=0,this._offsets=new mi(e.type)}setValue(e,t){let r=this._pending||(this._pending=new Map),n=r.get(e);n&&(this._pendingLength-=n.length),this._pendingLength+=t instanceof Bt?t[Ar].length:t.length,r.set(e,t)}setValid(e,t){return super.setValid(e,t)?!0:((this._pending||(this._pending=new Map)).set(e,void 0),!1)}clear(){return this._pendingLength=0,this._pending=void 0,super.clear()}flush(){return this._flush(),super.flush()}finish(){return this._flush(),super.finish()}_flush(){let e=this._pending,t=this._pendingLength;return this._pendingLength=0,this._pending=void 0,e&&e.size>0&&this._flushPending(e,t),this}};var Or=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}offset(){return this.bb.readInt64(this.bb_pos)}metaDataLength(){return this.bb.readInt32(this.bb_pos+8)}bodyLength(){return this.bb.readInt64(this.bb_pos+16)}static sizeOf(){return 24}static createBlock(e,t,r,n){return e.prep(8,24),e.writeInt64(BigInt(n!=null?n:0)),e.pad(4),e.writeInt32(r),e.writeInt64(BigInt(t!=null?t:0)),e.offset()}};var tt=class c{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFooter(e,t){return(t||new c).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFooter(e,t){return e.setPosition(e.position()+4),(t||new c).__init(e.readInt32(e.position())+e.position(),e)}version(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):ue.V1}schema(e){let t=this.bb.__offset(this.bb_pos,6);return t?(e||new Ve).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}dictionaries(e,t){let r=this.bb.__offset(this.bb_pos,8);return r?(t||new Or).__init(this.bb.__vector(this.bb_pos+r)+e*24,this.bb):null}dictionariesLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}recordBatches(e,t){let r=this.bb.__offset(this.bb_pos,10);return r?(t||new Or).__init(this.bb.__vector(this.bb_pos+r)+e*24,this.bb):null}recordBatchesLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let r=this.bb.__offset(this.bb_pos,12);return r?(t||new Me).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startFooter(e){e.startObject(5)}static addVersion(e,t){e.addFieldInt16(0,t,ue.V1)}static addSchema(e,t){e.addFieldOffset(1,t,0)}static addDictionaries(e,t){e.addFieldOffset(2,t,0)}static startDictionariesVector(e,t){e.startVector(24,t,8)}static addRecordBatches(e,t){e.addFieldOffset(3,t,0)}static startRecordBatchesVector(e,t){e.startVector(24,t,8)}static addCustomMetadata(e,t){e.addFieldOffset(4,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let r=t.length-1;r>=0;r--)e.addOffset(t[r]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endFooter(e){return e.endObject()}static finishFooterBuffer(e,t){e.finish(t)}static finishSizePrefixedFooterBuffer(e,t){e.finish(t,void 0,!0)}};var de=class c{constructor(e=[],t,r,n=ue.V5){this.fields=e||[],this.metadata=t||new Map,r||(r=Ja(this.fields)),this.dictionaries=r,this.metadataVersion=n}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(e=>e.name)}toString(){return"Schema<{ ".concat(this.fields.map((e,t)=>"".concat(t,": ").concat(e)).join(", ")," }>")}select(e){let t=new Set(e),r=this.fields.filter(n=>t.has(n.name));return new c(r,this.metadata)}selectAt(e){let t=e.map(r=>this.fields[r]).filter(Boolean);return new c(t,this.metadata)}assign(...e){let t=e[0]instanceof c?e[0]:Array.isArray(e[0])?new c(e[0]):new c(e),r=[...this.fields],n=As(As(new Map,this.metadata),t.metadata),a=t.fields.filter(l=>{let u=r.findIndex(_=>_.name===l.name);return~u?(r[u]=l.clone({metadata:As(As(new Map,r[u].metadata),l.metadata)}))&&!1:!0}),o=Ja(a,new Map);return new c([...r,...a],n,new Map([...this.dictionaries,...o]))}};de.prototype.fields=null;de.prototype.metadata=null;de.prototype.dictionaries=null;var ie=class c{static new(...e){let[t,r,n,a]=e;return e[0]&&typeof e[0]=="object"&&({name:t}=e[0],r===void 0&&(r=e[0].type),n===void 0&&(n=e[0].nullable),a===void 0&&(a=e[0].metadata)),new c("".concat(t),r,n,a)}constructor(e,t,r=!1,n){this.name=e,this.type=t,this.nullable=r,this.metadata=n||new Map}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return"".concat(this.name,": ").concat(this.type)}clone(...e){let[t,r,n,a]=e;return!e[0]||typeof e[0]!="object"?[t=this.name,r=this.type,n=this.nullable,a=this.metadata]=e:{name:t=this.name,type:r=this.type,nullable:n=this.nullable,metadata:a=this.metadata}=e[0],c.new(t,r,n,a)}};ie.prototype.type=null;ie.prototype.name=null;ie.prototype.nullable=null;ie.prototype.metadata=null;function As(c,e){return new Map([...c||new Map,...e||new Map])}function Ja(c,e=new Map){for(let t=-1,r=c.length;++t0&&Ja(a.children,e)}return e}var w_=Ir,E_=Je,ir=class{static decode(e){e=new E_(z(e));let t=tt.getRootAsFooter(e),r=de.decode(t.schema(),new Map,t.version());return new Ka(r,t)}static encode(e){let t=new w_,r=de.encode(t,e.schema);tt.startRecordBatchesVector(t,e.numRecordBatches);for(let o of[...e.recordBatches()].slice().reverse())nr.encode(t,o);let n=t.endVector();tt.startDictionariesVector(t,e.numDictionaries);for(let o of[...e.dictionaryBatches()].slice().reverse())nr.encode(t,o);let a=t.endVector();return tt.startFooter(t),tt.addSchema(t,r),tt.addVersion(t,ue.V5),tt.addRecordBatches(t,n),tt.addDictionaries(t,a),tt.finishFooterBuffer(t,tt.endFooter(t)),t.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(e,t=ue.V5,r,n){this.schema=e,this.version=t,r&&(this._recordBatches=r),n&&(this._dictionaryBatches=n)}*recordBatches(){for(let e,t=-1,r=this.numRecordBatches;++t=0&&e=0&&e=0&&e=0&&ethis._closedPromiseResolve=e)}get closed(){return this._closedPromise}cancel(e){return B(this,void 0,void 0,function*(){yield this.return(e)})}write(e){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(e):this.resolvers.shift().resolve({done:!1,value:e}))}abort(e){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:e}:this.resolvers.shift().reject({done:!0,value:e}))}close(){if(this._closedPromiseResolve){let{resolvers:e}=this;for(;e.length>0;)e.shift().resolve(ye);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(e){return Be.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,e)}toNodeStream(e){return Be.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,e)}throw(e){return B(this,void 0,void 0,function*(){return yield this.abort(e),ye})}return(e){return B(this,void 0,void 0,function*(){return yield this.close(),ye})}read(e){return B(this,void 0,void 0,function*(){return(yield this.next(e,"read")).value})}peek(e){return B(this,void 0,void 0,function*(){return(yield this.next(e,"peek")).value})}next(...e){return this._values.length>0?Promise.resolve({done:!1,value:this._values.shift()}):this._error?Promise.reject({done:!0,value:this._error.error}):this._closedPromiseResolve?new Promise((t,r)=>{this.resolvers.push({resolve:t,reject:r})}):Promise.resolve(ye)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}};var Rt=class extends Ds{write(e){if((e=z(e)).byteLength>0)return super.write(e)}toString(e=!1){return e?Ti(this.toUint8Array(!0)):this.toUint8Array(!1).then(Ti)}toUint8Array(e=!1){return e?Ye(this._values)[0]:B(this,void 0,void 0,function*(){var t,r,n,a;let o=[],l=0;try{for(var u=!0,_=ut(this),d;d=yield _.next(),t=d.done,!t;u=!0){a=d.value,u=!1;let f=a;o.push(f),l+=f.byteLength}}catch(f){r={error:f}}finally{try{!u&&!t&&(n=_.return)&&(yield n.call(_))}finally{if(r)throw r.error}}return Ye(o,l)[0]})}},Gt=class{constructor(e){e&&(this.source=new Za(Be.fromIterable(e)))}[Symbol.iterator](){return this}next(e){return this.source.next(e)}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}peek(e){return this.source.peek(e)}read(e){return this.source.read(e)}},at=class c{constructor(e){e instanceof c?this.source=e.source:e instanceof Rt?this.source=new sr(Be.fromAsyncIterable(e)):In(e)?this.source=new sr(Be.fromNodeStream(e)):Fi(e)?this.source=new sr(Be.fromDOMStream(e)):Mn(e)?this.source=new sr(Be.fromDOMStream(e.body)):dt(e)?this.source=new sr(Be.fromIterable(e)):_t(e)?this.source=new sr(Be.fromAsyncIterable(e)):rt(e)&&(this.source=new sr(Be.fromAsyncIterable(e)))}[Symbol.asyncIterator](){return this}next(e){return this.source.next(e)}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}get closed(){return this.source.closed}cancel(e){return this.source.cancel(e)}peek(e){return this.source.peek(e)}read(e){return this.source.read(e)}},Za=class{constructor(e){this.source=e}cancel(e){this.return(e)}peek(e){return this.next(e,"peek").value}read(e){return this.next(e,"read").value}next(e,t="read"){return this.source.next({cmd:t,size:e})}throw(e){return Object.create(this.source.throw&&this.source.throw(e)||ye)}return(e){return Object.create(this.source.return&&this.source.return(e)||ye)}},sr=class{constructor(e){this.source=e,this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}cancel(e){return B(this,void 0,void 0,function*(){yield this.return(e)})}get closed(){return this._closedPromise}read(e){return B(this,void 0,void 0,function*(){return(yield this.next(e,"read")).value})}peek(e){return B(this,void 0,void 0,function*(){return(yield this.next(e,"peek")).value})}next(e){return B(this,arguments,void 0,function*(t,r="read"){return yield this.source.next({cmd:r,size:t})})}throw(e){return B(this,void 0,void 0,function*(){let t=this.source.throw&&(yield this.source.throw(e))||ye;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}return(e){return B(this,void 0,void 0,function*(){let t=this.source.return&&(yield this.source.return(e))||ye;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}};var Ji=class extends Gt{constructor(e,t){super(),this.position=0,this.buffer=z(e),this.size=t===void 0?this.buffer.byteLength:t}readInt32(e){let{buffer:t,byteOffset:r}=this.readAt(e,4);return new DataView(t,r).getInt32(0,!0)}seek(e){return this.position=Math.min(e,this.size),eKi,Int128:()=>Zi,Int64:()=>ar,Uint64:()=>Le});function hi(c){return c<0&&(c=4294967295+c+1),"0x".concat(c.toString(16))}var gi=8,eo=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],Ki=class{constructor(e){this.buffer=e}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(e){let t=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),r=new Uint32Array([e.buffer[1]>>>16,e.buffer[1]&65535,e.buffer[0]>>>16,e.buffer[0]&65535]),n=t[3]*r[3];this.buffer[0]=n&65535;let a=n>>>16;return n=t[2]*r[3],a+=n,n=t[3]*r[2]>>>0,a+=n,this.buffer[0]+=a<<16,this.buffer[1]=a>>>0>>16,this.buffer[1]+=t[1]*r[3]+t[2]*r[2]+t[3]*r[1],this.buffer[1]+=t[0]*r[3]+t[1]*r[2]+t[2]*r[1]+t[3]*r[0]<<16,this}_plus(e){let t=this.buffer[0]+e.buffer[0]>>>0;this.buffer[1]+=e.buffer[1],t>>0&&++this.buffer[1],this.buffer[0]=t}lessThan(e){return this.buffer[1]>>0,t[2]=this.buffer[2]+e.buffer[2]>>>0,t[1]=this.buffer[1]+e.buffer[1]>>>0,t[0]=this.buffer[0]+e.buffer[0]>>>0,t[0]>>0&&++t[1],t[1]>>0&&++t[2],t[2]>>0&&++t[3],this.buffer[3]=t[3],this.buffer[2]=t[2],this.buffer[1]=t[1],this.buffer[0]=t[0],this}hex(){return"".concat(hi(this.buffer[3])," ").concat(hi(this.buffer[2])," ").concat(hi(this.buffer[1])," ").concat(hi(this.buffer[0]))}static multiply(e,t){return new c(new Uint32Array(e.buffer)).times(t)}static add(e,t){return new c(new Uint32Array(e.buffer)).plus(t)}static from(e,t=new Uint32Array(4)){return c.fromString(typeof e=="string"?e:e.toString(),t)}static fromNumber(e,t=new Uint32Array(4)){return c.fromString(e.toString(),t)}static fromString(e,t=new Uint32Array(4)){let r=e.startsWith("-"),n=e.length,a=new c(t);for(let o=r?1:0;o0&&this.readData(e,r)||new Uint8Array(0)}readOffsets(e,t){return this.readData(e,t)}readTypeIds(e,t){return this.readData(e,t)}readData(e,{length:t,offset:r}=this.nextBufferRange()){return this.bytes.subarray(r,r+t)}readDictionary(e){return this.dictionaries.get(e.id)}},ks=class extends en{constructor(e,t,r,n,a){super(new Uint8Array(0),t,r,n,a),this.sources=e}readNullBitmap(e,t,{offset:r}=this.nextBufferRange()){return t<=0?new Uint8Array(0):Ur(this.sources[r])}readOffsets(e,{offset:t}=this.nextBufferRange()){return re(Uint8Array,re(e.OffsetArrayType,this.sources[t]))}readTypeIds(e,{offset:t}=this.nextBufferRange()){return re(Uint8Array,re(e.ArrayType,this.sources[t]))}readData(e,{offset:t}=this.nextBufferRange()){let{sources:r}=this;return R.isTimestamp(e)?re(Uint8Array,ar.convertArray(r[t])):(R.isInt(e)||R.isTime(e))&&e.bitWidth===64||R.isDuration(e)?re(Uint8Array,ar.convertArray(r[t])):R.isDate(e)&&e.unit===Ae.MILLISECOND?re(Uint8Array,ar.convertArray(r[t])):R.isDecimal(e)?re(Uint8Array,Zi.convertArray(r[t])):R.isBinary(e)||R.isLargeBinary(e)||R.isFixedSizeBinary(e)?L_(r[t]):R.isBool(e)?Ur(r[t]):R.isUtf8(e)||R.isLargeUtf8(e)?Ft(r[t].join("")):re(Uint8Array,re(e.ArrayType,r[t].map(n=>+n)))}};function L_(c){let e=c.join(""),t=new Uint8Array(e.length/2);for(let r=0;r>1]=Number.parseInt(e.slice(r,r+2),16);return t}var vi=class extends ze{constructor(e){super(e),this._values=new Lt(Uint8Array)}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,t){return super.setValue(e,z(t))}_flushPending(e,t){let r=this._offsets,n=this._values.reserve(t).buffer,a=0;for(let[o,l]of e)if(l===void 0)r.set(o,0);else{let u=l.length;n.set(l,a),r.set(o,u),a+=u}}};var yi=class extends ze{constructor(e){super(e),this._values=new Lt(Uint8Array)}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,t){return super.setValue(e,z(t))}_flushPending(e,t){let r=this._offsets,n=this._values.reserve(t).buffer,a=0;for(let[o,l]of e)if(l===void 0)r.set(o,BigInt(0));else{let u=l.length;n.set(l,a),r.set(o,BigInt(u)),a+=u}}};var Ts=class extends Se{constructor(e){super(e),this._values=new pi}setValue(e,t){this._values.set(e,+t)}};var Nr=class extends Fe{};Nr.prototype._setValue=Ia;var tn=class extends Nr{};tn.prototype._setValue=Zn;var rn=class extends Nr{};rn.prototype._setValue=es;var nn=class extends Fe{};nn.prototype._setValue=Ga;var Fs=class extends Se{constructor({type:e,nullValues:t,dictionaryHashFunction:r}){super({type:new Ze(e.dictionary,e.indices,e.id,e.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=Wr({type:this.type.indices,nullValues:t}),this.dictionary=Wr({type:this.type.dictionary,nullValues:null}),typeof r=="function"&&(this.valueToKey=r)}get values(){return this.indices.values}get nullCount(){return this.indices.nullCount}get nullBitmap(){return this.indices.nullBitmap}get byteLength(){return this.indices.byteLength+this.dictionary.byteLength}get reservedLength(){return this.indices.reservedLength+this.dictionary.reservedLength}get reservedByteLength(){return this.indices.reservedByteLength+this.dictionary.reservedByteLength}isValid(e){return this.indices.isValid(e)}setValid(e,t){let r=this.indices;return t=r.setValid(e,t),this.length=r.length,t}setValue(e,t){let r=this._keysToIndices,n=this.valueToKey(t),a=r[n];return a===void 0&&(r[n]=a=this._dictionaryOffset+this.dictionary.append(t).length-1),this.indices.setValue(e,a)}flush(){let e=this.type,t=this._dictionary,r=this.dictionary.toVector(),n=this.indices.flush().clone(e);return n.dictionary=t?t.concat(r):r,this.finished||(this._dictionaryOffset+=r.length),this._dictionary=n.dictionary,this.clear(),n}finish(){return this.indices.finish(),this.dictionary.finish(),this._dictionaryOffset=0,this._keysToIndices=Object.create(null),super.finish()}clear(){return this.indices.clear(),this.dictionary.clear(),super.clear()}valueToKey(e){return typeof e=="string"?e:"".concat(e)}};var sn=class extends Fe{};sn.prototype._setValue=Pa;var xs=class extends Se{setValue(e,t){let[r]=this.children,n=e*this.stride;for(let a=-1,o=t.length;++a0)throw new Error("FixedSizeListBuilder can only have one child.");let r=this.children.push(e);return this.type=new St(this.type.listSize,new ie(t,e.type,!0)),r}};var Vr=class extends Fe{setValue(e,t){this._values.set(e,t)}},Cs=class extends Vr{setValue(e,t){super.setValue(e,zi(t))}},Ms=class extends Vr{},Ps=class extends Vr{};var zr=class extends Fe{};zr.prototype._setValue=Ua;var an=class extends zr{};an.prototype._setValue=ls;var on=class extends zr{};on.prototype._setValue=us;var or=class extends Fe{};or.prototype._setValue=ja;var cn=class extends or{};cn.prototype._setValue=_s;var ln=class extends or{};ln.prototype._setValue=ds;var un=class extends or{};un.prototype._setValue=ps;var _n=class extends or{};_n.prototype._setValue=ms;var ot=class extends Fe{setValue(e,t){this._values.set(e,t)}},Is=class extends ot{},Bs=class extends ot{},Rs=class extends ot{},Gs=class extends ot{},Us=class extends ot{},js=class extends ot{},Os=class extends ot{},Hs=class extends ot{};var Ns=class extends ze{constructor(e){super(e),this._offsets=new mi(e.type)}addChild(e,t="0"){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=e,this.type=new yt(new ie(t,e.type,!0)),this.numChildren-1}_flushPending(e){let t=this._offsets,[r]=this.children;for(let[n,a]of e)if(typeof a>"u")t.set(n,0);else{let o=a,l=o.length,u=t.set(n,l).buffer[n];for(let _=-1;++_0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=e,this.type=new wt(new ie(t,e.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(e){let t=this._offsets,[r]=this.children;for(let[n,a]of e)if(a===void 0)t.set(n,0);else{let{[n]:o,[n+1]:l}=t.set(n,a.size).buffer;for(let u of a.entries())if(r.set(o,u),++o>=l)break}}};var Vs=class extends Se{setValue(e,t){}setValid(e,t){return this.length=Math.max(e+1,this.length),t}};var zs=class extends Se{setValue(e,t){let{children:r,type:n}=this;switch(Array.isArray(t)||t.constructor){case!0:return n.children.forEach((a,o)=>r[o].set(e,t[o]));case Map:return n.children.forEach((a,o)=>r[o].set(e,t.get(a.name)));default:return n.children.forEach((a,o)=>r[o].set(e,t[a.name]))}}setValid(e,t){return super.setValid(e,t)||this.children.forEach(r=>r.setValid(e,t)),t}addChild(e,t="".concat(this.numChildren)){let r=this.children.push(e);return this.type=new ve([...this.type.children,new ie(t,e.type,!0)]),r}};var cr=class extends Fe{};cr.prototype._setValue=Ba;var dn=class extends cr{};dn.prototype._setValue=ts;var fn=class extends cr{};fn.prototype._setValue=rs;var pn=class extends cr{};pn.prototype._setValue=is;var mn=class extends cr{};mn.prototype._setValue=ns;var lr=class extends Fe{};lr.prototype._setValue=Ra;var hn=class extends lr{};hn.prototype._setValue=ss;var gn=class extends lr{};gn.prototype._setValue=as;var vn=class extends lr{};vn.prototype._setValue=os;var yn=class extends lr{};yn.prototype._setValue=cs;var bi=class extends Se{constructor(e){super(e),this._typeIds=new rr(Int8Array,0,1),typeof e.valueToChildTypeId=="function"&&(this._valueToChildTypeId=e.valueToChildTypeId)}get typeIdToChildIndex(){return this.type.typeIdToChildIndex}append(e,t){return this.set(this.length,e,t)}set(e,t,r){return r===void 0&&(r=this._valueToChildTypeId(this,t,e)),this.setValue(e,t,r),this}setValue(e,t,r){this._typeIds.set(e,r);let n=this.type.typeIdToChildIndex[r],a=this.children[n];a==null||a.set(e,t)}addChild(e,t="".concat(this.children.length)){let r=this.children.push(e),{type:{children:n,mode:a,typeIds:o}}=this,l=[...n,new ie(t,e.type)];return this.type=new bt(a,[...o,r],l),r}_valueToChildTypeId(e,t,r){throw new Error("Cannot map UnionBuilder value to child typeId. Pass the `childTypeId` as the second argument to unionBuilder.append(), or supply a `valueToChildTypeId` function as part of the UnionBuilder constructor options.")}},$s=class extends bi{},qs=class extends bi{constructor(e){super(e),this._offsets=new rr(Int32Array)}setValue(e,t,r){let n=this._typeIds.set(e,r).buffer[e],a=this.getChildAt(this.type.typeIdToChildIndex[n]),o=this._offsets.set(e,a.length).buffer[e];a==null||a.set(o,t)}};var bn=class extends ze{constructor(e){super(e),this._values=new Lt(Uint8Array)}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,t){return super.setValue(e,Ft(t))}_flushPending(e,t){}};bn.prototype._flushPending=vi.prototype._flushPending;var Sn=class extends ze{constructor(e){super(e),this._values=new Lt(Uint8Array)}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,t){return super.setValue(e,Ft(t))}_flushPending(e,t){}};Sn.prototype._flushPending=yi.prototype._flushPending;var ro=class extends j{visitNull(){return Vs}visitBool(){return Ts}visitInt(){return ot}visitInt8(){return Is}visitInt16(){return Bs}visitInt32(){return Rs}visitInt64(){return Gs}visitUint8(){return Us}visitUint16(){return js}visitUint32(){return Os}visitUint64(){return Hs}visitFloat(){return Vr}visitFloat16(){return Cs}visitFloat32(){return Ms}visitFloat64(){return Ps}visitUtf8(){return bn}visitLargeUtf8(){return Sn}visitBinary(){return vi}visitLargeBinary(){return yi}visitFixedSizeBinary(){return sn}visitDate(){return Nr}visitDateDay(){return tn}visitDateMillisecond(){return rn}visitTimestamp(){return cr}visitTimestampSecond(){return dn}visitTimestampMillisecond(){return fn}visitTimestampMicrosecond(){return pn}visitTimestampNanosecond(){return mn}visitTime(){return lr}visitTimeSecond(){return hn}visitTimeMillisecond(){return gn}visitTimeMicrosecond(){return vn}visitTimeNanosecond(){return yn}visitDecimal(){return nn}visitList(){return Ns}visitStruct(){return zs}visitUnion(){return bi}visitDenseUnion(){return qs}visitSparseUnion(){return $s}visitDictionary(){return Fs}visitInterval(){return zr}visitIntervalDayTime(){return an}visitIntervalYearMonth(){return on}visitDuration(){return or}visitDurationSecond(){return cn}visitDurationMillisecond(){return ln}visitDurationMicrosecond(){return un}visitDurationNanosecond(){return _n}visitFixedSizeList(){return xs}visitMap(){return Ws}},Kc=new ro;var W=class extends j{compareSchemas(e,t){return e===t||t instanceof e.constructor&&this.compareManyFields(e.fields,t.fields)}compareManyFields(e,t){return e===t||Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((r,n)=>this.compareFields(r,t[n]))}compareFields(e,t){return e===t||t instanceof e.constructor&&e.name===t.name&&e.nullable===t.nullable&&this.visit(e.type,t.type)}};function Ne(c,e){return e instanceof c.constructor}function $r(c,e){return c===e||Ne(c,e)}function ur(c,e){return c===e||Ne(c,e)&&c.bitWidth===e.bitWidth&&c.isSigned===e.isSigned}function Xs(c,e){return c===e||Ne(c,e)&&c.precision===e.precision}function A_(c,e){return c===e||Ne(c,e)&&c.byteWidth===e.byteWidth}function io(c,e){return c===e||Ne(c,e)&&c.unit===e.unit}function wn(c,e){return c===e||Ne(c,e)&&c.unit===e.unit&&c.timezone===e.timezone}function En(c,e){return c===e||Ne(c,e)&&c.unit===e.unit&&c.bitWidth===e.bitWidth}function D_(c,e){return c===e||Ne(c,e)&&c.children.length===e.children.length&&Ut.compareManyFields(c.children,e.children)}function k_(c,e){return c===e||Ne(c,e)&&c.children.length===e.children.length&&Ut.compareManyFields(c.children,e.children)}function no(c,e){return c===e||Ne(c,e)&&c.mode===e.mode&&c.typeIds.every((t,r)=>t===e.typeIds[r])&&Ut.compareManyFields(c.children,e.children)}function T_(c,e){return c===e||Ne(c,e)&&c.id===e.id&&c.isOrdered===e.isOrdered&&Ut.visit(c.indices,e.indices)&&Ut.visit(c.dictionary,e.dictionary)}function so(c,e){return c===e||Ne(c,e)&&c.unit===e.unit}function Ln(c,e){return c===e||Ne(c,e)&&c.unit===e.unit}function F_(c,e){return c===e||Ne(c,e)&&c.listSize===e.listSize&&c.children.length===e.children.length&&Ut.compareManyFields(c.children,e.children)}function x_(c,e){return c===e||Ne(c,e)&&c.keysSorted===e.keysSorted&&c.children.length===e.children.length&&Ut.compareManyFields(c.children,e.children)}W.prototype.visitNull=$r;W.prototype.visitBool=$r;W.prototype.visitInt=ur;W.prototype.visitInt8=ur;W.prototype.visitInt16=ur;W.prototype.visitInt32=ur;W.prototype.visitInt64=ur;W.prototype.visitUint8=ur;W.prototype.visitUint16=ur;W.prototype.visitUint32=ur;W.prototype.visitUint64=ur;W.prototype.visitFloat=Xs;W.prototype.visitFloat16=Xs;W.prototype.visitFloat32=Xs;W.prototype.visitFloat64=Xs;W.prototype.visitUtf8=$r;W.prototype.visitLargeUtf8=$r;W.prototype.visitBinary=$r;W.prototype.visitLargeBinary=$r;W.prototype.visitFixedSizeBinary=A_;W.prototype.visitDate=io;W.prototype.visitDateDay=io;W.prototype.visitDateMillisecond=io;W.prototype.visitTimestamp=wn;W.prototype.visitTimestampSecond=wn;W.prototype.visitTimestampMillisecond=wn;W.prototype.visitTimestampMicrosecond=wn;W.prototype.visitTimestampNanosecond=wn;W.prototype.visitTime=En;W.prototype.visitTimeSecond=En;W.prototype.visitTimeMillisecond=En;W.prototype.visitTimeMicrosecond=En;W.prototype.visitTimeNanosecond=En;W.prototype.visitDecimal=$r;W.prototype.visitList=D_;W.prototype.visitStruct=k_;W.prototype.visitUnion=no;W.prototype.visitDenseUnion=no;W.prototype.visitSparseUnion=no;W.prototype.visitDictionary=T_;W.prototype.visitInterval=so;W.prototype.visitIntervalDayTime=so;W.prototype.visitIntervalYearMonth=so;W.prototype.visitDuration=Ln;W.prototype.visitDurationSecond=Ln;W.prototype.visitDurationMillisecond=Ln;W.prototype.visitDurationMicrosecond=Ln;W.prototype.visitDurationNanosecond=Ln;W.prototype.visitFixedSizeList=F_;W.prototype.visitMap=x_;var Ut=new W;function qr(c,e){return Ut.compareSchemas(c,e)}function Zc(c,e){return Ut.compareFields(c,e)}function el(c,e){return Ut.visit(c,e)}function Wr(c){let e=c.type,t=new(Kc.getVisitFn(e)())(c);if(e.children&&e.children.length>0){let r=c.children||[],n={nullValues:c.nullValues},a=Array.isArray(r)?(o,l)=>r[l]||n:({name:o})=>r[o]||n;for(let[o,l]of e.children.entries()){let{type:u}=l,_=a(l,o);t.children.push(Wr(Object.assign(Object.assign({},_),{type:u})))}}return t}function Qs(c,e){return C_(c,e.map(t=>t.data.concat()))}function C_(c,e){let t=[...c.fields],r=[],n={numBatches:e.reduce((f,p)=>Math.max(f,p.length),0)},a=0,o=0,l=-1,u=e.length,_,d=[];for(;n.numBatches-- >0;){for(o=Number.POSITIVE_INFINITY,l=-1;++l0&&(r[a++]=J({type:new ve(t),length:o,nullCount:0,children:d.slice()})))}return[c=c.assign(t),r.map(f=>new De(c,f))]}function M_(c,e,t,r,n){var a;let o=(e+63&-64)>>3;for(let l=-1,u=r.length;++l=e)d===e?t[l]=_:(t[l]=_.slice(0,e),n.numBatches=Math.max(n.numBatches,r[l].unshift(_.slice(e,d-e))));else{let f=c[l];c[l]=f.clone({nullable:!0}),t[l]=(a=_==null?void 0:_._changeLengthAndBackfillNullBitmap(e))!==null&&a!==void 0?a:J({type:f.type,length:e,nullCount:e,nullBitmap:new Uint8Array(o)})}}return t}var tl,We=class c{constructor(...e){var t,r;if(e.length===0)return this.batches=[],this.schema=new de([]),this._offsets=[0],this;let n,a;e[0]instanceof de&&(n=e.shift()),e.at(-1)instanceof Uint32Array&&(a=e.pop());let o=u=>{if(u){if(u instanceof De)return[u];if(u instanceof c)return u.batches;if(u instanceof le){if(u.type instanceof ve)return[new De(new de(u.type.children),u)]}else{if(Array.isArray(u))return u.flatMap(_=>o(_));if(typeof u[Symbol.iterator]=="function")return[...u].flatMap(_=>o(_));if(typeof u=="object"){let _=Object.keys(u),d=_.map(m=>new se([u[m]])),f=n!=null?n:new de(_.map((m,h)=>new ie(String(m),d[h].type,d[h].nullable))),[,p]=Qs(f,d);return p.length===0?[new De(u)]:p}}}return[]},l=e.flatMap(u=>o(u));if(n=(r=n!=null?n:(t=l[0])===null||t===void 0?void 0:t.schema)!==null&&r!==void 0?r:new de([]),!(n instanceof de))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(let u of l){if(!(u instanceof De))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!qr(n,u.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=n,this.batches=l,this._offsets=a!=null?a:bs(this.data)}get data(){return this.batches.map(({data:e})=>e)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.reduce((e,t)=>e+t.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=ys(this.data)),this._nullCount}isValid(e){return!1}get(e){return null}at(e){return this.get(Br(e,this.numRows))}set(e,t){}indexOf(e,t){return-1}[Symbol.iterator](){return this.batches.length>0?fi.visit(new se(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return"[\n ".concat(this.toArray().join(",\n "),"\n]")}concat(...e){let t=this.schema,r=this.data.concat(e.flatMap(({data:n})=>n));return new c(t,r.map(n=>new De(t,n)))}slice(e,t){let r=this.schema;[e,t]=$i({length:this.numRows},e,t);let n=Ss(this.data,this._offsets,e,t);return new c(r,n.map(a=>new De(r,a)))}getChild(e){return this.getChildAt(this.schema.fields.findIndex(t=>t.name===e))}getChildAt(e){if(e>-1&&er.children[e]);if(t.length===0){let{type:r}=this.schema.fields[e],n=J({type:r,length:0,nullCount:0});t.push(n._changeLengthAndBackfillNullBitmap(this.numRows))}return new se(t)}return null}setChild(e,t){var r;return this.setChildAt((r=this.schema.fields)===null||r===void 0?void 0:r.findIndex(n=>n.name===e),t)}setChildAt(e,t){let r=this.schema,n=[...this.batches];if(e>-1&&ethis.getChildAt(_));[a[e],l[e]]=[o,t],[r,n]=Qs(r,l)}return new c(r,n)}select(e){let t=this.schema.fields.reduce((r,n,a)=>r.set(n.name,a),new Map);return this.selectAt(e.map(r=>t.get(r)).filter(r=>r>-1))}selectAt(e){let t=this.schema.selectAt(e),r=this.batches.map(n=>n.selectAt(e));return new c(t,r)}assign(e){let t=this.schema.fields,[r,n]=e.schema.fields.reduce((l,u,_)=>{let[d,f]=l,p=t.findIndex(m=>m.name===u.name);return~p?f[p]=_:d.push(_),l},[[],[]]),a=this.schema.assign(e.schema),o=[...t.map((l,u)=>[u,n[u]]).map(([l,u])=>u===void 0?this.getChildAt(l):e.getChildAt(u)),...r.map(l=>e.getChildAt(l))].filter(Boolean);return new c(...Qs(a,o))}};tl=Symbol.toStringTag;We[tl]=(c=>(c.schema=null,c.batches=[],c._offsets=new Uint32Array([0]),c._nullCount=-1,c[Symbol.isConcatSpreadable]=!0,c.isValid=di(Qi),c.get=di(Te.getVisitFn(y.Struct)),c.set=ws(Re.getVisitFn(y.Struct)),c.indexOf=Es(jr.getVisitFn(y.Struct)),"Table"))(We.prototype);var il,De=class c{constructor(...e){switch(e.length){case 2:{if([this.schema]=e,!(this.schema instanceof de))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=J({nullCount:0,type:new ve(this.schema.fields),children:this.schema.fields.map(t=>J({type:t.type,nullCount:0}))})]=e,!(this.data instanceof le))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=rl(this.schema,this.data.children);break}case 1:{let[t]=e,{fields:r,children:n,length:a}=Object.keys(t).reduce((u,_,d)=>(u.children[d]=t[_],u.length=Math.max(u.length,t[_].length),u.fields[d]=ie.new({name:_,type:t[_].type,nullable:!0}),u),{length:0,fields:new Array,children:new Array}),o=new de(r),l=J({type:new ve(r),length:a,children:n,nullCount:0});[this.schema,this.data]=rl(o,l.children,a);break}default:throw new TypeError("RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.")}}get dictionaries(){return this._dictionaries||(this._dictionaries=nl(this.schema.fields,this.data.children))}get numCols(){return this.schema.fields.length}get numRows(){return this.data.length}get nullCount(){return this.data.nullCount}isValid(e){return this.data.getValid(e)}get(e){return Te.visit(this.data,e)}at(e){return this.get(Br(e,this.numRows))}set(e,t){return Re.visit(this.data,e,t)}indexOf(e,t){return jr.visit(this.data,e,t)}[Symbol.iterator](){return fi.visit(new se([this.data]))}toArray(){return[...this]}concat(...e){return new We(this.schema,[this,...e])}slice(e,t){let[r]=new se([this.data]).slice(e,t).data;return new c(this.schema,r)}getChild(e){var t;return this.getChildAt((t=this.schema.fields)===null||t===void 0?void 0:t.findIndex(r=>r.name===e))}getChildAt(e){return e>-1&&en.name===e),t)}setChildAt(e,t){let r=this.schema,n=this.data;if(e>-1&&el.name===a);~o&&(n[o]=this.data.children[o])}return new c(t,J({type:r,length:this.numRows,children:n}))}selectAt(e){let t=this.schema.selectAt(e),r=e.map(a=>this.data.children[a]).filter(Boolean),n=J({type:new ve(t.fields),length:this.numRows,children:r});return new c(t,n)}};il=Symbol.toStringTag;De[il]=(c=>(c._nullCount=-1,c[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(De.prototype);function rl(c,e,t=e.reduce((r,n)=>Math.max(r,n.length),0)){var r;let n=[...c.fields],a=[...e],o=(t+63&-64)>>3;for(let[l,u]of c.fields.entries()){let _=e[l];(!_||_.length!==t)&&(n[l]=u.clone({nullable:!0}),a[l]=(r=_==null?void 0:_._changeLengthAndBackfillNullBitmap(t))!==null&&r!==void 0?r:J({type:u.type,length:t,nullCount:t,nullBitmap:new Uint8Array(o)}))}return[c.assign(n),J({type:new ve(n),length:t,children:a})]}function nl(c,e,t=new Map){var r,n;if(((r=c==null?void 0:c.length)!==null&&r!==void 0?r:0)>0&&(c==null?void 0:c.length)===(e==null?void 0:e.length))for(let a=-1,o=c.length;++aJ({type:n.type})),r=J({type:new ve(e.fields),nullCount:0,children:t});super(e,r)}};var At=class c{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsMessage(e,t){return(t||new c).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMessage(e,t){return e.setPosition(e.position()+4),(t||new c).__init(e.readInt32(e.position())+e.position(),e)}version(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):ue.V1}headerType(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb_pos+e):ne.NONE}header(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__union(e,this.bb_pos+t):null}bodyLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}customMetadata(e,t){let r=this.bb.__offset(this.bb_pos,12);return r?(t||new Me).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startMessage(e){e.startObject(5)}static addVersion(e,t){e.addFieldInt16(0,t,ue.V1)}static addHeaderType(e,t){e.addFieldInt8(1,t,ne.NONE)}static addHeader(e,t){e.addFieldOffset(2,t,0)}static addBodyLength(e,t){e.addFieldInt64(3,t,BigInt("0"))}static addCustomMetadata(e,t){e.addFieldOffset(4,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let r=t.length-1;r>=0;r--)e.addOffset(t[r]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endMessage(e){return e.endObject()}static finishMessageBuffer(e,t){e.finish(t)}static finishSizePrefixedMessageBuffer(e,t){e.finish(t,void 0,!0)}static createMessage(e,t,r,n,a,o){return c.startMessage(e),c.addVersion(e,t),c.addHeaderType(e,r),c.addHeader(e,n),c.addBodyLength(e,a),c.addCustomMetadata(e,o),c.endMessage(e)}};var ao=class extends j{visit(e,t){return e==null||t==null?void 0:super.visit(e,t)}visitNull(e,t){return Oi.startNull(t),Oi.endNull(t)}visitInt(e,t){return mt.startInt(t),mt.addBitWidth(t,e.bitWidth),mt.addIsSigned(t,e.isSigned),mt.endInt(t)}visitFloat(e,t){return br.startFloatingPoint(t),br.addPrecision(t,e.precision),br.endFloatingPoint(t)}visitBinary(e,t){return Bi.startBinary(t),Bi.endBinary(t)}visitLargeBinary(e,t){return Gi.startLargeBinary(t),Gi.endLargeBinary(t)}visitBool(e,t){return Ri.startBool(t),Ri.endBool(t)}visitUtf8(e,t){return Ni.startUtf8(t),Ni.endUtf8(t)}visitLargeUtf8(e,t){return Ui.startLargeUtf8(t),Ui.endLargeUtf8(t)}visitDecimal(e,t){return Pt.startDecimal(t),Pt.addScale(t,e.scale),Pt.addPrecision(t,e.precision),Pt.addBitWidth(t,e.bitWidth),Pt.endDecimal(t)}visitDate(e,t){return hr.startDate(t),hr.addUnit(t,e.unit),hr.endDate(t)}visitTime(e,t){return Ht.startTime(t),Ht.addUnit(t,e.unit),Ht.addBitWidth(t,e.bitWidth),Ht.endTime(t)}visitTimestamp(e,t){let r=e.timezone&&t.createString(e.timezone)||void 0;return Nt.startTimestamp(t),Nt.addUnit(t,e.unit),r!==void 0&&Nt.addTimezone(t,r),Nt.endTimestamp(t)}visitInterval(e,t){return Sr.startInterval(t),Sr.addUnit(t,e.unit),Sr.endInterval(t)}visitDuration(e,t){return gr.startDuration(t),gr.addUnit(t,e.unit),gr.endDuration(t)}visitList(e,t){return ji.startList(t),ji.endList(t)}visitStruct(e,t){return Hi.startStruct_(t),Hi.endStruct_(t)}visitUnion(e,t){ht.startTypeIdsVector(t,e.typeIds.length);let r=ht.createTypeIdsVector(t,e.typeIds);return ht.startUnion(t),ht.addMode(t,e.mode),ht.addTypeIds(t,r),ht.endUnion(t)}visitDictionary(e,t){let r=this.visit(e.indices,t);return Mt.startDictionaryEncoding(t),Mt.addId(t,BigInt(e.id)),Mt.addIsOrdered(t,e.isOrdered),r!==void 0&&Mt.addIndexType(t,r),Mt.endDictionaryEncoding(t)}visitFixedSizeBinary(e,t){return vr.startFixedSizeBinary(t),vr.addByteWidth(t,e.byteWidth),vr.endFixedSizeBinary(t)}visitFixedSizeList(e,t){return yr.startFixedSizeList(t),yr.addListSize(t,e.listSize),yr.endFixedSizeList(t)}visitMap(e,t){return wr.startMap(t),wr.addKeysSorted(t,e.keysSorted),wr.endMap(t)}},Ys=new ao;function cl(c,e=new Map){return new de(I_(c,e),Js(c.metadata),e)}function oo(c){return new Ge(c.count,ul(c.columns),_l(c.columns))}function ll(c){return new qe(oo(c.data),c.id,c.isDelta)}function I_(c,e){return(c.fields||[]).filter(Boolean).map(t=>ie.fromJSON(t,e))}function sl(c,e){return(c.children||[]).filter(Boolean).map(t=>ie.fromJSON(t,e))}function ul(c){return(c||[]).reduce((e,t)=>[...e,new ct(t.count,B_(t.VALIDITY)),...ul(t.children)],[])}function _l(c,e=[]){for(let t=-1,r=(c||[]).length;++te+ +(t===0),0)}function dl(c,e){let t,r,n,a,o,l;return!e||!(a=c.dictionary)?(o=ol(c,sl(c,e)),n=new ie(c.name,o,c.nullable,Js(c.metadata))):e.has(t=a.id)?(r=(r=a.indexType)?al(r):new It,l=new Ze(e.get(t),r,t,a.isOrdered),n=new ie(c.name,l,c.nullable,Js(c.metadata))):(r=(r=a.indexType)?al(r):new It,e.set(t,o=ol(c,sl(c,e))),l=new Ze(o,r,t,a.isOrdered),n=new ie(c.name,l,c.nullable,Js(c.metadata))),n||null}function Js(c=[]){return new Map(c.map(({key:e,value:t})=>[e,t]))}function al(c){return new Pe(c.isSigned,c.bitWidth)}function ol(c,e){let t=c.type.name;switch(t){case"NONE":return new He;case"null":return new He;case"binary":return new Wt;case"largebinary":return new Vt;case"utf8":return new zt;case"largeutf8":return new $t;case"bool":return new qt;case"list":return new yt((e||[])[0]);case"struct":return new ve(e||[]);case"struct_":return new ve(e||[])}switch(t){case"int":{let r=c.type;return new Pe(r.isSigned,r.bitWidth)}case"floatingpoint":{let r=c.type;return new st(pe[r.precision])}case"decimal":{let r=c.type;return new Xt(r.scale,r.precision,r.bitWidth)}case"date":{let r=c.type;return new Qt(Ae[r.unit])}case"time":{let r=c.type;return new Yt(G[r.unit],r.bitWidth)}case"timestamp":{let r=c.type;return new Jt(G[r.unit],r.timezone)}case"interval":{let r=c.type;return new Kt(Ce[r.unit])}case"duration":{let r=c.type;return new Zt(G[r.unit])}case"union":{let r=c.type,[n,...a]=(r.mode+"").toLowerCase(),o=n.toUpperCase()+a.join("");return new bt(he[o],r.typeIds||[],e||[])}case"fixedsizebinary":{let r=c.type;return new er(r.byteWidth)}case"fixedsizelist":{let r=c.type;return new St(r.listSize,(e||[])[0])}case"map":{let r=c.type;return new wt((e||[])[0],r.keysSorted)}}throw new Error('Unrecognized type: "'.concat(t,'"'))}var R_=Ir,G_=Je,Xe=class c{static fromJSON(e,t){let r=new c(0,ue.V5,t);return r._createHeader=U_(e,t),r}static decode(e){e=new G_(z(e));let t=At.getRootAsMessage(e),r=t.bodyLength(),n=t.version(),a=t.headerType(),o=new c(r,n,a);return o._createHeader=j_(t,a),o}static encode(e){let t=new R_,r=-1;return e.isSchema()?r=de.encode(t,e.header()):e.isRecordBatch()?r=Ge.encode(t,e.header()):e.isDictionaryBatch()&&(r=qe.encode(t,e.header())),At.startMessage(t),At.addVersion(t,ue.V5),At.addHeader(t,r),At.addHeaderType(t,e.headerType),At.addBodyLength(t,BigInt(e.bodyLength)),At.finishMessageBuffer(t,At.endMessage(t)),t.asUint8Array()}static from(e,t=0){if(e instanceof de)return new c(0,ue.V5,ne.Schema,e);if(e instanceof Ge)return new c(t,ue.V5,ne.RecordBatch,e);if(e instanceof qe)return new c(t,ue.V5,ne.DictionaryBatch,e);throw new Error("Unrecognized Message header: ".concat(e))}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get bodyLength(){return this._bodyLength}header(){return this._createHeader()}isSchema(){return this.headerType===ne.Schema}isRecordBatch(){return this.headerType===ne.RecordBatch}isDictionaryBatch(){return this.headerType===ne.DictionaryBatch}constructor(e,t,r,n){this._version=t,this._headerType=r,this.body=new Uint8Array(0),n&&(this._createHeader=()=>n),this._bodyLength=ae(e)}},Ge=class{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}constructor(e,t,r){this._nodes=t,this._buffers=r,this._length=ae(e)}},qe=class{get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}constructor(e,t,r=!1){this._data=e,this._isDelta=r,this._id=ae(t)}},$e=class{constructor(e,t){this.offset=ae(e),this.length=ae(t)}},ct=class{constructor(e,t){this.length=ae(e),this.nullCount=ae(t)}};function U_(c,e){return()=>{switch(e){case ne.Schema:return de.fromJSON(c);case ne.RecordBatch:return Ge.fromJSON(c);case ne.DictionaryBatch:return qe.fromJSON(c)}throw new Error("Unrecognized Message type: { name: ".concat(ne[e],", type: ").concat(e," }"))}}function j_(c,e){return()=>{switch(e){case ne.Schema:return de.decode(c.header(new Ve),new Map,c.version());case ne.RecordBatch:return Ge.decode(c.header(new Ke),c.version());case ne.DictionaryBatch:return qe.decode(c.header(new Ot),c.version())}throw new Error("Unrecognized Message type: { name: ".concat(ne[e],", type: ").concat(e," }"))}}ie.encode=Y_;ie.decode=X_;ie.fromJSON=dl;de.encode=Q_;de.decode=O_;de.fromJSON=cl;Ge.encode=J_;Ge.decode=H_;Ge.fromJSON=oo;qe.encode=K_;qe.decode=N_;qe.fromJSON=ll;ct.encode=Z_;ct.decode=V_;$e.encode=ed;$e.decode=W_;function O_(c,e=new Map,t=ue.V5){let r=q_(c,e);return new de(r,Ks(c),e,t)}function H_(c,e=ue.V5){if(c.compression()!==null)throw new Error("Record batch compression not implemented");return new Ge(c.length(),z_(c),$_(c,e))}function N_(c,e=ue.V5){return new qe(Ge.decode(c.data(),e),c.id(),c.isDelta())}function W_(c){return new $e(c.offset(),c.length())}function V_(c){return new ct(c.length(),c.nullCount())}function z_(c){let e=[];for(let t,r=-1,n=-1,a=c.nodesLength();++rie.encode(c,a));Ve.startFieldsVector(c,t.length);let r=Ve.createFieldsVector(c,t),n=e.metadata&&e.metadata.size>0?Ve.createCustomMetadataVector(c,[...e.metadata].map(([a,o])=>{let l=c.createString("".concat(a)),u=c.createString("".concat(o));return Me.startKeyValue(c),Me.addKey(c,l),Me.addValue(c,u),Me.endKeyValue(c)})):-1;return Ve.startSchema(c),Ve.addFields(c,r),Ve.addEndianness(c,td?mr.Little:mr.Big),n!==-1&&Ve.addCustomMetadata(c,n),Ve.endSchema(c)}function Y_(c,e){let t=-1,r=-1,n=-1,a=e.type,o=e.typeId;R.isDictionary(a)?(o=a.dictionary.typeId,n=Ys.visit(a,c),r=Ys.visit(a.dictionary,c)):r=Ys.visit(a,c);let l=(a.children||[]).map(d=>ie.encode(c,d)),u=je.createChildrenVector(c,l),_=e.metadata&&e.metadata.size>0?je.createCustomMetadataVector(c,[...e.metadata].map(([d,f])=>{let p=c.createString("".concat(d)),m=c.createString("".concat(f));return Me.startKeyValue(c),Me.addKey(c,p),Me.addValue(c,m),Me.endKeyValue(c)})):-1;return e.name&&(t=c.createString(e.name)),je.startField(c),je.addType(c,r),je.addTypeType(c,o),je.addChildren(c,u),je.addNullable(c,!!e.nullable),t!==-1&&je.addName(c,t),n!==-1&&je.addDictionary(c,n),_!==-1&&je.addCustomMetadata(c,_),je.endField(c)}function J_(c,e){let t=e.nodes||[],r=e.buffers||[];Ke.startNodesVector(c,t.length);for(let o of t.slice().reverse())ct.encode(c,o);let n=c.endVector();Ke.startBuffersVector(c,r.length);for(let o of r.slice().reverse())$e.encode(c,o);let a=c.endVector();return Ke.startRecordBatch(c),Ke.addLength(c,BigInt(e.length)),Ke.addNodes(c,n),Ke.addBuffers(c,a),Ke.endRecordBatch(c)}function K_(c,e){let t=Ge.encode(c,e.data);return Ot.startDictionaryBatch(c),Ot.addId(c,BigInt(e.id)),Ot.addIsDelta(c,e.isDelta),Ot.addData(c,t),Ot.endDictionaryBatch(c)}function Z_(c,e){return ii.createFieldNode(c,BigInt(e.length),BigInt(e.nullCount))}function ed(c,e){return ri.createBuffer(c,BigInt(e.offset),BigInt(e.length))}var td=(()=>{let c=new ArrayBuffer(2);return new DataView(c).setInt16(0,256,!0),new Int16Array(c)[0]===256})();var lo=c=>"Expected ".concat(ne[c]," Message in stream, but was null or length 0."),uo=c=>"Header pointer of flatbuffer-encoded ".concat(ne[c]," Message is null or length 0."),hl=(c,e)=>"Expected to read ".concat(c," metadata bytes, but only read ").concat(e,"."),gl=(c,e)=>"Expected to read ".concat(c," bytes for message body, but only read ").concat(e,"."),Si=class{constructor(e){this.source=e instanceof Gt?e:new Gt(e)}[Symbol.iterator](){return this}next(){let e;return(e=this.readMetadataLength()).done?ye:e.value===-1&&(e=this.readMetadataLength()).done?ye:(e=this.readMetadata(e.value)).done?ye:e}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}readMessage(e){let t;if((t=this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(lo(e));return t.value}readMessageBody(e){if(e<=0)return new Uint8Array(0);let t=z(this.source.read(e));if(t.byteLength[...n,...a.VALIDITY&&[a.VALIDITY]||[],...a.TYPE_ID&&[a.TYPE_ID]||[],...a.OFFSET&&[a.OFFSET]||[],...a.DATA&&[a.DATA]||[],...t(a.children)],[])}}readMessage(e){let t;if((t=this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(lo(e));return t.value}readSchema(){let e=ne.Schema,t=this.readMessage(e),r=t==null?void 0:t.header();if(!t||!r)throw new Error(uo(e));return r}},Zs=4,co="ARROW1",wi=new Uint8Array(co.length);for(let c=0;cthis):this}readRecordBatch(e){return this._impl.isFile()?this._impl.readRecordBatch(e):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return Be.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return Be.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e,t){throw new Error('"throughDOM" not available in this environment')}static from(e){return e instanceof c?e:Fn(e)?id(e):Cn(e)?ad(e):_t(e)?B(this,void 0,void 0,function*(){return yield c.from(yield e)}):Mn(e)||Fi(e)||In(e)||rt(e)?sd(new at(e)):nd(new Gt(e))}static readAll(e){return e instanceof c?e.isSync()?yl(e):bl(e):Fn(e)||ArrayBuffer.isView(e)||dt(e)||xn(e)?yl(e):bl(e)}},jt=class extends Ue{constructor(e){super(e),this._impl=e}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return Qe(this,arguments,function*(){yield ee(yield*Mr(ei(ut(this[Symbol.iterator]()))))})}},Tr=class extends Ue{constructor(e){super(e),this._impl=e}readAll(){return B(this,void 0,void 0,function*(){var e,t,r,n;let a=new Array;try{for(var o=!0,l=ut(this),u;u=yield l.next(),e=u.done,!e;o=!0){n=u.value,o=!1;let _=n;a.push(_)}}catch(_){t={error:_}}finally{try{!o&&!e&&(r=l.return)&&(yield r.call(l))}finally{if(t)throw t.error}}return a})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}},Fr=class extends jt{constructor(e){super(e),this._impl=e}},kn=class extends Tr{constructor(e){super(e),this._impl=e}},ta=class{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(e=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=e}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(e){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=e,this.dictionaries=new Map,this}_loadRecordBatch(e,t){let r=this._loadVectors(e,t,this.schema.fields),n=J({type:new ve(this.schema.fields),length:e.length,children:r});return new De(this.schema,n)}_loadDictionaryBatch(e,t){let{id:r,isDelta:n}=e,{dictionaries:a,schema:o}=this,l=a.get(r),u=o.dictionaries.get(r),_=this._loadVectors(e.data,t,[u]);return(l&&n?l.concat(new se(_)):new se(_)).memoize()}_loadVectors(e,t,r){return new en(t,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(r)}},Li=class extends ta{constructor(e,t){super(t),this._reader=Fn(e)?new Dn(this._handle=e):new Si(this._handle=e)}isSync(){return!0}isStream(){return!0}[Symbol.iterator](){return this}cancel(){!this.closed&&(this.closed=!0)&&(this.reset()._reader.return(),this._reader=null,this.dictionaries=null)}open(e){return this.closed||(this.autoDestroy=Sl(this,e),this.schema||(this.schema=this._reader.readSchema())||this.cancel()),this}throw(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(e):ye}return(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(e):ye}next(){if(this.closed)return ye;let e,{_reader:t}=this;for(;e=this._readNextMessageAndValidate();)if(e.isSchema())this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let r=e.header(),n=t.readMessageBody(e.bodyLength);return{done:!1,value:this._loadRecordBatch(r,n)}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let r=e.header(),n=t.readMessageBody(e.bodyLength),a=this._loadDictionaryBatch(r,n);this.dictionaries.set(r.id,a)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Xr(this.schema)}):this.return()}_readNextMessageAndValidate(e){return this._reader.readMessage(e)}},Ai=class extends ta{constructor(e,t){super(t),this._reader=new An(this._handle=e)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return B(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(e){return B(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=Sl(this,e),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(e){return B(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(e):ye})}return(e){return B(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(e):ye})}next(){return B(this,void 0,void 0,function*(){if(this.closed)return ye;let e,{_reader:t}=this;for(;e=yield this._readNextMessageAndValidate();)if(e.isSchema())yield this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let r=e.header(),n=yield t.readMessageBody(e.bodyLength);return{done:!1,value:this._loadRecordBatch(r,n)}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let r=e.header(),n=yield t.readMessageBody(e.bodyLength),a=this._loadDictionaryBatch(r,n);this.dictionaries.set(r.id,a)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Xr(this.schema)}):yield this.return()})}_readNextMessageAndValidate(e){return B(this,void 0,void 0,function*(){return yield this._reader.readMessage(e)})}},ra=class extends Li{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(e,t){super(e instanceof Ji?e:new Ji(e),t)}isSync(){return!0}isFile(){return!0}open(e){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(let t of this._footer.dictionaryBatches())t&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(e)}readRecordBatch(e){var t;if(this.closed)return null;this._footer||this.open();let r=(t=this._footer)===null||t===void 0?void 0:t.getRecordBatch(e);if(r&&this._handle.seek(r.offset)){let n=this._reader.readMessage(ne.RecordBatch);if(n!=null&&n.isRecordBatch()){let a=n.header(),o=this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(a,o)}}return null}_readDictionaryBatch(e){var t;let r=(t=this._footer)===null||t===void 0?void 0:t.getDictionaryBatch(e);if(r&&this._handle.seek(r.offset)){let n=this._reader.readMessage(ne.DictionaryBatch);if(n!=null&&n.isDictionaryBatch()){let a=n.header(),o=this._reader.readMessageBody(n.bodyLength),l=this._loadDictionaryBatch(a,o);this.dictionaries.set(a.id,l)}}}_readFooter(){let{_handle:e}=this,t=e.size-_o,r=e.readInt32(t),n=e.readAt(t-r,r);return ir.decode(n)}_readNextMessageAndValidate(e){var t;if(this._footer||this.open(),this._footer&&this._recordBatchIndexsuper.open}});return B(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(let r of this._footer.dictionaryBatches())r&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield t.open.call(this,e)})}readRecordBatch(e){return B(this,void 0,void 0,function*(){var t;if(this.closed)return null;this._footer||(yield this.open());let r=(t=this._footer)===null||t===void 0?void 0:t.getRecordBatch(e);if(r&&(yield this._handle.seek(r.offset))){let n=yield this._reader.readMessage(ne.RecordBatch);if(n!=null&&n.isRecordBatch()){let a=n.header(),o=yield this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(a,o)}}return null})}_readDictionaryBatch(e){return B(this,void 0,void 0,function*(){var t;let r=(t=this._footer)===null||t===void 0?void 0:t.getDictionaryBatch(e);if(r&&(yield this._handle.seek(r.offset))){let n=yield this._reader.readMessage(ne.DictionaryBatch);if(n!=null&&n.isDictionaryBatch()){let a=n.header(),o=yield this._reader.readMessageBody(n.bodyLength),l=this._loadDictionaryBatch(a,o);this.dictionaries.set(a.id,l)}}})}_readFooter(){return B(this,void 0,void 0,function*(){let{_handle:e}=this;e._pending&&(yield e._pending);let t=e.size-_o,r=yield e.readInt32(t),n=yield e.readAt(t-r,r);return ir.decode(n)})}_readNextMessageAndValidate(e){return B(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex=4?ea(e)?new Fr(new ra(c.read())):new jt(new Li(c)):new jt(new Li(function*(){}()))}function sd(c){return B(this,void 0,void 0,function*(){let e=yield c.peek(Ei+7&-8);return e&&e.byteLength>=4?ea(e)?new Fr(new ra(yield c.read())):new Tr(new Ai(c)):new Tr(new Ai(function(){return Qe(this,arguments,function*(){})}()))})}function ad(c){return B(this,void 0,void 0,function*(){let{size:e}=yield c.stat(),t=new kr(c,e);return e>=vl&&ea(yield t.readAt(0,Ei+7&-8))?new kn(new fo(t)):new Tr(new Ai(t))})}var Ee=class c extends j{static assemble(...e){let t=n=>n.flatMap(a=>Array.isArray(a)?t(a):a instanceof De?a.data.children:a.data),r=new c;return r.visitMany(t(e)),r}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}visit(e){if(e instanceof se)return this.visitMany(e.data),this;let{type:t}=e;if(!R.isDictionary(t)){let{length:r}=e;if(r>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(R.isUnion(t))this.nodes.push(new ct(r,0));else{let{nullCount:n}=e;R.isNull(t)||Dt.call(this,n<=0?new Uint8Array(0):Gr(e.offset,r,e.nullBitmap)),this.nodes.push(new ct(r,n))}}return super.visit(e)}visitNull(e){return this}visitDictionary(e){return this.visit(e.clone(e.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}};function Dt(c){let e=c.byteLength+7&-8;return this.buffers.push(c),this.bufferRegions.push(new $e(this._byteLength,e)),this._byteLength+=e,this}function od(c){var e;let{type:t,length:r,typeIds:n,valueOffsets:a}=c;if(Dt.call(this,n),t.mode===he.Sparse)return mo.call(this,c);if(t.mode===he.Dense){if(c.offset<=0)return Dt.call(this,a),mo.call(this,c);{let o=new Int32Array(r),l=Object.create(null),u=Object.create(null);for(let _,d,f=-1;++f{let f=t.typeIds[d],p=l[f],m=u[f];return _.slice(p,Math.min(r,m))}))}}return this}function cd(c){let e;return c.nullCount>=c.length?Dt.call(this,new Uint8Array(0)):(e=c.values)instanceof Uint8Array?Dt.call(this,Gr(c.offset,c.length,e)):Dt.call(this,Ur(c.values))}function _r(c){return Dt.call(this,c.values.subarray(0,c.length*c.stride))}function ia(c){let{length:e,values:t,valueOffsets:r}=c,n=ae(r[0]),a=ae(r[e]),o=Math.min(a-n,t.byteLength-n);return Dt.call(this,Rn(-n,e+1,r)),Dt.call(this,t.subarray(n,n+o)),this}function ho(c){let{length:e,valueOffsets:t}=c;if(t){let{[0]:r,[e]:n}=t;return Dt.call(this,Rn(-r,e+1,t)),this.visit(c.children[0].slice(r,n-r))}return this.visit(c.children[0])}function mo(c){return this.visitMany(c.type.children.map((e,t)=>c.children[t]).filter(Boolean))[0]}Ee.prototype.visitBool=cd;Ee.prototype.visitInt=_r;Ee.prototype.visitFloat=_r;Ee.prototype.visitUtf8=ia;Ee.prototype.visitLargeUtf8=ia;Ee.prototype.visitBinary=ia;Ee.prototype.visitLargeBinary=ia;Ee.prototype.visitFixedSizeBinary=_r;Ee.prototype.visitDate=_r;Ee.prototype.visitTimestamp=_r;Ee.prototype.visitTime=_r;Ee.prototype.visitDecimal=_r;Ee.prototype.visitList=ho;Ee.prototype.visitStruct=mo;Ee.prototype.visitUnion=od;Ee.prototype.visitInterval=_r;Ee.prototype.visitDuration=_r;Ee.prototype.visitFixedSizeList=ho;Ee.prototype.visitMap=ho;var Qr=class extends Hr{static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e,t){throw new Error('"throughDOM" not available in this environment')}constructor(e){super(),this._position=0,this._started=!1,this._sink=new Rt,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,Oe(e)||(e={autoDestroy:!0,writeLegacyIpcFormat:!1}),this._autoDestroy=typeof e.autoDestroy=="boolean"?e.autoDestroy:!0,this._writeLegacyIpcFormat=typeof e.writeLegacyIpcFormat=="boolean"?e.writeLegacyIpcFormat:!1}toString(e=!1){return this._sink.toString(e)}toUint8Array(e=!1){return this._sink.toUint8Array(e)}writeAll(e){return _t(e)?e.then(t=>this.writeAll(t)):rt(e)?vo(this,e):go(this,e)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(e){return this._sink.toDOMStream(e)}toNodeStream(e){return this._sink.toNodeStream(e)}close(){return this.reset()._sink.close()}abort(e){return this.reset()._sink.abort(e)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(e=this._sink,t=null){return e===this._sink||e instanceof Rt?this._sink=e:(this._sink=new Rt,e&&Go(e)?this.toDOMStream({type:"bytes"}).pipeTo(e):e&&Uo(e)&&this.toNodeStream({objectMode:!1}).pipe(e)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,(!t||!qr(t,this._schema))&&(t==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=t,this._writeSchema(t))),this}write(e){let t=null;if(this._sink){if(e==null)return this.finish()&&void 0;if(e instanceof We&&!(t=e.schema))return this.finish()&&void 0;if(e instanceof De&&!(t=e.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(t&&!qr(t,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,t)}e instanceof De?e instanceof Xr||this._writeRecordBatch(e):e instanceof We?this.writeAll(e.batches):dt(e)&&this.writeAll(e)}_writeMessage(e,t=8){let r=t-1,n=Xe.encode(e),a=n.byteLength,o=this._writeLegacyIpcFormat?4:8,l=a+o+r&~r,u=l-a-o;return e.headerType===ne.RecordBatch?this._recordBatchBlocks.push(new nr(l,e.bodyLength,this._position)):e.headerType===ne.DictionaryBatch&&this._dictionaryBlocks.push(new nr(l,e.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(l-o)),a>0&&this._write(n),this._writePadding(u)}_write(e){if(this._started){let t=z(e);t&&t.byteLength>0&&(this._sink.write(t),this._position+=t.byteLength)}return this}_writeSchema(e){return this._writeMessage(Xe.from(e))}_writeFooter(e){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(wi)}_writePadding(e){return e>0?this._write(new Uint8Array(e)):this}_writeRecordBatch(e){let{byteLength:t,nodes:r,bufferRegions:n,buffers:a}=Ee.assemble(e),o=new Ge(e.numRows,r,n),l=Xe.from(o,t);return this._writeDictionaries(e)._writeMessage(l)._writeBodyBuffers(a)}_writeDictionaryBatch(e,t,r=!1){let{byteLength:n,nodes:a,bufferRegions:o,buffers:l}=Ee.assemble(new se([e])),u=new Ge(e.length,a,o),_=new qe(u,t,r),d=Xe.from(_,n);return this._writeMessage(d)._writeBodyBuffers(l)}_writeBodyBuffers(e){let t,r,n;for(let a=-1,o=e.length;++a0&&(this._write(t),(n=(r+7&-8)-r)>0&&this._writePadding(n));return this}_writeDictionaries(e){var t,r;for(let[n,a]of e.dictionaries){let o=(t=a==null?void 0:a.data)!==null&&t!==void 0?t:[],l=this._seenDictionaries.get(n),u=(r=this._dictionaryDeltaOffsets.get(n))!==null&&r!==void 0?r:0;if(!l||l.data[0]!==o[0])for(let[_,d]of o.entries())this._writeDictionaryBatch(d,n,_>0);else if(ur.writeAll(n)):rt(e)?vo(r,e):go(r,e)}},Jr=class c extends Qr{static writeAll(e){let t=new c;return _t(e)?e.then(r=>t.writeAll(r)):rt(e)?vo(t,e):go(t,e)}constructor(){super(),this._autoDestroy=!0}_writeSchema(e){return this._writeMagic()._writePadding(2)}_writeDictionaryBatch(e,t,r=!1){if(!r&&this._seenDictionaries.has(t))throw new Error("The Arrow File format does not support replacement dictionaries. ");return super._writeDictionaryBatch(e,t,r)}_writeFooter(e){let t=ir.encode(new ir(e,ue.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(e)._write(t)._write(Int32Array.of(t.byteLength))._writeMagic()}};function go(c,e){let t=e;e instanceof We&&(t=e.batches,c.reset(void 0,e.schema));for(let r of t)c.write(r);return c.finish()}function vo(c,e){return B(this,void 0,void 0,function*(){var t,r,n,a,o,l,u;try{for(t=!0,r=ut(e);n=yield r.next(),a=n.done,!a;t=!0){u=n.value,t=!1;let _=u;c.write(_)}}catch(_){o={error:_}}finally{try{!t&&!a&&(l=r.return)&&(yield l.call(r))}finally{if(o)throw o.error}}return c.finish()})}function wl(c,e){if(rt(c))return ud(c,e);if(dt(c))return ld(c,e);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function ld(c,e){let t=null,r=(e==null?void 0:e.type)==="bytes"||!1,n=(e==null?void 0:e.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},e),{start(o){a(o,t||(t=c[Symbol.iterator]()))},pull(o){t?a(o,t):o.close()},cancel(){(t!=null&&t.return&&t.return()||!0)&&(t=null)}}),Object.assign({highWaterMark:r?n:void 0},e));function a(o,l){let u,_=null,d=o.desiredSize||null;for(;!(_=l.next(r?d:null)).done;)if(ArrayBuffer.isView(_.value)&&(u=z(_.value))&&(d!=null&&r&&(d=d-u.byteLength+1),_.value=u),o.enqueue(_.value),d!=null&&--d<=0)return;o.close()}}function ud(c,e){let t=null,r=(e==null?void 0:e.type)==="bytes"||!1,n=(e==null?void 0:e.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},e),{start(o){return B(this,void 0,void 0,function*(){yield a(o,t||(t=c[Symbol.asyncIterator]()))})},pull(o){return B(this,void 0,void 0,function*(){t?yield a(o,t):o.close()})},cancel(){return B(this,void 0,void 0,function*(){(t!=null&&t.return&&(yield t.return())||!0)&&(t=null)})}}),Object.assign({highWaterMark:r?n:void 0},e));function a(o,l){return B(this,void 0,void 0,function*(){let u,_=null,d=o.desiredSize||null;for(;!(_=yield l.next(r?d:null)).done;)if(ArrayBuffer.isView(_.value)&&(u=z(_.value))&&(d!=null&&r&&(d=d-u.byteLength+1),_.value=u),o.enqueue(_.value),d!=null&&--d<=0)return;o.close()})}}function Al(c){return new yo(c)}var yo=class{constructor(e){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:t,["writableStrategy"]:r,["queueingStrategy"]:n="count"}=e,a=Bo(e,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=Wr(a),this._getSize=n!=="bytes"?El:Ll;let{["highWaterMark"]:o=n==="bytes"?Math.pow(2,14):1e3}=Object.assign({},t),{["highWaterMark"]:l=n==="bytes"?Math.pow(2,14):1e3}=Object.assign({},r);this.readable=new ReadableStream({cancel:()=>{this._builder.clear()},pull:u=>{this._maybeFlush(this._builder,this._controller=u)},start:u=>{this._maybeFlush(this._builder,this._controller=u)}},{highWaterMark:o,size:n!=="bytes"?El:Ll}),this.writable=new WritableStream({abort:()=>{this._builder.clear()},write:()=>{this._maybeFlush(this._builder,this._controller)},close:()=>{this._maybeFlush(this._builder.finish(),this._controller)}},{highWaterMark:l,size:u=>this._writeValueAndReturnChunkSize(u)})}_writeValueAndReturnChunkSize(e){let t=this._bufferedSize;return this._bufferedSize=this._getSize(this._builder.append(e)),this._bufferedSize-t}_maybeFlush(e,t){t!=null&&(this._bufferedSize>=t.desiredSize&&++this._numChunks&&this._enqueue(t,e.toVector()),e.finished&&((e.length>0||this._numChunks===0)&&++this._numChunks&&this._enqueue(t,e.toVector()),!this._finished&&(this._finished=!0)&&this._enqueue(t,null)))}_enqueue(e,t){this._bufferedSize=0,this._controller=null,t==null?e.close():e.enqueue(t)}},El=c=>{var e;return(e=c==null?void 0:c.length)!==null&&e!==void 0?e:0},Ll=c=>{var e;return(e=c==null?void 0:c.byteLength)!==null&&e!==void 0?e:0};function na(c,e){let t=new Rt,r=null,n=new ReadableStream({cancel(){return B(this,void 0,void 0,function*(){yield t.close()})},start(l){return B(this,void 0,void 0,function*(){yield o(l,r||(r=yield a()))})},pull(l){return B(this,void 0,void 0,function*(){r?yield o(l,r):l.close()})}});return{writable:new WritableStream(t,Object.assign({highWaterMark:Math.pow(2,14)},c)),readable:n};function a(){return B(this,void 0,void 0,function*(){return yield(yield Ue.from(t)).open(e)})}function o(l,u){return B(this,void 0,void 0,function*(){let _=l.desiredSize,d=null;for(;!(d=yield u.next()).done;)if(l.enqueue(d.value),_!=null&&--_<=0)return;l.close()})}}function sa(c,e){let t=new this(c),r=new at(t),n=new ReadableStream({cancel(){return B(this,void 0,void 0,function*(){yield r.cancel()})},pull(o){return B(this,void 0,void 0,function*(){yield a(o)})},start(o){return B(this,void 0,void 0,function*(){yield a(o)})}},Object.assign({highWaterMark:Math.pow(2,14)},e));return{writable:new WritableStream(t,c),readable:n};function a(o){return B(this,void 0,void 0,function*(){let l=null,u=o.desiredSize;for(;l=yield r.read(u||null);)if(o.enqueue(l),u!=null&&(u-=l.byteLength)<=0)return;o.close()})}}function aa(c,e="stream"){return(e==="stream"?Yr:Jr).writeAll(c).toUint8Array(!0)}var pd=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},xa),to),$a),Ca),Ea),za),Da),{compareSchemas:qr,compareFields:Zc,compareTypes:el});Be.toDOMStream=wl;Se.throughDOM=Al;Ue.throughDOM=na;Fr.throughDOM=na;jt.throughDOM=na;Qr.throughDOM=sa;Jr.throughDOM=sa;Yr.throughDOM=sa;function Di(c){switch(c.typeId){case y.Binary:return{sqlType:"binary"};case y.Bool:return{sqlType:"bool"};case y.Date:return{sqlType:"date"};case y.DateDay:return{sqlType:"date32[d]"};case y.DateMillisecond:return{sqlType:"date64[ms]"};case y.Decimal:{let e=c;return{sqlType:"decimal",precision:e.precision,scale:e.scale}}case y.Float:return{sqlType:"float"};case y.Float16:return{sqlType:"float16"};case y.Float32:return{sqlType:"float32"};case y.Float64:return{sqlType:"float64"};case y.Int:return{sqlType:"int32"};case y.Int16:return{sqlType:"int16"};case y.Int32:return{sqlType:"int32"};case y.Int64:return{sqlType:"int64"};case y.Uint16:return{sqlType:"uint16"};case y.Uint32:return{sqlType:"uint32"};case y.Uint64:return{sqlType:"uint64"};case y.Uint8:return{sqlType:"uint8"};case y.IntervalDayTime:return{sqlType:"interval[dt]"};case y.IntervalYearMonth:return{sqlType:"interval[m]"};case y.List:return{sqlType:"list",valueType:Di(c.valueType)};case y.FixedSizeBinary:return{sqlType:"fixedsizebinary",byteWidth:c.byteWidth};case y.Null:return{sqlType:"null"};case y.Utf8:return{sqlType:"utf8"};case y.Struct:return{sqlType:"struct",fields:c.children.map(t=>oa(t.name,t.type))};case y.Map:{let e=c;return{sqlType:"map",keyType:Di(e.keyType),valueType:Di(e.valueType)}}case y.Time:return{sqlType:"time[s]"};case y.TimeMicrosecond:return{sqlType:"time[us]"};case y.TimeMillisecond:return{sqlType:"time[ms]"};case y.TimeNanosecond:return{sqlType:"time[ns]"};case y.TimeSecond:return{sqlType:"time[s]"};case y.Timestamp:return{sqlType:"timestamp",timezone:c.timezone||void 0};case y.TimestampSecond:return{sqlType:"timestamp[s]",timezone:c.timezone||void 0};case y.TimestampMicrosecond:return{sqlType:"timestamp[us]",timezone:c.timezone||void 0};case y.TimestampNanosecond:return{sqlType:"timestamp[ns]",timezone:c.timezone||void 0};case y.TimestampMillisecond:return{sqlType:"timestamp[ms]",timezone:c.timezone||void 0}}throw new Error("unsupported arrow type: ".concat(c.toString()))}function oa(c,e){let t=Di(e);return t.name=c,t}var ca=class{constructor(){this._bindings=null;this._nextMessageId=0}log(e){this.postMessage({messageId:this._nextMessageId++,requestId:0,type:"LOG",data:e},[])}sendOK(e){this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"OK",data:null},[])}failWith(e,t){let r={name:t.name,message:t.message,stack:t.stack||void 0};this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"ERROR",data:r},[])}async onMessage(e){switch(e.type){case"PING":this.sendOK(e);return;case"INSTANTIATE":this._bindings!=null&&this.failWith(e,new Error("duckdb already initialized"));try{this._bindings=await this.instantiate(e.data[0],e.data[1],t=>{this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"INSTANTIATE_PROGRESS",data:t},[])}),this.sendOK(e)}catch(t){console.log(t),this._bindings=null,this.failWith(e,t)}return;default:break}if(!this._bindings)return this.failWith(e,new Error("duckdb is not initialized"));try{switch(e.type){case"GET_VERSION":this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"VERSION_STRING",data:this._bindings.getVersion()},[]);break;case"GET_FEATURE_FLAGS":this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"FEATURE_FLAGS",data:this._bindings.getFeatureFlags()},[]);break;case"RESET":this._bindings.reset(),this.sendOK(e);break;case"OPEN":this._bindings.open(e.data),this.sendOK(e);break;case"DROP_FILE":this._bindings.dropFile(e.data),this.sendOK(e);break;case"DROP_FILES":this._bindings.dropFiles(),this.sendOK(e);break;case"FLUSH_FILES":this._bindings.flushFiles(),this.sendOK(e);break;case"CONNECT":{let t=this._bindings.connect();this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"CONNECTION_INFO",data:t.useUnsafe((r,n)=>n)},[]);break}case"DISCONNECT":this._bindings.disconnect(e.data),this.sendOK(e);break;case"CREATE_PREPARED":{let t=this._bindings.createPrepared(e.data[0],e.data[1]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"PREPARED_STATEMENT_ID",data:t},[]);break}case"CLOSE_PREPARED":{this._bindings.closePrepared(e.data[0],e.data[1]),this.sendOK(e);break}case"RUN_PREPARED":{let t=this._bindings.runPrepared(e.data[0],e.data[1],e.data[2]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"QUERY_RESULT",data:t},[t.buffer]);break}case"RUN_QUERY":{let t=this._bindings.runQuery(e.data[0],e.data[1]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"QUERY_RESULT",data:t},[t.buffer]);break}case"SEND_PREPARED":{let t=this._bindings.sendPrepared(e.data[0],e.data[1],e.data[2]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"QUERY_RESULT_HEADER",data:t},[t.buffer]);break}case"START_PENDING_QUERY":{let t=this._bindings.startPendingQuery(e.data[0],e.data[1]),r=[];t&&r.push(t.buffer),this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"QUERY_RESULT_HEADER_OR_NULL",data:t},r);break}case"POLL_PENDING_QUERY":{let t=this._bindings.pollPendingQuery(e.data),r=[];t&&r.push(t.buffer),this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"QUERY_RESULT_HEADER_OR_NULL",data:t},r);break}case"CANCEL_PENDING_QUERY":{let t=this._bindings.cancelPendingQuery(e.data);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"SUCCESS",data:t},[]);break}case"FETCH_QUERY_RESULTS":{let t=this._bindings.fetchQueryResults(e.data);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"QUERY_RESULT_CHUNK",data:t},[t.buffer]);break}case"GET_TABLE_NAMES":{let t=this._bindings.getTableNames(e.data[0],e.data[1]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"TABLE_NAMES",data:t},[]);break}case"GLOB_FILE_INFOS":{let t=this._bindings.globFiles(e.data);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"FILE_INFOS",data:t},[]);break}case"REGISTER_FILE_URL":this._bindings.registerFileURL(e.data[0],e.data[1],e.data[2],e.data[3]),this.sendOK(e);break;case"REGISTER_FILE_BUFFER":this._bindings.registerFileBuffer(e.data[0],e.data[1]),this.sendOK(e);break;case"REGISTER_FILE_HANDLE":this._bindings.registerFileHandle(e.data[0],e.data[1],e.data[2],e.data[3]),this.sendOK(e);break;case"COPY_FILE_TO_PATH":this._bindings.copyFileToPath(e.data[0],e.data[1]),this.sendOK(e);break;case"COPY_FILE_TO_BUFFER":{let t=this._bindings.copyFileToBuffer(e.data);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"FILE_BUFFER",data:t},[]);break}case"COLLECT_FILE_STATISTICS":this._bindings.collectFileStatistics(e.data[0],e.data[1]),this.sendOK(e);break;case"EXPORT_FILE_STATISTICS":{this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"FILE_STATISTICS",data:this._bindings.exportFileStatistics(e.data)},[]);break}case"INSERT_ARROW_FROM_IPC_STREAM":{this._bindings.insertArrowFromIPCStream(e.data[0],e.data[1],e.data[2]),this.sendOK(e);break}case"IMPORT_CSV_FROM_PATH":{this._bindings.insertCSVFromPath(e.data[0],e.data[1],e.data[2]),this.sendOK(e);break}case"IMPORT_JSON_FROM_PATH":{this._bindings.insertJSONFromPath(e.data[0],e.data[1],e.data[2]),this.sendOK(e);break}case"TOKENIZE":{let t=this._bindings.tokenize(e.data);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"SCRIPT_TOKENS",data:t},[]);break}}}catch(t){return console.log(t),this.failWith(e,t)}}};var Bl=Po(Fl());var la=class{constructor(e,t){this._bindings=e,this._conn=t}close(){this._bindings.disconnect(this._conn)}useUnsafe(e){return e(this._bindings,this._conn)}query(e){let t=this._bindings.runQuery(this._conn,e),r=Ue.from(t);return console.assert(r.isSync()),console.assert(r.isFile()),new We(r)}async send(e){let t=this._bindings.startPendingQuery(this._conn,e);for(;t==null;)t=await new Promise((a,o)=>{try{a(this._bindings.pollPendingQuery(this._conn))}catch(l){console.log(l),o(l)}});let r=new ua(this._bindings,this._conn,t),n=Ue.from(r);return console.assert(n.isSync()),console.assert(n.isStream()),n}cancelSent(){return this._bindings.cancelPendingQuery(this._conn)}getTableNames(e){return this._bindings.getTableNames(this._conn,e)}prepare(e){let t=this._bindings.createPrepared(this._conn,e);return new Eo(this._bindings,this._conn,t)}createScalarFunction(e,t,r){this._bindings.createScalarFunction(this._conn,e,t,r)}insertArrowTable(e,t){let r=aa(e,"stream");this.insertArrowFromIPCStream(r,t)}insertArrowFromIPCStream(e,t){this._bindings.insertArrowFromIPCStream(this._conn,e,t)}insertCSVFromPath(e,t){this._bindings.insertCSVFromPath(this._conn,e,t)}insertJSONFromPath(e,t){this._bindings.insertJSONFromPath(this._conn,e,t)}},ua=class{constructor(e,t,r){this.bindings=e;this.conn=t;this.header=r;this._first=!0,this._depleted=!1}next(){if(this._first)return this._first=!1,{done:!1,value:this.header};if(this._depleted)return{done:!0,value:null};let e=this.bindings.fetchQueryResults(this.conn);return this._depleted=e.length==0,{done:this._depleted,value:e}}[Symbol.iterator](){return this}},Eo=class{constructor(e,t,r){this.bindings=e,this.connectionId=t,this.statementId=r}close(){this.bindings.closePrepared(this.connectionId,this.statementId)}query(...e){let t=this.bindings.runPrepared(this.connectionId,this.statementId,e),r=Ue.from(t);return console.assert(r.isSync()),console.assert(r.isFile()),new We(r)}send(...e){let t=this.bindings.sendPrepared(this.connectionId,this.statementId,e),r=new ua(this.bindings,this.connectionId,t),n=Ue.from(r);return console.assert(n.isSync()),console.assert(n.isStream()),n}};var Ml=new TextEncoder,xl=new TextDecoder("utf-8");function Lo(c,e,t){let r=Ml.encode(t),n=c._malloc(r.byteLength),a=c.HEAPU8.subarray(n,n+r.byteLength);a.set(r),c.HEAPF64[(e>>3)+0]=1,c.HEAPF64[(e>>3)+1]=n,c.HEAPF64[(e>>3)+2]=a.byteLength}function Do(c){switch(c){case"UINT8":case"INT8":return 1;case"INT32":case"FLOAT":return 4;case"INT64":case"UINT64":case"DOUBLE":case"VARCHAR":return 8;default:return 0}}function Ao(c,e,t,r){let n=c.HEAPU8.subarray(e,e+r*Do(t));switch(t){case"UINT8":return new Uint8Array(n.buffer,n.byteOffset,r);case"INT8":return new Int8Array(n.buffer,n.byteOffset,r);case"INT32":return new Int32Array(n.buffer,n.byteOffset,r);case"FLOAT":return new Float32Array(n.buffer,n.byteOffset,r);case"DOUBLE":return new Float64Array(n.buffer,n.byteOffset,r);case"VARCHAR":return new Float64Array(n.buffer,n.byteOffset,r);default:return new Array(0)}}function Cl(c,e,t){let r=c.HEAPU8.subarray(e,e+t);return new Uint8Array(r.buffer,r.byteOffset,t)}function _a(c,e,t){let r=c.HEAPU8.subarray(e,e+t*8);return new Float64Array(r.buffer,r.byteOffset,t)}function Pl(c,e,t,r,n,a,o,l){try{let u=c._udfFunctions.get(r);if(!u){Lo(e,t,"Unknown UDF with id: "+r);return}let _=xl.decode(e.HEAPU8.subarray(n,n+a)),d=JSON.parse(_),f=_a(e,o,l/8),p=A=>{var D;let C=null;switch(A.validityBuffer!==void 0&&(C=Cl(e,f[A.validityBuffer],d.rows)),A.physicalType){case"VARCHAR":{if(A.dataBuffer===null||A.dataBuffer===void 0)throw new Error("malformed data view, expected data buffer for VARCHAR argument");if(A.lengthBuffer===null||A.lengthBuffer===void 0)throw new Error("malformed data view, expected data length buffer for VARCHAR argument");let P=Ao(e,f[A.dataBuffer],A.physicalType,d.rows),k=[],M=_a(e,f[A.lengthBuffer],d.rows);for(let I=0;Ik[I]}case"STRUCT":{let P={},k=[];for(let M=0;M<(((D=A.children)==null?void 0:D.length)||0);++M){let I=A.children[M],X=p(I);k.push(Z=>{P[I.name]=X(Z)})}return C!=null?M=>{if(!C[M])return null;for(let I of k)I(M);return P}:M=>{for(let I of k)I(M);return P}}default:{if(A.dataBuffer===void 0)throw new Error("malformed data view, expected data buffer for argument of type: "+A.physicalType);let P=Ao(e,f[A.dataBuffer],A.physicalType,d.rows);return C!=null?k=>C[k]?P[k]:null:k=>P[k]}}},m=[];for(let A=0;A>3)+0]=0,e.HEAPF64[(t>>3)+1]=F,e.HEAPF64[(t>>3)+2]=0}catch(u){Lo(e,t,u.toString())}}function hd(){let c=new TextDecoder;return e=>(typeof SharedArrayBuffer<"u"&&e.buffer instanceof SharedArrayBuffer&&(e=new Uint8Array(e)),c.decode(e))}var gd=hd();function lt(c,e){console.error("FAIL WITH: ".concat(e)),c.ccall("duckdb_web_fail_with",null,["string"],[e])}function Kr(c,e,t){let r=c.HEAPU8.subarray(e,e+t),n=new Uint8Array(new ArrayBuffer(r.byteLength));return n.set(r),n}function te(c,e,t){return gd(c.HEAPU8.subarray(e,e+t))}function fe(c,e,t,r){let n=c.stackSave(),a=c.stackAlloc(3*8);t.unshift("number"),r.unshift(a),c.ccall(e,null,t,r);let o=c.HEAPF64[(a>>3)+0],l=c.HEAPF64[(a>>3)+1],u=c.HEAPF64[(a>>3)+2];return c.stackRestore(n),[o,l,u]}function be(c){c.ccall("duckdb_web_clear_response",null,[],[])}var da=class{constructor(e){let t=new Float64Array(e.buffer,e.byteOffset,e.byteLength/8),r=new Uint8Array(new ArrayBuffer(e.byteLength));r.set(e.subarray(7*8)),this.totalFileReadsCold=t[0],this.totalFileReadsAhead=t[1],this.totalFileReadsCached=t[2],this.totalFileWrites=t[3],this.totalPageAccesses=t[4],this.totalPageLoads=t[5],this.blockSize=t[6],this.blockStats=r}getBlockStats(e,t){return t=t||{file_reads_cold:0,file_reads_ahead:0,file_reads_cached:0,file_writes:0,page_accesses:0,page_loads:0},t.file_writes=this.blockStats[e*3+0]&15,t.file_reads_cold=this.blockStats[e*3+0]>>4,t.file_reads_ahead=this.blockStats[e*3+1]&15,t.file_reads_cached=this.blockStats[e*3+1]>>4,t.page_accesses=this.blockStats[e*3+1]&15,t.page_loads=this.blockStats[e*3+1]>>4,t}};var Il=new TextEncoder;var fa=class{constructor(e,t){this._instance=null;this._initPromise=null;this._initPromiseResolver=()=>{};this.onInstantiationProgress=[];this._logger=e,this._runtime=t,this._nextUDFId=1}get logger(){return this._logger}get mod(){return this._instance}get pthread(){return this.mod.PThread||null}async instantiate(e=t=>{}){return this._instance!=null?this:(this._initPromise!=null&&(this.onInstantiationProgress.push(e),await this._initPromise),this._initPromise=new Promise(t=>{this._initPromiseResolver=t}),this.onInstantiationProgress=[e],this._instance=await this.instantiateImpl({print:console.log.bind(console),printErr:console.log.bind(console),onRuntimeInitialized:this._initPromiseResolver}),await this._initPromise,this._initPromise=null,this.onInstantiationProgress=this.onInstantiationProgress.filter(t=>t!=e),globalThis.DUCKDB_BINDINGS=this,this)}open(e){let[t,r,n]=fe(this.mod,"duckdb_web_open",["string"],[JSON.stringify(e)]);if(t!==0)throw new Error(te(this.mod,r,n));be(this.mod)}reset(){let[e,t,r]=fe(this.mod,"duckdb_web_reset",[],[]);if(e!==0)throw new Error(te(this.mod,t,r));be(this.mod)}getVersion(){let[e,t,r]=fe(this.mod,"duckdb_web_get_version",[],[]);if(e!==0)throw new Error(te(this.mod,t,r));let n=te(this.mod,t,r);return be(this.mod),n}getFeatureFlags(){return this.mod.ccall("duckdb_web_get_feature_flags","number",[],[])}tokenize(e){let[t,r,n]=fe(this.mod,"duckdb_web_tokenize",["string"],[e]);if(t!==0)throw new Error(te(this.mod,r,n));let a=te(this.mod,r,n);return be(this.mod),JSON.parse(a)}connect(){let e=this.mod.ccall("duckdb_web_connect","number",[],[]);return new la(this,e)}disconnect(e){if(this.mod.ccall("duckdb_web_disconnect",null,["number"],[e]),this.pthread)for(let t of[...this.pthread.runningWorkers,...this.pthread.unusedWorkers])t.postMessage({cmd:"dropUDFFunctions",connectionId:e})}runQuery(e,t){let r=Il.encode(t),n=this.mod._malloc(r.length);this.mod.HEAPU8.subarray(n,n+r.length).set(r);let[o,l,u]=fe(this.mod,"duckdb_web_query_run_buffer",["number","number","number"],[e,n,r.length]);if(o!==0)throw new Error(te(this.mod,l,u));let _=Kr(this.mod,l,u);return be(this.mod),this.mod._free(n),_}startPendingQuery(e,t){let[r,n,a]=fe(this.mod,"duckdb_web_pending_query_start",["number","string"],[e,t]);if(r!==0)throw new Error(te(this.mod,n,a));if(n==0)return null;let o=Kr(this.mod,n,a);return be(this.mod),o}pollPendingQuery(e){let[t,r,n]=fe(this.mod,"duckdb_web_pending_query_poll",["number"],[e]);if(t!==0)throw new Error(te(this.mod,r,n));if(r==0)return null;let a=Kr(this.mod,r,n);return be(this.mod),a}cancelPendingQuery(e){return this.mod.ccall("duckdb_web_pending_query_cancel","boolean",["number"],[e])}fetchQueryResults(e){let[t,r,n]=fe(this.mod,"duckdb_web_query_fetch_results",["number"],[e]);if(t!==0)throw new Error(te(this.mod,r,n));let a=Kr(this.mod,r,n);return be(this.mod),a}getTableNames(e,t){let[r,n,a]=fe(this.mod,"duckdb_web_get_tablenames",["number","string"],[e,t]);if(r!==0)throw new Error(te(this.mod,n,a));let o=te(this.mod,n,a);return be(this.mod),JSON.parse(o)}createScalarFunction(e,t,r,n){let a={functionId:this._nextUDFId,name:t,returnType:Di(r)},o={functionId:a.functionId,connectionId:e,name:t,returnType:r,func:n};this._nextUDFId+=1;let[l,u,_]=fe(this.mod,"duckdb_web_udf_scalar_create",["number","string"],[e,JSON.stringify(a)]);if(l!==0)throw new Error(te(this.mod,u,_));if(be(this.mod),globalThis.DUCKDB_RUNTIME._udfFunctions=(globalThis.DUCKDB_RUNTIME._udfFunctions||new Map).set(o.functionId,o),this.pthread)for(let d of[...this.pthread.runningWorkers,...this.pthread.unusedWorkers])d.postMessage({cmd:"registerUDFFunction",udf:o})}createPrepared(e,t){let[r,n,a]=fe(this.mod,"duckdb_web_prepared_create",["number","string"],[e,t]);if(r!==0)throw new Error(te(this.mod,n,a));return be(this.mod),n}closePrepared(e,t){let[r,n,a]=fe(this.mod,"duckdb_web_prepared_close",["number","number"],[e,t]);if(r!==0)throw new Error(te(this.mod,n,a));be(this.mod)}runPrepared(e,t,r){let[n,a,o]=fe(this.mod,"duckdb_web_prepared_run",["number","number","string"],[e,t,JSON.stringify(r)]);if(n!==0)throw new Error(te(this.mod,a,o));let l=Kr(this.mod,a,o);return be(this.mod),l}sendPrepared(e,t,r){let[n,a,o]=fe(this.mod,"duckdb_web_prepared_send",["number","number","string"],[e,t,JSON.stringify(r)]);if(n!==0)throw new Error(te(this.mod,a,o));let l=Kr(this.mod,a,o);return be(this.mod),l}insertArrowFromIPCStream(e,t,r){if(t.length==0)return;let n=this.mod._malloc(t.length);this.mod.HEAPU8.subarray(n,n+t.length).set(t);let o=r?JSON.stringify(r):"",[l,u,_]=fe(this.mod,"duckdb_web_insert_arrow_from_ipc_stream",["number","number","number","string"],[e,n,t.length,o]);if(l!==0)throw new Error(te(this.mod,u,_))}insertCSVFromPath(e,t,r){if(r.columns!==void 0){r.columnsFlat=[];for(let _ in r.columns)r.columnsFlat.push(oa(_,r.columns[_]))}let n={...r};n.columns=n.columnsFlat,delete n.columnsFlat;let a=JSON.stringify(n),[o,l,u]=fe(this.mod,"duckdb_web_insert_csv_from_path",["number","string","string"],[e,t,a]);if(o!==0)throw new Error(te(this.mod,l,u))}insertJSONFromPath(e,t,r){if(r.columns!==void 0){r.columnsFlat=[];for(let _ in r.columns)r.columnsFlat.push(oa(_,r.columns[_]))}let n={...r};n.columns=n.columnsFlat,delete n.columnsFlat;let a=JSON.stringify(n),[o,l,u]=fe(this.mod,"duckdb_web_insert_json_from_path",["number","string","string"],[e,t,a]);if(o!==0)throw new Error(te(this.mod,l,u))}globFiles(e){let[t,r,n]=fe(this.mod,"duckdb_web_fs_glob_file_infos",["string"],[e]);if(t!==0)throw new Error(te(this.mod,r,n));let a=te(this.mod,r,n);be(this.mod);let o=JSON.parse(a);return o==null?[]:o}registerFileURL(e,t,r,n=!1){t===void 0&&(t=e);let[a,o,l]=fe(this.mod,"duckdb_web_fs_register_file_url",["string","string"],[e,t,r,n]);if(a!==0)throw new Error(te(this.mod,o,l));be(this.mod)}registerFileText(e,t){let r=Il.encode(t);this.registerFileBuffer(e,r)}registerFileBuffer(e,t){let r=this.mod._malloc(t.length);this.mod.HEAPU8.subarray(r,r+t.length).set(t);let[a,o,l]=fe(this.mod,"duckdb_web_fs_register_file_buffer",["string","number","number"],[e,r,t.length]);if(a!==0)throw new Error(te(this.mod,o,l));be(this.mod)}registerFileHandle(e,t,r,n){let[a,o,l]=fe(this.mod,"duckdb_web_fs_register_file_url",["string","string","number","boolean"],[e,e,r,n]);if(a!==0)throw new Error(te(this.mod,o,l));if(be(this.mod),globalThis.DUCKDB_RUNTIME._files=(globalThis.DUCKDB_RUNTIME._files||new Map).set(e,t),this.pthread){for(let u of this.pthread.runningWorkers)u.postMessage({cmd:"registerFileHandle",fileName:e,fileHandle:t});for(let u of this.pthread.unusedWorkers)u.postMessage({cmd:"dropFileHandle",fileName:e})}}dropFile(e){let[t,r,n]=fe(this.mod,"duckdb_web_fs_drop_file",["string"],[e]);if(t!==0)throw new Error(te(this.mod,r,n));be(this.mod)}dropFiles(){let[e,t,r]=fe(this.mod,"duckdb_web_fs_drop_files",[],[]);if(e!==0)throw new Error(te(this.mod,t,r));be(this.mod)}flushFiles(){this.mod.ccall("duckdb_web_flush_files",null,[],[])}copyFileToPath(e,t){let[r,n,a]=fe(this.mod,"duckdb_web_copy_file_to_path",["string","string"],[e,t]);if(r!==0)throw new Error(te(this.mod,n,a));be(this.mod)}copyFileToBuffer(e){let[t,r,n]=fe(this.mod,"duckdb_web_copy_file_to_buffer",["string"],[e]);if(t!==0)throw new Error(te(this.mod,r,n));let a=this.mod.HEAPU8.subarray(r,r+n),o=new Uint8Array(a.length);return o.set(a),be(this.mod),o}collectFileStatistics(e,t){let[r,n,a]=fe(this.mod,"duckdb_web_collect_file_stats",["string","boolean"],[e,t]);if(r!==0)throw new Error(te(this.mod,n,a))}exportFileStatistics(e){let[t,r,n]=fe(this.mod,"duckdb_web_export_file_stats",["string"],[e]);if(t!==0)throw new Error(te(this.mod,r,n));return new da(this.mod.HEAPU8.subarray(r,r+n))}};var pa=class extends fa{constructor(e,t,r,n){super(e,t),this.mainModuleURL=r,this.pthreadWorkerURL=n}locateFile(e,t){if(e.endsWith(".wasm"))return this.mainModuleURL;if(e.endsWith(".worker.js")){if(!this.pthreadWorkerURL)throw new Error("Missing DuckDB worker URL!");return this.pthreadWorkerURL}throw new Error("WASM instantiation requested unexpected file: prefix=".concat(t," path=").concat(e))}instantiateWasm(e,t){globalThis.DUCKDB_RUNTIME=this._runtime;let r=this.onInstantiationProgress;if(WebAssembly.instantiateStreaming)if(typeof TransformStream=="function"){let a=(async()=>{var h;let o=new Request(this.mainModuleURL),l=await fetch(o),u=l.headers.get("content-length"),_=u&&parseInt(u,10)||0,d=new Date,f={startedAt:d,updatedAt:d,bytesTotal:_||0,bytesLoaded:0},p={transform(g,v){f.bytesLoaded+=g.byteLength;let b=new Date;if(b.getTime()-f.updatedAt.getTime()<20){f.updatedAt=b,v.enqueue(g);return}for(let S of r)S(f);v.enqueue(g)}},m=new TransformStream(p);return new Response((h=l.body)==null?void 0:h.pipeThrough(m),l)})();WebAssembly.instantiateStreaming(a,e).then(o=>{t(o.instance,o.module)})}else{console.warn("instantiating without progress handler since transform streams are unavailable");let n=new Request(this.mainModuleURL);WebAssembly.instantiateStreaming(fetch(n),e).then(a=>{t(a.instance,a.module)})}else if(typeof XMLHttpRequest=="function"){let n=new XMLHttpRequest,a=this.mainModuleURL,o=new Date,l={startedAt:o,updatedAt:o,bytesTotal:0,bytesLoaded:0};n.open("GET",a),n.responseType="arraybuffer",n.onerror=u=>{throw this.logger.log({timestamp:new Date,level:4,origin:3,topic:5,event:2,value:"Failed to load WASM: "+u}),new Error(u.toString())},n.onprogress=u=>{l.bytesTotal=u.total,l.bytesLoaded=u.loaded;let _=new Date;if(_.getTime()-l.updatedAt.getTime()<20){l.updatedAt=_;return}for(let d of r)d(l)},n.onload=()=>{WebAssembly.instantiate(n.response,e).then(u=>{t(u.instance,u.module)}).catch(u=>{throw this.logger.log({timestamp:new Date,level:4,origin:3,topic:5,event:2,value:"Failed to instantiate WASM: "+u}),new Error(u)})},n.send()}else console.warn("instantiating with manual fetch since streaming instantiation and xhrs are unavailable"),(async()=>{let a=new Request(this.mainModuleURL),l=await(await fetch(a)).arrayBuffer();WebAssembly.instantiate(l,e).then(u=>{t(u.instance,u.module)})})();return[]}};var ma=class extends pa{constructor(e,t,r,n=null){super(e,t,r,n)}instantiateImpl(e){return(0,Bl.default)({...e,instantiateWasm:this.instantiateWasm.bind(this),locateFile:this.locateFile.bind(this)})}};var xr=Po(Ul()),jl=function(c,e,t){var r;if((r=c==null?void 0:c.endpoint)!=null&&r.startsWith("http")){let n="".concat(c==null?void 0:c.endpoint),a=n.indexOf("://")+3;return n.substring(a)}else return c!=null&&c.endpoint?"".concat(t,".").concat(c==null?void 0:c.endpoint):"".concat(t,".s3.amazonaws.com")};function vd(c,e,t){var a,o,l,u;let r=Ol(e),n=r.path;return Hl(c)&&(n="/".concat(r.bucket).concat(n)),{url:n,query:"",host:jl(c,e,r.bucket),region:(a=c==null?void 0:c.region)!=null?a:"",service:"s3",method:t,accessKeyId:(o=c==null?void 0:c.accessKeyId)!=null?o:"",secretAccessKey:(l=c==null?void 0:c.secretAccessKey)!=null?l:"",sessionToken:(u=c==null?void 0:c.sessionToken)!=null?u:"",dateNow:new Date().toISOString().replace(/-/g,"").split("T")[0],datetimeNow:new Date().toISOString().replace(/-/g,"").replace(/:/g,"").split(".")[0]+"Z"}}function yd(c,e=!1){let t="0123456789ABCDEF",r="";for(let n=0;n="A"&&a<="Z"||a>="a"&&a<="z"||a>="0"&&a<="9"||a=="_"||a=="-"||a=="~"||a=="."?r+=a:a=="/"?e?r+="%2F":r+=a:(r+="%",r+=t[a.charCodeAt(0)>>4],r+=t[a.charCodeAt(0)&15])}return r}function bd(c,e=null){var h;let t=(h=e==null?void 0:e.contentHash)!=null?h:"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",r=new Map;r.set("x-amz-date",c.datetimeNow),r.set("x-amz-content-sha256",t),c.sessionToken&&r.set("x-amz-security-token",c.sessionToken);let n="";e!=null&&e.contentType&&(n+="content-type;"),n+="host;x-amz-content-sha256;x-amz-date",c.sessionToken&&(n+=";x-amz-security-token");let a=c.method+"\n"+yd(c.url)+"\n"+c.query;e!=null&&e.contentType&&(a+="\ncontent-type:"+(e==null?void 0:e.contentType)),a+="\nhost:"+c.host+"\nx-amz-content-sha256:"+t+"\nx-amz-date:"+c.datetimeNow,c.sessionToken&&c.sessionToken.length>0&&(a+="\nx-amz-security-token:"+c.sessionToken),a+="\n\n"+n+"\n"+t;let o=(0,xr.sha256)(a),l="AWS4-HMAC-SHA256\n"+c.datetimeNow+"\n"+c.dateNow+"/"+c.region+"/"+c.service+"/aws4_request\n"+o,u="AWS4"+c.secretAccessKey,_=xr.sha256.hmac.arrayBuffer(u,c.dateNow),d=xr.sha256.hmac.arrayBuffer(_,c.region),f=xr.sha256.hmac.arrayBuffer(d,c.service),p=xr.sha256.hmac.arrayBuffer(f,"aws4_request"),m=xr.sha256.hmac(p,l);return r.set("Authorization","AWS4-HMAC-SHA256 Credential="+c.accessKeyId+"/"+c.dateNow+"/"+c.region+"/"+c.service+"/aws4_request, SignedHeaders="+n+", Signature="+m),r}var Sd=function(c,e,t,r=null,n=null){let a=vd(c,e,t),o={contentType:r,contentHash:n?xr.sha256.hex(n):null};return bd(a,o)};function kt(c,e,t,r,n=null,a=null){(e!=null&&e.accessKeyId||e!=null&&e.sessionToken)&&(Sd(e,t,r,n,a).forEach((l,u)=>{c.setRequestHeader(u,l)}),n&&c.setRequestHeader("content-type",n))}function Ol(c){if(c.indexOf("s3://")!=0)throw new Error("URL needs to start with s3://");let e=c.indexOf("/",5);if(e==-1)throw new Error("URL needs to contain a '/' after the host");let t=c.substring(5,e);if(!t)throw new Error("URL needs to contain a bucket name");let r=c.substring(e);if(!r)throw new Error("URL needs to contain key");return{bucket:t,path:r}}function Hl(c){var e;return!!((e=c==null?void 0:c.endpoint)!=null&&e.startsWith("http"))}function Tt(c,e){let t=Ol(e);return Hl(c)?"".concat(c==null?void 0:c.endpoint,"/").concat(t.bucket)+t.path:"https://"+jl(c,e,t.bucket)+t.path}var ce={_files:new Map,_fileInfoCache:new Map,_udfFunctions:new Map,_globalFileInfo:null,getFileInfo(c,e){try{let t=ce._fileInfoCache.get(e),[r,n,a]=fe(c,"duckdb_web_fs_get_file_info_by_id",["number","number"],[e,(t==null?void 0:t.cacheEpoch)||0]);if(r!==0)return null;if(a===0)return t;let o=te(c,n,a);be(c);try{let l=JSON.parse(o);if(l==null)return null;let u={...l,blob:null};return ce._fileInfoCache.set(e,u),u}catch(l){return console.warn(l),null}}catch(t){return console.log(t),null}},getGlobalFileInfo(c){var e;try{let[t,r,n]=fe(c,"duckdb_web_get_global_file_info",["number"],[((e=ce._globalFileInfo)==null?void 0:e.cacheEpoch)||0]);if(t!==0)return null;if(n===0)return ce._globalFileInfo;let a=te(c,r,n);be(c);let o=JSON.parse(a);return o==null?null:(ce._globalFileInfo={...o,blob:null},ce._globalFileInfo)}catch(t){return console.log(t),null}},testPlatformFeature:(c,e)=>{switch(e){case 1:return typeof BigInt64Array<"u";default:return console.warn("test for unknown feature: ".concat(e)),!1}},getDefaultDataProtocol(c){return 2},openFile:(c,e,t)=>{var r,n;try{ce._fileInfoCache.delete(e);let a=ce.getFileInfo(c,e);switch(a==null?void 0:a.dataProtocol){case 4:case 5:{if(t&1&&t&2)throw new Error("Opening file ".concat(a.fileName," failed: cannot open file with both read and write flags set"));if(t&32)throw new Error("Opening file ".concat(a.fileName," failed: appending to HTTP/S3 files is not supported"));if(t&2){let u=new XMLHttpRequest;if(a.dataProtocol==5?(u.open("HEAD",Tt(a.s3Config,a.dataUrl),!1),kt(u,a.s3Config,a.dataUrl,"HEAD")):u.open("HEAD",a.dataUrl,!1),u.send(null),u.status!=200&&u.status!=404)throw new Error("Opening file ".concat(a.fileName," failed: Unexpected return status from server (").concat(u.status,")"));if(u.status==404&&!(t&8||t&16))throw new Error("Opening file ".concat(a.fileName," failed: Cannot write to non-existent file without FILE_FLAGS_FILE_CREATE or FILE_FLAGS_FILE_CREATE_NEW flag."));let _=c._malloc(1),d=new Uint8Array;c.HEAPU8.set(d,_);let f=c._malloc(2*8);return c.HEAPF64[(f>>3)+0]=1,c.HEAPF64[(f>>3)+1]=_,f}else if(!(t&1))throw new Error("Opening file ".concat(a.fileName," failed: unsupported file flags: ").concat(t));let o=null,l=null;if(a.reliableHeadRequests||!a.allowFullHttpReads)try{let u=new XMLHttpRequest;if(a.dataProtocol==5?(u.open("HEAD",Tt(a.s3Config,a.dataUrl),!1),kt(u,a.s3Config,a.dataUrl,"HEAD")):u.open("HEAD",a.dataUrl,!1),u.setRequestHeader("Range","bytes=0-"),u.send(null),o=u.getResponseHeader("Content-Length"),o!==null&&u.status==206){let _=c._malloc(16);return c.HEAPF64[(_>>3)+0]=+o,c.HEAPF64[(_>>3)+1]=0,_}}catch(u){l=u,console.warn("HEAD request with range header failed: ".concat(u))}if(a.allowFullHttpReads){{let _=new XMLHttpRequest;a.dataProtocol==5?(_.open("GET",Tt(a.s3Config,a.dataUrl),!1),kt(_,a.s3Config,a.dataUrl,"GET")):_.open("GET",a.dataUrl,!1),_.responseType="arraybuffer",_.setRequestHeader("Range","bytes=0-0"),_.send(null);let d=(r=_.getResponseHeader("Content-Range"))==null?void 0:r.split("/")[1],f=_.getResponseHeader("Content-Length"),p=null;if(d!==void 0)p=d;else if(!a.reliableHeadRequests){let m=new XMLHttpRequest;a.dataProtocol==5?(m.open("HEAD",Tt(a.s3Config,a.dataUrl),!1),kt(m,a.s3Config,a.dataUrl,"HEAD")):m.open("HEAD",a.dataUrl,!1),m.setRequestHeader("Range","bytes=0-"),m.send(null),o=m.getResponseHeader("Content-Length"),o!==null&&+o>1&&(p=o)}if(_.status==206&&f!==null&&+f==1&&p!==null){let m=c._malloc(16);return c.HEAPF64[(m>>3)+0]=+p,c.HEAPF64[(m>>3)+1]=0,m}if(_.status==200&&f!==null&&o!==null&&+f==+o){console.warn("fall back to full HTTP read for: ".concat(a.dataUrl));let m=c._malloc(_.response.byteLength),h=new Uint8Array(_.response,0,_.response.byteLength);c.HEAPU8.set(h,m);let g=c._malloc(2*8);return c.HEAPF64[(g>>3)+0]=_.response.byteLength,c.HEAPF64[(g>>3)+1]=m,g}}console.warn("falling back to full HTTP read for: ".concat(a.dataUrl));let u=new XMLHttpRequest;if(a.dataProtocol==5?(u.open("GET",Tt(a.s3Config,a.dataUrl),!1),kt(u,a.s3Config,a.dataUrl,"GET")):u.open("GET",a.dataUrl,!1),u.responseType="arraybuffer",u.send(null),u.status==200){let _=c._malloc(u.response.byteLength),d=new Uint8Array(u.response,0,u.response.byteLength);c.HEAPU8.set(d,_);let f=c._malloc(2*8);return c.HEAPF64[(f>>3)+0]=u.response.byteLength,c.HEAPF64[(f>>3)+1]=_,f}}if(l!=null)throw new Error("Reading file ".concat(a.fileName," failed with error: ").concat(l));return 0}case 2:{let o=(n=ce._files)==null?void 0:n.get(a.fileName);if(o){let _=c._malloc(16);return c.HEAPF64[(_>>3)+0]=o.size,c.HEAPF64[(_>>3)+1]=0,_}console.warn("Buffering missing file: ".concat(a.fileName));let l=c._malloc(2*8),u=c._malloc(1);return c.HEAPF64[(l>>3)+0]=1,c.HEAPF64[(l>>3)+1]=u,l}}}catch(a){console.error(a.toString()),lt(c,a.toString())}return 0},glob:(c,e,t)=>{var r;try{let n=te(c,e,t);if(n.startsWith("http")||n.startsWith("s3://")){let a=new XMLHttpRequest;if(n.startsWith("s3://")){let o=ce.getGlobalFileInfo(c);a.open("HEAD",Tt(o==null?void 0:o.s3Config,n),!1),kt(a,o==null?void 0:o.s3Config,n,"HEAD")}else a.open("HEAD",n,!1);if(a.send(null),a.status!=200&&a.status!==206){if(!((r=ce.getGlobalFileInfo(c))!=null&&r.allowFullHttpReads))return lt(c,"HEAD request failed: ".concat(n,", with full http reads are disabled")),0;let o=new XMLHttpRequest;if(n.startsWith("s3://")){let u=ce.getGlobalFileInfo(c);o.open("GET",Tt(u==null?void 0:u.s3Config,n),!1),kt(o,u==null?void 0:u.s3Config,n,"HEAD")}else o.open("GET",n,!1);if(o.setRequestHeader("Range","bytes=0-0"),o.send(null),o.status!=200&&o.status!==206)return lt(c,"HEAD and GET requests failed: ".concat(n)),0;let l=o.getResponseHeader("Content-Length");l&&+l>1&&console.warn("Range request for ".concat(n," did not return a partial response: ").concat(o.status,' "').concat(o.statusText,'"'))}c.ccall("duckdb_web_fs_glob_add_path",null,["string"],[n])}}catch(n){return console.log(n),lt(c,n.toString()),0}},checkFile:(c,e,t)=>{try{let r=te(c,e,t);if(r.startsWith("http")||r.startsWith("s3://")){let n=new XMLHttpRequest;if(r.startsWith("s3://")){let a=ce.getGlobalFileInfo(c);n.open("HEAD",Tt(a==null?void 0:a.s3Config,r),!1),kt(n,a==null?void 0:a.s3Config,r,"HEAD")}else n.open("HEAD",r,!1);return n.send(null),n.status==206||n.status==200}}catch(r){return console.log(r),!1}return!1},syncFile:(c,e)=>{},closeFile:(c,e)=>{var r;let t=ce.getFileInfo(c,e);switch(ce._fileInfoCache.delete(e),t==null?void 0:t.dataProtocol){case 0:case 4:case 5:break;case 1:case 2:return;case 3:{let n=(r=ce._files)==null?void 0:r.get(t.fileName);if(!n)throw new Error("No OPFS access handle registered with name: ".concat(t.fileName));return n.flush()}}},truncateFile:(c,e,t)=>{var n;let r=ce.getFileInfo(c,e);switch(r==null?void 0:r.dataProtocol){case 4:lt(c,"Cannot truncate a http file");return;case 5:lt(c,"Cannot truncate an s3 file");return;case 0:case 1:case 2:lt(c,"truncateFile not implemented");return;case 3:{let a=(n=ce._files)==null?void 0:n.get(r.fileName);if(!a)throw new Error("No OPFS access handle registered with name: ".concat(r.fileName));return a.truncate(t)}}return 0},readFile(c,e,t,r,n){var a,o;if(r==0)return 0;try{let l=ce.getFileInfo(c,e);switch(l==null?void 0:l.dataProtocol){case 4:case 5:{if(!l.dataUrl)throw new Error("Missing data URL for file ".concat(e));try{let u=new XMLHttpRequest;if(l.dataProtocol==5?(u.open("GET",Tt(l==null?void 0:l.s3Config,l.dataUrl),!1),kt(u,l==null?void 0:l.s3Config,l.dataUrl,"GET")):u.open("GET",l.dataUrl,!1),u.responseType="arraybuffer",u.setRequestHeader("Range","bytes=".concat(n,"-").concat(n+r-1)),u.send(null),u.status==206||u.status==200&&r==u.response.byteLength&&n==0){let _=new Uint8Array(u.response,0,Math.min(u.response.byteLength,r));return c.HEAPU8.set(_,t),_.byteLength}else if(u.status==200){console.warn("Range request for ".concat(l.dataUrl," did not return a partial response: ").concat(u.status,' "').concat(u.statusText,'"'));let _=new Uint8Array(u.response,n,Math.min(u.response.byteLength-n,r));return c.HEAPU8.set(_,t),_.byteLength}else throw new Error("Range request for ".concat(l.dataUrl," did returned non-success status: ").concat(u.status,' "').concat(u.statusText,'"'))}catch(u){throw console.log(u),new Error("Range request for ".concat(l.dataUrl," failed with error: ").concat(u,'"'))}}case 2:{let u=(a=ce._files)==null?void 0:a.get(l.fileName);if(!u)throw new Error("No HTML5 file registered with name: ".concat(l.fileName));let _=u.slice(n,n+r),d=new Uint8Array(new FileReaderSync().readAsArrayBuffer(_));return c.HEAPU8.set(d,t),d.byteLength}case 3:{let u=(o=ce._files)==null?void 0:o.get(l.fileName);if(!u)throw new Error("No OPFS access handle registered with name: ".concat(l.fileName));let _=c.HEAPU8.subarray(t,t+r);return u.read(_,{at:n})}}return 0}catch(l){return console.log(l),lt(c,l.toString()),0}},writeFile:(c,e,t,r,n)=>{var o;let a=ce.getFileInfo(c,e);switch(a==null?void 0:a.dataProtocol){case 4:return lt(c,"Cannot write to HTTP file"),0;case 5:{let l=c.HEAPU8.subarray(t,t+r),u=new XMLHttpRequest;return u.open("PUT",Tt(a==null?void 0:a.s3Config,a.dataUrl),!1),kt(u,a==null?void 0:a.s3Config,a.dataUrl,"PUT","",l),u.send(l),u.status!==200?(lt(c,"Failed writing file: HTTP "+u.status),0):r}case 2:return lt(c,"cannot write using the html5 file reader api"),0;case 3:{let l=(o=ce._files)==null?void 0:o.get(a.fileName);if(!l)throw new Error("No OPFS access handle registered with name: ".concat(a.fileName));let u=c.HEAPU8.subarray(t,t+r);return l.write(u,{at:n})}}return 0},getLastFileModificationTime:(c,e)=>{var r;let t=ce.getFileInfo(c,e);switch(t==null?void 0:t.dataProtocol){case 2:{if(!((r=ce._files)==null?void 0:r.get(t.fileName)))throw Error("No handle available for file: ".concat(t.fileName));return 0}case 4:case 5:return new Date().getTime()}return 0},checkDirectory:(c,e,t)=>{let r=te(c,e,t);return console.log("checkDirectory: ".concat(r)),!1},createDirectory:(c,e,t)=>{let r=te(c,e,t);console.log("createDirectory: ".concat(r))},removeDirectory:(c,e,t)=>{let r=te(c,e,t);console.log("removeDirectory: ".concat(r))},listDirectoryEntries:(c,e,t)=>{let r=te(c,e,t);return console.log("listDirectoryEntries: ".concat(r)),!1},moveFile:(c,e,t,r,n)=>{var u,_;let a=te(c,e,t),o=te(c,r,n),l=(u=ce._files)==null?void 0:u.get(a);l!==void 0&&(ce._files.delete(l),ce._files.set(o,l));for(let[d,f]of((_=ce._fileInfoCache)==null?void 0:_.entries())||[])if(f.dataUrl==a){ce._fileInfoCache.delete(d);break}return!0},removeFile:(c,e,t)=>{},callScalarUDF:(c,e,t,r,n,a,o)=>{Pl(ce,c,e,t,r,n,a,o)}};var ko=class extends ca{postMessage(e,t){globalThis.postMessage(e,t)}async instantiate(e,t,r){return await new ma(this,ce,e,t).instantiate(r)}};function Nl(){let c=new ko;globalThis.onmessage=async e=>{await c.onMessage(e.data)}}Nl();return Xl(wd);})(); -/*! Bundled license information: - -js-sha256/src/sha256.js: - (** - * [js-sha256]{@link https://github.com/emn178/js-sha256} - * - * @version 0.11.0 - * @author Chen, Yi-Cyuan [emn178@gmail.com] - * @copyright Chen, Yi-Cyuan 2014-2024 - * @license MIT - *) -*/ -//# sourceMappingURL=duckdb-browser-mvp.worker.js.map diff --git a/build/assets/duckdb-eh-DrTJ_0hP.wasm b/build/assets/duckdb-eh-DrTJ_0hP.wasm deleted file mode 100644 index a3eeccc..0000000 Binary files a/build/assets/duckdb-eh-DrTJ_0hP.wasm and /dev/null differ diff --git a/build/assets/duckdb-mvp-DuKjbjvP.wasm b/build/assets/duckdb-mvp-DuKjbjvP.wasm deleted file mode 100644 index c1253fc..0000000 Binary files a/build/assets/duckdb-mvp-DuKjbjvP.wasm and /dev/null differ diff --git a/build/assets/index-DiwrgTda.css b/build/assets/index-DiwrgTda.css deleted file mode 100644 index 7704ff6..0000000 --- a/build/assets/index-DiwrgTda.css +++ /dev/null @@ -1 +0,0 @@ -#root{max-width:1280px;margin:0 auto;padding:2rem;text-align:center}.logo{height:6em;padding:1.5em;will-change:filter;transition:filter .3s}.logo:hover{filter:drop-shadow(0 0 2em #646cffaa)}.logo.react:hover{filter:drop-shadow(0 0 2em #61dafbaa)}@keyframes logo-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@media (prefers-reduced-motion: no-preference){a:nth-of-type(2) .logo{animation:logo-spin infinite 20s linear}}.card{padding:2em}.read-the-docs{color:#888}:root{font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;display:flex;place-items:center;min-width:320px;min-height:100vh}h1{font-size:3.2em;line-height:1.1}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:border-color .25s}button:hover{border-color:#646cff}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}@media (prefers-color-scheme: light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}} diff --git a/build/assets/index-DwWOe-n1.js b/build/assets/index-DwWOe-n1.js deleted file mode 100644 index ddd7073..0000000 --- a/build/assets/index-DwWOe-n1.js +++ /dev/null @@ -1,43 +0,0 @@ -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var zf={exports:{}},wl={},jf={exports:{}},H={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var gs=Symbol.for("react.element"),sg=Symbol.for("react.portal"),og=Symbol.for("react.fragment"),lg=Symbol.for("react.strict_mode"),ag=Symbol.for("react.profiler"),ug=Symbol.for("react.provider"),cg=Symbol.for("react.context"),dg=Symbol.for("react.forward_ref"),fg=Symbol.for("react.suspense"),hg=Symbol.for("react.memo"),pg=Symbol.for("react.lazy"),ed=Symbol.iterator;function yg(e){return e===null||typeof e!="object"?null:(e=ed&&e[ed]||e["@@iterator"],typeof e=="function"?e:null)}var Vf={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},$f=Object.assign,Wf={};function ci(e,t,n){this.props=e,this.context=t,this.refs=Wf,this.updater=n||Vf}ci.prototype.isReactComponent={};ci.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ci.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Hf(){}Hf.prototype=ci.prototype;function Au(e,t,n){this.props=e,this.context=t,this.refs=Wf,this.updater=n||Vf}var Lu=Au.prototype=new Hf;Lu.constructor=Au;$f(Lu,ci.prototype);Lu.isPureReactComponent=!0;var nd=Array.isArray,Yf=Object.prototype.hasOwnProperty,Cu={current:null},Qf={key:!0,ref:!0,__self:!0,__source:!0};function Gf(e,t,n){var r,i={},s=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)Yf.call(t,r)&&!Qf.hasOwnProperty(r)&&(i[r]=t[r]);var l=arguments.length-2;if(l===1)i.children=n;else if(1>>1,kt=b[_t];if(0>>1;_ti($l,$))Kni(Os,$l)?(b[_t]=Os,b[Kn]=$,_t=Kn):(b[_t]=$l,b[Gn]=$,_t=Gn);else if(Kni(Os,$))b[_t]=Os,b[Kn]=$,_t=Kn;else break t}}return z}function i(b,z){var $=b.sortIndex-z.sortIndex;return $!==0?$:b.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var a=[],u=[],d=1,h=null,m=3,g=!1,w=!1,S=!1,it=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,f=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(b){for(var z=n(u);z!==null;){if(z.callback===null)r(u);else if(z.startTime<=b)r(u),z.sortIndex=z.expirationTime,t(a,z);else break;z=n(u)}}function v(b){if(S=!1,y(b),!w)if(n(a)!==null)w=!0,jl(E);else{var z=n(u);z!==null&&Vl(v,z.startTime-b)}}function E(b,z){w=!1,S&&(S=!1,p(O),O=-1),g=!0;var $=m;try{for(y(z),h=n(a);h!==null&&(!(h.expirationTime>z)||b&&!Te());){var _t=h.callback;if(typeof _t=="function"){h.callback=null,m=h.priorityLevel;var kt=_t(h.expirationTime<=z);z=e.unstable_now(),typeof kt=="function"?h.callback=kt:h===n(a)&&r(a),y(z)}else r(a);h=n(a)}if(h!==null)var ks=!0;else{var Gn=n(u);Gn!==null&&Vl(v,Gn.startTime-z),ks=!1}return ks}finally{h=null,m=$,g=!1}}var N=!1,k=null,O=-1,vt=5,Y=-1;function Te(){return!(e.unstable_now()-Yb||125_t?(b.sortIndex=$,t(u,b),n(a)===null&&b===n(u)&&(S?(p(O),O=-1):S=!0,Vl(v,$-_t))):(b.sortIndex=kt,t(a,b),w||g||(w=!0,jl(E))),b},e.unstable_shouldYield=Te,e.unstable_wrapCallback=function(b){var z=m;return function(){var $=m;m=z;try{return b.apply(this,arguments)}finally{m=$}}}})(Zf);Xf.exports=Zf;var Ng=Xf.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var kg=rr,ae=Ng;function _(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ka=Object.prototype.hasOwnProperty,Og=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,id={},sd={};function Dg(e){return ka.call(sd,e)?!0:ka.call(id,e)?!1:Og.test(e)?sd[e]=!0:(id[e]=!0,!1)}function Fg(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Bg(e,t,n,r){if(t===null||typeof t>"u"||Fg(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Ht(e,t,n,r,i,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var Rt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Rt[e]=new Ht(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Rt[t]=new Ht(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Rt[e]=new Ht(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Rt[e]=new Ht(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Rt[e]=new Ht(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Rt[e]=new Ht(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Rt[e]=new Ht(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Rt[e]=new Ht(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Rt[e]=new Ht(e,5,!1,e.toLowerCase(),null,!1,!1)});var Uu=/[\-:]([a-z])/g;function xu(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Uu,xu);Rt[t]=new Ht(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Uu,xu);Rt[t]=new Ht(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Uu,xu);Rt[t]=new Ht(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Rt[e]=new Ht(e,1,!1,e.toLowerCase(),null,!1,!1)});Rt.xlinkHref=new Ht("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Rt[e]=new Ht(e,1,!1,e.toLowerCase(),null,!0,!0)});function Pu(e,t,n,r){var i=Rt.hasOwnProperty(t)?Rt[t]:null;(i!==null?i.type!==0:r||!(2l||i[o]!==s[l]){var a=` -`+i[o].replace(" at new "," at ");return e.displayName&&a.includes("")&&(a=a.replace("",e.displayName)),a}while(1<=o&&0<=l);break}}}finally{Yl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ni(e):""}function Rg(e){switch(e.tag){case 5:return Ni(e.type);case 16:return Ni("Lazy");case 13:return Ni("Suspense");case 19:return Ni("SuspenseList");case 0:case 2:case 15:return e=Ql(e.type,!1),e;case 11:return e=Ql(e.type.render,!1),e;case 1:return e=Ql(e.type,!0),e;default:return""}}function Ba(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Fr:return"Fragment";case Dr:return"Portal";case Oa:return"Profiler";case zu:return"StrictMode";case Da:return"Suspense";case Fa:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case nh:return(e.displayName||"Context")+".Consumer";case eh:return(e._context.displayName||"Context")+".Provider";case ju:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Vu:return t=e.displayName||null,t!==null?t:Ba(e.type)||"Memo";case In:t=e._payload,e=e._init;try{return Ba(e(t))}catch{}}return null}function Ag(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ba(t);case 8:return t===zu?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function xn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ih(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Lg(e){var t=ih(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Bs(e){e._valueTracker||(e._valueTracker=Lg(e))}function sh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ih(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function _o(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ra(e,t){var n=t.checked;return yt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function ld(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=xn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function oh(e,t){t=t.checked,t!=null&&Pu(e,"checked",t,!1)}function Aa(e,t){oh(e,t);var n=xn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?La(e,t.type,n):t.hasOwnProperty("defaultValue")&&La(e,t.type,xn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ad(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function La(e,t,n){(t!=="number"||_o(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var ki=Array.isArray;function Vr(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Rs.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ki(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var xi={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Cg=["Webkit","ms","Moz","O"];Object.keys(xi).forEach(function(e){Cg.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),xi[t]=xi[e]})});function ch(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||xi.hasOwnProperty(e)&&xi[e]?(""+t).trim():t+"px"}function dh(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=ch(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var Mg=yt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ua(e,t){if(t){if(Mg[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(_(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(_(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(_(61))}if(t.style!=null&&typeof t.style!="object")throw Error(_(62))}}function xa(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Pa=null;function $u(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var za=null,$r=null,Wr=null;function dd(e){if(e=ws(e)){if(typeof za!="function")throw Error(_(280));var t=e.stateNode;t&&(t=Tl(t),za(e.stateNode,e.type,t))}}function fh(e){$r?Wr?Wr.push(e):Wr=[e]:$r=e}function hh(){if($r){var e=$r,t=Wr;if(Wr=$r=null,dd(e),t)for(e=0;e>>=0,e===0?32:31-(Qg(e)/Gg|0)|0}var As=64,Ls=4194304;function Oi(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Eo(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var l=o&~i;l!==0?r=Oi(l):(s&=o,s!==0&&(r=Oi(s)))}else o=n&~i,o!==0?r=Oi(o):s!==0&&(r=Oi(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function vs(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Be(t),e[t]=n}function Xg(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=zi),wd=" ",Sd=!1;function Ah(e,t){switch(e){case"keyup":return N0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Lh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Br=!1;function O0(e,t){switch(e){case"compositionend":return Lh(t);case"keypress":return t.which!==32?null:(Sd=!0,wd);case"textInput":return e=t.data,e===wd&&Sd?null:e;default:return null}}function D0(e,t){if(Br)return e==="compositionend"||!qu&&Ah(e,t)?(e=Bh(),Xs=Gu=On=null,Br=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}t:{for(;n;){if(n.nextSibling){n=n.nextSibling;break t}n=n.parentNode}n=void 0}n=Td(n)}}function xh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?xh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ph(){for(var e=window,t=_o();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=_o(e.document)}return t}function Xu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function x0(e){var t=Ph(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&xh(n.ownerDocument.documentElement,n)){if(r!==null&&Xu(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=Nd(n,s);var o=Nd(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Rr=null,Ya=null,Vi=null,Qa=!1;function kd(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Qa||Rr==null||Rr!==_o(r)||(r=Rr,"selectionStart"in r&&Xu(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Vi&&es(Vi,r)||(Vi=r,r=No(Ya,"onSelect"),0Cr||(e.current=Za[Cr],Za[Cr]=null,Cr--)}function lt(e,t){Cr++,Za[Cr]=e.current,e.current=t}var Pn={},Ut=Hn(Pn),Xt=Hn(!1),lr=Pn;function Zr(e,t){var n=e.type.contextTypes;if(!n)return Pn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Zt(e){return e=e.childContextTypes,e!=null}function Oo(){ut(Xt),ut(Ut)}function Ld(e,t,n){if(Ut.current!==Pn)throw Error(_(168));lt(Ut,t),lt(Xt,n)}function Gh(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(_(108,Ag(e)||"Unknown",i));return yt({},n,r)}function Do(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Pn,lr=Ut.current,lt(Ut,e),lt(Xt,Xt.current),!0}function Cd(e,t,n){var r=e.stateNode;if(!r)throw Error(_(169));n?(e=Gh(e,t,lr),r.__reactInternalMemoizedMergedChildContext=e,ut(Xt),ut(Ut),lt(Ut,e)):ut(Xt),lt(Xt,n)}var rn=null,Nl=!1,la=!1;function Kh(e){rn===null?rn=[e]:rn.push(e)}function J0(e){Nl=!0,Kh(e)}function Yn(){if(!la&&rn!==null){la=!0;var e=0,t=rt;try{var n=rn;for(rt=1;e>=o,i-=o,ln=1<<32-Be(t)+i|n<O?(vt=k,k=null):vt=k.sibling;var Y=m(p,k,y[O],v);if(Y===null){k===null&&(k=vt);break}e&&k&&Y.alternate===null&&t(p,k),f=s(Y,f,O),N===null?E=Y:N.sibling=Y,N=Y,k=vt}if(O===y.length)return n(p,k),dt&&qn(p,O),E;if(k===null){for(;OO?(vt=k,k=null):vt=k.sibling;var Te=m(p,k,Y.value,v);if(Te===null){k===null&&(k=vt);break}e&&k&&Te.alternate===null&&t(p,k),f=s(Te,f,O),N===null?E=Te:N.sibling=Te,N=Te,k=vt}if(Y.done)return n(p,k),dt&&qn(p,O),E;if(k===null){for(;!Y.done;O++,Y=y.next())Y=h(p,Y.value,v),Y!==null&&(f=s(Y,f,O),N===null?E=Y:N.sibling=Y,N=Y);return dt&&qn(p,O),E}for(k=r(p,k);!Y.done;O++,Y=y.next())Y=g(k,p,O,Y.value,v),Y!==null&&(e&&Y.alternate!==null&&k.delete(Y.key===null?O:Y.key),f=s(Y,f,O),N===null?E=Y:N.sibling=Y,N=Y);return e&&k.forEach(function(yi){return t(p,yi)}),dt&&qn(p,O),E}function it(p,f,y,v){if(typeof y=="object"&&y!==null&&y.type===Fr&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Fs:t:{for(var E=y.key,N=f;N!==null;){if(N.key===E){if(E=y.type,E===Fr){if(N.tag===7){n(p,N.sibling),f=i(N,y.props.children),f.return=p,p=f;break t}}else if(N.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===In&&xd(E)===N.type){n(p,N.sibling),f=i(N,y.props),f.ref=Ii(p,N,y),f.return=p,p=f;break t}n(p,N);break}else t(p,N);N=N.sibling}y.type===Fr?(f=sr(y.props.children,p.mode,v,y.key),f.return=p,p=f):(v=oo(y.type,y.key,y.props,null,p.mode,v),v.ref=Ii(p,f,y),v.return=p,p=v)}return o(p);case Dr:t:{for(N=y.key;f!==null;){if(f.key===N)if(f.tag===4&&f.stateNode.containerInfo===y.containerInfo&&f.stateNode.implementation===y.implementation){n(p,f.sibling),f=i(f,y.children||[]),f.return=p,p=f;break t}else{n(p,f);break}else t(p,f);f=f.sibling}f=ya(y,p.mode,v),f.return=p,p=f}return o(p);case In:return N=y._init,it(p,f,N(y._payload),v)}if(ki(y))return w(p,f,y,v);if(gi(y))return S(p,f,y,v);js(p,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,f!==null&&f.tag===6?(n(p,f.sibling),f=i(f,y),f.return=p,p=f):(n(p,f),f=pa(y,p.mode,v),f.return=p,p=f),o(p)):n(p,f)}return it}var ei=Zh(!0),tp=Zh(!1),Ro=Hn(null),Ao=null,xr=null,nc=null;function rc(){nc=xr=Ao=null}function ic(e){var t=Ro.current;ut(Ro),e._currentValue=t}function nu(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Yr(e,t){Ao=e,nc=xr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(qt=!0),e.firstContext=null)}function Se(e){var t=e._currentValue;if(nc!==e)if(e={context:e,memoizedValue:t,next:null},xr===null){if(Ao===null)throw Error(_(308));xr=e,Ao.dependencies={lanes:0,firstContext:e}}else xr=xr.next=e;return t}var tr=null;function sc(e){tr===null?tr=[e]:tr.push(e)}function ep(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,sc(t)):(n.next=i.next,i.next=n),t.interleaved=n,fn(e,r)}function fn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var En=!1;function oc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function np(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function un(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ln(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,K&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,fn(e,n)}return i=r.interleaved,i===null?(t.next=t,sc(r)):(t.next=i.next,i.next=t),r.interleaved=t,fn(e,n)}function to(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Hu(e,n)}}function Pd(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Lo(e,t,n,r){var i=e.updateQueue;En=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var a=l,u=a.next;a.next=null,o===null?s=u:o.next=u,o=a;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=a))}if(s!==null){var h=i.baseState;o=0,d=u=a=null,l=s;do{var m=l.lane,g=l.eventTime;if((r&m)===m){d!==null&&(d=d.next={eventTime:g,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});t:{var w=e,S=l;switch(m=t,g=n,S.tag){case 1:if(w=S.payload,typeof w=="function"){h=w.call(g,h,m);break t}h=w;break t;case 3:w.flags=w.flags&-65537|128;case 0:if(w=S.payload,m=typeof w=="function"?w.call(g,h,m):w,m==null)break t;h=yt({},h,m);break t;case 2:En=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,m=i.effects,m===null?i.effects=[l]:m.push(l))}else g={eventTime:g,lane:m,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=g,a=h):d=d.next=g,o|=m;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;m=l,l=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(!0);if(d===null&&(a=h),i.baseState=a,i.firstBaseUpdate=u,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);cr|=o,e.lanes=o,e.memoizedState=h}}function zd(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=ua.transition;ua.transition={};try{e(!1),t()}finally{rt=n,ua.transition=r}}function _p(){return Ie().memoizedState}function tv(e,t,n){var r=Mn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},wp(e))Sp(t,n);else if(n=ep(e,t,n,r),n!==null){var i=$t();Re(n,e,r,i),Ip(n,t,r)}}function ev(e,t,n){var r=Mn(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(wp(e))Sp(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,l=s(o,n);if(i.hasEagerState=!0,i.eagerState=l,Le(l,o)){var a=t.interleaved;a===null?(i.next=i,sc(t)):(i.next=a.next,a.next=i),t.interleaved=i;return}}catch{}finally{}n=ep(e,t,i,r),n!==null&&(i=$t(),Re(n,e,r,i),Ip(n,t,r))}}function wp(e){var t=e.alternate;return e===pt||t!==null&&t===pt}function Sp(e,t){$i=Mo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ip(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Hu(e,n)}}var Uo={readContext:Se,useCallback:At,useContext:At,useEffect:At,useImperativeHandle:At,useInsertionEffect:At,useLayoutEffect:At,useMemo:At,useReducer:At,useRef:At,useState:At,useDebugValue:At,useDeferredValue:At,useTransition:At,useMutableSource:At,useSyncExternalStore:At,useId:At,unstable_isNewReconciler:!1},nv={readContext:Se,useCallback:function(e,t){return xe().memoizedState=[e,t===void 0?null:t],e},useContext:Se,useEffect:Vd,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,no(4194308,4,pp.bind(null,t,e),n)},useLayoutEffect:function(e,t){return no(4194308,4,e,t)},useInsertionEffect:function(e,t){return no(4,2,e,t)},useMemo:function(e,t){var n=xe();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=xe();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=tv.bind(null,pt,e),[r.memoizedState,e]},useRef:function(e){var t=xe();return e={current:e},t.memoizedState=e},useState:jd,useDebugValue:pc,useDeferredValue:function(e){return xe().memoizedState=e},useTransition:function(){var e=jd(!1),t=e[0];return e=Z0.bind(null,e[1]),xe().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=pt,i=xe();if(dt){if(n===void 0)throw Error(_(407));n=n()}else{if(n=t(),Dt===null)throw Error(_(349));ur&30||op(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,Vd(ap.bind(null,r,s,e),[e]),r.flags|=2048,us(9,lp.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=xe(),t=Dt.identifierPrefix;if(dt){var n=an,r=ln;n=(r&~(1<<32-Be(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ls++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[je]=t,e[is]=r,Rp(e,t,!1,!1),t.stateNode=e;t:{switch(o=xa(n,r),n){case"dialog":at("cancel",e),at("close",e),i=r;break;case"iframe":case"object":case"embed":at("load",e),i=r;break;case"video":case"audio":for(i=0;iii&&(t.flags|=128,r=!0,Ei(s,!1),t.lanes=4194304)}else{if(!r)if(e=Co(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ei(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!dt)return Lt(t),null}else 2*wt()-s.renderingStartTime>ii&&n!==1073741824&&(t.flags|=128,r=!0,Ei(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=wt(),t.sibling=null,n=ft.current,lt(ft,r?n&1|2:n&1),t):(Lt(t),null);case 22:case 23:return wc(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ie&1073741824&&(Lt(t),t.subtreeFlags&6&&(t.flags|=8192)):Lt(t),null;case 24:return null;case 25:return null}throw Error(_(156,t.tag))}function cv(e,t){switch(tc(t),t.tag){case 1:return Zt(t.type)&&Oo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ni(),ut(Xt),ut(Ut),uc(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return ac(t),null;case 13:if(ut(ft),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(_(340));ti()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ut(ft),null;case 4:return ni(),null;case 10:return ic(t.type._context),null;case 22:case 23:return wc(),null;case 24:return null;default:return null}}var $s=!1,Ct=!1,dv=typeof WeakSet=="function"?WeakSet:Set,I=null;function Pr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){gt(e,t,r)}else n.current=null}function du(e,t,n){try{n()}catch(r){gt(e,t,r)}}var Zd=!1;function fv(e,t){if(Ga=bo,e=Ph(),Xu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else t:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break t}var o=0,l=-1,a=-1,u=0,d=0,h=e,m=null;e:for(;;){for(var g;h!==n||i!==0&&h.nodeType!==3||(l=o+i),h!==s||r!==0&&h.nodeType!==3||(a=o+r),h.nodeType===3&&(o+=h.nodeValue.length),(g=h.firstChild)!==null;)m=h,h=g;for(;;){if(h===e)break e;if(m===n&&++u===i&&(l=o),m===s&&++d===r&&(a=o),(g=h.nextSibling)!==null)break;h=m,m=h.parentNode}h=g}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ka={focusedElem:e,selectionRange:n},bo=!1,I=t;I!==null;)if(t=I,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,I=e;else for(;I!==null;){t=I;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var S=w.memoizedProps,it=w.memoizedState,p=t.stateNode,f=p.getSnapshotBeforeUpdate(t.elementType===t.type?S:ke(t.type,S),it);p.__reactInternalSnapshotBeforeUpdate=f}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(_(163))}}catch(v){gt(t,t.return,v)}if(e=t.sibling,e!==null){e.return=t.return,I=e;break}I=t.return}return w=Zd,Zd=!1,w}function Wi(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&du(t,n,s)}i=i.next}while(i!==r)}}function Dl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function fu(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Cp(e){var t=e.alternate;t!==null&&(e.alternate=null,Cp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[je],delete t[is],delete t[Xa],delete t[G0],delete t[K0])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Mp(e){return e.tag===5||e.tag===3||e.tag===4}function tf(e){t:for(;;){for(;e.sibling===null;){if(e.return===null||Mp(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue t;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function hu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ko));else if(r!==4&&(e=e.child,e!==null))for(hu(e,t,n),e=e.sibling;e!==null;)hu(e,t,n),e=e.sibling}function pu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(pu(e,t,n),e=e.sibling;e!==null;)pu(e,t,n),e=e.sibling}var Ft=null,Oe=!1;function vn(e,t,n){for(n=n.child;n!==null;)Up(e,t,n),n=n.sibling}function Up(e,t,n){if(Qe&&typeof Qe.onCommitFiberUnmount=="function")try{Qe.onCommitFiberUnmount(Sl,n)}catch{}switch(n.tag){case 5:Ct||Pr(n,t);case 6:var r=Ft,i=Oe;Ft=null,vn(e,t,n),Ft=r,Oe=i,Ft!==null&&(Oe?(e=Ft,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ft.removeChild(n.stateNode));break;case 18:Ft!==null&&(Oe?(e=Ft,n=n.stateNode,e.nodeType===8?oa(e.parentNode,n):e.nodeType===1&&oa(e,n),Zi(e)):oa(Ft,n.stateNode));break;case 4:r=Ft,i=Oe,Ft=n.stateNode.containerInfo,Oe=!0,vn(e,t,n),Ft=r,Oe=i;break;case 0:case 11:case 14:case 15:if(!Ct&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&du(n,t,o),i=i.next}while(i!==r)}vn(e,t,n);break;case 1:if(!Ct&&(Pr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){gt(n,t,l)}vn(e,t,n);break;case 21:vn(e,t,n);break;case 22:n.mode&1?(Ct=(r=Ct)||n.memoizedState!==null,vn(e,t,n),Ct=r):vn(e,t,n);break;default:vn(e,t,n)}}function ef(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new dv),t.forEach(function(r){var i=Sv.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Ne(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=o),r&=~s}if(r=i,r=wt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*pv(r/1960))-r,10e?16:e,Dn===null)var r=!1;else{if(e=Dn,Dn=null,zo=0,K&6)throw Error(_(331));var i=K;for(K|=4,I=e.current;I!==null;){var s=I,o=s.child;if(I.flags&16){var l=s.deletions;if(l!==null){for(var a=0;awt()-vc?ir(e,0):gc|=n),te(e,t)}function Hp(e,t){t===0&&(e.mode&1?(t=Ls,Ls<<=1,!(Ls&130023424)&&(Ls=4194304)):t=1);var n=$t();e=fn(e,t),e!==null&&(vs(e,t,n),te(e,n))}function wv(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Hp(e,n)}function Sv(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(_(314))}r!==null&&r.delete(t),Hp(e,n)}var Yp;Yp=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Xt.current)qt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return qt=!1,av(e,t,n);qt=!!(e.flags&131072)}else qt=!1,dt&&t.flags&1048576&&Jh(t,Bo,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ro(e,t),e=t.pendingProps;var i=Zr(t,Ut.current);Yr(t,n),i=dc(null,t,r,e,i,n);var s=fc();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Zt(r)?(s=!0,Do(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,oc(t),i.updater=Ol,t.stateNode=i,i._reactInternals=t,iu(t,r,e,n),t=lu(null,t,r,!0,s,n)):(t.tag=0,dt&&s&&Zu(t),Pt(null,t,i,n),t=t.child),t;case 16:r=t.elementType;t:{switch(ro(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=Ev(r),e=ke(r,e),i){case 0:t=ou(null,t,r,e,n);break t;case 1:t=Jd(null,t,r,e,n);break t;case 11:t=Gd(null,t,r,e,n);break t;case 14:t=Kd(null,t,r,ke(r.type,e),n);break t}throw Error(_(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ke(r,i),ou(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ke(r,i),Jd(e,t,r,i,n);case 3:t:{if(Dp(t),e===null)throw Error(_(387));r=t.pendingProps,s=t.memoizedState,i=s.element,np(e,t),Lo(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=ri(Error(_(423)),t),t=qd(e,t,r,n,i);break t}else if(r!==i){i=ri(Error(_(424)),t),t=qd(e,t,r,n,i);break t}else for(oe=An(t.stateNode.containerInfo.firstChild),le=t,dt=!0,Fe=null,n=tp(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ti(),r===i){t=hn(e,t,n);break t}Pt(e,t,r,n)}t=t.child}return t;case 5:return rp(t),e===null&&eu(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,Ja(r,i)?o=null:s!==null&&Ja(r,s)&&(t.flags|=32),Op(e,t),Pt(e,t,o,n),t.child;case 6:return e===null&&eu(t),null;case 13:return Fp(e,t,n);case 4:return lc(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ei(t,null,r,n):Pt(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ke(r,i),Gd(e,t,r,i,n);case 7:return Pt(e,t,t.pendingProps,n),t.child;case 8:return Pt(e,t,t.pendingProps.children,n),t.child;case 12:return Pt(e,t,t.pendingProps.children,n),t.child;case 10:t:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,lt(Ro,r._currentValue),r._currentValue=o,s!==null)if(Le(s.value,o)){if(s.children===i.children&&!Xt.current){t=hn(e,t,n);break t}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var l=s.dependencies;if(l!==null){o=s.child;for(var a=l.firstContext;a!==null;){if(a.context===r){if(s.tag===1){a=un(-1,n&-n),a.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?a.next=a:(a.next=d.next,d.next=a),u.pending=a}}s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),nu(s.return,n,t),l.lanes|=n;break}a=a.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(_(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),nu(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Pt(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Yr(t,n),i=Se(i),r=r(i),t.flags|=1,Pt(e,t,r,n),t.child;case 14:return r=t.type,i=ke(r,t.pendingProps),i=ke(r.type,i),Kd(e,t,r,i,n);case 15:return Np(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ke(r,i),ro(e,t),t.tag=1,Zt(r)?(e=!0,Do(t)):e=!1,Yr(t,n),Ep(t,r,i),iu(t,r,i,n),lu(null,t,r,!0,e,n);case 19:return Bp(e,t,n);case 22:return kp(e,t,n)}throw Error(_(156,t.tag))};function Qp(e,t){return wh(e,t)}function Iv(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ve(e,t,n,r){return new Iv(e,t,n,r)}function Ic(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ev(e){if(typeof e=="function")return Ic(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ju)return 11;if(e===Vu)return 14}return 2}function Un(e,t){var n=e.alternate;return n===null?(n=ve(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function oo(e,t,n,r,i,s){var o=2;if(r=e,typeof e=="function")Ic(e)&&(o=1);else if(typeof e=="string")o=5;else t:switch(e){case Fr:return sr(n.children,i,s,t);case zu:o=8,i|=8;break;case Oa:return e=ve(12,n,t,i|2),e.elementType=Oa,e.lanes=s,e;case Da:return e=ve(13,n,t,i),e.elementType=Da,e.lanes=s,e;case Fa:return e=ve(19,n,t,i),e.elementType=Fa,e.lanes=s,e;case rh:return Bl(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case eh:o=10;break t;case nh:o=9;break t;case ju:o=11;break t;case Vu:o=14;break t;case In:o=16,r=null;break t}throw Error(_(130,e==null?e:typeof e,""))}return t=ve(o,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function sr(e,t,n,r){return e=ve(7,e,r,t),e.lanes=n,e}function Bl(e,t,n,r){return e=ve(22,e,r,t),e.elementType=rh,e.lanes=n,e.stateNode={isHidden:!1},e}function pa(e,t,n){return e=ve(6,e,null,t),e.lanes=n,e}function ya(e,t,n){return t=ve(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function bv(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Kl(0),this.expirationTimes=Kl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Kl(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Ec(e,t,n,r,i,s,o,l,a){return e=new bv(e,t,n,l,a),t===1?(t=1,s===!0&&(t|=8)):t=0,s=ve(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},oc(s),e}function Tv(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(qp)}catch(e){console.error(e)}}qp(),qf.exports=ce;var Fv=qf.exports,Xp,cf=Fv;Xp=cf.createRoot,cf.hydrateRoot;function P(e,t,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function l(d){try{u(r.next(d))}catch(h){o(h)}}function a(d){try{u(r.throw(d))}catch(h){o(h)}}function u(d){d.done?s(d.value):i(d.value).then(l,a)}u((r=r.apply(e,t||[])).next())})}function df(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function j(e){return this instanceof j?(this.v=e,this):new j(e)}function He(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),l("next"),l("throw"),l("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(g){return function(w){return Promise.resolve(w).then(g,h)}}function l(g,w){r[g]&&(i[g]=function(S){return new Promise(function(it,p){s.push([g,S,it,p])>1||a(g,S)})},w&&(i[g]=w(i[g])))}function a(g,w){try{u(r[g](w))}catch(S){m(s[0][3],S)}}function u(g){g.value instanceof j?Promise.resolve(g.value.v).then(d,h):m(s[0][2],g)}function d(g){a("next",g)}function h(g){a("throw",g)}function m(g,w){g(w),s.shift(),s.length&&a(s[0][0],s[0][1])}}function lo(e){var t,n;return t={},r("next"),r("throw",function(i){throw i}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(i,s){t[i]=e[i]?function(o){return(n=!n)?{value:j(e[i](o)),done:!1}:s?s(o):o}:s}}function or(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof df=="function"?df(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(s){n[s]=e[s]&&function(o){return new Promise(function(l,a){o=e[s](o),i(l,a,o.done,o.value)})}}function i(s,o,l,a){Promise.resolve(a).then(function(u){s({value:u,done:l})},o)}}const Bv=new TextDecoder("utf-8"),_u=e=>Bv.decode(e),Rv=new TextEncoder,kc=e=>Rv.encode(e),Av=e=>typeof e=="number",Zp=e=>typeof e=="boolean",bt=e=>typeof e=="function",ee=e=>e!=null&&Object(e)===e,fr=e=>ee(e)&&bt(e.then),Is=e=>ee(e)&&bt(e[Symbol.iterator]),hi=e=>ee(e)&&bt(e[Symbol.asyncIterator]),wu=e=>ee(e)&&ee(e.schema),ty=e=>ee(e)&&"done"in e&&"value"in e,ey=e=>ee(e)&&bt(e.stat)&&Av(e.fd),ny=e=>ee(e)&&Oc(e.body),Ml=e=>"_getDOMStream"in e&&"_getNodeStream"in e,Lv=e=>ee(e)&&bt(e.abort)&&bt(e.getWriter)&&!Ml(e),Oc=e=>ee(e)&&bt(e.cancel)&&bt(e.getReader)&&!Ml(e),Cv=e=>ee(e)&&bt(e.end)&&bt(e.write)&&Zp(e.writable)&&!Ml(e),ry=e=>ee(e)&&bt(e.read)&&bt(e.pipe)&&Zp(e.readable)&&!Ml(e),Mv=e=>ee(e)&&bt(e.clear)&&bt(e.bytes)&&bt(e.position)&&bt(e.setPosition)&&bt(e.capacity)&&bt(e.getBufferIdentifier)&&bt(e.createLong),Dc=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function Uv(e){const t=e[0]?[e[0]]:[];let n,r,i,s;for(let o,l,a=0,u=0,d=e.length;++ad+h.byteLength,0);let i,s,o,l=0,a=-1;const u=Math.min(t||Number.POSITIVE_INFINITY,r);for(const d=n.length;++ant(Int32Array,e),hf=e=>nt(BigInt64Array,e),Q=e=>nt(Uint8Array,e),Su=e=>(e.next(),e);function*xv(e,t){const n=function*(i){yield i},r=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Dc?n(t):Is(t)?t:n(t);return yield*Su(function*(i){let s=null;do s=i.next(yield nt(e,s));while(!s.done)}(r[Symbol.iterator]())),new e}const Pv=e=>xv(Uint8Array,e);function iy(e,t){return He(this,arguments,function*(){if(fr(t))return yield j(yield j(yield*lo(or(iy(e,yield j(t))))));const r=function(o){return He(this,arguments,function*(){yield yield j(yield j(o))})},i=function(o){return He(this,arguments,function*(){yield j(yield*lo(or(Su(function*(l){let a=null;do a=l.next(yield a==null?void 0:a.value);while(!a.done)}(o[Symbol.iterator]())))))})},s=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Dc?r(t):Is(t)?i(t):hi(t)?t:r(t);return yield j(yield*lo(or(Su(function(o){return He(this,arguments,function*(){let l=null;do l=yield j(o.next(yield yield j(nt(e,l))));while(!l.done)})}(s[Symbol.asyncIterator]()))))),yield j(new e)})}const zv=e=>iy(Uint8Array,e);function sy(e,t,n){if(e!==0){n=n.slice(0,t);for(let r=-1,i=n.length;++r0)do if(e[n]!==t[n])return!1;while(++n(e.next(),e);function*Vv(e){let t,n=!1,r=[],i,s,o,l=0;function a(){return s==="peek"?Ke(r,o)[0]:([i,r,l]=Ke(r,o),i)}({cmd:s,size:o}=(yield null)||{cmd:"read",size:0});const u=Pv(e)[Symbol.iterator]();try{do if({done:t,value:i}=Number.isNaN(o-l)?u.next():u.next(o-l),!t&&i.byteLength>0&&(r.push(i),l+=i.byteLength),t||o<=l)do({cmd:s,size:o}=yield a());while(o0&&(i.push(s),a+=s.byteLength),n||l<=a)do({cmd:o,size:l}=yield yield j(u()));while(l0&&(i.push(Q(s)),a+=s.byteLength),n||l<=a)do({cmd:o,size:l}=yield yield j(u()));while(l{})}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=null}cancel(t){return P(this,void 0,void 0,function*(){const{reader:n,source:r}=this;n&&(yield n.cancel(t).catch(()=>{})),r&&r.locked&&this.releaseLock()})}read(t){return P(this,void 0,void 0,function*(){if(t===0)return{done:this.reader==null,value:new Uint8Array(0)};const n=yield this.reader.read();return!n.done&&(n.value=Q(n)),n})}}const ma=(e,t)=>{const n=i=>r([t,i]);let r;return[t,n,new Promise(i=>(r=i)&&e.once(t,n))]};function Yv(e){return He(this,arguments,function*(){const n=[];let r="error",i=!1,s=null,o,l,a=0,u=[],d;function h(){return o==="peek"?Ke(u,l)[0]:([d,u,a]=Ke(u,l),d)}if({cmd:o,size:l}=(yield yield j(null))||{cmd:"read",size:0},e.isTTY)return yield yield j(new Uint8Array(0)),yield j(null);try{n[0]=ma(e,"end"),n[1]=ma(e,"error");do{if(n[2]=ma(e,"readable"),[r,s]=yield j(Promise.race(n.map(g=>g[2]))),r==="error")break;if((i=r==="end")||(Number.isFinite(l-a)?(d=Q(e.read(l-a)),d.byteLength0&&(u.push(d),a+=d.byteLength)),i||l<=a)do({cmd:o,size:l}=yield yield j(h()));while(l{for(const[p,f]of g)e.off(p,f);try{const p=e.destroy;p&&p.call(e,w),w=void 0}catch(p){w=p||w}finally{w!=null?it(w):S()}})}})}var St;(function(e){e[e.V1=0]="V1",e[e.V2=1]="V2",e[e.V3=2]="V3",e[e.V4=3]="V4",e[e.V5=4]="V5"})(St||(St={}));var xt;(function(e){e[e.Sparse=0]="Sparse",e[e.Dense=1]="Dense"})(xt||(xt={}));var Mt;(function(e){e[e.HALF=0]="HALF",e[e.SINGLE=1]="SINGLE",e[e.DOUBLE=2]="DOUBLE"})(Mt||(Mt={}));var Ee;(function(e){e[e.DAY=0]="DAY",e[e.MILLISECOND=1]="MILLISECOND"})(Ee||(Ee={}));var A;(function(e){e[e.SECOND=0]="SECOND",e[e.MILLISECOND=1]="MILLISECOND",e[e.MICROSECOND=2]="MICROSECOND",e[e.NANOSECOND=3]="NANOSECOND"})(A||(A={}));var Je;(function(e){e[e.YEAR_MONTH=0]="YEAR_MONTH",e[e.DAY_TIME=1]="DAY_TIME",e[e.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(Je||(Je={}));const ga=2,Ve=4,sn=4,Z=4,bn=new Int32Array(2),pf=new Float32Array(bn.buffer),yf=new Float64Array(bn.buffer),Qs=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var Iu;(function(e){e[e.UTF8_BYTES=1]="UTF8_BYTES",e[e.UTF16_STRING=2]="UTF16_STRING"})(Iu||(Iu={}));let si=class oy{constructor(t){this.bytes_=t,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(t){return new oy(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(t){this.position_=t}capacity(){return this.bytes_.length}readInt8(t){return this.readUint8(t)<<24>>24}readUint8(t){return this.bytes_[t]}readInt16(t){return this.readUint16(t)<<16>>16}readUint16(t){return this.bytes_[t]|this.bytes_[t+1]<<8}readInt32(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}readUint32(t){return this.readInt32(t)>>>0}readInt64(t){return BigInt.asIntN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<>8}writeUint16(t,n){this.bytes_[t]=n,this.bytes_[t+1]=n>>8}writeInt32(t,n){this.bytes_[t]=n,this.bytes_[t+1]=n>>8,this.bytes_[t+2]=n>>16,this.bytes_[t+3]=n>>24}writeUint32(t,n){this.bytes_[t]=n,this.bytes_[t+1]=n>>8,this.bytes_[t+2]=n>>16,this.bytes_[t+3]=n>>24}writeInt64(t,n){this.writeInt32(t,Number(BigInt.asIntN(32,n))),this.writeInt32(t+4,Number(BigInt.asIntN(32,n>>BigInt(32))))}writeUint64(t,n){this.writeUint32(t,Number(BigInt.asUintN(32,n))),this.writeUint32(t+4,Number(BigInt.asUintN(32,n>>BigInt(32))))}writeFloat32(t,n){pf[0]=n,this.writeInt32(t,bn[0])}writeFloat64(t,n){yf[0]=n,this.writeInt32(t,bn[Qs?0:1]),this.writeInt32(t+4,bn[Qs?1:0])}getBufferIdentifier(){if(this.bytes_.lengththis.minalign&&(this.minalign=t);const r=~(this.bb.capacity()-this.space+n)+1&t-1;for(;this.space=0&&this.vtable[n]==0;n--);const r=n+1;for(;n>=0;n--)this.addInt16(this.vtable[n]!=0?t-this.vtable[n]:0);const i=2;this.addInt16(t-this.object_start);const s=(r+i)*ga;this.addInt16(s);let o=0;const l=this.space;t:for(n=0;n=0;o--)this.writeInt8(s.charCodeAt(o))}this.prep(this.minalign,Ve+i),this.addOffset(t),i&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,n){this.finish(t,n,!0)}requiredField(t,n){const r=this.bb.capacity()-t,i=r-this.bb.readInt32(r);if(!(n=0;r--)t.addInt32(n[r]);return t.endVector()}static startTypeIdsVector(t,n){t.startVector(4,n,4)}static endUnion(t){return t.endObject()}static createUnion(t,n,r){return Kt.startUnion(t),Kt.addMode(t,n),Kt.addTypeIds(t,r),Kt.endUnion(t)}}let If=class Mi{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsUtf8(t,n){return(n||new Mi).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,n){return t.setPosition(t.position()+Z),(n||new Mi).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(t){t.startObject(0)}static endUtf8(t){return t.endObject()}static createUtf8(t){return Mi.startUtf8(t),Mi.endUtf8(t)}};var ot;(function(e){e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.FloatingPoint=3]="FloatingPoint",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct_=13]="Struct_",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Duration=18]="Duration",e[e.LargeBinary=19]="LargeBinary",e[e.LargeUtf8=20]="LargeUtf8",e[e.LargeList=21]="LargeList",e[e.RunEndEncoded=22]="RunEndEncoded"})(ot||(ot={}));let fe=class po{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsField(t,n){return(n||new po).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,n){return t.setPosition(t.position()+Z),(n||new po).__init(t.readInt32(t.position())+t.position(),t)}name(t){const n=this.bb.__offset(this.bb_pos,4);return n?this.bb.__string(this.bb_pos+n,t):null}nullable(){const t=this.bb.__offset(this.bb_pos,6);return t?!!this.bb.readInt8(this.bb_pos+t):!1}typeType(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint8(this.bb_pos+t):ot.NONE}type(t){const n=this.bb.__offset(this.bb_pos,10);return n?this.bb.__union(t,this.bb_pos+n):null}dictionary(t){const n=this.bb.__offset(this.bb_pos,12);return n?(t||new on).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}children(t,n){const r=this.bb.__offset(this.bb_pos,14);return r?(n||new po).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}childrenLength(){const t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,n){const r=this.bb.__offset(this.bb_pos,16);return r?(n||new Tt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__vector_len(this.bb_pos+t):0}static startField(t){t.startObject(7)}static addName(t,n){t.addFieldOffset(0,n,0)}static addNullable(t,n){t.addFieldInt8(1,+n,0)}static addTypeType(t,n){t.addFieldInt8(2,n,ot.NONE)}static addType(t,n){t.addFieldOffset(3,n,0)}static addDictionary(t,n){t.addFieldOffset(4,n,0)}static addChildren(t,n){t.addFieldOffset(5,n,0)}static createChildrenVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addOffset(n[r]);return t.endVector()}static startChildrenVector(t,n){t.startVector(4,n,4)}static addCustomMetadata(t,n){t.addFieldOffset(6,n,0)}static createCustomMetadataVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addOffset(n[r]);return t.endVector()}static startCustomMetadataVector(t,n){t.startVector(4,n,4)}static endField(t){return t.endObject()}},Pe=class Xe{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsSchema(t,n){return(n||new Xe).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,n){return t.setPosition(t.position()+Z),(n||new Xe).__init(t.readInt32(t.position())+t.position(),t)}endianness(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):oi.Little}fields(t,n){const r=this.bb.__offset(this.bb_pos,6);return r?(n||new fe).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}fieldsLength(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,n){const r=this.bb.__offset(this.bb_pos,8);return r?(n||new Tt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}features(t){const n=this.bb.__offset(this.bb_pos,10);return n?this.bb.readInt64(this.bb.__vector(this.bb_pos+n)+t*8):BigInt(0)}featuresLength(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}static startSchema(t){t.startObject(4)}static addEndianness(t,n){t.addFieldInt16(0,n,oi.Little)}static addFields(t,n){t.addFieldOffset(1,n,0)}static createFieldsVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addOffset(n[r]);return t.endVector()}static startFieldsVector(t,n){t.startVector(4,n,4)}static addCustomMetadata(t,n){t.addFieldOffset(2,n,0)}static createCustomMetadataVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addOffset(n[r]);return t.endVector()}static startCustomMetadataVector(t,n){t.startVector(4,n,4)}static addFeatures(t,n){t.addFieldOffset(3,n,0)}static createFeaturesVector(t,n){t.startVector(8,n.length,8);for(let r=n.length-1;r>=0;r--)t.addInt64(n[r]);return t.endVector()}static startFeaturesVector(t,n){t.startVector(8,n,8)}static endSchema(t){return t.endObject()}static finishSchemaBuffer(t,n){t.finish(n)}static finishSizePrefixedSchemaBuffer(t,n){t.finish(n,void 0,!0)}static createSchema(t,n,r,i,s){return Xe.startSchema(t),Xe.addEndianness(t,n),Xe.addFields(t,r),Xe.addCustomMetadata(t,i),Xe.addFeatures(t,s),Xe.endSchema(t)}};var J;(function(e){e[e.NONE=0]="NONE",e[e.Schema=1]="Schema",e[e.DictionaryBatch=2]="DictionaryBatch",e[e.RecordBatch=3]="RecordBatch",e[e.Tensor=4]="Tensor",e[e.SparseTensor=5]="SparseTensor"})(J||(J={}));var c;(function(e){e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.Float=3]="Float",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct=13]="Struct",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Duration=18]="Duration",e[e.LargeBinary=19]="LargeBinary",e[e.LargeUtf8=20]="LargeUtf8",e[e.Dictionary=-1]="Dictionary",e[e.Int8=-2]="Int8",e[e.Int16=-3]="Int16",e[e.Int32=-4]="Int32",e[e.Int64=-5]="Int64",e[e.Uint8=-6]="Uint8",e[e.Uint16=-7]="Uint16",e[e.Uint32=-8]="Uint32",e[e.Uint64=-9]="Uint64",e[e.Float16=-10]="Float16",e[e.Float32=-11]="Float32",e[e.Float64=-12]="Float64",e[e.DateDay=-13]="DateDay",e[e.DateMillisecond=-14]="DateMillisecond",e[e.TimestampSecond=-15]="TimestampSecond",e[e.TimestampMillisecond=-16]="TimestampMillisecond",e[e.TimestampMicrosecond=-17]="TimestampMicrosecond",e[e.TimestampNanosecond=-18]="TimestampNanosecond",e[e.TimeSecond=-19]="TimeSecond",e[e.TimeMillisecond=-20]="TimeMillisecond",e[e.TimeMicrosecond=-21]="TimeMicrosecond",e[e.TimeNanosecond=-22]="TimeNanosecond",e[e.DenseUnion=-23]="DenseUnion",e[e.SparseUnion=-24]="SparseUnion",e[e.IntervalDayTime=-25]="IntervalDayTime",e[e.IntervalYearMonth=-26]="IntervalYearMonth",e[e.DurationSecond=-27]="DurationSecond",e[e.DurationMillisecond=-28]="DurationMillisecond",e[e.DurationMicrosecond=-29]="DurationMicrosecond",e[e.DurationNanosecond=-30]="DurationNanosecond"})(c||(c={}));var en;(function(e){e[e.OFFSET=0]="OFFSET",e[e.DATA=1]="DATA",e[e.VALIDITY=2]="VALIDITY",e[e.TYPE=3]="TYPE"})(en||(en={}));const Qv=void 0;function ds(e){if(e===null)return"null";if(e===Qv)return"undefined";switch(typeof e){case"number":return`${e}`;case"bigint":return`${e}`;case"string":return`"${e}"`}return typeof e[Symbol.toPrimitive]=="function"?e[Symbol.toPrimitive]("string"):ArrayBuffer.isView(e)?e instanceof BigInt64Array||e instanceof BigUint64Array?`[${[...e].map(t=>ds(t))}]`:`[${e}]`:ArrayBuffer.isView(e)?`[${e}]`:JSON.stringify(e,(t,n)=>typeof n=="bigint"?`${n}`:n)}function st(e){if(typeof e=="bigint"&&(eNumber.MAX_SAFE_INTEGER))throw new TypeError(`${e} is not safe to convert to a number.`);return Number(e)}function dy(e,t){return st(e/t)+st(e%t)/st(t)}const Gv=Symbol.for("isArrowBigNum");function Ce(e,...t){return t.length===0?Object.setPrototypeOf(nt(this.TypedArray,e),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(e,...t),this.constructor.prototype)}Ce.prototype[Gv]=!0;Ce.prototype.toJSON=function(){return`"${hs(this)}"`};Ce.prototype.valueOf=function(e){return fy(this,e)};Ce.prototype.toString=function(){return hs(this)};Ce.prototype[Symbol.toPrimitive]=function(e="default"){switch(e){case"number":return fy(this);case"string":return hs(this);case"default":return qv(this)}return hs(this)};function Gr(...e){return Ce.apply(this,e)}function Kr(...e){return Ce.apply(this,e)}function fs(...e){return Ce.apply(this,e)}Object.setPrototypeOf(Gr.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Kr.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(fs.prototype,Object.create(Uint32Array.prototype));Object.assign(Gr.prototype,Ce.prototype,{constructor:Gr,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(Kr.prototype,Ce.prototype,{constructor:Kr,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(fs.prototype,Ce.prototype,{constructor:fs,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});const Kv=BigInt(4294967296)*BigInt(4294967296),Jv=Kv-BigInt(1);function fy(e,t){const{buffer:n,byteOffset:r,byteLength:i,signed:s}=e,o=new BigUint64Array(n,r,i/8),l=s&&o.at(-1)&BigInt(1)<=0)return va(e);t=t.slice();let r=1;for(let s=0;s(e.children=null,e.ArrayType=Array,e.OffsetArrayType=Int32Array,e[Symbol.toStringTag]="DataType"))(T.prototype);class zn extends T{constructor(){super(c.Null)}toString(){return"Null"}}py=Symbol.toStringTag;zn[py]=(e=>e[Symbol.toStringTag]="Null")(zn.prototype);class hr extends T{constructor(t,n){super(c.Int),this.isSigned=t,this.bitWidth=n}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}yy=Symbol.toStringTag;hr[yy]=(e=>(e.isSigned=null,e.bitWidth=null,e[Symbol.toStringTag]="Int"))(hr.prototype);class ps extends hr{constructor(){super(!0,32)}get ArrayType(){return Int32Array}}Object.defineProperty(ps.prototype,"ArrayType",{value:Int32Array});class Yo extends T{constructor(t){super(c.Float),this.precision=t}get ArrayType(){switch(this.precision){case Mt.HALF:return Uint16Array;case Mt.SINGLE:return Float32Array;case Mt.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}}my=Symbol.toStringTag;Yo[my]=(e=>(e.precision=null,e[Symbol.toStringTag]="Float"))(Yo.prototype);class Qo extends T{constructor(){super(c.Binary)}toString(){return"Binary"}}gy=Symbol.toStringTag;Qo[gy]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Binary"))(Qo.prototype);class Go extends T{constructor(){super(c.LargeBinary)}toString(){return"LargeBinary"}}vy=Symbol.toStringTag;Go[vy]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]="LargeBinary"))(Go.prototype);class Ko extends T{constructor(){super(c.Utf8)}toString(){return"Utf8"}}_y=Symbol.toStringTag;Ko[_y]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Utf8"))(Ko.prototype);class Jo extends T{constructor(){super(c.LargeUtf8)}toString(){return"LargeUtf8"}}wy=Symbol.toStringTag;Jo[wy]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]="LargeUtf8"))(Jo.prototype);class qo extends T{constructor(){super(c.Bool)}toString(){return"Bool"}}Sy=Symbol.toStringTag;qo[Sy]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Bool"))(qo.prototype);class Xo extends T{constructor(t,n,r=128){super(c.Decimal),this.scale=t,this.precision=n,this.bitWidth=r}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}}Iy=Symbol.toStringTag;Xo[Iy]=(e=>(e.scale=null,e.precision=null,e.ArrayType=Uint32Array,e[Symbol.toStringTag]="Decimal"))(Xo.prototype);class Zo extends T{constructor(t){super(c.Date),this.unit=t}toString(){return`Date${(this.unit+1)*32}<${Ee[this.unit]}>`}get ArrayType(){return this.unit===Ee.DAY?Int32Array:BigInt64Array}}Ey=Symbol.toStringTag;Zo[Ey]=(e=>(e.unit=null,e[Symbol.toStringTag]="Date"))(Zo.prototype);class tl extends T{constructor(t,n){super(c.Time),this.unit=t,this.bitWidth=n}toString(){return`Time${this.bitWidth}<${A[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}}by=Symbol.toStringTag;tl[by]=(e=>(e.unit=null,e.bitWidth=null,e[Symbol.toStringTag]="Time"))(tl.prototype);class el extends T{constructor(t,n){super(c.Timestamp),this.unit=t,this.timezone=n}toString(){return`Timestamp<${A[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}}Ty=Symbol.toStringTag;el[Ty]=(e=>(e.unit=null,e.timezone=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]="Timestamp"))(el.prototype);class nl extends T{constructor(t){super(c.Interval),this.unit=t}toString(){return`Interval<${Je[this.unit]}>`}}Ny=Symbol.toStringTag;nl[Ny]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Interval"))(nl.prototype);class rl extends T{constructor(t){super(c.Duration),this.unit=t}toString(){return`Duration<${A[this.unit]}>`}}ky=Symbol.toStringTag;rl[ky]=(e=>(e.unit=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]="Duration"))(rl.prototype);class il extends T{constructor(t){super(c.List),this.children=[t]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}}Oy=Symbol.toStringTag;il[Oy]=(e=>(e.children=null,e[Symbol.toStringTag]="List"))(il.prototype);class jt extends T{constructor(t){super(c.Struct),this.children=t}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}Dy=Symbol.toStringTag;jt[Dy]=(e=>(e.children=null,e[Symbol.toStringTag]="Struct"))(jt.prototype);class sl extends T{constructor(t,n,r){super(c.Union),this.mode=t,this.children=r,this.typeIds=n=Int32Array.from(n),this.typeIdToChildIndex=n.reduce((i,s,o)=>(i[s]=o)&&i||i,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}}Fy=Symbol.toStringTag;sl[Fy]=(e=>(e.mode=null,e.typeIds=null,e.children=null,e.typeIdToChildIndex=null,e.ArrayType=Int8Array,e[Symbol.toStringTag]="Union"))(sl.prototype);class ol extends T{constructor(t){super(c.FixedSizeBinary),this.byteWidth=t}toString(){return`FixedSizeBinary[${this.byteWidth}]`}}By=Symbol.toStringTag;ol[By]=(e=>(e.byteWidth=null,e.ArrayType=Uint8Array,e[Symbol.toStringTag]="FixedSizeBinary"))(ol.prototype);class ll extends T{constructor(t,n){super(c.FixedSizeList),this.listSize=t,this.children=[n]}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}Ry=Symbol.toStringTag;ll[Ry]=(e=>(e.children=null,e.listSize=null,e[Symbol.toStringTag]="FixedSizeList"))(ll.prototype);class al extends T{constructor(t,n=!1){var r,i,s;if(super(c.Map),this.children=[t],this.keysSorted=n,t&&(t.name="entries",!((r=t==null?void 0:t.type)===null||r===void 0)&&r.children)){const o=(i=t==null?void 0:t.type)===null||i===void 0?void 0:i.children[0];o&&(o.name="key");const l=(s=t==null?void 0:t.type)===null||s===void 0?void 0:s.children[1];l&&(l.name="value")}}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}Ay=Symbol.toStringTag;al[Ay]=(e=>(e.children=null,e.keysSorted=null,e[Symbol.toStringTag]="Map_"))(al.prototype);const Xv=(e=>()=>++e)(-1);class li extends T{constructor(t,n,r,i){super(c.Dictionary),this.indices=n,this.dictionary=t,this.isOrdered=i||!1,this.id=r==null?Xv():st(r)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}}Ly=Symbol.toStringTag;li[Ly]=(e=>(e.id=null,e.indices=null,e.isOrdered=null,e.dictionary=null,e[Symbol.toStringTag]="Dictionary"))(li.prototype);function nn(e){const t=e;switch(e.typeId){case c.Decimal:return e.bitWidth/32;case c.Interval:return 1+t.unit;case c.FixedSizeList:return t.listSize;case c.FixedSizeBinary:return t.byteWidth;default:return 1}}class V{visitMany(t,...n){return t.map((r,i)=>this.visit(r,...n.map(s=>s[i])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,n=!0){return Zv(this,t,n)}getVisitFnByTypeId(t,n=!0){return Nr(this,t,n)}visitNull(t,...n){return null}visitBool(t,...n){return null}visitInt(t,...n){return null}visitFloat(t,...n){return null}visitUtf8(t,...n){return null}visitLargeUtf8(t,...n){return null}visitBinary(t,...n){return null}visitLargeBinary(t,...n){return null}visitFixedSizeBinary(t,...n){return null}visitDate(t,...n){return null}visitTimestamp(t,...n){return null}visitTime(t,...n){return null}visitDecimal(t,...n){return null}visitList(t,...n){return null}visitStruct(t,...n){return null}visitUnion(t,...n){return null}visitDictionary(t,...n){return null}visitInterval(t,...n){return null}visitDuration(t,...n){return null}visitFixedSizeList(t,...n){return null}visitMap(t,...n){return null}}function Zv(e,t,n=!0){return typeof t=="number"?Nr(e,t,n):typeof t=="string"&&t in c?Nr(e,c[t],n):t&&t instanceof T?Nr(e,Ef(t),n):t!=null&&t.type&&t.type instanceof T?Nr(e,Ef(t.type),n):Nr(e,c.NONE,n)}function Nr(e,t,n=!0){let r=null;switch(t){case c.Null:r=e.visitNull;break;case c.Bool:r=e.visitBool;break;case c.Int:r=e.visitInt;break;case c.Int8:r=e.visitInt8||e.visitInt;break;case c.Int16:r=e.visitInt16||e.visitInt;break;case c.Int32:r=e.visitInt32||e.visitInt;break;case c.Int64:r=e.visitInt64||e.visitInt;break;case c.Uint8:r=e.visitUint8||e.visitInt;break;case c.Uint16:r=e.visitUint16||e.visitInt;break;case c.Uint32:r=e.visitUint32||e.visitInt;break;case c.Uint64:r=e.visitUint64||e.visitInt;break;case c.Float:r=e.visitFloat;break;case c.Float16:r=e.visitFloat16||e.visitFloat;break;case c.Float32:r=e.visitFloat32||e.visitFloat;break;case c.Float64:r=e.visitFloat64||e.visitFloat;break;case c.Utf8:r=e.visitUtf8;break;case c.LargeUtf8:r=e.visitLargeUtf8;break;case c.Binary:r=e.visitBinary;break;case c.LargeBinary:r=e.visitLargeBinary;break;case c.FixedSizeBinary:r=e.visitFixedSizeBinary;break;case c.Date:r=e.visitDate;break;case c.DateDay:r=e.visitDateDay||e.visitDate;break;case c.DateMillisecond:r=e.visitDateMillisecond||e.visitDate;break;case c.Timestamp:r=e.visitTimestamp;break;case c.TimestampSecond:r=e.visitTimestampSecond||e.visitTimestamp;break;case c.TimestampMillisecond:r=e.visitTimestampMillisecond||e.visitTimestamp;break;case c.TimestampMicrosecond:r=e.visitTimestampMicrosecond||e.visitTimestamp;break;case c.TimestampNanosecond:r=e.visitTimestampNanosecond||e.visitTimestamp;break;case c.Time:r=e.visitTime;break;case c.TimeSecond:r=e.visitTimeSecond||e.visitTime;break;case c.TimeMillisecond:r=e.visitTimeMillisecond||e.visitTime;break;case c.TimeMicrosecond:r=e.visitTimeMicrosecond||e.visitTime;break;case c.TimeNanosecond:r=e.visitTimeNanosecond||e.visitTime;break;case c.Decimal:r=e.visitDecimal;break;case c.List:r=e.visitList;break;case c.Struct:r=e.visitStruct;break;case c.Union:r=e.visitUnion;break;case c.DenseUnion:r=e.visitDenseUnion||e.visitUnion;break;case c.SparseUnion:r=e.visitSparseUnion||e.visitUnion;break;case c.Dictionary:r=e.visitDictionary;break;case c.Interval:r=e.visitInterval;break;case c.IntervalDayTime:r=e.visitIntervalDayTime||e.visitInterval;break;case c.IntervalYearMonth:r=e.visitIntervalYearMonth||e.visitInterval;break;case c.Duration:r=e.visitDuration;break;case c.DurationSecond:r=e.visitDurationSecond||e.visitDuration;break;case c.DurationMillisecond:r=e.visitDurationMillisecond||e.visitDuration;break;case c.DurationMicrosecond:r=e.visitDurationMicrosecond||e.visitDuration;break;case c.DurationNanosecond:r=e.visitDurationNanosecond||e.visitDuration;break;case c.FixedSizeList:r=e.visitFixedSizeList;break;case c.Map:r=e.visitMap;break}if(typeof r=="function")return r;if(!n)return()=>null;throw new Error(`Unrecognized type '${c[t]}'`)}function Ef(e){switch(e.typeId){case c.Null:return c.Null;case c.Int:{const{bitWidth:t,isSigned:n}=e;switch(t){case 8:return n?c.Int8:c.Uint8;case 16:return n?c.Int16:c.Uint16;case 32:return n?c.Int32:c.Uint32;case 64:return n?c.Int64:c.Uint64}return c.Int}case c.Float:switch(e.precision){case Mt.HALF:return c.Float16;case Mt.SINGLE:return c.Float32;case Mt.DOUBLE:return c.Float64}return c.Float;case c.Binary:return c.Binary;case c.LargeBinary:return c.LargeBinary;case c.Utf8:return c.Utf8;case c.LargeUtf8:return c.LargeUtf8;case c.Bool:return c.Bool;case c.Decimal:return c.Decimal;case c.Time:switch(e.unit){case A.SECOND:return c.TimeSecond;case A.MILLISECOND:return c.TimeMillisecond;case A.MICROSECOND:return c.TimeMicrosecond;case A.NANOSECOND:return c.TimeNanosecond}return c.Time;case c.Timestamp:switch(e.unit){case A.SECOND:return c.TimestampSecond;case A.MILLISECOND:return c.TimestampMillisecond;case A.MICROSECOND:return c.TimestampMicrosecond;case A.NANOSECOND:return c.TimestampNanosecond}return c.Timestamp;case c.Date:switch(e.unit){case Ee.DAY:return c.DateDay;case Ee.MILLISECOND:return c.DateMillisecond}return c.Date;case c.Interval:switch(e.unit){case Je.DAY_TIME:return c.IntervalDayTime;case Je.YEAR_MONTH:return c.IntervalYearMonth}return c.Interval;case c.Duration:switch(e.unit){case A.SECOND:return c.DurationSecond;case A.MILLISECOND:return c.DurationMillisecond;case A.MICROSECOND:return c.DurationMicrosecond;case A.NANOSECOND:return c.DurationNanosecond}return c.Duration;case c.Map:return c.Map;case c.List:return c.List;case c.Struct:return c.Struct;case c.Union:switch(e.mode){case xt.Dense:return c.DenseUnion;case xt.Sparse:return c.SparseUnion}return c.Union;case c.FixedSizeBinary:return c.FixedSizeBinary;case c.FixedSizeList:return c.FixedSizeList;case c.Dictionary:return c.Dictionary}throw new Error(`Unrecognized type '${c[e.typeId]}'`)}V.prototype.visitInt8=null;V.prototype.visitInt16=null;V.prototype.visitInt32=null;V.prototype.visitInt64=null;V.prototype.visitUint8=null;V.prototype.visitUint16=null;V.prototype.visitUint32=null;V.prototype.visitUint64=null;V.prototype.visitFloat16=null;V.prototype.visitFloat32=null;V.prototype.visitFloat64=null;V.prototype.visitDateDay=null;V.prototype.visitDateMillisecond=null;V.prototype.visitTimestampSecond=null;V.prototype.visitTimestampMillisecond=null;V.prototype.visitTimestampMicrosecond=null;V.prototype.visitTimestampNanosecond=null;V.prototype.visitTimeSecond=null;V.prototype.visitTimeMillisecond=null;V.prototype.visitTimeMicrosecond=null;V.prototype.visitTimeNanosecond=null;V.prototype.visitDenseUnion=null;V.prototype.visitSparseUnion=null;V.prototype.visitIntervalDayTime=null;V.prototype.visitIntervalYearMonth=null;V.prototype.visitDuration=null;V.prototype.visitDurationSecond=null;V.prototype.visitDurationMillisecond=null;V.prototype.visitDurationMicrosecond=null;V.prototype.visitDurationNanosecond=null;const Cy=new Float64Array(1),vr=new Uint32Array(Cy.buffer);function My(e){const t=(e&31744)>>10,n=(e&1023)/1024,r=Math.pow(-1,(e&32768)>>15);switch(t){case 31:return r*(n?Number.NaN:1/0);case 0:return r*(n?6103515625e-14*n:0)}return r*Math.pow(2,t-15)*(1+n)}function t_(e){if(e!==e)return 32256;Cy[0]=e;const t=(vr[1]&2147483648)>>16&65535;let n=vr[1]&2146435072,r=0;return n>=1089470464?vr[0]>0?n=31744:(n=(n&2080374784)>>16,r=(vr[1]&1048575)>>10):n<=1056964608?(r=1048576+(vr[1]&1048575),r=1048576+(r<<(n>>20)-998)>>21,n=0):(n=n-1056964608>>10,r=(vr[1]&1048575)+512>>10),t|n|r&65535}class L extends V{}function U(e){return(t,n,r)=>{if(t.setValid(n,r!=null))return e(t,n,r)}}const e_=(e,t,n)=>{e[t]=Math.floor(n/864e5)},Uy=(e,t,n,r)=>{if(n+1{const i=e+n;r?t[i>>3]|=1<>3]&=~(1<{e[t]=n},Bc=({values:e},t,n)=>{e[t]=n},xy=({values:e},t,n)=>{e[t]=t_(n)},r_=(e,t,n)=>{switch(e.type.precision){case Mt.HALF:return xy(e,t,n);case Mt.SINGLE:case Mt.DOUBLE:return Bc(e,t,n)}},Py=({values:e},t,n)=>{e_(e,t,n.valueOf())},zy=({values:e},t,n)=>{e[t]=BigInt(n)},i_=({stride:e,values:t},n,r)=>{t.set(r.subarray(0,e),e*n)},jy=({values:e,valueOffsets:t},n,r)=>Uy(e,t,n,r),Vy=({values:e,valueOffsets:t},n,r)=>Uy(e,t,n,kc(r)),s_=(e,t,n)=>{e.type.unit===Ee.DAY?Py(e,t,n):zy(e,t,n)},$y=({values:e},t,n)=>{e[t]=BigInt(n/1e3)},Wy=({values:e},t,n)=>{e[t]=BigInt(n)},Hy=({values:e},t,n)=>{e[t]=BigInt(n*1e3)},Yy=({values:e},t,n)=>{e[t]=BigInt(n*1e6)},o_=(e,t,n)=>{switch(e.type.unit){case A.SECOND:return $y(e,t,n);case A.MILLISECOND:return Wy(e,t,n);case A.MICROSECOND:return Hy(e,t,n);case A.NANOSECOND:return Yy(e,t,n)}},Qy=({values:e},t,n)=>{e[t]=n},Gy=({values:e},t,n)=>{e[t]=n},Ky=({values:e},t,n)=>{e[t]=n},Jy=({values:e},t,n)=>{e[t]=n},l_=(e,t,n)=>{switch(e.type.unit){case A.SECOND:return Qy(e,t,n);case A.MILLISECOND:return Gy(e,t,n);case A.MICROSECOND:return Ky(e,t,n);case A.NANOSECOND:return Jy(e,t,n)}},a_=({values:e,stride:t},n,r)=>{e.set(r.subarray(0,t),t*n)},u_=(e,t,n)=>{const r=e.children[0],i=e.valueOffsets,s=be.getVisitFn(r);if(Array.isArray(n))for(let o=-1,l=i[t],a=i[t+1];l{const r=e.children[0],{valueOffsets:i}=e,s=be.getVisitFn(r);let{[t]:o,[t+1]:l}=i;const a=n instanceof Map?n.entries():Object.entries(n);for(const u of a)if(s(r,o,u),++o>=l)break},d_=(e,t)=>(n,r,i,s)=>r&&n(r,e,t[s]),f_=(e,t)=>(n,r,i,s)=>r&&n(r,e,t.get(s)),h_=(e,t)=>(n,r,i,s)=>r&&n(r,e,t.get(i.name)),p_=(e,t)=>(n,r,i,s)=>r&&n(r,e,t[i.name]),y_=(e,t,n)=>{const r=e.type.children.map(s=>be.getVisitFn(s.type)),i=n instanceof Map?h_(t,n):n instanceof q?f_(t,n):Array.isArray(n)?d_(t,n):p_(t,n);e.type.children.forEach((s,o)=>i(r[o],e.children[o],s,o))},m_=(e,t,n)=>{e.type.mode===xt.Dense?qy(e,t,n):Xy(e,t,n)},qy=(e,t,n)=>{const r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];be.visit(i,e.valueOffsets[t],n)},Xy=(e,t,n)=>{const r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];be.visit(i,t,n)},g_=(e,t,n)=>{var r;(r=e.dictionary)===null||r===void 0||r.set(e.values[t],n)},v_=(e,t,n)=>{e.type.unit===Je.DAY_TIME?Zy(e,t,n):tm(e,t,n)},Zy=({values:e},t,n)=>{e.set(n.subarray(0,2),2*t)},tm=({values:e},t,n)=>{e[t]=n[0]*12+n[1]%12},em=({values:e},t,n)=>{e[t]=n},nm=({values:e},t,n)=>{e[t]=n},rm=({values:e},t,n)=>{e[t]=n},im=({values:e},t,n)=>{e[t]=n},__=(e,t,n)=>{switch(e.type.unit){case A.SECOND:return em(e,t,n);case A.MILLISECOND:return nm(e,t,n);case A.MICROSECOND:return rm(e,t,n);case A.NANOSECOND:return im(e,t,n)}},w_=(e,t,n)=>{const{stride:r}=e,i=e.children[0],s=be.getVisitFn(i);if(Array.isArray(n))for(let o=-1,l=t*r;++o`${ds(t)}: ${ds(n)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new S_(this[De],this[Jr])}}class S_{constructor(t,n){this.childIndex=0,this.children=t.children,this.rowIndex=n,this.childFields=t.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){const t=this.childIndex;return tn.name)}has(t,n){return t[De].type.children.findIndex(r=>r.name===n)!==-1}getOwnPropertyDescriptor(t,n){if(t[De].type.children.findIndex(r=>r.name===n)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,n){if(Reflect.has(t,n))return t[n];const r=t[De].type.children.findIndex(i=>i.name===n);if(r!==-1){const i=ne.visit(t[De].children[r],t[Jr]);return Reflect.set(t,n,i),i}}set(t,n,r){const i=t[De].type.children.findIndex(s=>s.name===n);return i!==-1?(be.visit(t[De].children[i],t[Jr],r),Reflect.set(t,n,r)):Reflect.has(t,n)||typeof n=="symbol"?Reflect.set(t,n,r):!1}}class D extends V{}function C(e){return(t,n)=>t.getValid(n)?e(t,n):null}const E_=(e,t)=>864e5*e[t],b_=(e,t)=>null,sm=(e,t,n)=>{if(n+1>=t.length)return null;const r=st(t[n]),i=st(t[n+1]);return e.subarray(r,i)},T_=({offset:e,values:t},n)=>{const r=e+n;return(t[r>>3]&1<E_(e,t),lm=({values:e},t)=>st(e[t]),Qn=({stride:e,values:t},n)=>t[e*n],N_=({stride:e,values:t},n)=>My(t[e*n]),am=({values:e},t)=>e[t],k_=({stride:e,values:t},n)=>t.subarray(e*n,e*(n+1)),um=({values:e,valueOffsets:t},n)=>sm(e,t,n),cm=({values:e,valueOffsets:t},n)=>{const r=sm(e,t,n);return r!==null?_u(r):null},O_=({values:e},t)=>e[t],D_=({type:e,values:t},n)=>e.precision!==Mt.HALF?t[n]:My(t[n]),F_=(e,t)=>e.type.unit===Ee.DAY?om(e,t):lm(e,t),dm=({values:e},t)=>1e3*st(e[t]),fm=({values:e},t)=>st(e[t]),hm=({values:e},t)=>dy(e[t],BigInt(1e3)),pm=({values:e},t)=>dy(e[t],BigInt(1e6)),B_=(e,t)=>{switch(e.type.unit){case A.SECOND:return dm(e,t);case A.MILLISECOND:return fm(e,t);case A.MICROSECOND:return hm(e,t);case A.NANOSECOND:return pm(e,t)}},ym=({values:e},t)=>e[t],mm=({values:e},t)=>e[t],gm=({values:e},t)=>e[t],vm=({values:e},t)=>e[t],R_=(e,t)=>{switch(e.type.unit){case A.SECOND:return ym(e,t);case A.MILLISECOND:return mm(e,t);case A.MICROSECOND:return gm(e,t);case A.NANOSECOND:return vm(e,t)}},A_=({values:e,stride:t},n)=>Fc.decimal(e.subarray(t*n,t*(n+1))),L_=(e,t)=>{const{valueOffsets:n,stride:r,children:i}=e,{[t*r]:s,[t*r+1]:o}=n,a=i[0].slice(s,o-s);return new q([a])},C_=(e,t)=>{const{valueOffsets:n,children:r}=e,{[t]:i,[t+1]:s}=n,o=r[0];return new Ac(o.slice(i,s-i))},M_=(e,t)=>new Rc(e,t),U_=(e,t)=>e.type.mode===xt.Dense?_m(e,t):wm(e,t),_m=(e,t)=>{const n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return ne.visit(r,e.valueOffsets[t])},wm=(e,t)=>{const n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return ne.visit(r,t)},x_=(e,t)=>{var n;return(n=e.dictionary)===null||n===void 0?void 0:n.get(e.values[t])},P_=(e,t)=>e.type.unit===Je.DAY_TIME?Sm(e,t):Im(e,t),Sm=({values:e},t)=>e.subarray(2*t,2*(t+1)),Im=({values:e},t)=>{const n=e[t],r=new Int32Array(2);return r[0]=Math.trunc(n/12),r[1]=Math.trunc(n%12),r},Em=({values:e},t)=>e[t],bm=({values:e},t)=>e[t],Tm=({values:e},t)=>e[t],Nm=({values:e},t)=>e[t],z_=(e,t)=>{switch(e.type.unit){case A.SECOND:return Em(e,t);case A.MILLISECOND:return bm(e,t);case A.MICROSECOND:return Tm(e,t);case A.NANOSECOND:return Nm(e,t)}},j_=(e,t)=>{const{stride:n,children:r}=e,s=r[0].slice(t*n,n);return new q([s])};D.prototype.visitNull=C(b_);D.prototype.visitBool=C(T_);D.prototype.visitInt=C(O_);D.prototype.visitInt8=C(Qn);D.prototype.visitInt16=C(Qn);D.prototype.visitInt32=C(Qn);D.prototype.visitInt64=C(am);D.prototype.visitUint8=C(Qn);D.prototype.visitUint16=C(Qn);D.prototype.visitUint32=C(Qn);D.prototype.visitUint64=C(am);D.prototype.visitFloat=C(D_);D.prototype.visitFloat16=C(N_);D.prototype.visitFloat32=C(Qn);D.prototype.visitFloat64=C(Qn);D.prototype.visitUtf8=C(cm);D.prototype.visitLargeUtf8=C(cm);D.prototype.visitBinary=C(um);D.prototype.visitLargeBinary=C(um);D.prototype.visitFixedSizeBinary=C(k_);D.prototype.visitDate=C(F_);D.prototype.visitDateDay=C(om);D.prototype.visitDateMillisecond=C(lm);D.prototype.visitTimestamp=C(B_);D.prototype.visitTimestampSecond=C(dm);D.prototype.visitTimestampMillisecond=C(fm);D.prototype.visitTimestampMicrosecond=C(hm);D.prototype.visitTimestampNanosecond=C(pm);D.prototype.visitTime=C(R_);D.prototype.visitTimeSecond=C(ym);D.prototype.visitTimeMillisecond=C(mm);D.prototype.visitTimeMicrosecond=C(gm);D.prototype.visitTimeNanosecond=C(vm);D.prototype.visitDecimal=C(A_);D.prototype.visitList=C(L_);D.prototype.visitStruct=C(M_);D.prototype.visitUnion=C(U_);D.prototype.visitDenseUnion=C(_m);D.prototype.visitSparseUnion=C(wm);D.prototype.visitDictionary=C(x_);D.prototype.visitInterval=C(P_);D.prototype.visitIntervalDayTime=C(Sm);D.prototype.visitIntervalYearMonth=C(Im);D.prototype.visitDuration=C(z_);D.prototype.visitDurationSecond=C(Em);D.prototype.visitDurationMillisecond=C(bm);D.prototype.visitDurationMicrosecond=C(Tm);D.prototype.visitDurationNanosecond=C(Nm);D.prototype.visitFixedSizeList=C(j_);D.prototype.visitMap=C(C_);const ne=new D,kr=Symbol.for("keys"),qr=Symbol.for("vals"),Or=Symbol.for("kKeysAsStrings"),Tu=Symbol.for("_kKeysAsStrings");class Ac{constructor(t){return this[kr]=new q([t.children[0]]).memoize(),this[qr]=t.children[1],new Proxy(this,new $_)}get[Or](){return this[Tu]||(this[Tu]=Array.from(this[kr].toArray(),String))}[Symbol.iterator](){return new V_(this[kr],this[qr])}get size(){return this[kr].length}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[kr],n=this[qr],r={};for(let i=-1,s=t.length;++i`${ds(t)}: ${ds(n)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}}class V_{constructor(t,n){this.keys=t,this.vals=n,this.keyIndex=0,this.numKeys=t.length}[Symbol.iterator](){return this}next(){const t=this.keyIndex;return t===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(t),ne.visit(this.vals,t)]})}}class $_{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[Or]}has(t,n){return t[Or].includes(n)}getOwnPropertyDescriptor(t,n){if(t[Or].indexOf(n)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,n){if(Reflect.has(t,n))return t[n];const r=t[Or].indexOf(n);if(r!==-1){const i=ne.visit(Reflect.get(t,qr),r);return Reflect.set(t,n,i),i}}set(t,n,r){const i=t[Or].indexOf(n);return i!==-1?(be.visit(Reflect.get(t,qr),i,r),Reflect.set(t,n,r)):Reflect.has(t,n)?Reflect.set(t,n,r):!1}}Object.defineProperties(Ac.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[kr]:{writable:!0,enumerable:!1,configurable:!1,value:null},[qr]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Tu]:{writable:!0,enumerable:!1,configurable:!1,value:null}});let bf;function km(e,t,n,r){const{length:i=0}=e;let s=typeof t!="number"?0:t,o=typeof n!="number"?i:n;return s<0&&(s=(s%i+i)%i),o<0&&(o=(o%i+i)%i),oi&&(o=i),r?r(e,s,o):[s,o]}const Lc=(e,t)=>e<0?t+e:e,Tf=e=>e!==e;function pi(e){if(typeof e!=="object"||e===null)return Tf(e)?Tf:n=>n===e;if(e instanceof Date){const n=e.valueOf();return r=>r instanceof Date?r.valueOf()===n:!1}return ArrayBuffer.isView(e)?n=>n?jv(e,n):!1:e instanceof Map?H_(e):Array.isArray(e)?W_(e):e instanceof q?Y_(e):Q_(e,!0)}function W_(e){const t=[];for(let n=-1,r=e.length;++n!1;const r=[];for(let i=-1,s=n.length;++i{if(!n||typeof n!="object")return!1;switch(n.constructor){case Array:return G_(e,n);case Map:return Nf(e,n,n.keys());case Ac:case Rc:case Object:case void 0:return Nf(e,n,t||Object.keys(n))}return n instanceof q?K_(e,n):!1}}function G_(e,t){const n=e.length;if(t.length!==n)return!1;for(let r=-1;++r>r}function ul(e,t,n){const r=n.byteLength+7&-8;if(e>0||n.byteLength>3):cl(new Cc(n,e,t,null,Om)).subarray(0,r)),i}return n}function cl(e){const t=[];let n=0,r=0,i=0;for(const o of e)o&&(i|=1<0)&&(t[n++]=i);const s=new Uint8Array(t.length+7&-8);return s.set(t),s}class Cc{constructor(t,n,r,i,s){this.bytes=t,this.length=r,this.context=i,this.get=s,this.bit=n%8,this.byteIndex=n>>3,this.byte=t[this.byteIndex++],this.index=0}next(){return this.index>3<<3,i=t+(t%8===0?0:8-t%8);return Nu(e,t,i)+Nu(e,r,n)+q_(e,i>>3,r-i>>3)}function q_(e,t,n){let r=0,i=Math.trunc(t);const s=new DataView(e.buffer,e.byteOffset,e.byteLength),o=n===void 0?e.byteLength:i+n;for(;o-i>=4;)r+=_a(s.getUint32(i)),i+=4;for(;o-i>=2;)r+=_a(s.getUint16(i)),i+=2;for(;o-i>=1;)r+=_a(s.getUint8(i)),i+=1;return r}function _a(e){let t=Math.trunc(e);return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}const X_=-1;class tt{get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){const{type:t}=this;return T.isSparseUnion(t)?this.children.some(n=>n.nullable):T.isDenseUnion(t)?this.children.some(n=>n.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let t=0;const{valueOffsets:n,values:r,nullBitmap:i,typeIds:s}=this;return n&&(t+=n.byteLength),r&&(t+=r.byteLength),i&&(t+=i.byteLength),s&&(t+=s.byteLength),this.children.reduce((o,l)=>o+l.byteLength,t)}get nullCount(){if(T.isUnion(this.type))return this.children.reduce((r,i)=>r+i.nullCount,0);let t=this._nullCount,n;return t<=X_&&(n=this.nullBitmap)&&(this._nullCount=t=n.length===0?0:this.length-Nu(n,this.offset,this.offset+this.length)),t}constructor(t,n,r,i,s,o=[],l){this.type=t,this.children=o,this.dictionary=l,this.offset=Math.floor(Math.max(n||0,0)),this.length=Math.floor(Math.max(r||0,0)),this._nullCount=Math.floor(Math.max(i||0,-1));let a;s instanceof tt?(this.stride=s.stride,this.values=s.values,this.typeIds=s.typeIds,this.nullBitmap=s.nullBitmap,this.valueOffsets=s.valueOffsets):(this.stride=nn(t),s&&((a=s[0])&&(this.valueOffsets=a),(a=s[1])&&(this.values=a),(a=s[2])&&(this.nullBitmap=a),(a=s[3])&&(this.typeIds=a)))}getValid(t){const{type:n}=this;if(T.isUnion(n)){const r=n,i=this.children[r.typeIdToChildIndex[this.typeIds[t]]],s=r.mode===xt.Dense?this.valueOffsets[t]:t;return i.getValid(s)}if(this.nullable&&this.nullCount>0){const r=this.offset+t;return(this.nullBitmap[r>>3]&1<>3;(!s||s.byteLength<=d)&&(s=new Uint8Array((o+l+63&-64)>>3).fill(255),this.nullCount>0?(s.set(ul(o,l,this.nullBitmap),0),Object.assign(this,{nullBitmap:s})):Object.assign(this,{nullBitmap:s,_nullCount:0}));const h=s[d];r=(h&u)!==0,s[d]=n?h|u:h&~u}return r!==!!n&&(this._nullCount=this.nullCount+(n?-1:1)),n}clone(t=this.type,n=this.offset,r=this.length,i=this._nullCount,s=this,o=this.children){return new tt(t,n,r,i,s,o,this.dictionary)}slice(t,n){const{stride:r,typeId:i,children:s}=this,o=+(this._nullCount===0)-1,l=i===16?r:1,a=this._sliceBuffers(t,n,r,i);return this.clone(this.type,this.offset+t,n,o,a,s.length===0||this.valueOffsets?s:this._sliceChildren(s,l*t,l*n))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===c.Null)return this.clone(this.type,0,t,0);const{length:n,nullCount:r}=this,i=new Uint8Array((t+63&-64)>>3).fill(255,0,n>>3);i[n>>3]=(1<0&&i.set(ul(this.offset,n,this.nullBitmap),0);const s=this.buffers;return s[en.VALIDITY]=i,this.clone(this.type,0,t,r+(t-n),s)}_sliceBuffers(t,n,r,i){let s;const{buffers:o}=this;return(s=o[en.TYPE])&&(o[en.TYPE]=s.subarray(t,t+n)),(s=o[en.OFFSET])&&(o[en.OFFSET]=s.subarray(t,t+n+1))||(s=o[en.DATA])&&(o[en.DATA]=i===6?s:s.subarray(r*t,r*(t+n))),o}_sliceChildren(t,n,r){return t.map(i=>i.slice(n,r))}}tt.prototype.children=Object.freeze([]);class Qi extends V{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){const{["type"]:n,["offset"]:r=0,["length"]:i=0}=t;return new tt(n,r,i,i)}visitBool(t){const{["type"]:n,["offset"]:r=0}=t,i=Q(t.nullBitmap),s=nt(n.ArrayType,t.data),{["length"]:o=s.length>>3,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new tt(n,r,o,l,[void 0,s,i])}visitInt(t){const{["type"]:n,["offset"]:r=0}=t,i=Q(t.nullBitmap),s=nt(n.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new tt(n,r,o,l,[void 0,s,i])}visitFloat(t){const{["type"]:n,["offset"]:r=0}=t,i=Q(t.nullBitmap),s=nt(n.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new tt(n,r,o,l,[void 0,s,i])}visitUtf8(t){const{["type"]:n,["offset"]:r=0}=t,i=Q(t.data),s=Q(t.nullBitmap),o=Ti(t.valueOffsets),{["length"]:l=o.length-1,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new tt(n,r,l,a,[o,i,s])}visitLargeUtf8(t){const{["type"]:n,["offset"]:r=0}=t,i=Q(t.data),s=Q(t.nullBitmap),o=hf(t.valueOffsets),{["length"]:l=o.length-1,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new tt(n,r,l,a,[o,i,s])}visitBinary(t){const{["type"]:n,["offset"]:r=0}=t,i=Q(t.data),s=Q(t.nullBitmap),o=Ti(t.valueOffsets),{["length"]:l=o.length-1,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new tt(n,r,l,a,[o,i,s])}visitLargeBinary(t){const{["type"]:n,["offset"]:r=0}=t,i=Q(t.data),s=Q(t.nullBitmap),o=hf(t.valueOffsets),{["length"]:l=o.length-1,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new tt(n,r,l,a,[o,i,s])}visitFixedSizeBinary(t){const{["type"]:n,["offset"]:r=0}=t,i=Q(t.nullBitmap),s=nt(n.ArrayType,t.data),{["length"]:o=s.length/nn(n),["nullCount"]:l=t.nullBitmap?-1:0}=t;return new tt(n,r,o,l,[void 0,s,i])}visitDate(t){const{["type"]:n,["offset"]:r=0}=t,i=Q(t.nullBitmap),s=nt(n.ArrayType,t.data),{["length"]:o=s.length/nn(n),["nullCount"]:l=t.nullBitmap?-1:0}=t;return new tt(n,r,o,l,[void 0,s,i])}visitTimestamp(t){const{["type"]:n,["offset"]:r=0}=t,i=Q(t.nullBitmap),s=nt(n.ArrayType,t.data),{["length"]:o=s.length/nn(n),["nullCount"]:l=t.nullBitmap?-1:0}=t;return new tt(n,r,o,l,[void 0,s,i])}visitTime(t){const{["type"]:n,["offset"]:r=0}=t,i=Q(t.nullBitmap),s=nt(n.ArrayType,t.data),{["length"]:o=s.length/nn(n),["nullCount"]:l=t.nullBitmap?-1:0}=t;return new tt(n,r,o,l,[void 0,s,i])}visitDecimal(t){const{["type"]:n,["offset"]:r=0}=t,i=Q(t.nullBitmap),s=nt(n.ArrayType,t.data),{["length"]:o=s.length/nn(n),["nullCount"]:l=t.nullBitmap?-1:0}=t;return new tt(n,r,o,l,[void 0,s,i])}visitList(t){const{["type"]:n,["offset"]:r=0,["child"]:i}=t,s=Q(t.nullBitmap),o=Ti(t.valueOffsets),{["length"]:l=o.length-1,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new tt(n,r,l,a,[o,void 0,s],[i])}visitStruct(t){const{["type"]:n,["offset"]:r=0,["children"]:i=[]}=t,s=Q(t.nullBitmap),{length:o=i.reduce((a,{length:u})=>Math.max(a,u),0),nullCount:l=t.nullBitmap?-1:0}=t;return new tt(n,r,o,l,[void 0,void 0,s],i)}visitUnion(t){const{["type"]:n,["offset"]:r=0,["children"]:i=[]}=t,s=nt(n.ArrayType,t.typeIds),{["length"]:o=s.length,["nullCount"]:l=-1}=t;if(T.isSparseUnion(n))return new tt(n,r,o,l,[void 0,void 0,void 0,s],i);const a=Ti(t.valueOffsets);return new tt(n,r,o,l,[a,void 0,void 0,s],i)}visitDictionary(t){const{["type"]:n,["offset"]:r=0}=t,i=Q(t.nullBitmap),s=nt(n.indices.ArrayType,t.data),{["dictionary"]:o=new q([new Qi().visit({type:n.dictionary})])}=t,{["length"]:l=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new tt(n,r,l,a,[void 0,s,i],[],o)}visitInterval(t){const{["type"]:n,["offset"]:r=0}=t,i=Q(t.nullBitmap),s=nt(n.ArrayType,t.data),{["length"]:o=s.length/nn(n),["nullCount"]:l=t.nullBitmap?-1:0}=t;return new tt(n,r,o,l,[void 0,s,i])}visitDuration(t){const{["type"]:n,["offset"]:r=0}=t,i=Q(t.nullBitmap),s=nt(n.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new tt(n,r,o,l,[void 0,s,i])}visitFixedSizeList(t){const{["type"]:n,["offset"]:r=0,["child"]:i=new Qi().visit({type:n.valueType})}=t,s=Q(t.nullBitmap),{["length"]:o=i.length/nn(n),["nullCount"]:l=t.nullBitmap?-1:0}=t;return new tt(n,r,o,l,[void 0,void 0,s],[i])}visitMap(t){const{["type"]:n,["offset"]:r=0,["child"]:i=new Qi().visit({type:n.childType})}=t,s=Q(t.nullBitmap),o=Ti(t.valueOffsets),{["length"]:l=o.length-1,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new tt(n,r,l,a,[o,void 0,s],[i])}}const Z_=new Qi;function W(e){return Z_.visit(e)}class kf{constructor(t=0,n){this.numChunks=t,this.getChunkIterator=n,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndext.nullable)}function Dm(e){return e.reduce((t,n)=>t+n.nullCount,0)}function Fm(e){return e.reduce((t,n,r)=>(t[r+1]=t[r]+n.length,t),new Uint32Array(e.length+1))}function Bm(e,t,n,r){const i=[];for(let s=-1,o=e.length;++s=r)break;if(n>=a+u)continue;if(a>=n&&a+u<=r){i.push(l);continue}const d=Math.max(0,n-a),h=Math.min(r-a,u);i.push(l.slice(d,h-d))}return i.length===0&&i.push(e[0].slice(0,0)),i}function Mc(e,t,n,r){let i=0,s=0,o=t.length-1;do{if(i>=o-1)return n0?0:-1}function nw(e,t){const{nullBitmap:n}=e;if(!n||e.nullCount<=0)return-1;let r=0;for(const i of new Cc(n,e.offset+(t||0),e.length,n,Om)){if(!i)return r;++r}return-1}function x(e,t,n){if(t===void 0)return-1;if(t===null)switch(e.typeId){case c.Union:break;case c.Dictionary:break;default:return nw(e,n)}const r=ne.getVisitFn(e),i=pi(t);for(let s=(n||0)-1,o=e.length;++s{const i=e.data[r];return i.values.subarray(0,i.length)[Symbol.iterator]()});let n=0;return new kf(e.data.length,r=>{const s=e.data[r].length,o=e.slice(n,n+s);return n+=s,new rw(o)})}class rw{constructor(t){this.vector=t,this.index=0}next(){return this.indexl.data):t;if(s.length===0||s.some(l=>!(l instanceof tt)))throw new TypeError("Vector constructor expects an Array of Data instances.");const o=(n=s[0])===null||n===void 0?void 0:n.type;switch(s.length){case 0:this._offsets=[0];break;case 1:{const{get:l,set:a,indexOf:u}=Mm[o.typeId],d=s[0];this.isValid=h=>Uc(d,h),this.get=h=>l(d,h),this.set=(h,m)=>a(d,h,m),this.indexOf=h=>u(d,h),this._offsets=[0,d.length];break}default:Object.setPrototypeOf(this,Um[o.typeId]),this._offsets=Fm(s);break}this.data=s,this.type=o,this.stride=nn(o),this.numChildren=(i=(r=o.children)===null||r===void 0?void 0:r.length)!==null&&i!==void 0?i:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,n)=>t+n.byteLength,0)}get nullable(){return tw(this.data)}get nullCount(){return Dm(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${c[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}at(t){return this.get(Lc(t,this.length))}set(t,n){}indexOf(t,n){return-1}includes(t,n){return this.indexOf(t,n)>-1}[Symbol.iterator](){return xc.visit(this)}concat(...t){return new q(this.data.concat(t.flatMap(n=>n.data).flat(Number.POSITIVE_INFINITY)))}slice(t,n){return new q(km(this,t,n,({data:r,_offsets:i},s,o)=>Bm(r,i,s,o)))}toJSON(){return[...this]}toArray(){const{type:t,data:n,length:r,stride:i,ArrayType:s}=this;switch(t.typeId){case c.Int:case c.Float:case c.Decimal:case c.Time:case c.Timestamp:switch(n.length){case 0:return new s;case 1:return n[0].values.subarray(0,r*i);default:return n.reduce((o,{values:l,length:a})=>(o.array.set(l.subarray(0,a*i),o.offset),o.offset+=a*i,o),{array:new s(r*i),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(t){var n;return this.getChildAt((n=this.type.children)===null||n===void 0?void 0:n.findIndex(r=>r.name===t))}getChildAt(t){return t>-1&&tn[t])):null}get isMemoized(){return T.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(T.isDictionary(this.type)){const t=new hl(this.data[0].dictionary),n=this.data.map(r=>{const i=r.clone();return i.dictionary=t,i});return new q(n)}return new hl(this)}unmemoize(){if(T.isDictionary(this.type)&&this.isMemoized){const t=this.data[0].dictionary.unmemoize(),n=this.data.map(r=>{const i=r.clone();return i.dictionary=t,i});return new q(n)}return this}}Cm=Symbol.toStringTag;q[Cm]=(e=>{e.type=T.prototype,e.data=[],e.length=0,e.stride=1,e.numChildren=0,e._offsets=new Uint32Array([0]),e[Symbol.isConcatSpreadable]=!0;const t=Object.keys(c).map(n=>c[n]).filter(n=>typeof n=="number"&&n!==c.NONE);for(const n of t){const r=ne.getVisitFnByTypeId(n),i=be.getVisitFnByTypeId(n),s=fl.getVisitFnByTypeId(n);Mm[n]={get:r,set:i,indexOf:s},Um[n]=Object.create(e,{isValid:{value:dl(Uc)},get:{value:dl(ne.getVisitFnByTypeId(n))},set:{value:Rm(be.getVisitFnByTypeId(n))},indexOf:{value:Am(fl.getVisitFnByTypeId(n))}})}return"Vector"})(q.prototype);class hl extends q{constructor(t){super(t.data);const n=this.get,r=this.set,i=this.slice,s=new Array(this.length);Object.defineProperty(this,"get",{value(o){const l=s[o];if(l!==void 0)return l;const a=n.call(this,o);return s[o]=a,a}}),Object.defineProperty(this,"set",{value(o,l){r.call(this,o,l),s[o]=l}}),Object.defineProperty(this,"slice",{value:(o,l)=>new hl(i.call(this,o,l))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new q(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}class ku{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}offset(){return this.bb.readInt64(this.bb_pos)}metaDataLength(){return this.bb.readInt32(this.bb_pos+8)}bodyLength(){return this.bb.readInt64(this.bb_pos+16)}static sizeOf(){return 24}static createBlock(t,n,r,i){return t.prep(8,24),t.writeInt64(BigInt(i??0)),t.pad(4),t.writeInt32(r),t.writeInt64(BigInt(n??0)),t.offset()}}class re{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsFooter(t,n){return(n||new re).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,n){return t.setPosition(t.position()+Z),(n||new re).__init(t.readInt32(t.position())+t.position(),t)}version(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):St.V1}schema(t){const n=this.bb.__offset(this.bb_pos,6);return n?(t||new Pe).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}dictionaries(t,n){const r=this.bb.__offset(this.bb_pos,8);return r?(n||new ku).__init(this.bb.__vector(this.bb_pos+r)+t*24,this.bb):null}dictionariesLength(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}recordBatches(t,n){const r=this.bb.__offset(this.bb_pos,10);return r?(n||new ku).__init(this.bb.__vector(this.bb_pos+r)+t*24,this.bb):null}recordBatchesLength(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,n){const r=this.bb.__offset(this.bb_pos,12);return r?(n||new Tt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startFooter(t){t.startObject(5)}static addVersion(t,n){t.addFieldInt16(0,n,St.V1)}static addSchema(t,n){t.addFieldOffset(1,n,0)}static addDictionaries(t,n){t.addFieldOffset(2,n,0)}static startDictionariesVector(t,n){t.startVector(24,n,8)}static addRecordBatches(t,n){t.addFieldOffset(3,n,0)}static startRecordBatchesVector(t,n){t.startVector(24,n,8)}static addCustomMetadata(t,n){t.addFieldOffset(4,n,0)}static createCustomMetadataVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addOffset(n[r]);return t.endVector()}static startCustomMetadataVector(t,n){t.startVector(4,n,4)}static endFooter(t){return t.endObject()}static finishFooterBuffer(t,n){t.finish(n)}static finishSizePrefixedFooterBuffer(t,n){t.finish(n,void 0,!0)}}class X{constructor(t=[],n,r,i=St.V5){this.fields=t||[],this.metadata=n||new Map,r||(r=Ou(this.fields)),this.dictionaries=r,this.metadataVersion=i}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(t=>t.name)}toString(){return`Schema<{ ${this.fields.map((t,n)=>`${n}: ${t}`).join(", ")} }>`}select(t){const n=new Set(t),r=this.fields.filter(i=>n.has(i.name));return new X(r,this.metadata)}selectAt(t){const n=t.map(r=>this.fields[r]).filter(Boolean);return new X(n,this.metadata)}assign(...t){const n=t[0]instanceof X?t[0]:Array.isArray(t[0])?new X(t[0]):new X(t),r=[...this.fields],i=Gs(Gs(new Map,this.metadata),n.metadata),s=n.fields.filter(l=>{const a=r.findIndex(u=>u.name===l.name);return~a?(r[a]=l.clone({metadata:Gs(Gs(new Map,r[a].metadata),l.metadata)}))&&!1:!0}),o=Ou(s,new Map);return new X([...r,...s],i,new Map([...this.dictionaries,...o]))}}X.prototype.fields=null;X.prototype.metadata=null;X.prototype.dictionaries=null;class ct{static new(...t){let[n,r,i,s]=t;return t[0]&&typeof t[0]=="object"&&({name:n}=t[0],r===void 0&&(r=t[0].type),i===void 0&&(i=t[0].nullable),s===void 0&&(s=t[0].metadata)),new ct(`${n}`,r,i,s)}constructor(t,n,r=!1,i){this.name=t,this.type=n,this.nullable=r,this.metadata=i||new Map}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...t){let[n,r,i,s]=t;return!t[0]||typeof t[0]!="object"?[n=this.name,r=this.type,i=this.nullable,s=this.metadata]=t:{name:n=this.name,type:r=this.type,nullable:i=this.nullable,metadata:s=this.metadata}=t[0],ct.new(n,r,i,s)}}ct.prototype.type=null;ct.prototype.name=null;ct.prototype.nullable=null;ct.prototype.metadata=null;function Gs(e,t){return new Map([...e||new Map,...t||new Map])}function Ou(e,t=new Map){for(let n=-1,r=e.length;++n0&&Ou(s.children,t)}return t}var iw=ly,sw=si;class ys{static decode(t){t=new sw(Q(t));const n=re.getRootAsFooter(t),r=X.decode(n.schema(),new Map,n.version());return new ow(r,n)}static encode(t){const n=new iw,r=X.encode(n,t.schema);re.startRecordBatchesVector(n,t.numRecordBatches);for(const o of[...t.recordBatches()].slice().reverse())jn.encode(n,o);const i=n.endVector();re.startDictionariesVector(n,t.numDictionaries);for(const o of[...t.dictionaryBatches()].slice().reverse())jn.encode(n,o);const s=n.endVector();return re.startFooter(n),re.addSchema(n,r),re.addVersion(n,St.V5),re.addRecordBatches(n,i),re.addDictionaries(n,s),re.finishFooterBuffer(n,re.endFooter(n)),n.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(t,n=St.V5,r,i){this.schema=t,this.version=n,r&&(this._recordBatches=r),i&&(this._dictionaryBatches=i)}*recordBatches(){for(let t,n=-1,r=this.numRecordBatches;++n=0&&t=0&&t=0&&t=0&&tthis._closedPromiseResolve=t)}get closed(){return this._closedPromise}cancel(t){return P(this,void 0,void 0,function*(){yield this.return(t)})}write(t){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(t):this.resolvers.shift().resolve({done:!1,value:t}))}abort(t){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:t}:this.resolvers.shift().reject({done:!0,value:t}))}close(){if(this._closedPromiseResolve){const{resolvers:t}=this;for(;t.length>0;)t.shift().resolve(ht);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return he.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return he.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return P(this,void 0,void 0,function*(){return yield this.abort(t),ht})}return(t){return P(this,void 0,void 0,function*(){return yield this.close(),ht})}read(t){return P(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return P(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(...t){return this._values.length>0?Promise.resolve({done:!1,value:this._values.shift()}):this._error?Promise.reject({done:!0,value:this._error.error}):this._closedPromiseResolve?new Promise((n,r)=>{this.resolvers.push({resolve:n,reject:r})}):Promise.resolve(ht)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}}class yo extends lw{write(t){if((t=Q(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?_u(this.toUint8Array(!0)):this.toUint8Array(!1).then(_u)}toUint8Array(t=!1){return t?Ke(this._values)[0]:P(this,void 0,void 0,function*(){var n,r,i,s;const o=[];let l=0;try{for(var a=!0,u=or(this),d;d=yield u.next(),n=d.done,!n;a=!0){s=d.value,a=!1;const h=s;o.push(h),l+=h.byteLength}}catch(h){r={error:h}}finally{try{!a&&!n&&(i=u.return)&&(yield i.call(u))}finally{if(r)throw r.error}}return Ke(o,l)[0]})}}class pl{constructor(t){t&&(this.source=new aw(he.fromIterable(t)))}[Symbol.iterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}}class ai{constructor(t){t instanceof ai?this.source=t.source:t instanceof yo?this.source=new Jn(he.fromAsyncIterable(t)):ry(t)?this.source=new Jn(he.fromNodeStream(t)):Oc(t)?this.source=new Jn(he.fromDOMStream(t)):ny(t)?this.source=new Jn(he.fromDOMStream(t.body)):Is(t)?this.source=new Jn(he.fromIterable(t)):fr(t)?this.source=new Jn(he.fromAsyncIterable(t)):hi(t)&&(this.source=new Jn(he.fromAsyncIterable(t)))}[Symbol.asyncIterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}get closed(){return this.source.closed}cancel(t){return this.source.cancel(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}}class aw{constructor(t){this.source=t}cancel(t){this.return(t)}peek(t){return this.next(t,"peek").value}read(t){return this.next(t,"read").value}next(t,n="read"){return this.source.next({cmd:n,size:t})}throw(t){return Object.create(this.source.throw&&this.source.throw(t)||ht)}return(t){return Object.create(this.source.return&&this.source.return(t)||ht)}}class Jn{constructor(t){this.source=t,this._closedPromise=new Promise(n=>this._closedPromiseResolve=n)}cancel(t){return P(this,void 0,void 0,function*(){yield this.return(t)})}get closed(){return this._closedPromise}read(t){return P(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return P(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(t){return P(this,arguments,void 0,function*(n,r="read"){return yield this.source.next({cmd:r,size:n})})}throw(t){return P(this,void 0,void 0,function*(){const n=this.source.throw&&(yield this.source.throw(t))||ht;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(n)})}return(t){return P(this,void 0,void 0,function*(){const n=this.source.return&&(yield this.source.return(t))||ht;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(n)})}}class Df extends pl{constructor(t,n){super(),this.position=0,this.buffer=Q(t),this.size=n===void 0?this.buffer.byteLength:n}readInt32(t){const{buffer:n,byteOffset:r}=this.readAt(t,4);return new DataView(n,r).getInt32(0,!0)}seek(t){return this.position=Math.min(t,this.size),t>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),r=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]);let i=n[3]*r[3];this.buffer[0]=i&65535;let s=i>>>16;return i=n[2]*r[3],s+=i,i=n[3]*r[2]>>>0,s+=i,this.buffer[0]+=s<<16,this.buffer[1]=s>>>0>>16,this.buffer[1]+=n[1]*r[3]+n[2]*r[2]+n[3]*r[1],this.buffer[1]+=n[0]*r[3]+n[1]*r[2]+n[2]*r[1]+n[3]*r[0]<<16,this}_plus(t){const n=this.buffer[0]+t.buffer[0]>>>0;this.buffer[1]+=t.buffer[1],n>>0&&++this.buffer[1],this.buffer[0]=n}lessThan(t){return this.buffer[1]>>0,n[2]=this.buffer[2]+t.buffer[2]>>>0,n[1]=this.buffer[1]+t.buffer[1]>>>0,n[0]=this.buffer[0]+t.buffer[0]>>>0,n[0]>>0&&++n[1],n[1]>>0&&++n[2],n[2]>>0&&++n[3],this.buffer[3]=n[3],this.buffer[2]=n[2],this.buffer[1]=n[1],this.buffer[0]=n[0],this}hex(){return`${jr(this.buffer[3])} ${jr(this.buffer[2])} ${jr(this.buffer[1])} ${jr(this.buffer[0])}`}static multiply(t,n){return new ze(new Uint32Array(t.buffer)).times(n)}static add(t,n){return new ze(new Uint32Array(t.buffer)).plus(n)}static from(t,n=new Uint32Array(4)){return ze.fromString(typeof t=="string"?t:t.toString(),n)}static fromNumber(t,n=new Uint32Array(4)){return ze.fromString(t.toString(),n)}static fromString(t,n=new Uint32Array(4)){const r=t.startsWith("-"),i=t.length,s=new ze(n);for(let o=r?1:0;o0&&this.readData(t,r)||new Uint8Array(0)}readOffsets(t,n){return this.readData(t,n)}readTypeIds(t,n){return this.readData(t,n)}readData(t,{length:n,offset:r}=this.nextBufferRange()){return this.bytes.subarray(r,r+n)}readDictionary(t){return this.dictionaries.get(t.id)}}class cw extends Pm{constructor(t,n,r,i,s){super(new Uint8Array(0),n,r,i,s),this.sources=t}readNullBitmap(t,n,{offset:r}=this.nextBufferRange()){return n<=0?new Uint8Array(0):cl(this.sources[r])}readOffsets(t,{offset:n}=this.nextBufferRange()){return nt(Uint8Array,nt(t.OffsetArrayType,this.sources[n]))}readTypeIds(t,{offset:n}=this.nextBufferRange()){return nt(Uint8Array,nt(t.ArrayType,this.sources[n]))}readData(t,{offset:n}=this.nextBufferRange()){const{sources:r}=this;return T.isTimestamp(t)||(T.isInt(t)||T.isTime(t))&&t.bitWidth===64||T.isDuration(t)||T.isDate(t)&&t.unit===Ee.MILLISECOND?nt(Uint8Array,Qt.convertArray(r[n])):T.isDecimal(t)?nt(Uint8Array,ze.convertArray(r[n])):T.isBinary(t)||T.isLargeBinary(t)||T.isFixedSizeBinary(t)?dw(r[n]):T.isBool(t)?cl(r[n]):T.isUtf8(t)||T.isLargeUtf8(t)?kc(r[n].join("")):nt(Uint8Array,nt(t.ArrayType,r[n].map(i=>+i)))}}function dw(e){const t=e.join(""),n=new Uint8Array(t.length/2);for(let r=0;r>1]=Number.parseInt(t.slice(r,r+2),16);return n}class R extends V{compareSchemas(t,n){return t===n||n instanceof t.constructor&&this.compareManyFields(t.fields,n.fields)}compareManyFields(t,n){return t===n||Array.isArray(t)&&Array.isArray(n)&&t.length===n.length&&t.every((r,i)=>this.compareFields(r,n[i]))}compareFields(t,n){return t===n||n instanceof t.constructor&&t.name===n.name&&t.nullable===n.nullable&&this.visit(t.type,n.type)}}function Yt(e,t){return t instanceof e.constructor}function mr(e,t){return e===t||Yt(e,t)}function mn(e,t){return e===t||Yt(e,t)&&e.bitWidth===t.bitWidth&&e.isSigned===t.isSigned}function xl(e,t){return e===t||Yt(e,t)&&e.precision===t.precision}function fw(e,t){return e===t||Yt(e,t)&&e.byteWidth===t.byteWidth}function jc(e,t){return e===t||Yt(e,t)&&e.unit===t.unit}function Es(e,t){return e===t||Yt(e,t)&&e.unit===t.unit&&e.timezone===t.timezone}function bs(e,t){return e===t||Yt(e,t)&&e.unit===t.unit&&e.bitWidth===t.bitWidth}function hw(e,t){return e===t||Yt(e,t)&&e.children.length===t.children.length&&Vn.compareManyFields(e.children,t.children)}function pw(e,t){return e===t||Yt(e,t)&&e.children.length===t.children.length&&Vn.compareManyFields(e.children,t.children)}function Vc(e,t){return e===t||Yt(e,t)&&e.mode===t.mode&&e.typeIds.every((n,r)=>n===t.typeIds[r])&&Vn.compareManyFields(e.children,t.children)}function yw(e,t){return e===t||Yt(e,t)&&e.id===t.id&&e.isOrdered===t.isOrdered&&Vn.visit(e.indices,t.indices)&&Vn.visit(e.dictionary,t.dictionary)}function $c(e,t){return e===t||Yt(e,t)&&e.unit===t.unit}function Ts(e,t){return e===t||Yt(e,t)&&e.unit===t.unit}function mw(e,t){return e===t||Yt(e,t)&&e.listSize===t.listSize&&e.children.length===t.children.length&&Vn.compareManyFields(e.children,t.children)}function gw(e,t){return e===t||Yt(e,t)&&e.keysSorted===t.keysSorted&&e.children.length===t.children.length&&Vn.compareManyFields(e.children,t.children)}R.prototype.visitNull=mr;R.prototype.visitBool=mr;R.prototype.visitInt=mn;R.prototype.visitInt8=mn;R.prototype.visitInt16=mn;R.prototype.visitInt32=mn;R.prototype.visitInt64=mn;R.prototype.visitUint8=mn;R.prototype.visitUint16=mn;R.prototype.visitUint32=mn;R.prototype.visitUint64=mn;R.prototype.visitFloat=xl;R.prototype.visitFloat16=xl;R.prototype.visitFloat32=xl;R.prototype.visitFloat64=xl;R.prototype.visitUtf8=mr;R.prototype.visitLargeUtf8=mr;R.prototype.visitBinary=mr;R.prototype.visitLargeBinary=mr;R.prototype.visitFixedSizeBinary=fw;R.prototype.visitDate=jc;R.prototype.visitDateDay=jc;R.prototype.visitDateMillisecond=jc;R.prototype.visitTimestamp=Es;R.prototype.visitTimestampSecond=Es;R.prototype.visitTimestampMillisecond=Es;R.prototype.visitTimestampMicrosecond=Es;R.prototype.visitTimestampNanosecond=Es;R.prototype.visitTime=bs;R.prototype.visitTimeSecond=bs;R.prototype.visitTimeMillisecond=bs;R.prototype.visitTimeMicrosecond=bs;R.prototype.visitTimeNanosecond=bs;R.prototype.visitDecimal=mr;R.prototype.visitList=hw;R.prototype.visitStruct=pw;R.prototype.visitUnion=Vc;R.prototype.visitDenseUnion=Vc;R.prototype.visitSparseUnion=Vc;R.prototype.visitDictionary=yw;R.prototype.visitInterval=$c;R.prototype.visitIntervalDayTime=$c;R.prototype.visitIntervalYearMonth=$c;R.prototype.visitDuration=Ts;R.prototype.visitDurationSecond=Ts;R.prototype.visitDurationMillisecond=Ts;R.prototype.visitDurationMicrosecond=Ts;R.prototype.visitDurationNanosecond=Ts;R.prototype.visitFixedSizeList=mw;R.prototype.visitMap=gw;const Vn=new R;function Du(e,t){return Vn.compareSchemas(e,t)}function wa(e,t){return vw(e,t.map(n=>n.data.concat()))}function vw(e,t){const n=[...e.fields],r=[],i={numBatches:t.reduce((h,m)=>Math.max(h,m.length),0)};let s=0,o=0,l=-1;const a=t.length;let u,d=[];for(;i.numBatches-- >0;){for(o=Number.POSITIVE_INFINITY,l=-1;++l0&&(r[s++]=W({type:new jt(n),length:o,nullCount:0,children:d.slice()})))}return[e=e.assign(n),r.map(h=>new Jt(e,h))]}function _w(e,t,n,r,i){var s;const o=(t+63&-64)>>3;for(let l=-1,a=r.length;++l=t)d===t?n[l]=u:(n[l]=u.slice(0,t),i.numBatches=Math.max(i.numBatches,r[l].unshift(u.slice(t,d-t))));else{const h=e[l];e[l]=h.clone({nullable:!0}),n[l]=(s=u==null?void 0:u._changeLengthAndBackfillNullBitmap(t))!==null&&s!==void 0?s:W({type:h.type,length:t,nullCount:t,nullBitmap:new Uint8Array(o)})}}return n}var zm;class zt{constructor(...t){var n,r;if(t.length===0)return this.batches=[],this.schema=new X([]),this._offsets=[0],this;let i,s;t[0]instanceof X&&(i=t.shift()),t.at(-1)instanceof Uint32Array&&(s=t.pop());const o=a=>{if(a){if(a instanceof Jt)return[a];if(a instanceof zt)return a.batches;if(a instanceof tt){if(a.type instanceof jt)return[new Jt(new X(a.type.children),a)]}else{if(Array.isArray(a))return a.flatMap(u=>o(u));if(typeof a[Symbol.iterator]=="function")return[...a].flatMap(u=>o(u));if(typeof a=="object"){const u=Object.keys(a),d=u.map(g=>new q([a[g]])),h=i??new X(u.map((g,w)=>new ct(String(g),d[w].type,d[w].nullable))),[,m]=wa(h,d);return m.length===0?[new Jt(a)]:m}}}return[]},l=t.flatMap(a=>o(a));if(i=(r=i??((n=l[0])===null||n===void 0?void 0:n.schema))!==null&&r!==void 0?r:new X([]),!(i instanceof X))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(const a of l){if(!(a instanceof Jt))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!Du(i,a.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=i,this.batches=l,this._offsets=s??Fm(this.data)}get data(){return this.batches.map(({data:t})=>t)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.reduce((t,n)=>t+n.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=Dm(this.data)),this._nullCount}isValid(t){return!1}get(t){return null}at(t){return this.get(Lc(t,this.numRows))}set(t,n){}indexOf(t,n){return-1}[Symbol.iterator](){return this.batches.length>0?xc.visit(new q(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[ - ${this.toArray().join(`, - `)} -]`}concat(...t){const n=this.schema,r=this.data.concat(t.flatMap(({data:i})=>i));return new zt(n,r.map(i=>new Jt(n,i)))}slice(t,n){const r=this.schema;[t,n]=km({length:this.numRows},t,n);const i=Bm(this.data,this._offsets,t,n);return new zt(r,i.map(s=>new Jt(r,s)))}getChild(t){return this.getChildAt(this.schema.fields.findIndex(n=>n.name===t))}getChildAt(t){if(t>-1&&tr.children[t]);if(n.length===0){const{type:r}=this.schema.fields[t],i=W({type:r,length:0,nullCount:0});n.push(i._changeLengthAndBackfillNullBitmap(this.numRows))}return new q(n)}return null}setChild(t,n){var r;return this.setChildAt((r=this.schema.fields)===null||r===void 0?void 0:r.findIndex(i=>i.name===t),n)}setChildAt(t,n){let r=this.schema,i=[...this.batches];if(t>-1&&tthis.getChildAt(u));[s[t],l[t]]=[o,n],[r,i]=wa(r,l)}return new zt(r,i)}select(t){const n=this.schema.fields.reduce((r,i,s)=>r.set(i.name,s),new Map);return this.selectAt(t.map(r=>n.get(r)).filter(r=>r>-1))}selectAt(t){const n=this.schema.selectAt(t),r=this.batches.map(i=>i.selectAt(t));return new zt(n,r)}assign(t){const n=this.schema.fields,[r,i]=t.schema.fields.reduce((l,a,u)=>{const[d,h]=l,m=n.findIndex(g=>g.name===a.name);return~m?h[m]=u:d.push(u),l},[[],[]]),s=this.schema.assign(t.schema),o=[...n.map((l,a)=>[a,i[a]]).map(([l,a])=>a===void 0?this.getChildAt(l):t.getChildAt(a)),...r.map(l=>t.getChildAt(l))].filter(Boolean);return new zt(...wa(s,o))}}zm=Symbol.toStringTag;zt[zm]=(e=>(e.schema=null,e.batches=[],e._offsets=new Uint32Array([0]),e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,e.isValid=dl(Uc),e.get=dl(ne.getVisitFn(c.Struct)),e.set=Rm(be.getVisitFn(c.Struct)),e.indexOf=Am(fl.getVisitFn(c.Struct)),"Table"))(zt.prototype);var jm;let Jt=class Ui{constructor(...t){switch(t.length){case 2:{if([this.schema]=t,!(this.schema instanceof X))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=W({nullCount:0,type:new jt(this.schema.fields),children:this.schema.fields.map(n=>W({type:n.type,nullCount:0}))})]=t,!(this.data instanceof tt))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=Ff(this.schema,this.data.children);break}case 1:{const[n]=t,{fields:r,children:i,length:s}=Object.keys(n).reduce((a,u,d)=>(a.children[d]=n[u],a.length=Math.max(a.length,n[u].length),a.fields[d]=ct.new({name:u,type:n[u].type,nullable:!0}),a),{length:0,fields:new Array,children:new Array}),o=new X(r),l=W({type:new jt(r),length:s,children:i,nullCount:0});[this.schema,this.data]=Ff(o,l.children,s);break}default:throw new TypeError("RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.")}}get dictionaries(){return this._dictionaries||(this._dictionaries=Vm(this.schema.fields,this.data.children))}get numCols(){return this.schema.fields.length}get numRows(){return this.data.length}get nullCount(){return this.data.nullCount}isValid(t){return this.data.getValid(t)}get(t){return ne.visit(this.data,t)}at(t){return this.get(Lc(t,this.numRows))}set(t,n){return be.visit(this.data,t,n)}indexOf(t,n){return fl.visit(this.data,t,n)}[Symbol.iterator](){return xc.visit(new q([this.data]))}toArray(){return[...this]}concat(...t){return new zt(this.schema,[this,...t])}slice(t,n){const[r]=new q([this.data]).slice(t,n).data;return new Ui(this.schema,r)}getChild(t){var n;return this.getChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(r=>r.name===t))}getChildAt(t){return t>-1&&ti.name===t),n)}setChildAt(t,n){let r=this.schema,i=this.data;if(t>-1&&tl.name===s);~o&&(i[o]=this.data.children[o])}return new Ui(n,W({type:r,length:this.numRows,children:i}))}selectAt(t){const n=this.schema.selectAt(t),r=t.map(s=>this.data.children[s]).filter(Boolean),i=W({type:new jt(n.fields),length:this.numRows,children:r});return new Ui(n,i)}};jm=Symbol.toStringTag;Jt[jm]=(e=>(e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(Jt.prototype);function Ff(e,t,n=t.reduce((r,i)=>Math.max(r,i.length),0)){var r;const i=[...e.fields],s=[...t],o=(n+63&-64)>>3;for(const[l,a]of e.fields.entries()){const u=t[l];(!u||u.length!==n)&&(i[l]=a.clone({nullable:!0}),s[l]=(r=u==null?void 0:u._changeLengthAndBackfillNullBitmap(n))!==null&&r!==void 0?r:W({type:a.type,length:n,nullCount:n,nullBitmap:new Uint8Array(o)}))}return[e.assign(i),W({type:new jt(i),length:n,children:s})]}function Vm(e,t,n=new Map){var r,i;if(((r=e==null?void 0:e.length)!==null&&r!==void 0?r:0)>0&&(e==null?void 0:e.length)===(t==null?void 0:t.length))for(let s=-1,o=e.length;++sW({type:i.type})),r=W({type:new jt(t.fields),nullCount:0,children:n});super(t,r)}}let _n=class Ue{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsMessage(t,n){return(n||new Ue).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,n){return t.setPosition(t.position()+Z),(n||new Ue).__init(t.readInt32(t.position())+t.position(),t)}version(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):St.V1}headerType(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):J.NONE}header(t){const n=this.bb.__offset(this.bb_pos,8);return n?this.bb.__union(t,this.bb_pos+n):null}bodyLength(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}customMetadata(t,n){const r=this.bb.__offset(this.bb_pos,12);return r?(n||new Tt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startMessage(t){t.startObject(5)}static addVersion(t,n){t.addFieldInt16(0,n,St.V1)}static addHeaderType(t,n){t.addFieldInt8(1,n,J.NONE)}static addHeader(t,n){t.addFieldOffset(2,n,0)}static addBodyLength(t,n){t.addFieldInt64(3,n,BigInt("0"))}static addCustomMetadata(t,n){t.addFieldOffset(4,n,0)}static createCustomMetadataVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addOffset(n[r]);return t.endVector()}static startCustomMetadataVector(t,n){t.startVector(4,n,4)}static endMessage(t){return t.endObject()}static finishMessageBuffer(t,n){t.finish(n)}static finishSizePrefixedMessageBuffer(t,n){t.finish(n,void 0,!0)}static createMessage(t,n,r,i,s,o){return Ue.startMessage(t),Ue.addVersion(t,n),Ue.addHeaderType(t,r),Ue.addHeader(t,i),Ue.addBodyLength(t,s),Ue.addCustomMetadata(t,o),Ue.endMessage(t)}};class ww extends V{visit(t,n){return t==null||n==null?void 0:super.visit(t,n)}visitNull(t,n){return Sf.startNull(n),Sf.endNull(n)}visitInt(t,n){return se.startInt(n),se.addBitWidth(n,t.bitWidth),se.addIsSigned(n,t.isSigned),se.endInt(n)}visitFloat(t,n){return $e.startFloatingPoint(n),$e.addPrecision(n,t.precision),$e.endFloatingPoint(n)}visitBinary(t,n){return mf.startBinary(n),mf.endBinary(n)}visitLargeBinary(t,n){return vf.startLargeBinary(n),vf.endLargeBinary(n)}visitBool(t,n){return gf.startBool(n),gf.endBool(n)}visitUtf8(t,n){return If.startUtf8(n),If.endUtf8(n)}visitLargeUtf8(t,n){return _f.startLargeUtf8(n),_f.endLargeUtf8(n)}visitDecimal(t,n){return Sr.startDecimal(n),Sr.addScale(n,t.scale),Sr.addPrecision(n,t.precision),Sr.addBitWidth(n,t.bitWidth),Sr.endDecimal(n)}visitDate(t,n){return ao.startDate(n),ao.addUnit(n,t.unit),ao.endDate(n)}visitTime(t,n){return me.startTime(n),me.addUnit(n,t.unit),me.addBitWidth(n,t.bitWidth),me.endTime(n)}visitTimestamp(t,n){const r=t.timezone&&n.createString(t.timezone)||void 0;return ge.startTimestamp(n),ge.addUnit(n,t.unit),r!==void 0&&ge.addTimezone(n,r),ge.endTimestamp(n)}visitInterval(t,n){return We.startInterval(n),We.addUnit(n,t.unit),We.endInterval(n)}visitDuration(t,n){return uo.startDuration(n),uo.addUnit(n,t.unit),uo.endDuration(n)}visitList(t,n){return wf.startList(n),wf.endList(n)}visitStruct(t,n){return nr.startStruct_(n),nr.endStruct_(n)}visitUnion(t,n){Kt.startTypeIdsVector(n,t.typeIds.length);const r=Kt.createTypeIdsVector(n,t.typeIds);return Kt.startUnion(n),Kt.addMode(n,t.mode),Kt.addTypeIds(n,r),Kt.endUnion(n)}visitDictionary(t,n){const r=this.visit(t.indices,n);return on.startDictionaryEncoding(n),on.addId(n,BigInt(t.id)),on.addIsOrdered(n,t.isOrdered),r!==void 0&&on.addIndexType(n,r),on.endDictionaryEncoding(n)}visitFixedSizeBinary(t,n){return co.startFixedSizeBinary(n),co.addByteWidth(n,t.byteWidth),co.endFixedSizeBinary(n)}visitFixedSizeList(t,n){return fo.startFixedSizeList(n),fo.addListSize(n,t.listSize),fo.endFixedSizeList(n)}visitMap(t,n){return ho.startMap(n),ho.addKeysSorted(n,t.keysSorted),ho.endMap(n)}}const Sa=new ww;function Sw(e,t=new Map){return new X(Ew(e,t),mo(e.metadata),t)}function $m(e){return new ue(e.count,Wm(e.columns),Hm(e.columns))}function Iw(e){return new qe($m(e.data),e.id,e.isDelta)}function Ew(e,t){return(e.fields||[]).filter(Boolean).map(n=>ct.fromJSON(n,t))}function Bf(e,t){return(e.children||[]).filter(Boolean).map(n=>ct.fromJSON(n,t))}function Wm(e){return(e||[]).reduce((t,n)=>[...t,new $n(n.count,bw(n.VALIDITY)),...Wm(n.children)],[])}function Hm(e,t=[]){for(let n=-1,r=(e||[]).length;++nt+ +(n===0),0)}function Tw(e,t){let n,r,i,s,o,l;return!t||!(s=e.dictionary)?(o=Af(e,Bf(e,t)),i=new ct(e.name,o,e.nullable,mo(e.metadata))):t.has(n=s.id)?(r=(r=s.indexType)?Rf(r):new ps,l=new li(t.get(n),r,n,s.isOrdered),i=new ct(e.name,l,e.nullable,mo(e.metadata))):(r=(r=s.indexType)?Rf(r):new ps,t.set(n,o=Af(e,Bf(e,t))),l=new li(o,r,n,s.isOrdered),i=new ct(e.name,l,e.nullable,mo(e.metadata))),i||null}function mo(e=[]){return new Map(e.map(({key:t,value:n})=>[t,n]))}function Rf(e){return new hr(e.isSigned,e.bitWidth)}function Af(e,t){const n=e.type.name;switch(n){case"NONE":return new zn;case"null":return new zn;case"binary":return new Qo;case"largebinary":return new Go;case"utf8":return new Ko;case"largeutf8":return new Jo;case"bool":return new qo;case"list":return new il((t||[])[0]);case"struct":return new jt(t||[]);case"struct_":return new jt(t||[])}switch(n){case"int":{const r=e.type;return new hr(r.isSigned,r.bitWidth)}case"floatingpoint":{const r=e.type;return new Yo(Mt[r.precision])}case"decimal":{const r=e.type;return new Xo(r.scale,r.precision,r.bitWidth)}case"date":{const r=e.type;return new Zo(Ee[r.unit])}case"time":{const r=e.type;return new tl(A[r.unit],r.bitWidth)}case"timestamp":{const r=e.type;return new el(A[r.unit],r.timezone)}case"interval":{const r=e.type;return new nl(Je[r.unit])}case"duration":{const r=e.type;return new rl(A[r.unit])}case"union":{const r=e.type,[i,...s]=(r.mode+"").toLowerCase(),o=i.toUpperCase()+s.join("");return new sl(xt[o],r.typeIds||[],t||[])}case"fixedsizebinary":{const r=e.type;return new ol(r.byteWidth)}case"fixedsizelist":{const r=e.type;return new ll(r.listSize,(t||[])[0])}case"map":{const r=e.type;return new al((t||[])[0],r.keysSorted)}}throw new Error(`Unrecognized type: "${n}"`)}var Nw=ly,kw=si;class Vt{static fromJSON(t,n){const r=new Vt(0,St.V5,n);return r._createHeader=Ow(t,n),r}static decode(t){t=new kw(Q(t));const n=_n.getRootAsMessage(t),r=n.bodyLength(),i=n.version(),s=n.headerType(),o=new Vt(r,i,s);return o._createHeader=Dw(n,s),o}static encode(t){const n=new Nw;let r=-1;return t.isSchema()?r=X.encode(n,t.header()):t.isRecordBatch()?r=ue.encode(n,t.header()):t.isDictionaryBatch()&&(r=qe.encode(n,t.header())),_n.startMessage(n),_n.addVersion(n,St.V5),_n.addHeader(n,r),_n.addHeaderType(n,t.headerType),_n.addBodyLength(n,BigInt(t.bodyLength)),_n.finishMessageBuffer(n,_n.endMessage(n)),n.asUint8Array()}static from(t,n=0){if(t instanceof X)return new Vt(0,St.V5,J.Schema,t);if(t instanceof ue)return new Vt(n,St.V5,J.RecordBatch,t);if(t instanceof qe)return new Vt(n,St.V5,J.DictionaryBatch,t);throw new Error(`Unrecognized Message header: ${t}`)}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get bodyLength(){return this._bodyLength}header(){return this._createHeader()}isSchema(){return this.headerType===J.Schema}isRecordBatch(){return this.headerType===J.RecordBatch}isDictionaryBatch(){return this.headerType===J.DictionaryBatch}constructor(t,n,r,i){this._version=n,this._headerType=r,this.body=new Uint8Array(0),i&&(this._createHeader=()=>i),this._bodyLength=st(t)}}class ue{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}constructor(t,n,r){this._nodes=n,this._buffers=r,this._length=st(t)}}class qe{get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}constructor(t,n,r=!1){this._data=t,this._isDelta=r,this._id=st(n)}}class Ye{constructor(t,n){this.offset=st(t),this.length=st(n)}}class $n{constructor(t,n){this.length=st(t),this.nullCount=st(n)}}function Ow(e,t){return()=>{switch(t){case J.Schema:return X.fromJSON(e);case J.RecordBatch:return ue.fromJSON(e);case J.DictionaryBatch:return qe.fromJSON(e)}throw new Error(`Unrecognized Message type: { name: ${J[t]}, type: ${t} }`)}}function Dw(e,t){return()=>{switch(t){case J.Schema:return X.decode(e.header(new Pe),new Map,e.version());case J.RecordBatch:return ue.decode(e.header(new tn),e.version());case J.DictionaryBatch:return qe.decode(e.header(new _r),e.version())}throw new Error(`Unrecognized Message type: { name: ${J[t]}, type: ${t} }`)}}ct.encode=zw;ct.decode=xw;ct.fromJSON=Tw;X.encode=Pw;X.decode=Fw;X.fromJSON=Sw;ue.encode=jw;ue.decode=Bw;ue.fromJSON=$m;qe.encode=Vw;qe.decode=Rw;qe.fromJSON=Iw;$n.encode=$w;$n.decode=Lw;Ye.encode=Ww;Ye.decode=Aw;function Fw(e,t=new Map,n=St.V5){const r=Uw(e,t);return new X(r,go(e),t,n)}function Bw(e,t=St.V5){if(e.compression()!==null)throw new Error("Record batch compression not implemented");return new ue(e.length(),Cw(e),Mw(e,t))}function Rw(e,t=St.V5){return new qe(ue.decode(e.data(),t),e.id(),e.isDelta())}function Aw(e){return new Ye(e.offset(),e.length())}function Lw(e){return new $n(e.length(),e.nullCount())}function Cw(e){const t=[];for(let n,r=-1,i=-1,s=e.nodesLength();++rct.encode(e,s));Pe.startFieldsVector(e,n.length);const r=Pe.createFieldsVector(e,n),i=t.metadata&&t.metadata.size>0?Pe.createCustomMetadataVector(e,[...t.metadata].map(([s,o])=>{const l=e.createString(`${s}`),a=e.createString(`${o}`);return Tt.startKeyValue(e),Tt.addKey(e,l),Tt.addValue(e,a),Tt.endKeyValue(e)})):-1;return Pe.startSchema(e),Pe.addFields(e,r),Pe.addEndianness(e,Hw?oi.Little:oi.Big),i!==-1&&Pe.addCustomMetadata(e,i),Pe.endSchema(e)}function zw(e,t){let n=-1,r=-1,i=-1;const s=t.type;let o=t.typeId;T.isDictionary(s)?(o=s.dictionary.typeId,i=Sa.visit(s,e),r=Sa.visit(s.dictionary,e)):r=Sa.visit(s,e);const l=(s.children||[]).map(d=>ct.encode(e,d)),a=fe.createChildrenVector(e,l),u=t.metadata&&t.metadata.size>0?fe.createCustomMetadataVector(e,[...t.metadata].map(([d,h])=>{const m=e.createString(`${d}`),g=e.createString(`${h}`);return Tt.startKeyValue(e),Tt.addKey(e,m),Tt.addValue(e,g),Tt.endKeyValue(e)})):-1;return t.name&&(n=e.createString(t.name)),fe.startField(e),fe.addType(e,r),fe.addTypeType(e,o),fe.addChildren(e,a),fe.addNullable(e,!!t.nullable),n!==-1&&fe.addName(e,n),i!==-1&&fe.addDictionary(e,i),u!==-1&&fe.addCustomMetadata(e,u),fe.endField(e)}function jw(e,t){const n=t.nodes||[],r=t.buffers||[];tn.startNodesVector(e,n.length);for(const o of n.slice().reverse())$n.encode(e,o);const i=e.endVector();tn.startBuffersVector(e,r.length);for(const o of r.slice().reverse())Ye.encode(e,o);const s=e.endVector();return tn.startRecordBatch(e),tn.addLength(e,BigInt(t.length)),tn.addNodes(e,i),tn.addBuffers(e,s),tn.endRecordBatch(e)}function Vw(e,t){const n=ue.encode(e,t.data);return _r.startDictionaryBatch(e),_r.addId(e,BigInt(t.id)),_r.addIsDelta(e,t.isDelta),_r.addData(e,n),_r.endDictionaryBatch(e)}function $w(e,t){return cy.createFieldNode(e,BigInt(t.length),BigInt(t.nullCount))}function Ww(e,t){return uy.createBuffer(e,BigInt(t.offset),BigInt(t.length))}const Hw=(()=>{const e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),new Int16Array(e)[0]===256})(),Hc=e=>`Expected ${J[e]} Message in stream, but was null or length 0.`,Yc=e=>`Header pointer of flatbuffer-encoded ${J[e]} Message is null or length 0.`,Ym=(e,t)=>`Expected to read ${e} metadata bytes, but only read ${t}.`,Qm=(e,t)=>`Expected to read ${e} bytes for message body, but only read ${t}.`;class Gm{constructor(t){this.source=t instanceof pl?t:new pl(t)}[Symbol.iterator](){return this}next(){let t;return(t=this.readMetadataLength()).done||t.value===-1&&(t=this.readMetadataLength()).done||(t=this.readMetadata(t.value)).done?ht:t}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}readMessage(t){let n;if((n=this.next()).done)return null;if(t!=null&&n.value.headerType!==t)throw new Error(Hc(t));return n.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);const n=Q(this.source.read(t));if(n.byteLength[...i,...s.VALIDITY&&[s.VALIDITY]||[],...s.TYPE_ID&&[s.TYPE_ID]||[],...s.OFFSET&&[s.OFFSET]||[],...s.DATA&&[s.DATA]||[],...n(s.children)],[])}}readMessage(t){let n;if((n=this.next()).done)return null;if(t!=null&&n.value.headerType!==t)throw new Error(Hc(t));return n.value}readSchema(){const t=J.Schema,n=this.readMessage(t),r=n==null?void 0:n.header();if(!n||!r)throw new Error(Yc(t));return r}}const Pl=4,Fu="ARROW1",ms=new Uint8Array(Fu.length);for(let e=0;ethis):this}readRecordBatch(t){return this._impl.isFile()?this._impl.readRecordBatch(t):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return he.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return he.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,n){throw new Error('"throughDOM" not available in this environment')}static from(t){return t instanceof we?t:wu(t)?Xw(t):ey(t)?e1(t):fr(t)?P(this,void 0,void 0,function*(){return yield we.from(yield t)}):ny(t)||Oc(t)||ry(t)||hi(t)?t1(new ai(t)):Zw(new pl(t))}static readAll(t){return t instanceof we?t.isSync()?Uf(t):xf(t):wu(t)||ArrayBuffer.isView(t)||Is(t)||ty(t)?Uf(t):xf(t)}}class ml extends we{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return He(this,arguments,function*(){yield j(yield*lo(or(this[Symbol.iterator]())))})}}class gl extends we{constructor(t){super(t),this._impl=t}readAll(){return P(this,void 0,void 0,function*(){var t,n,r,i;const s=new Array;try{for(var o=!0,l=or(this),a;a=yield l.next(),t=a.done,!t;o=!0){i=a.value,o=!1;const u=i;s.push(u)}}catch(u){n={error:u}}finally{try{!o&&!t&&(r=l.return)&&(yield r.call(l))}finally{if(n)throw n.error}}return s})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}}class Jm extends ml{constructor(t){super(t),this._impl=t}}class Kw extends gl{constructor(t){super(t),this._impl=t}}class qm{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(t=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=t}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(t){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=t,this.dictionaries=new Map,this}_loadRecordBatch(t,n){const r=this._loadVectors(t,n,this.schema.fields),i=W({type:new jt(this.schema.fields),length:t.length,children:r});return new Jt(this.schema,i)}_loadDictionaryBatch(t,n){const{id:r,isDelta:i}=t,{dictionaries:s,schema:o}=this,l=s.get(r),a=o.dictionaries.get(r),u=this._loadVectors(t.data,n,[a]);return(l&&i?l.concat(new q(u)):new q(u)).memoize()}_loadVectors(t,n,r){return new Pm(n,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(r)}}class vl extends qm{constructor(t,n){super(n),this._reader=wu(t)?new Qw(this._handle=t):new Gm(this._handle=t)}isSync(){return!0}isStream(){return!0}[Symbol.iterator](){return this}cancel(){!this.closed&&(this.closed=!0)&&(this.reset()._reader.return(),this._reader=null,this.dictionaries=null)}open(t){return this.closed||(this.autoDestroy=Zm(this,t),this.schema||(this.schema=this._reader.readSchema())||this.cancel()),this}throw(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(t):ht}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):ht}next(){if(this.closed)return ht;let t;const{_reader:n}=this;for(;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const r=t.header(),i=n.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(r,i)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const r=t.header(),i=n.readMessageBody(t.bodyLength),s=this._loadDictionaryBatch(r,i);this.dictionaries.set(r.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Wc(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}}class _l extends qm{constructor(t,n){super(n),this._reader=new Yw(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return P(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(t){return P(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=Zm(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(t){return P(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):ht})}return(t){return P(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):ht})}next(){return P(this,void 0,void 0,function*(){if(this.closed)return ht;let t;const{_reader:n}=this;for(;t=yield this._readNextMessageAndValidate();)if(t.isSchema())yield this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const r=t.header(),i=yield n.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(r,i)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const r=t.header(),i=yield n.readMessageBody(t.bodyLength),s=this._loadDictionaryBatch(r,i);this.dictionaries.set(r.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Wc(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return P(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}}class Xm extends vl{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(t,n){super(t instanceof Df?t:new Df(t),n)}isSync(){return!0}isFile(){return!0}open(t){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(const n of this._footer.dictionaryBatches())n&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(t)}readRecordBatch(t){var n;if(this.closed)return null;this._footer||this.open();const r=(n=this._footer)===null||n===void 0?void 0:n.getRecordBatch(t);if(r&&this._handle.seek(r.offset)){const i=this._reader.readMessage(J.RecordBatch);if(i!=null&&i.isRecordBatch()){const s=i.header(),o=this._reader.readMessageBody(i.bodyLength);return this._loadRecordBatch(s,o)}}return null}_readDictionaryBatch(t){var n;const r=(n=this._footer)===null||n===void 0?void 0:n.getDictionaryBatch(t);if(r&&this._handle.seek(r.offset)){const i=this._reader.readMessage(J.DictionaryBatch);if(i!=null&&i.isDictionaryBatch()){const s=i.header(),o=this._reader.readMessageBody(i.bodyLength),l=this._loadDictionaryBatch(s,o);this.dictionaries.set(s.id,l)}}}_readFooter(){const{_handle:t}=this,n=t.size-Km,r=t.readInt32(n),i=t.readAt(n-r,r);return ys.decode(i)}_readNextMessageAndValidate(t){var n;if(this._footer||this.open(),this._footer&&this._recordBatchIndexsuper.open}});return P(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(const r of this._footer.dictionaryBatches())r&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield n.open.call(this,t)})}readRecordBatch(t){return P(this,void 0,void 0,function*(){var n;if(this.closed)return null;this._footer||(yield this.open());const r=(n=this._footer)===null||n===void 0?void 0:n.getRecordBatch(t);if(r&&(yield this._handle.seek(r.offset))){const i=yield this._reader.readMessage(J.RecordBatch);if(i!=null&&i.isRecordBatch()){const s=i.header(),o=yield this._reader.readMessageBody(i.bodyLength);return this._loadRecordBatch(s,o)}}return null})}_readDictionaryBatch(t){return P(this,void 0,void 0,function*(){var n;const r=(n=this._footer)===null||n===void 0?void 0:n.getDictionaryBatch(t);if(r&&(yield this._handle.seek(r.offset))){const i=yield this._reader.readMessage(J.DictionaryBatch);if(i!=null&&i.isDictionaryBatch()){const s=i.header(),o=yield this._reader.readMessageBody(i.bodyLength),l=this._loadDictionaryBatch(s,o);this.dictionaries.set(s.id,l)}}})}_readFooter(){return P(this,void 0,void 0,function*(){const{_handle:t}=this;t._pending&&(yield t._pending);const n=t.size-Km,r=yield t.readInt32(n),i=yield t.readAt(n-r,r);return ys.decode(i)})}_readNextMessageAndValidate(t){return P(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex=4?Qc(t)?new Jm(new Xm(e.read())):new ml(new vl(e)):new ml(new vl(function*(){}()))}function t1(e){return P(this,void 0,void 0,function*(){const t=yield e.peek(Ns+7&-8);return t&&t.byteLength>=4?Qc(t)?new Jm(new Xm(yield e.read())):new gl(new _l(e)):new gl(new _l(function(){return He(this,arguments,function*(){})}()))})}function e1(e){return P(this,void 0,void 0,function*(){const{size:t}=yield e.stat(),n=new yl(e,t);return t>=Gw&&Qc(yield n.readAt(0,Ns+7&-8))?new Kw(new Jw(n)):new gl(new _l(n))})}class mt extends V{static assemble(...t){const n=i=>i.flatMap(s=>Array.isArray(s)?n(s):s instanceof Jt?s.data.children:s.data),r=new mt;return r.visitMany(n(t)),r}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}visit(t){if(t instanceof q)return this.visitMany(t.data),this;const{type:n}=t;if(!T.isDictionary(n)){const{length:r}=t;if(r>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(T.isUnion(n))this.nodes.push(new $n(r,0));else{const{nullCount:i}=t;T.isNull(n)||Ae.call(this,i<=0?new Uint8Array(0):ul(t.offset,r,t.nullBitmap)),this.nodes.push(new $n(r,i))}}return super.visit(t)}visitNull(t){return this}visitDictionary(t){return this.visit(t.clone(t.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}}function Ae(e){const t=e.byteLength+7&-8;return this.buffers.push(e),this.bufferRegions.push(new Ye(this._byteLength,t)),this._byteLength+=t,this}function n1(e){var t;const{type:n,length:r,typeIds:i,valueOffsets:s}=e;if(Ae.call(this,i),n.mode===xt.Sparse)return Bu.call(this,e);if(n.mode===xt.Dense){if(e.offset<=0)return Ae.call(this,s),Bu.call(this,e);{const o=new Int32Array(r),l=Object.create(null),a=Object.create(null);for(let u,d,h=-1;++h{const h=n.typeIds[d],m=l[h],g=a[h];return u.slice(m,Math.min(r,g))}))}}return this}function r1(e){let t;return e.nullCount>=e.length?Ae.call(this,new Uint8Array(0)):(t=e.values)instanceof Uint8Array?Ae.call(this,ul(e.offset,e.length,t)):Ae.call(this,cl(e.values))}function gn(e){return Ae.call(this,e.values.subarray(0,e.length*e.stride))}function zl(e){const{length:t,values:n,valueOffsets:r}=e,i=st(r[0]),s=st(r[t]),o=Math.min(s-i,n.byteLength-i);return Ae.call(this,sy(-i,t+1,r)),Ae.call(this,n.subarray(i,i+o)),this}function Gc(e){const{length:t,valueOffsets:n}=e;if(n){const{[0]:r,[t]:i}=n;return Ae.call(this,sy(-r,t+1,n)),this.visit(e.children[0].slice(r,i-r))}return this.visit(e.children[0])}function Bu(e){return this.visitMany(e.type.children.map((t,n)=>e.children[n]).filter(Boolean))[0]}mt.prototype.visitBool=r1;mt.prototype.visitInt=gn;mt.prototype.visitFloat=gn;mt.prototype.visitUtf8=zl;mt.prototype.visitLargeUtf8=zl;mt.prototype.visitBinary=zl;mt.prototype.visitLargeBinary=zl;mt.prototype.visitFixedSizeBinary=gn;mt.prototype.visitDate=gn;mt.prototype.visitTimestamp=gn;mt.prototype.visitTime=gn;mt.prototype.visitDecimal=gn;mt.prototype.visitList=Gc;mt.prototype.visitStruct=Bu;mt.prototype.visitUnion=n1;mt.prototype.visitInterval=gn;mt.prototype.visitDuration=gn;mt.prototype.visitFixedSizeList=Gc;mt.prototype.visitMap=Gc;class tg extends Pc{static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,n){throw new Error('"throughDOM" not available in this environment')}constructor(t){super(),this._position=0,this._started=!1,this._sink=new yo,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,ee(t)||(t={autoDestroy:!0,writeLegacyIpcFormat:!1}),this._autoDestroy=typeof t.autoDestroy=="boolean"?t.autoDestroy:!0,this._writeLegacyIpcFormat=typeof t.writeLegacyIpcFormat=="boolean"?t.writeLegacyIpcFormat:!1}toString(t=!1){return this._sink.toString(t)}toUint8Array(t=!1){return this._sink.toUint8Array(t)}writeAll(t){return fr(t)?t.then(n=>this.writeAll(n)):hi(t)?Xc(this,t):qc(this,t)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(t){return this._sink.toDOMStream(t)}toNodeStream(t){return this._sink.toNodeStream(t)}close(){return this.reset()._sink.close()}abort(t){return this.reset()._sink.abort(t)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(t=this._sink,n=null){return t===this._sink||t instanceof yo?this._sink=t:(this._sink=new yo,t&&Lv(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&Cv(t)&&this.toNodeStream({objectMode:!1}).pipe(t)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,(!n||!Du(n,this._schema))&&(n==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=n,this._writeSchema(n))),this}write(t){let n=null;if(this._sink){if(t==null)return this.finish()&&void 0;if(t instanceof zt&&!(n=t.schema))return this.finish()&&void 0;if(t instanceof Jt&&!(n=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(n&&!Du(n,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,n)}t instanceof Jt?t instanceof Wc||this._writeRecordBatch(t):t instanceof zt?this.writeAll(t.batches):Is(t)&&this.writeAll(t)}_writeMessage(t,n=8){const r=n-1,i=Vt.encode(t),s=i.byteLength,o=this._writeLegacyIpcFormat?4:8,l=s+o+r&~r,a=l-s-o;return t.headerType===J.RecordBatch?this._recordBatchBlocks.push(new jn(l,t.bodyLength,this._position)):t.headerType===J.DictionaryBatch&&this._dictionaryBlocks.push(new jn(l,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(l-o)),s>0&&this._write(i),this._writePadding(a)}_write(t){if(this._started){const n=Q(t);n&&n.byteLength>0&&(this._sink.write(n),this._position+=n.byteLength)}return this}_writeSchema(t){return this._writeMessage(Vt.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(ms)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){const{byteLength:n,nodes:r,bufferRegions:i,buffers:s}=mt.assemble(t),o=new ue(t.numRows,r,i),l=Vt.from(o,n);return this._writeDictionaries(t)._writeMessage(l)._writeBodyBuffers(s)}_writeDictionaryBatch(t,n,r=!1){const{byteLength:i,nodes:s,bufferRegions:o,buffers:l}=mt.assemble(new q([t])),a=new ue(t.length,s,o),u=new qe(a,n,r),d=Vt.from(u,i);return this._writeMessage(d)._writeBodyBuffers(l)}_writeBodyBuffers(t){let n,r,i;for(let s=-1,o=t.length;++s0&&(this._write(n),(i=(r+7&-8)-r)>0&&this._writePadding(i));return this}_writeDictionaries(t){var n,r;for(const[i,s]of t.dictionaries){const o=(n=s==null?void 0:s.data)!==null&&n!==void 0?n:[],l=this._seenDictionaries.get(i),a=(r=this._dictionaryDeltaOffsets.get(i))!==null&&r!==void 0?r:0;if(!l||l.data[0]!==o[0])for(const[u,d]of o.entries())this._writeDictionaryBatch(d,i,u>0);else if(ar.writeAll(i)):hi(t)?Xc(r,t):qc(r,t)}}class Jc extends tg{static writeAll(t){const n=new Jc;return fr(t)?t.then(r=>n.writeAll(r)):hi(t)?Xc(n,t):qc(n,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeDictionaryBatch(t,n,r=!1){if(!r&&this._seenDictionaries.has(n))throw new Error("The Arrow File format does not support replacement dictionaries. ");return super._writeDictionaryBatch(t,n,r)}_writeFooter(t){const n=ys.encode(new ys(t,St.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(n)._write(Int32Array.of(n.byteLength))._writeMagic()}}function qc(e,t){let n=t;t instanceof zt&&(n=t.batches,e.reset(void 0,t.schema));for(const r of n)e.write(r);return e.finish()}function Xc(e,t){return P(this,void 0,void 0,function*(){var n,r,i,s,o,l,a;try{for(n=!0,r=or(t);i=yield r.next(),s=i.done,!s;n=!0){a=i.value,n=!1;const u=a;e.write(u)}}catch(u){o={error:u}}finally{try{!n&&!s&&(l=r.return)&&(yield l.call(r))}finally{if(o)throw o.error}}return e.finish()})}function i1(e,t="stream"){return(t==="stream"?Kc:Jc).writeAll(e).toUint8Array(!0)}var s1=Object.create,eg=Object.defineProperty,o1=Object.getOwnPropertyDescriptor,l1=Object.getOwnPropertyNames,a1=Object.getPrototypeOf,u1=Object.prototype.hasOwnProperty,c1=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),d1=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of l1(t))!u1.call(e,i)&&i!==n&&eg(e,i,{get:()=>t[i],enumerable:!(r=o1(t,i))||r.enumerable});return e},f1=(e,t,n)=>(n=e!=null?s1(a1(e)):{},d1(!e||!e.__esModule?eg(n,"default",{value:e,enumerable:!0}):n,e)),h1=c1((e,t)=>{t.exports=Worker}),p1=(e=>(e[e.UNDEFINED=0]="UNDEFINED",e[e.AUTOMATIC=1]="AUTOMATIC",e[e.READ_ONLY=2]="READ_ONLY",e[e.READ_WRITE=3]="READ_WRITE",e))(p1||{}),y1=(e=>(e[e.IDENTIFIER=0]="IDENTIFIER",e[e.NUMERIC_CONSTANT=1]="NUMERIC_CONSTANT",e[e.STRING_CONSTANT=2]="STRING_CONSTANT",e[e.OPERATOR=3]="OPERATOR",e[e.KEYWORD=4]="KEYWORD",e[e.COMMENT=5]="COMMENT",e))(y1||{}),m1=(e=>(e[e.NONE=0]="NONE",e[e.DEBUG=1]="DEBUG",e[e.INFO=2]="INFO",e[e.WARNING=3]="WARNING",e[e.ERROR=4]="ERROR",e))(m1||{}),g1=(e=>(e[e.NONE=0]="NONE",e[e.CONNECT=1]="CONNECT",e[e.DISCONNECT=2]="DISCONNECT",e[e.OPEN=3]="OPEN",e[e.QUERY=4]="QUERY",e[e.INSTANTIATE=5]="INSTANTIATE",e))(g1||{}),v1=(e=>(e[e.NONE=0]="NONE",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR",e[e.START=3]="START",e[e.RUN=4]="RUN",e[e.CAPTURE=5]="CAPTURE",e))(v1||{}),_1=(e=>(e[e.NONE=0]="NONE",e[e.WEB_WORKER=1]="WEB_WORKER",e[e.NODE_WORKER=2]="NODE_WORKER",e[e.BINDINGS=3]="BINDINGS",e[e.ASYNC_DUCKDB=4]="ASYNC_DUCKDB",e))(_1||{}),w1=class{constructor(e=2){this.level=e}log(e){e.level>=this.level&&console.log(e)}},S1=(e=>(e[e.SUCCESS=0]="SUCCESS",e))(S1||{}),I1=class{constructor(e,t){this._bindings=e,this._conn=t}get bindings(){return this._bindings}async close(){return this._bindings.disconnect(this._conn)}useUnsafe(e){return e(this._bindings,this._conn)}async query(e){this._bindings.logger.log({timestamp:new Date,level:2,origin:4,topic:4,event:4,value:e});let t=await this._bindings.runQuery(this._conn,e),n=we.from(t);return console.assert(n.isSync(),"Reader is not sync"),console.assert(n.isFile(),"Reader is not file"),new zt(n)}async send(e){this._bindings.logger.log({timestamp:new Date,level:2,origin:4,topic:4,event:4,value:e});let t=await this._bindings.startPendingQuery(this._conn,e);for(;t==null;)t=await this._bindings.pollPendingQuery(this._conn);let n=new ng(this._bindings,this._conn,t),r=await we.from(n);return console.assert(r.isAsync()),console.assert(r.isStream()),r}async cancelSent(){return await this._bindings.cancelPendingQuery(this._conn)}async getTableNames(e){return await this._bindings.getTableNames(this._conn,e)}async prepare(e){let t=await this._bindings.createPrepared(this._conn,e);return new E1(this._bindings,this._conn,t)}async insertArrowTable(e,t){let n=i1(e,"stream");await this.insertArrowFromIPCStream(n,t)}async insertArrowFromIPCStream(e,t){await this._bindings.insertArrowFromIPCStream(this._conn,e,t)}async insertCSVFromPath(e,t){await this._bindings.insertCSVFromPath(this._conn,e,t)}async insertJSONFromPath(e,t){await this._bindings.insertJSONFromPath(this._conn,e,t)}},ng=class{constructor(e,t,n){this.db=e,this.conn=t,this.header=n,this._first=!0,this._depleted=!1,this._inFlight=null}async next(){if(this._first)return this._first=!1,{done:!1,value:this.header};if(this._depleted)return{done:!0,value:null};let e;return this._inFlight!=null?(e=await this._inFlight,this._inFlight=null):e=await this.db.fetchQueryResults(this.conn),this._depleted=e.length==0,this._depleted||(this._inFlight=this.db.fetchQueryResults(this.conn)),{done:this._depleted,value:e}}[Symbol.asyncIterator](){return this}},E1=class{constructor(e,t,n){this.bindings=e,this.connectionId=t,this.statementId=n}async close(){await this.bindings.closePrepared(this.connectionId,this.statementId)}async query(...e){let t=await this.bindings.runPrepared(this.connectionId,this.statementId,e),n=we.from(t);return console.assert(n.isSync()),console.assert(n.isFile()),new zt(n)}async send(...e){let t=await this.bindings.sendPrepared(this.connectionId,this.statementId,e),n=new ng(this.bindings,this.connectionId,t),r=await we.from(n);return console.assert(r.isAsync()),console.assert(r.isStream()),r}},b1=(e=>(e.CANCEL_PENDING_QUERY="CANCEL_PENDING_QUERY",e.CLOSE_PREPARED="CLOSE_PREPARED",e.COLLECT_FILE_STATISTICS="COLLECT_FILE_STATISTICS",e.CONNECT="CONNECT",e.COPY_FILE_TO_BUFFER="COPY_FILE_TO_BUFFER",e.COPY_FILE_TO_PATH="COPY_FILE_TO_PATH",e.CREATE_PREPARED="CREATE_PREPARED",e.DISCONNECT="DISCONNECT",e.DROP_FILE="DROP_FILE",e.DROP_FILES="DROP_FILES",e.EXPORT_FILE_STATISTICS="EXPORT_FILE_STATISTICS",e.FETCH_QUERY_RESULTS="FETCH_QUERY_RESULTS",e.FLUSH_FILES="FLUSH_FILES",e.GET_FEATURE_FLAGS="GET_FEATURE_FLAGS",e.GET_TABLE_NAMES="GET_TABLE_NAMES",e.GET_VERSION="GET_VERSION",e.GLOB_FILE_INFOS="GLOB_FILE_INFOS",e.INSERT_ARROW_FROM_IPC_STREAM="INSERT_ARROW_FROM_IPC_STREAM",e.INSERT_CSV_FROM_PATH="IMPORT_CSV_FROM_PATH",e.INSERT_JSON_FROM_PATH="IMPORT_JSON_FROM_PATH",e.INSTANTIATE="INSTANTIATE",e.OPEN="OPEN",e.PING="PING",e.POLL_PENDING_QUERY="POLL_PENDING_QUERY",e.REGISTER_FILE_BUFFER="REGISTER_FILE_BUFFER",e.REGISTER_FILE_HANDLE="REGISTER_FILE_HANDLE",e.REGISTER_FILE_URL="REGISTER_FILE_URL",e.RESET="RESET",e.RUN_PREPARED="RUN_PREPARED",e.RUN_QUERY="RUN_QUERY",e.SEND_PREPARED="SEND_PREPARED",e.START_PENDING_QUERY="START_PENDING_QUERY",e.TOKENIZE="TOKENIZE",e))(b1||{}),T1=(e=>(e.CONNECTION_INFO="CONNECTION_INFO",e.ERROR="ERROR",e.FEATURE_FLAGS="FEATURE_FLAGS",e.FILE_BUFFER="FILE_BUFFER",e.FILE_INFOS="FILE_INFOS",e.FILE_SIZE="FILE_SIZE",e.FILE_STATISTICS="FILE_STATISTICS",e.INSTANTIATE_PROGRESS="INSTANTIATE_PROGRESS",e.LOG="LOG",e.OK="OK",e.PREPARED_STATEMENT_ID="PREPARED_STATEMENT_ID",e.QUERY_PLAN="QUERY_PLAN",e.QUERY_RESULT="QUERY_RESULT",e.QUERY_RESULT_CHUNK="QUERY_RESULT_CHUNK",e.QUERY_RESULT_HEADER="QUERY_RESULT_HEADER",e.QUERY_RESULT_HEADER_OR_NULL="QUERY_RESULT_HEADER_OR_NULL",e.REGISTERED_FILE="REGISTERED_FILE",e.SCRIPT_TOKENS="SCRIPT_TOKENS",e.SUCCESS="SUCCESS",e.TABLE_NAMES="TABLE_NAMES",e.VERSION_STRING="VERSION_STRING",e))(T1||{}),G=class{constructor(e,t){this.promiseResolver=()=>{},this.promiseRejecter=()=>{},this.type=e,this.data=t,this.promise=new Promise((n,r)=>{this.promiseResolver=n,this.promiseRejecter=r})}};function vo(e){switch(e.typeId){case c.Binary:return{sqlType:"binary"};case c.Bool:return{sqlType:"bool"};case c.Date:return{sqlType:"date"};case c.DateDay:return{sqlType:"date32[d]"};case c.DateMillisecond:return{sqlType:"date64[ms]"};case c.Decimal:{let t=e;return{sqlType:"decimal",precision:t.precision,scale:t.scale}}case c.Float:return{sqlType:"float"};case c.Float16:return{sqlType:"float16"};case c.Float32:return{sqlType:"float32"};case c.Float64:return{sqlType:"float64"};case c.Int:return{sqlType:"int32"};case c.Int16:return{sqlType:"int16"};case c.Int32:return{sqlType:"int32"};case c.Int64:return{sqlType:"int64"};case c.Uint16:return{sqlType:"uint16"};case c.Uint32:return{sqlType:"uint32"};case c.Uint64:return{sqlType:"uint64"};case c.Uint8:return{sqlType:"uint8"};case c.IntervalDayTime:return{sqlType:"interval[dt]"};case c.IntervalYearMonth:return{sqlType:"interval[m]"};case c.List:return{sqlType:"list",valueType:vo(e.valueType)};case c.FixedSizeBinary:return{sqlType:"fixedsizebinary",byteWidth:e.byteWidth};case c.Null:return{sqlType:"null"};case c.Utf8:return{sqlType:"utf8"};case c.Struct:return{sqlType:"struct",fields:e.children.map(t=>Ru(t.name,t.type))};case c.Map:{let t=e;return{sqlType:"map",keyType:vo(t.keyType),valueType:vo(t.valueType)}}case c.Time:return{sqlType:"time[s]"};case c.TimeMicrosecond:return{sqlType:"time[us]"};case c.TimeMillisecond:return{sqlType:"time[ms]"};case c.TimeNanosecond:return{sqlType:"time[ns]"};case c.TimeSecond:return{sqlType:"time[s]"};case c.Timestamp:return{sqlType:"timestamp",timezone:e.timezone||void 0};case c.TimestampSecond:return{sqlType:"timestamp[s]",timezone:e.timezone||void 0};case c.TimestampMicrosecond:return{sqlType:"timestamp[us]",timezone:e.timezone||void 0};case c.TimestampNanosecond:return{sqlType:"timestamp[ns]",timezone:e.timezone||void 0};case c.TimestampMillisecond:return{sqlType:"timestamp[ms]",timezone:e.timezone||void 0}}throw new Error("unsupported arrow type: ".concat(e.toString()))}function Ru(e,t){let n=vo(t);return n.name=e,n}var N1=new TextEncoder,k1=class{constructor(e,t=null){this._onInstantiationProgress=[],this._worker=null,this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{},this._nextMessageId=0,this._pendingRequests=new Map,this._logger=e,this._onMessageHandler=this.onMessage.bind(this),this._onErrorHandler=this.onError.bind(this),this._onCloseHandler=this.onClose.bind(this),t!=null&&this.attach(t)}get logger(){return this._logger}attach(e){this._worker=e,this._worker.addEventListener("message",this._onMessageHandler),this._worker.addEventListener("error",this._onErrorHandler),this._worker.addEventListener("close",this._onCloseHandler),this._workerShutdownPromise=new Promise((t,n)=>{this._workerShutdownResolver=t})}detach(){this._worker&&(this._worker.removeEventListener("message",this._onMessageHandler),this._worker.removeEventListener("error",this._onErrorHandler),this._worker.removeEventListener("close",this._onCloseHandler),this._worker=null,this._workerShutdownResolver(null),this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{})}async terminate(){this._worker&&(this._worker.terminate(),this._worker=null,this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{})}async postTask(e,t=[]){if(!this._worker){console.error("cannot send a message since the worker is not set!");return}let n=this._nextMessageId++;return this._pendingRequests.set(n,e),this._worker.postMessage({messageId:n,type:e.type,data:e.data},t),await e.promise}onMessage(e){var t;let n=e.data;switch(n.type){case"LOG":{this._logger.log(n.data);return}case"INSTANTIATE_PROGRESS":{for(let i of this._onInstantiationProgress)i(n.data);return}}let r=this._pendingRequests.get(n.requestId);if(!r){console.warn("unassociated response: [".concat(n.requestId,", ").concat(n.type.toString(),"]"));return}if(this._pendingRequests.delete(n.requestId),n.type=="ERROR"){let i=new Error(n.data.message);i.name=n.data.name,(t=Object.getOwnPropertyDescriptor(i,"stack"))!=null&&t.writable&&(i.stack=n.data.stack),r.promiseRejecter(i);return}switch(r.type){case"CLOSE_PREPARED":case"COLLECT_FILE_STATISTICS":case"COPY_FILE_TO_PATH":case"DISCONNECT":case"DROP_FILE":case"DROP_FILES":case"FLUSH_FILES":case"INSERT_ARROW_FROM_IPC_STREAM":case"IMPORT_CSV_FROM_PATH":case"IMPORT_JSON_FROM_PATH":case"OPEN":case"PING":case"REGISTER_FILE_BUFFER":case"REGISTER_FILE_HANDLE":case"REGISTER_FILE_URL":case"RESET":if(n.type=="OK"){r.promiseResolver(n.data);return}break;case"INSTANTIATE":if(this._onInstantiationProgress=[],n.type=="OK"){r.promiseResolver(n.data);return}break;case"GLOB_FILE_INFOS":if(n.type=="FILE_INFOS"){r.promiseResolver(n.data);return}break;case"GET_VERSION":if(n.type=="VERSION_STRING"){r.promiseResolver(n.data);return}break;case"GET_FEATURE_FLAGS":if(n.type=="FEATURE_FLAGS"){r.promiseResolver(n.data);return}break;case"GET_TABLE_NAMES":if(n.type=="TABLE_NAMES"){r.promiseResolver(n.data);return}break;case"TOKENIZE":if(n.type=="SCRIPT_TOKENS"){r.promiseResolver(n.data);return}break;case"COPY_FILE_TO_BUFFER":if(n.type=="FILE_BUFFER"){r.promiseResolver(n.data);return}break;case"EXPORT_FILE_STATISTICS":if(n.type=="FILE_STATISTICS"){r.promiseResolver(n.data);return}break;case"CONNECT":if(n.type=="CONNECTION_INFO"){r.promiseResolver(n.data);return}break;case"RUN_PREPARED":case"RUN_QUERY":if(n.type=="QUERY_RESULT"){r.promiseResolver(n.data);return}break;case"SEND_PREPARED":if(n.type=="QUERY_RESULT_HEADER"){r.promiseResolver(n.data);return}break;case"START_PENDING_QUERY":if(n.type=="QUERY_RESULT_HEADER_OR_NULL"){r.promiseResolver(n.data);return}break;case"POLL_PENDING_QUERY":if(n.type=="QUERY_RESULT_HEADER_OR_NULL"){r.promiseResolver(n.data);return}break;case"CANCEL_PENDING_QUERY":if(this._onInstantiationProgress=[],n.type=="SUCCESS"){r.promiseResolver(n.data);return}break;case"FETCH_QUERY_RESULTS":if(n.type=="QUERY_RESULT_CHUNK"){r.promiseResolver(n.data);return}break;case"CREATE_PREPARED":if(n.type=="PREPARED_STATEMENT_ID"){r.promiseResolver(n.data);return}break}r.promiseRejecter(new Error("unexpected response type: ".concat(n.type.toString())))}onError(e){console.error(e),console.error("error in duckdb worker: ".concat(e.message)),this._pendingRequests.clear()}onClose(){if(this._workerShutdownResolver(null),this._pendingRequests.size!=0){console.warn("worker terminated with ".concat(this._pendingRequests.size," pending requests"));return}this._pendingRequests.clear()}async reset(){let e=new G("RESET",null);return await this.postTask(e)}async ping(){let e=new G("PING",null);await this.postTask(e)}async dropFile(e){let t=new G("DROP_FILE",e);return await this.postTask(t)}async dropFiles(){let e=new G("DROP_FILES",null);return await this.postTask(e)}async flushFiles(){let e=new G("FLUSH_FILES",null);return await this.postTask(e)}async instantiate(e,t=null,n=r=>{}){this._onInstantiationProgress.push(n);let r=new G("INSTANTIATE",[e,t]);return await this.postTask(r)}async getVersion(){let e=new G("GET_VERSION",null);return await this.postTask(e)}async getFeatureFlags(){let e=new G("GET_FEATURE_FLAGS",null);return await this.postTask(e)}async open(e){let t=new G("OPEN",e);await this.postTask(t)}async tokenize(e){let t=new G("TOKENIZE",e);return await this.postTask(t)}async connectInternal(){let e=new G("CONNECT",null);return await this.postTask(e)}async connect(){let e=await this.connectInternal();return new I1(this,e)}async disconnect(e){let t=new G("DISCONNECT",e);await this.postTask(t)}async runQuery(e,t){let n=new G("RUN_QUERY",[e,t]);return await this.postTask(n)}async startPendingQuery(e,t){let n=new G("START_PENDING_QUERY",[e,t]);return await this.postTask(n)}async pollPendingQuery(e){let t=new G("POLL_PENDING_QUERY",e);return await this.postTask(t)}async cancelPendingQuery(e){let t=new G("CANCEL_PENDING_QUERY",e);return await this.postTask(t)}async fetchQueryResults(e){let t=new G("FETCH_QUERY_RESULTS",e);return await this.postTask(t)}async getTableNames(e,t){let n=new G("GET_TABLE_NAMES",[e,t]);return await this.postTask(n)}async createPrepared(e,t){let n=new G("CREATE_PREPARED",[e,t]);return await this.postTask(n)}async closePrepared(e,t){let n=new G("CLOSE_PREPARED",[e,t]);await this.postTask(n)}async runPrepared(e,t,n){let r=new G("RUN_PREPARED",[e,t,n]);return await this.postTask(r)}async sendPrepared(e,t,n){let r=new G("SEND_PREPARED",[e,t,n]);return await this.postTask(r)}async globFiles(e){let t=new G("GLOB_FILE_INFOS",e);return await this.postTask(t)}async registerFileText(e,t){let n=N1.encode(t);await this.registerFileBuffer(e,n)}async registerFileURL(e,t,n,r){t===void 0&&(t=e);let i=new G("REGISTER_FILE_URL",[e,t,n,r]);await this.postTask(i)}async registerEmptyFileBuffer(e){}async registerFileBuffer(e,t){let n=new G("REGISTER_FILE_BUFFER",[e,t]);await this.postTask(n,[t.buffer])}async registerFileHandle(e,t,n,r){let i=new G("REGISTER_FILE_HANDLE",[e,t,n,r]);await this.postTask(i,[])}async collectFileStatistics(e,t){let n=new G("COLLECT_FILE_STATISTICS",[e,t]);await this.postTask(n,[])}async exportFileStatistics(e){let t=new G("EXPORT_FILE_STATISTICS",e);return await this.postTask(t,[])}async copyFileToBuffer(e){let t=new G("COPY_FILE_TO_BUFFER",e);return await this.postTask(t)}async copyFileToPath(e,t){let n=new G("COPY_FILE_TO_PATH",[e,t]);await this.postTask(n)}async insertArrowFromIPCStream(e,t,n){if(t.length==0)return;let r=new G("INSERT_ARROW_FROM_IPC_STREAM",[e,t,n]);await this.postTask(r,[t.buffer])}async insertCSVFromPath(e,t,n){if(n.columns!==void 0){let i=[];for(let s in n.columns){let o=n.columns[s];i.push(Ru(s,o))}n.columnsFlat=i,delete n.columns}let r=new G("IMPORT_CSV_FROM_PATH",[e,t,n]);await this.postTask(r)}async insertJSONFromPath(e,t,n){if(n.columns!==void 0){let i=[];for(let s in n.columns){let o=n.columns[s];i.push(Ru(s,o))}n.columnsFlat=i,delete n.columns}let r=new G("IMPORT_JSON_FROM_PATH",[e,t,n]);await this.postTask(r)}},O1=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,3,1,0,1,10,14,1,12,0,65,0,65,0,65,0,252,10,0,0,11])),D1=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,8,1,6,0,6,64,25,11,11])),F1=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])),B1=()=>(async e=>{try{return typeof MessageChannel<"u"&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(e)}catch{return!1}})(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11])),R1={name:"@duckdb/duckdb-wasm",version:"1.29.0",description:"DuckDB powered by WebAssembly",license:"MIT",repository:{type:"git",url:"https://github.com/duckdb/duckdb-wasm.git"},keywords:["sql","duckdb","relational","database","data","query","wasm","analytics","olap","arrow","parquet","json","csv"],dependencies:{"apache-arrow":"^17.0.0"},devDependencies:{"@types/emscripten":"^1.39.10","@types/jasmine":"^5.1.4","@typescript-eslint/eslint-plugin":"^6.21.0","@typescript-eslint/parser":"^6.21.0",esbuild:"^0.20.2",eslint:"^8.57.0","eslint-plugin-jasmine":"^4.1.3","eslint-plugin-react":"^7.34.0","fast-glob":"^3.3.2",jasmine:"^5.1.0","jasmine-core":"^5.1.2","jasmine-spec-reporter":"^7.0.0","js-sha256":"^0.11.0",karma:"^6.4.2","karma-chrome-launcher":"^3.2.0","karma-coverage":"^2.2.1","karma-firefox-launcher":"^2.1.3","karma-jasmine":"^5.1.0","karma-jasmine-html-reporter":"^2.1.0","karma-sourcemap-loader":"^0.4.0","karma-spec-reporter":"^0.0.36","make-dir":"^4.0.0",nyc:"^15.1.0",prettier:"^3.2.5",puppeteer:"^22.8.0",rimraf:"^5.0.5",s3rver:"^3.7.1",typedoc:"^0.25.13",typescript:"^5.3.3","wasm-feature-detect":"^1.6.1","web-worker":"^1.2.0"},scripts:{"build:debug":"node bundle.mjs debug && tsc --emitDeclarationOnly","build:release":"node bundle.mjs release && tsc --emitDeclarationOnly",docs:"typedoc",report:"node ./coverage.mjs","test:node":"node --enable-source-maps ../../node_modules/jasmine/bin/jasmine ./dist/tests-node.cjs","test:node:debug":"node --inspect-brk --enable-source-maps ../../node_modules/jasmine/bin/jasmine ./dist/tests-node.cjs","test:node:coverage":"nyc -r json --report-dir ./coverage/node node ../../node_modules/jasmine/bin/jasmine ./dist/tests-node.cjs","test:firefox":"karma start ./karma/tests-firefox.cjs","test:chrome":"karma start ./karma/tests-chrome.cjs","test:chrome:eh":"karma start ./karma/tests-chrome-eh.cjs","test:chrome:coverage":"karma start ./karma/tests-chrome-coverage.cjs","test:browser":"karma start ./karma/tests-all.cjs","test:browser:debug":"karma start ./karma/tests-debug.cjs",test:"npm run test:chrome && npm run test:node","test:coverage":"npm run test:chrome:coverage && npm run test:node:coverage && npm run report",lint:"eslint src test"},files:["dist","!dist/tests-*","!dist/duckdb-browser-mvp.worker.js.map","!dist/types/test"],main:"dist/duckdb-browser.cjs",module:"dist/duckdb-browser.mjs",types:"dist/duckdb-browser.d.ts",jsdelivr:"dist/duckdb-browser.cjs",unpkg:"dist/duckdb-browser.mjs",sideEffects:!1,browser:{fs:!1,path:!1,perf_hooks:!1,os:!1,worker_threads:!1},exports:{"./dist/duckdb-mvp.wasm":"./dist/duckdb-mvp.wasm","./dist/duckdb-eh.wasm":"./dist/duckdb-eh.wasm","./dist/duckdb-coi.wasm":"./dist/duckdb-coi.wasm","./dist/duckdb-browser":"./dist/duckdb-browser.mjs","./dist/duckdb-browser.cjs":"./dist/duckdb-browser.cjs","./dist/duckdb-browser.mjs":"./dist/duckdb-browser.mjs","./dist/duckdb-browser-coi.pthread.worker.js":"./dist/duckdb-browser-coi.pthread.worker.js","./dist/duckdb-browser-coi.worker.js":"./dist/duckdb-browser-coi.worker.js","./dist/duckdb-browser-eh.worker.js":"./dist/duckdb-browser-eh.worker.js","./dist/duckdb-browser-mvp.worker.js":"./dist/duckdb-browser-mvp.worker.js","./dist/duckdb-node":"./dist/duckdb-node.cjs","./dist/duckdb-node.cjs":"./dist/duckdb-node.cjs","./dist/duckdb-node-blocking":"./dist/duckdb-node-blocking.cjs","./dist/duckdb-node-blocking.cjs":"./dist/duckdb-node-blocking.cjs","./dist/duckdb-node-eh.worker.cjs":"./dist/duckdb-node-eh.worker.cjs","./dist/duckdb-node-mvp.worker.cjs":"./dist/duckdb-node-mvp.worker.cjs","./blocking":{node:{types:"./dist/duckdb-node-blocking.d.ts",require:"./dist/duckdb-node-blocking.cjs",import:"./dist/duckdb-node-blocking.cjs"},types:"./dist/duckdb-node-blocking.d.ts",import:"./dist/duckdb-node-blocking.mjs",require:"./dist/duckdb-node-blocking.cjs"},".":{browser:{types:"./dist/duckdb-browser.d.ts",import:"./dist/duckdb-browser.mjs",require:"./dist/duckdb-browser.cjs"},node:{types:"./dist/duckdb-node.d.ts",import:"./dist/duckdb-node.cjs",require:"./dist/duckdb-node.cjs"},types:"./dist/duckdb-browser.d.ts",import:"./dist/duckdb-browser.mjs",require:"./dist/duckdb-browser.cjs"}}},Zc=R1.version.split(".");Zc[0];Zc[1];Zc[2];var A1=()=>typeof navigator>"u",Ia=null,Ea=null,ba=null,Ta=null,Na=null;async function L1(){return Ia==null&&(Ia=typeof BigInt64Array<"u"),Ea==null&&(Ea=await D1()),ba==null&&(ba=await B1()),Ta==null&&(Ta=await F1()),Na==null&&(Na=await O1()),{bigInt64Array:Ia,crossOriginIsolated:A1()||globalThis.crossOriginIsolated||!1,wasmExceptions:Ea,wasmSIMD:Ta,wasmThreads:ba,wasmBulkMemory:Na}}async function C1(e){let t=await L1();if(t.wasmExceptions){if(t.wasmSIMD&&t.wasmThreads&&t.crossOriginIsolated&&e.coi)return{mainModule:e.coi.mainModule,mainWorker:e.coi.mainWorker,pthreadWorker:e.coi.pthreadWorker};if(e.eh)return{mainModule:e.eh.mainModule,mainWorker:e.eh.mainWorker,pthreadWorker:null}}return{mainModule:e.mvp.mainModule,mainWorker:e.mvp.mainWorker,pthreadWorker:null}}f1(h1());function M1(){let e=new TextDecoder;return t=>(typeof SharedArrayBuffer<"u"&&t.buffer instanceof SharedArrayBuffer&&(t=new Uint8Array(t)),e.decode(t))}M1();var U1=(e=>(e[e.BUFFER=0]="BUFFER",e[e.NODE_FS=1]="NODE_FS",e[e.BROWSER_FILEREADER=2]="BROWSER_FILEREADER",e[e.BROWSER_FSACCESS=3]="BROWSER_FSACCESS",e[e.HTTP=4]="HTTP",e[e.S3=5]="S3",e))(U1||{});const x1="/assets/duckdb-mvp-DuKjbjvP.wasm",P1="/assets/duckdb-browser-mvp.worker-CM-L3bpJ.js",z1="/assets/duckdb-eh-DrTJ_0hP.wasm",j1="/assets/duckdb-browser-eh.worker-D6ypKDsm.js",V1={mvp:{mainModule:x1,mainWorker:P1},eh:{mainModule:z1,mainWorker:j1}};async function $1(){console.log("🦆 Initializing DuckDB...");const e=await C1(V1);if(e.mainWorker==null)throw new Error("Failed to initialize worker from DuckDB bundle.");const t=new Worker(e.mainWorker),n=new w1(0),r=new k1(n,t);await r.instantiate(e.mainModule,e.pthreadWorker);const i=await r.connect();return{db:r,conn:i}}async function W1(e){await e.close()}function H1(){const[e,t]=rr.useState(null),[n,r]=rr.useState(null);return rr.useEffect(()=>{let i=()=>{};return $1().then(async s=>{i=()=>{t(null),r(null),W1(s.conn)},t(s.db),r(s.conn)}),()=>i==null?void 0:i()},[]),{db:e,conn:n}}const Pf=["Tamjid","Vinesh","Samarth","Andrew","Evan","David","Joni","Keegan","Lauren","Nancy","Shoji","James","Laura"];async function rg(e){const t=Pf[Math.floor(Math.random()*Pf.length)],n=Math.ceil(Math.random()*100);await e.query(`INSERT INTO friends VALUES ('${t}', ${n})`),console.log(`🦆 Inserted ('${t}', ${n}) into table [friends].`)}async function Y1(e){const n=(await e.query("SELECT * FROM friends")).toArray().map(r=>r.toJSON());console.log({friends:n})}async function Q1(e){await e.query("CREATE TABLE IF NOT EXISTS friends (name VARCHAR(255) NOT NULL, score INTEGER NOT NULL)"),await rg(e)}function G1(){const{db:e,conn:t}=H1();return rr.useEffect(()=>{e==null||t==null||Q1(t)},[e,t]),Sn.jsxs(Sn.Fragment,{children:[Sn.jsx("h1",{children:"Web DuckDB"}),Sn.jsx("p",{children:"The future is quack."}),Sn.jsx("button",{onClick:()=>t&&rg(t),children:"Insert"}),Sn.jsx("button",{onClick:()=>t&&Y1(t),children:"Query"})]})}Xp(document.getElementById("root")).render(Sn.jsx(rr.StrictMode,{children:Sn.jsx(G1,{})})); diff --git a/build/index.html b/build/index.html deleted file mode 100644 index 945a261..0000000 --- a/build/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - Web DuckDB - - - - -
- - diff --git a/build/vite.svg b/build/vite.svg deleted file mode 100644 index e7b8dfb..0000000 --- a/build/vite.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file