dynamsoft-barcode-reader-bundle
Version:
Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR
1 lines • 97.7 kB
JavaScript
var read_,readAsync,readBinary,Module=void 0!==Module?Module:{},moduleOverrides=Object.assign({},Module),arguments_=[],thisProgram="./this.program",quit_=(e,t)=>{throw t},ENVIRONMENT_IS_WEB=!1,ENVIRONMENT_IS_WORKER=!0,ENVIRONMENT_IS_NODE=!1,scriptDirectory="";function locateFile(e){return Module.locateFile?Module.locateFile(e,scriptDirectory):scriptDirectory+e}(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&(ENVIRONMENT_IS_WORKER?scriptDirectory=self.location.href:"undefined"!=typeof document&&document.currentScript&&(scriptDirectory=document.currentScript.src),scriptDirectory=0!==scriptDirectory.indexOf("blob:")?scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1):"",read_=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},ENVIRONMENT_IS_WORKER&&(readBinary=e=>{var t=new XMLHttpRequest;t.open("GET",e,!1),t.responseType="arraybuffer";let r=Date.now();return t.onloadstart=()=>{postMessage({type:"event",id:-3,body:{loaded:0,total:pe.lengthComputable?pe.total:0,tag:"starting",resourcesPath:e}})},t.onprogress=t=>{const n=Date.now();r+500<n&&(postMessage({type:"event",id:-3,body:{total:t.lengthComputable?t.total:0,loaded:t.loaded,tag:"in progress",resourcesPath:e}}),r=n)},t.onloadend=()=>{postMessage({type:"event",id:-3,body:{loaded:pe.lengthComputable?pe.total:0,total:pe.lengthComputable?pe.total:0,tag:"completed",resourcesPath:e}})},t.send(null),new Uint8Array(t.response)}),readAsync=(e,t,r)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?t(n.response):r()},n.onerror=r,n.send(null)});var wasmBinary,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),Module.quit&&(quit_=Module.quit),Module.wasmBinary&&(wasmBinary=Module.wasmBinary);var wasmMemory,noExitRuntime=Module.noExitRuntime||!0;"object"!=typeof WebAssembly&&abort("no native wasm support detected");var EXITSTATUS,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64,ABORT=!1;function assert(e,t){e||abort(t)}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)}var __ATPRERUN__=[],__ATINIT__=[],__ATPOSTRUN__=[],runtimeInitialized=!1;function preRun(){if(Module.preRun)for("function"==typeof Module.preRun&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=!0,Module.noFSInit||FS.init.initialized||FS.init(),FS.ignorePermissions=!1,TTY.init(),SOCKFS.root=FS.mount(SOCKFS,{},null),callRuntimeCallbacks(__ATINIT__)}function postRun(){if(Module.postRun)for("function"==typeof Module.postRun&&(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 addOnPostRun(e){__ATPOSTRUN__.unshift(e)}var runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null;function getUniqueRunDependency(e){return e}function addRunDependency(e){runDependencies++,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies)}function removeRunDependency(e){if(runDependencies--,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),0==runDependencies&&(null!==runDependencyWatcher&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var t=dependenciesFulfilled;dependenciesFulfilled=null,t()}}function abort(e){throw Module.onAbort&&Module.onAbort(e),err(e="Aborted("+e+")"),ABORT=!0,EXITSTATUS=1,e+=". Build with -sASSERTIONS for more info.",new WebAssembly.RuntimeError(e)}var wasmBinaryFile,tempDouble,tempI64,dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(e){return e.startsWith(dataURIPrefix)}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||!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER||"function"!=typeof fetch?Promise.resolve().then(()=>getBinarySync(e)):fetch(e,{credentials:"same-origin"}).then(async t=>{if(!t.ok)throw"failed to load wasm binary file at '"+e+"'";postMessage({type:"event",id:-3,body:{total:0,loaded:0,tag:"starting",resourcesPath:e}});const r=+t.headers.get("Content-Length"),n=t.body.getReader();let o=0,a=Date.now();const s=[];for(;;){const{done:t,value:i}=await n.read();if(t)break;if(s.push(i),o+=i.length,r){const t=Date.now();a+500<t&&(postMessage({type:"event",id:-3,body:{total:r,loaded:o,tag:"in progress",resourcesPath:e}}),a=t)}}const i=new Uint8Array(o);let l=0;for(const e of s)i.set(e,l),l+=e.length;return postMessage({type:"event",id:-3,body:{total:r,loaded:r,tag:"completed",resourcesPath:e}}),i}).catch(()=>getBinarySync(e))}function instantiateArrayBuffer(e,t,r){return getBinaryPromise(e).then(e=>WebAssembly.instantiate(e,t)).then(e=>e).then(r,e=>{err(`failed to asynchronously prepare wasm: ${e}`),abort(e)})}function instantiateAsync(e,t,r,n){return instantiateArrayBuffer(t,r,n)}function createWasm(){var e={env:wasmImports,wasi_snapshot_preview1:wasmImports};function t(e,t){return wasmExports=e.exports,wasmMemory=wasmExports.memory,updateMemoryViews(),wasmTable=wasmExports.__indirect_function_table,addOnInit(wasmExports.__wasm_call_ctors),exportWasmSymbols(wasmExports),removeRunDependency("wasm-instantiate"),wasmExports}if(addRunDependency("wasm-instantiate"),Module.instantiateWasm)try{return Module.instantiateWasm(e,t)}catch(e){return err(`Module.instantiateWasm callback failed with error: ${e}`),!1}return instantiateAsync(wasmBinary,wasmBinaryFile,e,function(e){t(e.instance)}),{}}isDataURI(wasmBinaryFile="dynamsoft-barcode-reader-bundle.wasm")||(wasmBinaryFile=locateFile(wasmBinaryFile));var callRuntimeCallbacks=e=>{for(;e.length>0;)e.shift()(Module)},asmjsMangle=e=>("__main_argc_argv"==e&&(e="main"),0==e.indexOf("dynCall_")||["stackAlloc","stackSave","stackRestore","getTempRet0","setTempRet0"].includes(e)?e:"_"+e),exportWasmSymbols=e=>{for(var t in e){var r=asmjsMangle(t);this[r]=Module[r]=e[t]}};function _CreateDirectoryFetcher(){abort("missing function: CreateDirectoryFetcher")}function _DDN_ConvertElement(){abort("missing function: DDN_ConvertElement")}function _DDN_CreateDDNResult(){abort("missing function: DDN_CreateDDNResult")}function _DDN_CreateDDNResultItem(){abort("missing function: DDN_CreateDDNResultItem")}function _DDN_CreateIntermediateResultUnits(){abort("missing function: DDN_CreateIntermediateResultUnits")}function _DDN_CreateParameters(){abort("missing function: DDN_CreateParameters")}function _DDN_CreateTargetRoiDefConditionFilter(){abort("missing function: DDN_CreateTargetRoiDefConditionFilter")}function _DDN_CreateTaskAlgEntity(){abort("missing function: DDN_CreateTaskAlgEntity")}function _DDN_HasSection(){abort("missing function: DDN_HasSection")}function _DDN_ReadTaskSetting(){abort("missing function: DDN_ReadTaskSetting")}function _DLR_ConvertElement(){abort("missing function: DLR_ConvertElement")}function _DLR_CreateBufferedCharacterItemSet(){abort("missing function: DLR_CreateBufferedCharacterItemSet")}function _DLR_CreateIntermediateResultUnits(){abort("missing function: DLR_CreateIntermediateResultUnits")}function _DLR_CreateParameters(){abort("missing function: DLR_CreateParameters")}function _DLR_CreateRecognizedTextLinesResult(){abort("missing function: DLR_CreateRecognizedTextLinesResult")}function _DLR_CreateTargetRoiDefConditionFilter(){abort("missing function: DLR_CreateTargetRoiDefConditionFilter")}function _DLR_CreateTaskAlgEntity(){abort("missing function: DLR_CreateTaskAlgEntity")}function _DLR_CreateTextLineResultItem(){abort("missing function: DLR_CreateTextLineResultItem")}function _DLR_ReadTaskSetting(){abort("missing function: DLR_ReadTaskSetting")}function _DMImage_GetDIB(){abort("missing function: DMImage_GetDIB")}function _DMImage_GetOrientation(){abort("missing function: DMImage_GetOrientation")}function _DeleteDirectoryFetcher(){abort("missing function: DeleteDirectoryFetcher")}function __ZN19LabelRecognizerWasm10getVersionEv(){abort("missing function: _ZN19LabelRecognizerWasm10getVersionEv")}function __ZN19LabelRecognizerWasm12DlrWasmClass15clearVerifyListEv(){abort("missing function: _ZN19LabelRecognizerWasm12DlrWasmClass15clearVerifyListEv")}function __ZN19LabelRecognizerWasm12DlrWasmClass22getDuplicateForgetTimeEv(){abort("missing function: _ZN19LabelRecognizerWasm12DlrWasmClass22getDuplicateForgetTimeEv")}function __ZN19LabelRecognizerWasm12DlrWasmClass22setDuplicateForgetTimeEi(){abort("missing function: _ZN19LabelRecognizerWasm12DlrWasmClass22setDuplicateForgetTimeEi")}function __ZN19LabelRecognizerWasm12DlrWasmClass25enableResultDeduplicationEb(){abort("missing function: _ZN19LabelRecognizerWasm12DlrWasmClass25enableResultDeduplicationEb")}function __ZN19LabelRecognizerWasm12DlrWasmClass27getJvFromTextLineResultItemEPKN9dynamsoft3dlr19CTextLineResultItemEPKcb(){abort("missing function: _ZN19LabelRecognizerWasm12DlrWasmClass27getJvFromTextLineResultItemEPKN9dynamsoft3dlr19CTextLineResultItemEPKcb")}function __ZN19LabelRecognizerWasm12DlrWasmClass29enableResultCrossVerificationEb(){abort("missing function: _ZN19LabelRecognizerWasm12DlrWasmClass29enableResultCrossVerificationEb")}function __ZN19LabelRecognizerWasm12DlrWasmClassC1Ev(){abort("missing function: _ZN19LabelRecognizerWasm12DlrWasmClassC1Ev")}function __ZN19LabelRecognizerWasm24getJvFromCharacterResultEPKN9dynamsoft3dlr16CCharacterResultE(){abort("missing function: _ZN19LabelRecognizerWasm24getJvFromCharacterResultEPKN9dynamsoft3dlr16CCharacterResultE")}function __ZN19LabelRecognizerWasm26getJvBufferedCharacterItemEPKN9dynamsoft3dlr22CBufferedCharacterItemE(){abort("missing function: _ZN19LabelRecognizerWasm26getJvBufferedCharacterItemEPKN9dynamsoft3dlr22CBufferedCharacterItemE")}function __ZN19LabelRecognizerWasm29getJvLocalizedTextLineElementEPKN9dynamsoft3dlr20intermediate_results25CLocalizedTextLineElementE(){abort("missing function: _ZN19LabelRecognizerWasm29getJvLocalizedTextLineElementEPKN9dynamsoft3dlr20intermediate_results25CLocalizedTextLineElementE")}function __ZN19LabelRecognizerWasm30getJvRecognizedTextLineElementEPKN9dynamsoft3dlr20intermediate_results26CRecognizedTextLineElementE(){abort("missing function: _ZN19LabelRecognizerWasm30getJvRecognizedTextLineElementEPKN9dynamsoft3dlr20intermediate_results26CRecognizedTextLineElementE")}function __ZN19LabelRecognizerWasm32getJvFromTextLineResultItem_JustEPKN9dynamsoft3dlr19CTextLineResultItemE(){abort("missing function: _ZN19LabelRecognizerWasm32getJvFromTextLineResultItem_JustEPKN9dynamsoft3dlr19CTextLineResultItemE")}function __ZN22DocumentNormalizerWasm10getVersionEv(){abort("missing function: _ZN22DocumentNormalizerWasm10getVersionEv")}function __ZN22DocumentNormalizerWasm12DdnWasmClass15clearVerifyListEv(){abort("missing function: _ZN22DocumentNormalizerWasm12DdnWasmClass15clearVerifyListEv")}function __ZN22DocumentNormalizerWasm12DdnWasmClass22getDuplicateForgetTimeEi(){abort("missing function: _ZN22DocumentNormalizerWasm12DdnWasmClass22getDuplicateForgetTimeEi")}function __ZN22DocumentNormalizerWasm12DdnWasmClass22setDuplicateForgetTimeEii(){abort("missing function: _ZN22DocumentNormalizerWasm12DdnWasmClass22setDuplicateForgetTimeEii")}function __ZN22DocumentNormalizerWasm12DdnWasmClass25enableResultDeduplicationEib(){abort("missing function: _ZN22DocumentNormalizerWasm12DdnWasmClass25enableResultDeduplicationEib")}function __ZN22DocumentNormalizerWasm12DdnWasmClass29enableResultCrossVerificationEib(){abort("missing function: _ZN22DocumentNormalizerWasm12DdnWasmClass29enableResultCrossVerificationEib")}function __ZN22DocumentNormalizerWasm12DdnWasmClass31getJvFromDetectedQuadResultItemEPKN9dynamsoft3ddn23CDetectedQuadResultItemEPKcb(){abort("missing function: _ZN22DocumentNormalizerWasm12DdnWasmClass31getJvFromDetectedQuadResultItemEPKN9dynamsoft3ddn23CDetectedQuadResultItemEPKcb")}function __ZN22DocumentNormalizerWasm12DdnWasmClass32getJvFromDeskewedImageResultItemEPKN9dynamsoft3ddn24CDeskewedImageResultItemEPKcb(){abort("missing function: _ZN22DocumentNormalizerWasm12DdnWasmClass32getJvFromDeskewedImageResultItemEPKN9dynamsoft3ddn24CDeskewedImageResultItemEPKcb")}function __ZN22DocumentNormalizerWasm12DdnWasmClass32getJvFromEnhancedImageResultItemEPKN9dynamsoft3ddn24CEnhancedImageResultItemE(){abort("missing function: _ZN22DocumentNormalizerWasm12DdnWasmClass32getJvFromEnhancedImageResultItemEPKN9dynamsoft3ddn24CEnhancedImageResultItemE")}function __ZN22DocumentNormalizerWasm12DdnWasmClassC1Ev(){abort("missing function: _ZN22DocumentNormalizerWasm12DdnWasmClassC1Ev")}function __ZN22DocumentNormalizerWasm36getJvFromDetectedQuadResultItem_JustEPKN9dynamsoft3ddn23CDetectedQuadResultItemE(){abort("missing function: _ZN22DocumentNormalizerWasm36getJvFromDetectedQuadResultItem_JustEPKN9dynamsoft3ddn23CDetectedQuadResultItemE")}function __ZN22DocumentNormalizerWasm37getJvFromDeskewedImageResultItem_JustEPKN9dynamsoft3ddn24CDeskewedImageResultItemE(){abort("missing function: _ZN22DocumentNormalizerWasm37getJvFromDeskewedImageResultItem_JustEPKN9dynamsoft3ddn24CDeskewedImageResultItemE")}function __ZN9dynamsoft7utility14CUtilityModule10GetVersionEv(){abort("missing function: _ZN9dynamsoft7utility14CUtilityModule10GetVersionEv")}_CreateDirectoryFetcher.stub=!0,_DDN_ConvertElement.stub=!0,_DDN_CreateDDNResult.stub=!0,_DDN_CreateDDNResultItem.stub=!0,_DDN_CreateIntermediateResultUnits.stub=!0,_DDN_CreateParameters.stub=!0,_DDN_CreateTargetRoiDefConditionFilter.stub=!0,_DDN_CreateTaskAlgEntity.stub=!0,_DDN_HasSection.stub=!0,_DDN_ReadTaskSetting.stub=!0,_DLR_ConvertElement.stub=!0,_DLR_CreateBufferedCharacterItemSet.stub=!0,_DLR_CreateIntermediateResultUnits.stub=!0,_DLR_CreateParameters.stub=!0,_DLR_CreateRecognizedTextLinesResult.stub=!0,_DLR_CreateTargetRoiDefConditionFilter.stub=!0,_DLR_CreateTaskAlgEntity.stub=!0,_DLR_CreateTextLineResultItem.stub=!0,_DLR_ReadTaskSetting.stub=!0,_DMImage_GetDIB.stub=!0,_DMImage_GetOrientation.stub=!0,_DeleteDirectoryFetcher.stub=!0,__ZN19LabelRecognizerWasm10getVersionEv.stub=!0,__ZN19LabelRecognizerWasm12DlrWasmClass15clearVerifyListEv.stub=!0,__ZN19LabelRecognizerWasm12DlrWasmClass22getDuplicateForgetTimeEv.stub=!0,__ZN19LabelRecognizerWasm12DlrWasmClass22setDuplicateForgetTimeEi.stub=!0,__ZN19LabelRecognizerWasm12DlrWasmClass25enableResultDeduplicationEb.stub=!0,__ZN19LabelRecognizerWasm12DlrWasmClass27getJvFromTextLineResultItemEPKN9dynamsoft3dlr19CTextLineResultItemEPKcb.stub=!0,__ZN19LabelRecognizerWasm12DlrWasmClass29enableResultCrossVerificationEb.stub=!0,__ZN19LabelRecognizerWasm12DlrWasmClassC1Ev.stub=!0,__ZN19LabelRecognizerWasm24getJvFromCharacterResultEPKN9dynamsoft3dlr16CCharacterResultE.stub=!0,__ZN19LabelRecognizerWasm26getJvBufferedCharacterItemEPKN9dynamsoft3dlr22CBufferedCharacterItemE.stub=!0,__ZN19LabelRecognizerWasm29getJvLocalizedTextLineElementEPKN9dynamsoft3dlr20intermediate_results25CLocalizedTextLineElementE.stub=!0,__ZN19LabelRecognizerWasm30getJvRecognizedTextLineElementEPKN9dynamsoft3dlr20intermediate_results26CRecognizedTextLineElementE.stub=!0,__ZN19LabelRecognizerWasm32getJvFromTextLineResultItem_JustEPKN9dynamsoft3dlr19CTextLineResultItemE.stub=!0,__ZN22DocumentNormalizerWasm10getVersionEv.stub=!0,__ZN22DocumentNormalizerWasm12DdnWasmClass15clearVerifyListEv.stub=!0,__ZN22DocumentNormalizerWasm12DdnWasmClass22getDuplicateForgetTimeEi.stub=!0,__ZN22DocumentNormalizerWasm12DdnWasmClass22setDuplicateForgetTimeEii.stub=!0,__ZN22DocumentNormalizerWasm12DdnWasmClass25enableResultDeduplicationEib.stub=!0,__ZN22DocumentNormalizerWasm12DdnWasmClass29enableResultCrossVerificationEib.stub=!0,__ZN22DocumentNormalizerWasm12DdnWasmClass31getJvFromDetectedQuadResultItemEPKN9dynamsoft3ddn23CDetectedQuadResultItemEPKcb.stub=!0,__ZN22DocumentNormalizerWasm12DdnWasmClass32getJvFromDeskewedImageResultItemEPKN9dynamsoft3ddn24CDeskewedImageResultItemEPKcb.stub=!0,__ZN22DocumentNormalizerWasm12DdnWasmClass32getJvFromEnhancedImageResultItemEPKN9dynamsoft3ddn24CEnhancedImageResultItemE.stub=!0,__ZN22DocumentNormalizerWasm12DdnWasmClassC1Ev.stub=!0,__ZN22DocumentNormalizerWasm36getJvFromDetectedQuadResultItem_JustEPKN9dynamsoft3ddn23CDetectedQuadResultItemE.stub=!0,__ZN22DocumentNormalizerWasm37getJvFromDeskewedImageResultItem_JustEPKN9dynamsoft3ddn24CDeskewedImageResultItemE.stub=!0,__ZN9dynamsoft7utility14CUtilityModule10GetVersionEv.stub=!0;var UTF8Decoder="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,UTF8ArrayToString=(e,t,r)=>{for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.buffer&&UTF8Decoder)return UTF8Decoder.decode(e.subarray(t,o));for(var a="";t<o;){var s=e[t++];if(128&s){var i=63&e[t++];if(192!=(224&s)){var l=63&e[t++];if((s=224==(240&s)?(15&s)<<12|i<<6|l:(7&s)<<18|i<<12|l<<6|63&e[t++])<65536)a+=String.fromCharCode(s);else{var c=s-65536;a+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else a+=String.fromCharCode((31&s)<<6|i)}else a+=String.fromCharCode(s)}return a},UTF8ToString=(e,t)=>e?UTF8ArrayToString(HEAPU8,e,t):"",___assert_fail=(e,t,r,n)=>{abort(`Assertion failed: ${UTF8ToString(e)}, at: `+[t?UTF8ToString(t):"unknown filename",r,n?UTF8ToString(n):"unknown function"])},exceptionCaught=[],uncaughtExceptionCount=0,___cxa_begin_catch=e=>{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(t.excPtr),t.get_exception_ptr()},exceptionLast=0,___cxa_end_catch=()=>{_setThrew(0,0);var e=exceptionCaught.pop();___cxa_decrement_exception_refcount(e.excPtr),exceptionLast=0};function ExceptionInfo(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){HEAPU32[this.ptr+4>>2]=e},this.get_type=function(){return HEAPU32[this.ptr+4>>2]},this.set_destructor=function(e){HEAPU32[this.ptr+8>>2]=e},this.get_destructor=function(){return HEAPU32[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,HEAP8[this.ptr+12|0]=e},this.get_caught=function(){return 0!=HEAP8[this.ptr+12|0]},this.set_rethrown=function(e){e=e?1:0,HEAP8[this.ptr+13|0]=e},this.get_rethrown=function(){return 0!=HEAP8[this.ptr+13|0]},this.init=function(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t)},this.set_adjusted_ptr=function(e){HEAPU32[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return HEAPU32[this.ptr+16>>2]},this.get_exception_ptr=function(){if(___cxa_is_pointer_type(this.get_type()))return HEAPU32[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}var ___resumeException=e=>{throw exceptionLast||(exceptionLast=e),exceptionLast},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 o in e){var a=e[o];if(0===a||a===n)break;var s=r.ptr+16;if(___cxa_can_catch(a,n,s))return setTempRet0(a),t}return setTempRet0(n),t},___cxa_find_matching_catch_2=()=>findMatchingCatch([]),___cxa_find_matching_catch_3=e=>findMatchingCatch([e]),___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},___cxa_rethrow_primary_exception=e=>{if(e){var t=new ExceptionInfo(e);exceptionCaught.push(t),t.set_rethrown(!0),___cxa_rethrow()}},___cxa_throw=(e,t,r)=>{throw new ExceptionInfo(e).init(t,r),uncaughtExceptionCount++,exceptionLast=e},___cxa_uncaught_exceptions=()=>uncaughtExceptionCount,PATH={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,t)=>{for(var r=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:e=>{var t=PATH.isAbs(e),r="/"===e.substr(-1);return(e=PATH.normalizeArray(e.split("/").filter(e=>!!e),!t).join("/"))||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"/";var t=(e=(e=PATH.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments);return PATH.normalize(e.join("/"))},join2:(e,t)=>PATH.normalize(e+"/"+t)},initRandomFill=()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>crypto.getRandomValues(e);abort("initRandomDevice")},randomFill=e=>(randomFill=initRandomFill())(e),PATH_FS={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:FS.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,t=PATH.isAbs(n)}return(t?"/":"")+(e=PATH.normalizeArray(e.split("/").filter(e=>!!e),!t).join("/"))||"."},relative:(e,t)=>{function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=PATH_FS.resolve(e).substr(1),t=PATH_FS.resolve(t).substr(1);for(var n=r(e.split("/")),o=r(t.split("/")),a=Math.min(n.length,o.length),s=a,i=0;i<a;i++)if(n[i]!==o[i]){s=i;break}var l=[];for(i=s;i<n.length;i++)l.push("..");return(l=l.concat(o.slice(s))).join("/")}},FS_stdin_getChar_buffer=[],lengthBytesUTF8=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n<=127?t++:n<=2047?t+=2:n>=55296&&n<=57343?(t+=4,++r):t+=3}return t},stringToUTF8Array=(e,t,r,n)=>{if(!(n>0))return 0;for(var o=r,a=r+n-1,s=0;s<e.length;++s){var i=e.charCodeAt(s);if(i>=55296&&i<=57343)i=65536+((1023&i)<<10)|1023&e.charCodeAt(++s);if(i<=127){if(r>=a)break;t[r++]=i}else if(i<=2047){if(r+1>=a)break;t[r++]=192|i>>6,t[r++]=128|63&i}else if(i<=65535){if(r+2>=a)break;t[r++]=224|i>>12,t[r++]=128|i>>6&63,t[r++]=128|63&i}else{if(r+3>=a)break;t[r++]=240|i>>18,t[r++]=128|i>>12&63,t[r++]=128|i>>6&63,t[r++]=128|63&i}}return t[r]=0,r-o};function intArrayFromString(e,t,r){var n=r>0?r:lengthBytesUTF8(e)+1,o=new Array(n),a=stringToUTF8Array(e,o,0,o.length);return t&&(o.length=a),o}var FS_stdin_getChar=()=>{if(!FS_stdin_getChar_buffer.length){var e=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\n"),!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,o){if(!e.tty||!e.tty.ops.get_char)throw new FS.ErrnoError(60);for(var a=0,s=0;s<n;s++){var i;try{i=e.tty.ops.get_char(e.tty)}catch(e){throw new FS.ErrnoError(29)}if(void 0===i&&0===a)throw new FS.ErrnoError(6);if(null==i)break;a++,t[r+s]=i}return a&&(e.node.timestamp=Date.now()),a},write(e,t,r,n,o){if(!e.tty||!e.tty.ops.put_char)throw new FS.ErrnoError(60);try{for(var a=0;a<n;a++)e.tty.ops.put_char(e.tty,t[r+a])}catch(e){throw new FS.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),a}},default_tty_ops:{get_char:e=>FS_stdin_getChar(),put_char(e,t){null===t||10===t?(out(UTF8ArrayToString(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(out(UTF8ArrayToString(e.output,0)),e.output=[])},ioctl_tcgets:e=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),ioctl_tcsets:(e,t,r)=>0,ioctl_tiocgwinsz:e=>[24,80]},default_tty1_ops:{put_char(e,t){null===t||10===t?(err(UTF8ArrayToString(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(err(UTF8ArrayToString(e.output,0)),e.output=[])}}},mmapAlloc=e=>{abort()},MEMFS={ops_table:null,mount:e=>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 o=FS.createNode(e,t,r,n);return FS.isDir(o.mode)?(o.node_ops=MEMFS.ops_table.dir.node,o.stream_ops=MEMFS.ops_table.dir.stream,o.contents={}):FS.isFile(o.mode)?(o.node_ops=MEMFS.ops_table.file.node,o.stream_ops=MEMFS.ops_table.file.stream,o.usedBytes=0,o.contents=null):FS.isLink(o.mode)?(o.node_ops=MEMFS.ops_table.link.node,o.stream_ops=MEMFS.ops_table.link.stream):FS.isChrdev(o.mode)&&(o.node_ops=MEMFS.ops_table.chrdev.node,o.stream_ops=MEMFS.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[t]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:e=>e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0),expandFileStorage(e,t){var r=e.contents?e.contents.length:0;if(!(r>=t)){t=Math.max(t,r*(r<1048576?2:1.125)>>>0),0!=r&&(t=Math.max(t,256));var n=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,t){if(e.usedBytes!=t)if(0==t)e.contents=null,e.usedBytes=0;else{var r=e.contents;e.contents=new Uint8Array(t),r&&e.contents.set(r.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr(e){var t={};return t.dev=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){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&MEMFS.resizeFileStorage(e,t.size)},lookup(e,t){throw FS.genericErrors[44]},mknod:(e,t,r,n)=>MEMFS.createNode(e,t,r,n),rename(e,t,r){if(FS.isDir(e.mode)){var n;try{n=FS.lookupNode(t,r)}catch(e){}if(n)for(var o 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,e.parent=t},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 in e.contents)e.contents.hasOwnProperty(r)&&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,o){var a=e.node.contents;if(o>=e.node.usedBytes)return 0;var s=Math.min(e.node.usedBytes-o,n);if(s>8&&a.subarray)t.set(a.subarray(o,o+s),r);else for(var i=0;i<s;i++)t[r+i]=a[o+i];return s},write(e,t,r,n,o,a){if(t.buffer===HEAP8.buffer&&(a=!1),!n)return 0;var s=e.node;if(s.timestamp=Date.now(),t.subarray&&(!s.contents||s.contents.subarray)){if(a)return s.contents=t.subarray(r,r+n),s.usedBytes=n,n;if(0===s.usedBytes&&0===o)return s.contents=t.slice(r,r+n),s.usedBytes=n,n;if(o+n<=s.usedBytes)return s.contents.set(t.subarray(r,r+n),o),n}if(MEMFS.expandFileStorage(s,o+n),s.contents.subarray&&t.subarray)s.contents.set(t.subarray(r,r+n),o);else for(var i=0;i<n;i++)s.contents[o+i]=t[r+i];return s.usedBytes=Math.max(s.usedBytes,o+n),n},llseek(e,t,r){var n=t;if(1===r?n+=e.position:2===r&&FS.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new FS.ErrnoError(28);return n},allocate(e,t,r){MEMFS.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap(e,t,r,n,o){if(!FS.isFile(e.node.mode))throw new FS.ErrnoError(43);var a,s,i=e.node.contents;if(2&o||i.buffer!==HEAP8.buffer){if((r>0||r+t<i.length)&&(i=i.subarray?i.subarray(r,r+t):Array.prototype.slice.call(i,r,r+t)),s=!0,!(a=mmapAlloc(t)))throw new FS.ErrnoError(48);HEAP8.set(i,a)}else s=!1,a=i.byteOffset;return{ptr:a,allocated:s}},msync:(e,t,r,n,o)=>(MEMFS.stream_ops.write(e,t,0,n,r,!1),0)}},asyncLoad=(e,t,r,n)=>{var o=n?"":getUniqueRunDependency(`al ${e}`);readAsync(e,r=>{assert(r,`Loading data file "${e}" failed (no arrayBuffer).`),t(new Uint8Array(r)),o&&removeRunDependency(o)},t=>{if(!r)throw`Loading data file "${e}" failed.`;r()}),o&&addRunDependency(o)},FS_createDataFile=(e,t,r,n,o,a)=>FS.createDataFile(e,t,r,n,o,a),preloadPlugins=Module.preloadPlugins||[],FS_handledByPreloadPlugin=(e,t,r,n)=>{"undefined"!=typeof Browser&&Browser.init();var o=!1;return preloadPlugins.forEach(a=>{o||a.canHandle(t)&&(a.handle(e,t,r,n),o=!0)}),o},FS_createPreloadedFile=(e,t,r,n,o,a,s,i,l,c)=>{var u=t?PATH_FS.resolve(PATH.join2(e,t)):e,d=getUniqueRunDependency(`cp ${u}`);function m(r){function m(r){c&&c(),i||FS_createDataFile(e,t,r,n,o,l),a&&a(),removeRunDependency(d)}FS_handledByPreloadPlugin(r,u,m,()=>{s&&s(),removeRunDependency(d)})||m(r)}addRunDependency(d),"string"==typeof r?asyncLoad(r,e=>m(e),s):m(r)},FS_modeStringToFlags=e=>{var t={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===t)throw new Error(`Unknown file open mode: ${e}`);return t},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:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(e,t={}){if(!(e=PATH_FS.resolve(e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new FS.ErrnoError(32);for(var r=e.split("/").filter(e=>!!e),n=FS.root,o="/",a=0;a<r.length;a++){var s=a===r.length-1;if(s&&t.parent)break;if(n=FS.lookupNode(n,r[a]),o=PATH.join2(o,r[a]),FS.isMountpoint(n)&&(!s||s&&t.follow_mount)&&(n=n.mounted.root),!s||t.follow)for(var i=0;FS.isLink(n.mode);){var l=FS.readlink(o);if(o=PATH_FS.resolve(PATH.dirname(o),l),n=FS.lookupPath(o,{recurse_count:t.recurse_count+1}).node,i++>40)throw new FS.ErrnoError(32)}}return{path:o,node:n}},getPath(e){for(var t;;){if(FS.isRoot(e)){var r=e.mount.mountpoint;return t?"/"!==r[r.length-1]?`${r}/${t}`:r+t:r}t=t?`${e.name}/${t}`:e.name,e=e.parent}},hashName(e,t){for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>0)%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,e);for(var n=FS.hashName(e.id,t),o=FS.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===e.id&&a===t)return o}return FS.lookup(e,t)},createNode(e,t,r,n){var o=new FS.FSNode(e,t,r,n);return FS.hashAddNode(o),o},destroyNode(e){FS.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>!(49152&~e),flagsToPermissionString(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:(e,t)=>FS.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2,mayLookup(e){var t=FS.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate(e,t){try{FS.lookupNode(e,t);return 20}catch(e){}return FS.nodePermissions(e,"wx")},mayDelete(e,t,r){var n;try{n=FS.lookupNode(e,t)}catch(e){return e.errno}var o=FS.nodePermissions(e,"wx");if(o)return o;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)=>e?FS.isLink(e.mode)?32:FS.isDir(e.mode)&&("r"!==FS.flagsToPermissionString(t)||512&t)?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)=>(FS.FSStream||(FS.FSStream=function(){this.shared={}},FS.FSStream.prototype={},Object.defineProperties(FS.FSStream.prototype,{object:{get(){return this.node},set(e){this.node=e}},isRead:{get(){return 1!=(2097155&this.flags)}},isWrite:{get(){return!!(2097155&this.flags)}},isAppend:{get(){return 1024&this.flags}},flags:{get(){return this.shared.flags},set(e){this.shared.flags=e}},position:{get(){return this.shared.position},set(e){this.shared.position=e}}})),e=Object.assign(new FS.FSStream,e),-1==t&&(t=FS.nextfd()),e.fd=t,FS.streams[t]=e,e),closeStream(e){FS.streams[e]=null},chrdev_stream_ops:{open(e){var t=FS.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek(){throw new FS.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,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.apply(r,n.mounts)}return t},syncfs(e,t){"function"==typeof e&&(t=e,e=!1),FS.syncFSRequests++,FS.syncFSRequests>1&&err(`warning: ${FS.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var r=FS.getMounts(FS.root.mount),n=0;function o(e){return FS.syncFSRequests--,t(e)}function a(e){if(e)return a.errored?void 0:(a.errored=!0,o(e));++n>=r.length&&o(null)}r.forEach(t=>{if(!t.type.syncfs)return a(null);t.type.syncfs(t,e,a)})},mount(e,t,r){var n,o="/"===r,a=!r;if(o&&FS.root)throw new FS.ErrnoError(10);if(!o&&!a){var s=FS.lookupPath(r,{follow_mount:!1});if(r=s.path,n=s.node,FS.isMountpoint(n))throw new FS.ErrnoError(10);if(!FS.isDir(n.mode))throw new FS.ErrnoError(54)}var i={type:e,opts:t,mountpoint:r,mounts:[]},l=e.mount(i);return l.mount=i,i.root=l,o?FS.root=l:n&&(n.mounted=i,n.mount&&n.mount.mounts.push(i)),l},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,o=FS.getMounts(n);Object.keys(FS.nameTable).forEach(e=>{for(var t=FS.nameTable[e];t;){var r=t.name_next;o.includes(t.mount)&&FS.destroyNode(t),t=r}}),r.mounted=null;var a=r.mount.mounts.indexOf(n);r.mount.mounts.splice(a,1)},lookup:(e,t)=>e.node_ops.lookup(e,t),mknod(e,t,r){var n=FS.lookupPath(e,{parent:!0}).node,o=PATH.basename(e);if(!o||"."===o||".."===o)throw new FS.ErrnoError(28);var a=FS.mayCreate(n,o);if(a)throw new FS.ErrnoError(a);if(!n.node_ops.mknod)throw new FS.ErrnoError(63);return n.node_ops.mknod(n,o,t,r)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,FS.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,FS.mknod(e,t,0)),mkdirTree(e,t){for(var r=e.split("/"),n="",o=0;o<r.length;++o)if(r[o]){n+="/"+r[o];try{FS.mkdir(n,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,r)=>(void 0===r&&(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}).node;if(!r)throw new FS.ErrnoError(44);var n=PATH.basename(t),o=FS.mayCreate(r,n);if(o)throw new FS.ErrnoError(o);if(!r.node_ops.symlink)throw new FS.ErrnoError(63);return r.node_ops.symlink(r,n,e)},rename(e,t){var r,n,o=PATH.dirname(e),a=PATH.dirname(t),s=PATH.basename(e),i=PATH.basename(t);if(r=FS.lookupPath(e,{parent:!0}).node,n=FS.lookupPath(t,{parent:!0}).node,!r||!n)throw new FS.ErrnoError(44);if(r.mount!==n.mount)throw new FS.ErrnoError(75);var l,c=FS.lookupNode(r,s),u=PATH_FS.relative(e,a);if("."!==u.charAt(0))throw new FS.ErrnoError(28);if("."!==(u=PATH_FS.relative(t,o)).charAt(0))throw new FS.ErrnoError(55);try{l=FS.lookupNode(n,i)}catch(e){}if(c!==l){var d=FS.isDir(c.mode),m=FS.mayDelete(r,s,d);if(m)throw new FS.ErrnoError(m);if(m=l?FS.mayDelete(n,i,d):FS.mayCreate(n,i))throw new FS.ErrnoError(m);if(!r.node_ops.rename)throw new FS.ErrnoError(63);if(FS.isMountpoint(c)||l&&FS.isMountpoint(l))throw new FS.ErrnoError(10);if(n!==r&&(m=FS.nodePermissions(r,"w")))throw new FS.ErrnoError(m);FS.hashRemoveNode(c);try{r.node_ops.rename(c,n,i)}catch(e){throw e}finally{FS.hashAddNode(c)}}},rmdir(e){var t=FS.lookupPath(e,{parent:!0}).node,r=PATH.basename(e),n=FS.lookupNode(t,r),o=FS.mayDelete(t,r,!0);if(o)throw new FS.ErrnoError(o);if(!t.node_ops.rmdir)throw new FS.ErrnoError(63);if(FS.isMountpoint(n))throw new FS.ErrnoError(10);t.node_ops.rmdir(t,r),FS.destroyNode(n)},readdir(e){var t=FS.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new FS.ErrnoError(54);return t.node_ops.readdir(t)},unlink(e){var t=FS.lookupPath(e,{parent:!0}).node;if(!t)throw new FS.ErrnoError(44);var r=PATH.basename(e),n=FS.lookupNode(t,r),o=FS.mayDelete(t,r,!1);if(o)throw new FS.ErrnoError(o);if(!t.node_ops.unlink)throw new FS.ErrnoError(63);if(FS.isMountpoint(n))throw new FS.ErrnoError(10);t.node_ops.unlink(t,r),FS.destroyNode(n)},readlink(e){var t=FS.lookupPath(e).node;if(!t)throw new FS.ErrnoError(44);if(!t.node_ops.readlink)throw new FS.ErrnoError(28);return PATH_FS.resolve(FS.getPath(t.parent),t.node_ops.readlink(t))},stat(e,t){var r=FS.lookupPath(e,{follow:!t}).node;if(!r)throw new FS.ErrnoError(44);if(!r.node_ops.getattr)throw new FS.ErrnoError(63);return r.node_ops.getattr(r)},lstat:e=>FS.stat(e,!0),chmod(e,t,r){var n;"string"==typeof e?n=FS.lookupPath(e,{follow:!r}).node:n=e;if(!n.node_ops.setattr)throw new FS.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,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 o;"string"==typeof e?o=FS.lookupPath(e,{follow:!n}).node:o=e;if(!o.node_ops.setattr)throw new FS.ErrnoError(63);o.node_ops.setattr(o,{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;"string"==typeof e?r=FS.lookupPath(e,{follow:!0}).node: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 n=FS.nodePermissions(r,"w");if(n)throw new FS.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate(e,t){var r=FS.getStreamChecked(e);if(!(2097155&r.flags))throw new FS.ErrnoError(28);FS.truncate(r.node,t)},utime(e,t,r){var n=FS.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open(e,t,r){if(""===e)throw new FS.ErrnoError(44);var n;if(r=void 0===r?438:r,r=64&(t="string"==typeof t?FS_modeStringToFlags(t):t)?4095&r|32768:0,"object"==typeof e)n=e;else{e=PATH.normalize(e);try{n=FS.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var o=!1;if(64&t)if(n){if(128&t)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),65536&t&&!FS.isDir(n.mode))throw new FS.ErrnoError(54);if(!o){var a=FS.mayOpen(n,t);if(a)throw new FS.ErrnoError(a)}512&t&&!o&&FS.truncate(n,0),t&=-131713;var s=FS.createStream({node:n,path:FS.getPath(n),flags:t,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!Module.logReadFiles||1&t||(FS.readFiles||(FS.readFiles={}),e in FS.readFiles||(FS.readFiles[e]=1)),s},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(e){throw e}finally{FS.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,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(0!=r&&1!=r&&2!=r)throw new FS.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read(e,t,r,n,o){if(n<0||o<0)throw new FS.ErrnoError(28);if(FS.isClosed(e))throw new FS.ErrnoError(8);if(1==(2097155&e.flags))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 a=void 0!==o;if(a){if(!e.seekable)throw new FS.ErrnoError(70)}else o=e.position;var s=e.stream_ops.read(e,t,r,n,o);return a||(e.position+=s),s},write(e,t,r,n,o,a){if(n<0||o<0)throw new FS.ErrnoError(28);if(FS.isClosed(e))throw new FS.ErrnoError(8);if(!(2097155&e.flags))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&&1024&e.flags&&FS.llseek(e,0,2);var s=void 0!==o;if(s){if(!e.seekable)throw new FS.ErrnoError(70)}else o=e.position;var i=e.stream_ops.write(e,t,r,n,o,a);return s||(e.position+=i),i},allocate(e,t,r){if(FS.isClosed(e))throw new FS.ErrnoError(8);if(t<0||r<=0)throw new FS.ErrnoError(28);if(!(2097155&e.flags))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,o){if(2&n&&!(2&o)&&2!=(2097155&e.flags))throw new FS.ErrnoError(2);if(1==(2097155&e.flags))throw new FS.ErrnoError(2);if(!e.stream_ops.mmap)throw new FS.ErrnoError(43);return e.stream_ops.mmap(e,t,r,n,o)},msync:(e,t,r,n,o)=>e.stream_ops.msync?e.stream_ops.msync(e,t,r,n,o):0,munmap:e=>0,ioctl(e,t,r){if(!e.stream_ops.ioctl)throw new 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","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error(`Invalid encoding type "${t.encoding}"`);var r,n=FS.open(e,t.flags),o=FS.stat(e).size,a=new Uint8Array(o);return FS.read(n,a,0,o,0),"utf8"===t.encoding?r=UTF8ArrayToString(a,0):"binary"===t.encoding&&(r=a),FS.close(n),r},writeFile(e,t,r={}){r.flags=r.flags||577;var n=FS.open(e,r.flags,r.mode);if("string"==typeof t){var o=new Uint8Array(lengthBytesUTF8(t)+1),a=stringToUTF8Array(t,o,0,o.length);FS.write(n,o,0,a,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");FS.write(n,t,0,t.byteLength,void 0,r.canOwn)}FS.close(n)},cwd:()=>FS.currentPath,chdir(e){var t=FS.lookupPath(e,{follow:!0});if(null===t.node)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:(e,t,r,n,o)=>n}),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=()=>(0===t&&(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(e,t){var r=+t,n=FS.getStreamChecked(r),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},t}},{},"/proc/self/fd")},createStandardStreams(){Module.stdin?FS.createDevice("/dev","stdin",Module.stdin):FS.symlink("/dev/tty","/dev/stdin"),Module.stdout?FS.createDevice("/dev","stdout",null,Module.stdout):FS.symlink("/dev/tty","/dev/stdout"),Module.stderr?FS.createDevice("/dev","stderr",null,Module.stderr):FS.symlink("/dev/tty1","/dev/stderr");FS.open("/dev/stdin",0),FS.open("/dev/stdout",1),FS.open("/dev/stderr",1)},ensureErrnoError(){FS.ErrnoError||(FS.ErrnoError=function(e,t){this.name="ErrnoError",this.node=t,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},FS.ErrnoError.prototype=new Error,FS.ErrnoError.prototype.constructor=FS.ErrnoError,[44].forEach(e=>{FS.genericErrors[e]=new FS.ErrnoError(e),FS.genericErrors[e].stack="<generic error, no stack>"}))},staticInit(){FS.ensureErrnoError(),FS.nameTable=new Array(4096),FS.mount(MEMFS,{},"/"),FS.createDefaultDirectories(),FS.createDefaultDevices(),FS.createSpecialDirectories(),FS.filesystems={MEMFS:MEMFS}},init(e,t,r){FS.init.initialized=!0,FS.ensureErrnoError(),Module.stdin=e||Module.stdin,Module.stdout=t||Module.stdout,Module.stderr=r||Module.stderr,FS.createStandardStreams()},quit(){FS.init.initialized=!1;for(var e=0;e<FS.streams.length;e++){var t=FS.streams[e];t&&FS.close(t)}},findObject(e,t){var r=FS.analyzePath(e,t);return r.exists?r.object:null},analyzePath(e,t){try{e=(n=FS.lookupPath(e,{follow:!t})).path}catch(e){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=FS.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=PATH.basename(e),n=FS.lookupPath(e,{follow:!t}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot="/"===n.path}catch(e){r.error=e.errno}return r},createPath(e,t,r,n){e="string"==typeof e?e:FS.getPath(e);for(var o=t.split("/").reverse();o.length;){var a=o.pop();if(a){var s=PATH.join2(e,a);try{FS.mkdir(s)}catch(e){}e=s}}return s},createFile(e,t,r,n,o){var a=PATH.join2("string"==typeof e?e:FS.getPath(e),t),s=FS_getMode(n,o);return FS.create(a,s)},createDataFile(e,t,r,n,o,a){var s=t;e&&(e="string"==typeof e?e:FS.getPath(e),s=t?PATH.join2(e,t):e);var i=FS_getMode(n,o),l=FS.create(s,i);if(r){if("string"==typeof r){for(var c=new Array(r.length),u=0,d=r.length;u<d;++u)c[u]=r.charCodeAt(u);r=c}FS.chmod(l,146|i);var m=FS.open(l,577);FS.write(m,r,0,r.length,0,a),FS.close(m),FS.chmod(l,i)}return l},createDevice(e,t,r,n){var o=PATH.join2("string"==typeof e?e:FS.getPath(e),t),a=FS_getMode(!!r,!!n);FS.createDevice.major||(FS.createDevice.major=64);var s=FS.makedev(FS.createDevice.major++,0);return FS.registerDevice(s,{open(e){e.seekable=!1},close(e){n&&n.buffer&&n.buffer.length&&n(10)},read(e,t,n,o,a){for(var s=0,i=0;i<o;i++){var l;try{l=r()}catch(e){throw new FS.ErrnoError(29)}if(void 0===l&&0===s)throw new FS.ErrnoError(6);if(null==l)break;s++,t[n+i]=l}return s&&(e.node.timestamp=Date.now()),s},write(e,t,r,o,a){for(var s=0;s<o;s++)try{n(t[r+s])}catch(e){throw new FS.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),s}}),FS.mkdev(o,a,s)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!read_)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=intArrayFromString(read_(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new FS.ErrnoError(29)}},createLazyFile(e,t,r,n,o){function a(){this.lengthKnown=!1,this.chunks=[]}if(a.prototype.get=function(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,r=e/this.chunkSize|0;return this.getter(r)[t]}},a.prototype.setDataGetter=function(e){this.getter=e},a.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",r,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+r+". Status: "+e.status);var t,n=Number(e.getResponseHeader("Content-length")),o=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,a=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,s=1048576;o||(s=n);var i=this;i.setDataGetter(e=>{var t=e*s,o=(e+1)*s-1;if(o=Math.min(o,n-1),void 0===i.chunks[e]&&(i.chunks[e]=((e,t)=>{if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",r,!1),n!==s&&o.setRequestHeader("Range","bytes="+e+"-"+t),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+r+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):intArrayFromString(o.responseText||"",!0)})(t,o)),void 0===i.chunks[e])throw new Error("doXHR failed!");return i.chunks[e]}),!a&&n||(s=n=1,n=this.getter(0).length,s=n,out("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=s,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers