scanbot-web-sdk 8.1.0-alpha.1 → 8.1.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/@types/core/bridge/worker-bridge.d.ts +28 -0
  2. package/@types/core/compiled/BarcodeConfigurationTypes.d.ts +146 -52
  3. package/@types/core/compiled/BarcodeDocumentModel.d.ts +12 -12
  4. package/@types/core/compiled/BarcodeScannerTypes.d.ts +13 -5
  5. package/@types/core/compiled/BarcodeTypes.d.ts +35 -0
  6. package/@types/core/compiled/CommonFieldType.d.ts +7 -1
  7. package/@types/core/compiled/DocumentQualityAnalyzerTypes.d.ts +43 -24
  8. package/@types/core/compiled/DocumentScannerTypes.d.ts +19 -19
  9. package/@types/core/compiled/DocumentsModel.d.ts +443 -1
  10. package/@types/core/compiled/MrzTypes.d.ts +9 -0
  11. package/@types/core/compiled/ParametricFilters.d.ts +36 -1
  12. package/@types/core/compiled/TextPatternScannerTypes.d.ts +5 -0
  13. package/@types/core/compiled/VinScannerTypes.d.ts +5 -0
  14. package/@types/core/compiled/utils.d.ts +1 -1
  15. package/@types/core-types.d.ts +1 -1
  16. package/@types/model/configuration/document-scanner-view-configuration.d.ts +4 -0
  17. package/@types/model/configuration/scanner-configuration.d.ts +3 -0
  18. package/@types/scanbot-sdk.d.ts +14 -0
  19. package/@types/service/pdf-generator.d.ts +2 -1
  20. package/@types/ui2/barcode/controllers/multiple-scanning-mode-controller.d.ts +4 -0
  21. package/@types/ui2/barcode/controllers/single-scanning-mode-controller.d.ts +4 -0
  22. package/@types/ui2/barcode/views/barcode-scanner.d.ts +2 -0
  23. package/@types/ui2/barcode/views/drawer/barcode-result-drawer.d.ts +2 -0
  24. package/@types/ui2/barcode/views/drawer/barcode-result-sidebar.d.ts +2 -0
  25. package/@types/ui2/barcode/views/navigation-bar.d.ts +1 -0
  26. package/@types/ui2/common.d.ts +1 -1
  27. package/@types/ui2/configuration/BarcodeTypes.d.ts +1 -1
  28. package/@types/ui2/configuration/barcode/BarcodeScannerScreenConfiguration.d.ts +2 -2
  29. package/@types/ui2/configuration/barcode/BarcodeTextLocalization.d.ts +15 -0
  30. package/@types/ui2/configuration/barcode/BarcodeUseCase.d.ts +3 -3
  31. package/@types/ui2/configuration/barcode/FindAndPickScanningModeUseCase.d.ts +4 -4
  32. package/@types/ui2/configuration/barcode/MultipleScanningModeUseCase.d.ts +2 -2
  33. package/@types/ui2/configuration/barcode/SingleScanningModeUseCase.d.ts +2 -2
  34. package/@types/ui2/configuration/check/CheckScannerScreenConfiguration.d.ts +4 -4
  35. package/@types/ui2/configuration/check/CheckScannerScreenTextLocalization.d.ts +15 -0
  36. package/@types/ui2/configuration/common/ActionBarConfiguration.d.ts +1 -1
  37. package/@types/ui2/configuration/common/CameraConfiguration.d.ts +6 -0
  38. package/@types/ui2/configuration/common/CameraPermission.d.ts +3 -3
  39. package/@types/ui2/configuration/common/Common.d.ts +19 -0
  40. package/@types/ui2/configuration/common/ScanCompletionOverlay.d.ts +1 -1
  41. package/@types/ui2/configuration/common/ScanbotAlertDialog.d.ts +2 -2
  42. package/@types/ui2/configuration/common/SelectCameraMenu.d.ts +63 -0
  43. package/@types/ui2/configuration/common/TopBarConfiguration.d.ts +8 -2
  44. package/@types/ui2/configuration/common/UserGuidanceConfiguration.d.ts +3 -3
  45. package/@types/ui2/configuration/common/ViewFinderConfiguration.d.ts +1 -1
  46. package/@types/ui2/configuration/credit_card/CreditCardScannerScreenConfiguration.d.ts +4 -4
  47. package/@types/ui2/configuration/credit_card/CreditCardScannerScreenTextLocalization.d.ts +15 -0
  48. package/@types/ui2/configuration/document/CameraScreenConfiguration.d.ts +6 -65
  49. package/@types/ui2/configuration/document/DocumentScannerCameraConfiguration.d.ts +6 -0
  50. package/@types/ui2/configuration/document/DocumentScannerScreens.d.ts +3 -3
  51. package/@types/ui2/configuration/document/DocumentScannerTextLocalization.d.ts +15 -15
  52. package/@types/ui2/configuration/document/DocumentScannerUserGuidance.d.ts +1 -1
  53. package/@types/ui2/configuration/document/DocumentScanningFlow.d.ts +3 -3
  54. package/@types/ui2/configuration/document_data/DocumentDataExtractorScreenConfiguration.d.ts +4 -4
  55. package/@types/ui2/configuration/document_data/DocumentDataExtractorScreenTextLocalization.d.ts +15 -0
  56. package/@types/ui2/configuration/mrz/MRZScannerScreenConfiguration.d.ts +3 -3
  57. package/@types/ui2/configuration/mrz/MRZScannerScreenTextLocalization.d.ts +15 -0
  58. package/@types/ui2/configuration/native/DocumentData.d.ts +1 -1
  59. package/@types/ui2/configuration/native/PageData.d.ts +1 -1
  60. package/@types/ui2/configuration/text_pattern/TextPatternScannerScreenConfiguration.d.ts +2 -2
  61. package/@types/ui2/configuration/text_pattern/TextPatternScannerScreenTextLocalization.d.ts +15 -0
  62. package/@types/ui2/configuration/vin/VINScannerScreenConfiguration.d.ts +2 -2
  63. package/@types/ui2/configuration/vin/VINScannerScreenTextLocalization.d.ts +15 -0
  64. package/@types/ui2/configuration.d.ts +1 -0
  65. package/@types/ui2/data-scanner/views/mrz-scanner-box.d.ts +4 -2
  66. package/@types/ui2/document/views/camera-screen/camera-select-dropdown.d.ts +2 -2
  67. package/@types/ui2/document/views/camera-screen/top-bar.d.ts +18 -3
  68. package/@types/ui2/document/views/camera-screen/use-document-scanner-view.d.ts +1 -0
  69. package/@types/ui2/document/views/common/common-top-bar.d.ts +1 -1
  70. package/@types/utils/assets/camera-localization.d.ts +44 -0
  71. package/@types/view/scanbot-camera-view.d.ts +2 -0
  72. package/@types/worker/worker-bridge.d.ts +28 -0
  73. package/bundle/ScanbotSDK.min.js +4 -4
  74. package/bundle/ScanbotSDK.ui2.min.js +85 -85
  75. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd-threads.js +1 -1
  76. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd-threads.wasm +0 -0
  77. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd.wasm +0 -0
  78. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm.wasm +0 -0
  79. package/bundle/bin/barcode-scanner/ScanbotSDK.Core-simd-threads.js +1 -1
  80. package/bundle/bin/barcode-scanner/ScanbotSDK.Core-simd.js +1 -1
  81. package/bundle/bin/barcode-scanner/ScanbotSDK.Core.js +1 -1
  82. package/bundle/bin/complete/ScanbotSDK.Asm-simd-threads.js +1 -1
  83. package/bundle/bin/complete/ScanbotSDK.Asm-simd-threads.wasm +0 -0
  84. package/bundle/bin/complete/ScanbotSDK.Asm-simd.wasm +0 -0
  85. package/bundle/bin/complete/ScanbotSDK.Asm.wasm +0 -0
  86. package/bundle/bin/complete/ScanbotSDK.Core-simd-threads.js +1 -1
  87. package/bundle/bin/complete/ScanbotSDK.Core-simd.js +1 -1
  88. package/bundle/bin/complete/ScanbotSDK.Core.js +1 -1
  89. package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd-threads.js +1 -1
  90. package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd-threads.wasm +0 -0
  91. package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd.wasm +0 -0
  92. package/bundle/bin/document-scanner/ScanbotSDK.Asm.wasm +0 -0
  93. package/bundle/bin/document-scanner/ScanbotSDK.Core-simd-threads.js +1 -1
  94. package/bundle/bin/document-scanner/ScanbotSDK.Core-simd.js +1 -1
  95. package/bundle/bin/document-scanner/ScanbotSDK.Core.js +1 -1
  96. package/package.json +1 -1
@@ -1 +1 @@
1
- (()=>{var e={290:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});const n="data:application/javascript;charset=utf-8;base64,InVzZSBzdHJpY3QiO3ZhciBNb2R1bGU9e307dmFyIGluaXRpYWxpemVkSlM9ZmFsc2U7ZnVuY3Rpb24gdGhyZWFkUHJpbnRFcnIoKXt2YXIgdGV4dD1BcnJheS5wcm90b3R5cGUuc2xpY2UuY2FsbChhcmd1bWVudHMpLmpvaW4oIiAiKTtjb25zb2xlLmVycm9yKHRleHQpfWZ1bmN0aW9uIHRocmVhZEFsZXJ0KCl7dmFyIHRleHQ9QXJyYXkucHJvdG90eXBlLnNsaWNlLmNhbGwoYXJndW1lbnRzKS5qb2luKCIgIik7cG9zdE1lc3NhZ2Uoe2NtZDoiYWxlcnQiLHRleHQ6dGV4dCx0aHJlYWRJZDpNb2R1bGVbIl9wdGhyZWFkX3NlbGYiXSgpfSl9dmFyIGVycj10aHJlYWRQcmludEVycjtzZWxmLmFsZXJ0PXRocmVhZEFsZXJ0O01vZHVsZVsiaW5zdGFudGlhdGVXYXNtIl09KGluZm8scmVjZWl2ZUluc3RhbmNlKT0+e3ZhciBtb2R1bGU9TW9kdWxlWyJ3YXNtTW9kdWxlIl07TW9kdWxlWyJ3YXNtTW9kdWxlIl09bnVsbDt2YXIgaW5zdGFuY2U9bmV3IFdlYkFzc2VtYmx5Lkluc3RhbmNlKG1vZHVsZSxpbmZvKTtyZXR1cm4gcmVjZWl2ZUluc3RhbmNlKGluc3RhbmNlKX07c2VsZi5vbnVuaGFuZGxlZHJlamVjdGlvbj1lPT57dGhyb3cgZS5yZWFzb258fGV9O2Z1bmN0aW9uIGhhbmRsZU1lc3NhZ2UoZSl7dHJ5e2lmKGUuZGF0YS5jbWQ9PT0ibG9hZCIpe2xldCBtZXNzYWdlUXVldWU9W107c2VsZi5vbm1lc3NhZ2U9ZT0+bWVzc2FnZVF1ZXVlLnB1c2goZSk7c2VsZi5zdGFydFdvcmtlcj1pbnN0YW5jZT0+e01vZHVsZT1pbnN0YW5jZTtwb3N0TWVzc2FnZSh7ImNtZCI6ImxvYWRlZCJ9KTtmb3IobGV0IG1zZyBvZiBtZXNzYWdlUXVldWUpe2hhbmRsZU1lc3NhZ2UobXNnKX1zZWxmLm9ubWVzc2FnZT1oYW5kbGVNZXNzYWdlfTtNb2R1bGVbIndhc21Nb2R1bGUiXT1lLmRhdGEud2FzbU1vZHVsZTtmb3IoY29uc3QgaGFuZGxlciBvZiBlLmRhdGEuaGFuZGxlcnMpe01vZHVsZVtoYW5kbGVyXT0oLi4uYXJncyk9Pntwb3N0TWVzc2FnZSh7Y21kOiJjYWxsSGFuZGxlciIsaGFuZGxlcjpoYW5kbGVyLGFyZ3M6YXJnc30pfX1Nb2R1bGVbIndhc21NZW1vcnkiXT1lLmRhdGEud2FzbU1lbW9yeTtNb2R1bGVbImJ1ZmZlciJdPU1vZHVsZVsid2FzbU1lbW9yeSJdLmJ1ZmZlcjtNb2R1bGVbIkVOVklST05NRU5UX0lTX1BUSFJFQUQiXT10cnVlO2lmKHR5cGVvZiBlLmRhdGEudXJsT3JCbG9iPT0ic3RyaW5nIil7aW1wb3J0U2NyaXB0cyhlLmRhdGEudXJsT3JCbG9iKX1lbHNle3ZhciBvYmplY3RVcmw9VVJMLmNyZWF0ZU9iamVjdFVSTChlLmRhdGEudXJsT3JCbG9iKTtpbXBvcnRTY3JpcHRzKG9iamVjdFVybCk7VVJMLnJldm9rZU9iamVjdFVSTChvYmplY3RVcmwpfWluaXRNb2R1bGUoTW9kdWxlKX1lbHNlIGlmKGUuZGF0YS5jbWQ9PT0icnVuIil7TW9kdWxlWyJfX2Vtc2NyaXB0ZW5fdGhyZWFkX2luaXQiXShlLmRhdGEucHRocmVhZF9wdHIsMCwwLDEpO01vZHVsZVsiX19lbXNjcmlwdGVuX3RocmVhZF9tYWlsYm94X2F3YWl0Il0oZS5kYXRhLnB0aHJlYWRfcHRyKTtNb2R1bGVbImVzdGFibGlzaFN0YWNrU3BhY2UiXSgpO01vZHVsZVsiUFRocmVhZCJdLnJlY2VpdmVPYmplY3RUcmFuc2ZlcihlLmRhdGEpO01vZHVsZVsiUFRocmVhZCJdLnRocmVhZEluaXRUTFMoKTtpZighaW5pdGlhbGl6ZWRKUyl7TW9kdWxlWyJfX2VtYmluZF9pbml0aWFsaXplX2JpbmRpbmdzIl0oKTtpbml0aWFsaXplZEpTPXRydWV9dHJ5e01vZHVsZVsiaW52b2tlRW50cnlQb2ludCJdKGUuZGF0YS5zdGFydF9yb3V0aW5lLGUuZGF0YS5hcmcpfWNhdGNoKGV4KXtpZihleCE9InVud2luZCIpe3Rocm93IGV4fX19ZWxzZSBpZihlLmRhdGEuY21kPT09ImNhbmNlbCIpe2lmKE1vZHVsZVsiX3B0aHJlYWRfc2VsZiJdKCkpe01vZHVsZVsiX19lbXNjcmlwdGVuX3RocmVhZF9leGl0Il0oLTEpfX1lbHNlIGlmKGUuZGF0YS50YXJnZXQ9PT0ic2V0aW1tZWRpYXRlIil7fWVsc2UgaWYoZS5kYXRhLmNtZD09PSJjaGVja01haWxib3giKXtpZihpbml0aWFsaXplZEpTKXtNb2R1bGVbImNoZWNrTWFpbGJveCJdKCl9fWVsc2UgaWYoZS5kYXRhLmNtZCl7ZXJyKGB3b3JrZXIuanMgcmVjZWl2ZWQgdW5rbm93biBjb21tYW5kICR7ZS5kYXRhLmNtZH1gKTtlcnIoZS5kYXRhKX19Y2F0Y2goZXgpe2lmKE1vZHVsZVsiX19lbXNjcmlwdGVuX3RocmVhZF9jcmFzaGVkIl0pe01vZHVsZVsiX19lbXNjcmlwdGVuX3RocmVhZF9jcmFzaGVkIl0oKX10aHJvdyBleH19c2VsZi5vbm1lc3NhZ2U9aGFuZGxlTWVzc2FnZTsK"},709:(e,t,r)=>{var n,o=(n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(e={}){function t(){return W.buffer!=S.buffer&&Z(),S}function o(){return W.buffer!=S.buffer&&Z(),P}function a(){return W.buffer!=S.buffer&&Z(),j}function i(){return W.buffer!=S.buffer&&Z(),$}function s(){return W.buffer!=S.buffer&&Z(),A}function u(){return W.buffer!=S.buffer&&Z(),D}function c(){return W.buffer!=S.buffer&&Z(),R}var l,d,h=e;h.ready=new Promise(((e,t)=>{l=e,d=t}));var f,p,m,v=Object.assign({},h),y="./this.program",g=(e,t)=>{throw t},w=h.ENVIRONMENT_IS_PTHREAD||!1,b="";function _(e){return h.locateFile?h.locateFile(e,b):b+e}b=self.location.href,n&&(b=n),b=0!==b.indexOf("blob:")?b.substr(0,b.replace(/[?#].*/,"").lastIndexOf("/")+1):"",f=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},m=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)},p=(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 E,k=h.print||console.log.bind(console),M=h.printErr||console.error.bind(console);Object.assign(h,v),v=null,h.arguments&&h.arguments,h.thisProgram&&(y=h.thisProgram),h.quit&&(g=h.quit),h.wasmBinary&&(E=h.wasmBinary);var W,T,C=h.noExitRuntime||!0;"object"!=typeof WebAssembly&&ne("no native wasm support detected");var F,S,P,j,$,A,D,x,R,I=!1;function V(e,t){e||ne(t)}function Z(){var e=W.buffer;h.HEAP8=S=new Int8Array(e),h.HEAP16=j=new Int16Array(e),h.HEAPU8=P=new Uint8Array(e),h.HEAPU16=$=new Uint16Array(e),h.HEAP32=A=new Int32Array(e),h.HEAPU32=D=new Uint32Array(e),h.HEAPF32=x=new Float32Array(e),h.HEAPF64=R=new Float64Array(e)}var O,N=h.INITIAL_MEMORY||134217728;if(V(N>=4194304,"INITIAL_MEMORY should be larger than STACK_SIZE, was "+N+"! (STACK_SIZE=4194304)"),w)W=h.wasmMemory;else if(h.wasmMemory)W=h.wasmMemory;else if(!((W=new WebAssembly.Memory({initial:N/65536,maximum:32768,shared:!0})).buffer instanceof SharedArrayBuffer))throw M("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),Error("bad memory");Z(),N=W.buffer.byteLength;var z=[],G=[],U=[],L=0;function X(){return C||L>0}function Y(){w||(h.noFSInit||Te.init.initialized||Te.init(),Te.ignorePermissions=!1,_e.init(),Ae(G))}function B(e){z.unshift(e)}var H,K,J,Q=0,q=null,ee=null;function te(e){Q++,h.monitorRunDependencies&&h.monitorRunDependencies(Q)}function re(e){if(Q--,h.monitorRunDependencies&&h.monitorRunDependencies(Q),0==Q&&(null!==q&&(clearInterval(q),q=null),ee)){var t=ee;ee=null,t()}}function ne(e){h.onAbort&&h.onAbort(e),M(e="Aborted("+e+")"),I=!0,F=1,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw d(t),t}function oe(e){return e.startsWith("data:application/octet-stream;base64,")}function ae(e){if(e==H&&E)return new Uint8Array(E);if(m)return m(e);throw"both async and sync fetching of the wasm failed"}function ie(e,t,r){return function(e){return E||"function"!=typeof fetch?Promise.resolve().then((()=>ae(e))):fetch(e,{credentials:"same-origin"}).then((t=>{if(!t.ok)throw"failed to load wasm binary file at '"+e+"'";return t.arrayBuffer()})).catch((()=>ae(e)))}(e).then((e=>WebAssembly.instantiate(e,t))).then((e=>e)).then(r,(e=>{M(`failed to asynchronously prepare wasm: ${e}`),ne(e)}))}oe(H="ScanbotSDK.Asm-simd-threads.wasm")||(H=_(H));var se={1460380:e=>hn(function(){return this[Ce(e)].toString()}.apply(function(){return this}.call(void 0)))};function ue(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var ce=e=>{e.terminate(),e.onmessage=e=>{}},le=e=>{var t=$e.pthreads[e];V(t),$e.returnWorkerToPool(t)},de=e=>{var t=$e.getNewWorker();if(!t)return 6;$e.runningWorkers.push(t),$e.pthreads[e.pthread_ptr]=t,t.pthread_ptr=e.pthread_ptr;var r={cmd:"run",start_routine:e.startRoutine,arg:e.arg,pthread_ptr:e.pthread_ptr};return t.postMessage(r,e.transferList),0},he={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,t)=>{for(var r=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:e=>{var t=he.isAbs(e),r="/"===e.substr(-1);return(e=he.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=he.splitPath(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:e=>{if("/"===e)return"/";var t=(e=(e=he.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments);return he.normalize(e.join("/"))},join2:(e,t)=>he.normalize(e+"/"+t)},fe=e=>(fe=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>(e.set(crypto.getRandomValues(new Uint8Array(e.byteLength))),e);ne("initRandomDevice")})())(e),pe={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:Te.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,t=he.isAbs(n)}return(t?"/":"")+(e=he.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||"."},relative:(e,t)=>{function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=pe.resolve(e).substr(1),t=pe.resolve(t).substr(1);for(var n=r(e.split("/")),o=r(t.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s<a;s++)if(n[s]!==o[s]){i=s;break}var u=[];for(s=i;s<n.length;s++)u.push("..");return(u=u.concat(o.slice(i))).join("/")}},me="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,ve=(e,t,r)=>{for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.buffer&&me)return me.decode(e.buffer instanceof SharedArrayBuffer?e.slice(t,o):e.subarray(t,o));for(var a="";t<o;){var i=e[t++];if(128&i){var s=63&e[t++];if(192!=(224&i)){var u=63&e[t++];if((i=224==(240&i)?(15&i)<<12|s<<6|u:(7&i)<<18|s<<12|u<<6|63&e[t++])<65536)a+=String.fromCharCode(i);else{var c=i-65536;a+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a},ye=[],ge=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},we=(e,t,r,n)=>{if(!(n>0))return 0;for(var o=r,a=r+n-1,i=0;i<e.length;++i){var s=e.charCodeAt(i);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++i)),s<=127){if(r>=a)break;t[r++]=s}else if(s<=2047){if(r+1>=a)break;t[r++]=192|s>>6,t[r++]=128|63&s}else if(s<=65535){if(r+2>=a)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|63&s}else{if(r+3>=a)break;t[r++]=240|s>>18,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}}return t[r]=0,r-o};function be(e,t,r){var n=r>0?r:ge(e)+1,o=new Array(n),a=we(e,o,0,o.length);return t&&(o.length=a),o}var _e={ttys:[],init(){},shutdown(){},register(e,t){_e.ttys[e]={input:[],output:[],ops:t},Te.registerDevice(e,_e.stream_ops)},stream_ops:{open(e){var t=_e.ttys[e.node.rdev];if(!t)throw new Te.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 Te.ErrnoError(60);for(var a=0,i=0;i<n;i++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new Te.ErrnoError(29)}if(void 0===s&&0===a)throw new Te.ErrnoError(6);if(null==s)break;a++,t[r+i]=s}return a&&(e.node.timestamp=Date.now()),a},write(e,t,r,n,o){if(!e.tty||!e.tty.ops.put_char)throw new Te.ErrnoError(60);try{for(var a=0;a<n;a++)e.tty.ops.put_char(e.tty,t[r+a])}catch(e){throw new Te.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),a}},default_tty_ops:{get_char:e=>(()=>{if(!ye.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;ye=be(e,!0)}return ye.shift()})(),put_char(e,t){null===t||10===t?(k(ve(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(k(ve(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?(M(ve(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(M(ve(e.output,0)),e.output=[])}}},Ee=e=>{e=((e,t)=>Math.ceil(e/t)*t)(e,65536);var t=Fn(65536,e);return t?((e,t)=>(o().fill(0,e,e+t),e))(t,e):0},ke={ops_table:null,mount:e=>ke.createNode(null,"/",16895,0),createNode(e,t,r,n){if(Te.isBlkdev(r)||Te.isFIFO(r))throw new Te.ErrnoError(63);ke.ops_table||(ke.ops_table={dir:{node:{getattr:ke.node_ops.getattr,setattr:ke.node_ops.setattr,lookup:ke.node_ops.lookup,mknod:ke.node_ops.mknod,rename:ke.node_ops.rename,unlink:ke.node_ops.unlink,rmdir:ke.node_ops.rmdir,readdir:ke.node_ops.readdir,symlink:ke.node_ops.symlink},stream:{llseek:ke.stream_ops.llseek}},file:{node:{getattr:ke.node_ops.getattr,setattr:ke.node_ops.setattr},stream:{llseek:ke.stream_ops.llseek,read:ke.stream_ops.read,write:ke.stream_ops.write,allocate:ke.stream_ops.allocate,mmap:ke.stream_ops.mmap,msync:ke.stream_ops.msync}},link:{node:{getattr:ke.node_ops.getattr,setattr:ke.node_ops.setattr,readlink:ke.node_ops.readlink},stream:{}},chrdev:{node:{getattr:ke.node_ops.getattr,setattr:ke.node_ops.setattr},stream:Te.chrdev_stream_ops}});var o=Te.createNode(e,t,r,n);return Te.isDir(o.mode)?(o.node_ops=ke.ops_table.dir.node,o.stream_ops=ke.ops_table.dir.stream,o.contents={}):Te.isFile(o.mode)?(o.node_ops=ke.ops_table.file.node,o.stream_ops=ke.ops_table.file.stream,o.usedBytes=0,o.contents=null):Te.isLink(o.mode)?(o.node_ops=ke.ops_table.link.node,o.stream_ops=ke.ops_table.link.stream):Te.isChrdev(o.mode)&&(o.node_ops=ke.ops_table.chrdev.node,o.stream_ops=ke.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[t]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:e=>e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0),expandFileStorage(e,t){var r=e.contents?e.contents.length:0;if(!(r>=t)){t=Math.max(t,r*(r<1048576?2:1.125)>>>0),0!=r&&(t=Math.max(t,256));var n=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,t){if(e.usedBytes!=t)if(0==t)e.contents=null,e.usedBytes=0;else{var r=e.contents;e.contents=new Uint8Array(t),r&&e.contents.set(r.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr(e){var t={};return t.dev=Te.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,Te.isDir(e.mode)?t.size=4096:Te.isFile(e.mode)?t.size=e.usedBytes:Te.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&ke.resizeFileStorage(e,t.size)},lookup(e,t){throw Te.genericErrors[44]},mknod:(e,t,r,n)=>ke.createNode(e,t,r,n),rename(e,t,r){if(Te.isDir(e.mode)){var n;try{n=Te.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new Te.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=r,t.contents[r]=e,t.timestamp=e.parent.timestamp,e.parent=t},unlink(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir(e,t){var r=Te.lookupNode(e,t);for(var n in r.contents)throw new Te.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir(e){var t=[".",".."];for(var r in e.contents)e.contents.hasOwnProperty(r)&&t.push(r);return t},symlink(e,t,r){var n=ke.createNode(e,t,41471,0);return n.link=r,n},readlink(e){if(!Te.isLink(e.mode))throw new Te.ErrnoError(28);return e.link}},stream_ops:{read(e,t,r,n,o){var a=e.node.contents;if(o>=e.node.usedBytes)return 0;var i=Math.min(e.node.usedBytes-o,n);if(i>8&&a.subarray)t.set(a.subarray(o,o+i),r);else for(var s=0;s<i;s++)t[r+s]=a[o+s];return i},write(e,r,n,o,a,i){if(r.buffer===t().buffer&&(i=!1),!o)return 0;var s=e.node;if(s.timestamp=Date.now(),r.subarray&&(!s.contents||s.contents.subarray)){if(i)return s.contents=r.subarray(n,n+o),s.usedBytes=o,o;if(0===s.usedBytes&&0===a)return s.contents=r.slice(n,n+o),s.usedBytes=o,o;if(a+o<=s.usedBytes)return s.contents.set(r.subarray(n,n+o),a),o}if(ke.expandFileStorage(s,a+o),s.contents.subarray&&r.subarray)s.contents.set(r.subarray(n,n+o),a);else for(var u=0;u<o;u++)s.contents[a+u]=r[n+u];return s.usedBytes=Math.max(s.usedBytes,a+o),o},llseek(e,t,r){var n=t;if(1===r?n+=e.position:2===r&&Te.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new Te.ErrnoError(28);return n},allocate(e,t,r){ke.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap(e,r,n,o,a){if(!Te.isFile(e.node.mode))throw new Te.ErrnoError(43);var i,s,u=e.node.contents;if(2&a||u.buffer!==t().buffer){if((n>0||n+r<u.length)&&(u=u.subarray?u.subarray(n,n+r):Array.prototype.slice.call(u,n,n+r)),s=!0,!(i=Ee(r)))throw new Te.ErrnoError(48);t().set(u,i)}else s=!1,i=u.byteOffset;return{ptr:i,allocated:s}},msync:(e,t,r,n,o)=>(ke.stream_ops.write(e,t,0,n,r,!1),0)}},Me=h.preloadPlugins||[],We=(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},Te={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(e,t={}){if(!(e=pe.resolve(e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new Te.ErrnoError(32);for(var r=e.split("/").filter((e=>!!e)),n=Te.root,o="/",a=0;a<r.length;a++){var i=a===r.length-1;if(i&&t.parent)break;if(n=Te.lookupNode(n,r[a]),o=he.join2(o,r[a]),Te.isMountpoint(n)&&(!i||i&&t.follow_mount)&&(n=n.mounted.root),!i||t.follow)for(var s=0;Te.isLink(n.mode);){var u=Te.readlink(o);if(o=pe.resolve(he.dirname(o),u),n=Te.lookupPath(o,{recurse_count:t.recurse_count+1}).node,s++>40)throw new Te.ErrnoError(32)}}return{path:o,node:n}},getPath(e){for(var t;;){if(Te.isRoot(e)){var r=e.mount.mountpoint;return t?"/"!==r[r.length-1]?`${r}/${t}`:r+t:r}t=t?`${e.name}/${t}`:e.name,e=e.parent}},hashName(e,t){for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>0)%Te.nameTable.length},hashAddNode(e){var t=Te.hashName(e.parent.id,e.name);e.name_next=Te.nameTable[t],Te.nameTable[t]=e},hashRemoveNode(e){var t=Te.hashName(e.parent.id,e.name);if(Te.nameTable[t]===e)Te.nameTable[t]=e.name_next;else for(var r=Te.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode(e,t){var r=Te.mayLookup(e);if(r)throw new Te.ErrnoError(r,e);for(var n=Te.hashName(e.id,t),o=Te.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===e.id&&a===t)return o}return Te.lookup(e,t)},createNode(e,t,r,n){var o=new Te.FSNode(e,t,r,n);return Te.hashAddNode(o),o},destroyNode(e){Te.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>49152==(49152&e),flagsToPermissionString(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:(e,t)=>Te.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2,mayLookup(e){var t=Te.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate(e,t){try{return Te.lookupNode(e,t),20}catch(e){}return Te.nodePermissions(e,"wx")},mayDelete(e,t,r){var n;try{n=Te.lookupNode(e,t)}catch(e){return e.errno}var o=Te.nodePermissions(e,"wx");if(o)return o;if(r){if(!Te.isDir(n.mode))return 54;if(Te.isRoot(n)||Te.getPath(n)===Te.cwd())return 10}else if(Te.isDir(n.mode))return 31;return 0},mayOpen:(e,t)=>e?Te.isLink(e.mode)?32:Te.isDir(e.mode)&&("r"!==Te.flagsToPermissionString(t)||512&t)?31:Te.nodePermissions(e,Te.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=Te.MAX_OPEN_FDS;e++)if(!Te.streams[e])return e;throw new Te.ErrnoError(33)},getStreamChecked(e){var t=Te.getStream(e);if(!t)throw new Te.ErrnoError(8);return t},getStream:e=>Te.streams[e],createStream:(e,t=-1)=>(Te.FSStream||(Te.FSStream=function(){this.shared={}},Te.FSStream.prototype={},Object.defineProperties(Te.FSStream.prototype,{object:{get(){return this.node},set(e){this.node=e}},isRead:{get(){return 1!=(2097155&this.flags)}},isWrite:{get(){return 0!=(2097155&this.flags)}},isAppend:{get(){return 1024&this.flags}},flags:{get(){return this.shared.flags},set(e){this.shared.flags=e}},position:{get(){return this.shared.position},set(e){this.shared.position=e}}})),e=Object.assign(new Te.FSStream,e),-1==t&&(t=Te.nextfd()),e.fd=t,Te.streams[t]=e,e),closeStream(e){Te.streams[e]=null},chrdev_stream_ops:{open(e){var t=Te.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek(){throw new Te.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice(e,t){Te.devices[e]={stream_ops:t}},getDevice:e=>Te.devices[e],getMounts(e){for(var t=[],r=[e];r.length;){var n=r.pop();t.push(n),r.push.apply(r,n.mounts)}return t},syncfs(e,t){"function"==typeof e&&(t=e,e=!1),Te.syncFSRequests++,Te.syncFSRequests>1&&M(`warning: ${Te.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var r=Te.getMounts(Te.root.mount),n=0;function o(e){return Te.syncFSRequests--,t(e)}function 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&&Te.root)throw new Te.ErrnoError(10);if(!o&&!a){var i=Te.lookupPath(r,{follow_mount:!1});if(r=i.path,n=i.node,Te.isMountpoint(n))throw new Te.ErrnoError(10);if(!Te.isDir(n.mode))throw new Te.ErrnoError(54)}var s={type:e,opts:t,mountpoint:r,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,o?Te.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount(e){var t=Te.lookupPath(e,{follow_mount:!1});if(!Te.isMountpoint(t.node))throw new Te.ErrnoError(28);var r=t.node,n=r.mounted,o=Te.getMounts(n);Object.keys(Te.nameTable).forEach((e=>{for(var t=Te.nameTable[e];t;){var r=t.name_next;o.includes(t.mount)&&Te.destroyNode(t),t=r}})),r.mounted=null;var 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=Te.lookupPath(e,{parent:!0}).node,o=he.basename(e);if(!o||"."===o||".."===o)throw new Te.ErrnoError(28);var a=Te.mayCreate(n,o);if(a)throw new Te.ErrnoError(a);if(!n.node_ops.mknod)throw new Te.ErrnoError(63);return n.node_ops.mknod(n,o,t,r)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,Te.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,Te.mknod(e,t,0)),mkdirTree(e,t){for(var r=e.split("/"),n="",o=0;o<r.length;++o)if(r[o]){n+="/"+r[o];try{Te.mkdir(n,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,r)=>("undefined"==typeof r&&(r=t,t=438),t|=8192,Te.mknod(e,t,r)),symlink(e,t){if(!pe.resolve(e))throw new Te.ErrnoError(44);var r=Te.lookupPath(t,{parent:!0}).node;if(!r)throw new Te.ErrnoError(44);var n=he.basename(t),o=Te.mayCreate(r,n);if(o)throw new Te.ErrnoError(o);if(!r.node_ops.symlink)throw new Te.ErrnoError(63);return r.node_ops.symlink(r,n,e)},rename(e,t){var r,n,o=he.dirname(e),a=he.dirname(t),i=he.basename(e),s=he.basename(t);if(r=Te.lookupPath(e,{parent:!0}).node,n=Te.lookupPath(t,{parent:!0}).node,!r||!n)throw new Te.ErrnoError(44);if(r.mount!==n.mount)throw new Te.ErrnoError(75);var u,c=Te.lookupNode(r,i),l=pe.relative(e,a);if("."!==l.charAt(0))throw new Te.ErrnoError(28);if("."!==(l=pe.relative(t,o)).charAt(0))throw new Te.ErrnoError(55);try{u=Te.lookupNode(n,s)}catch(e){}if(c!==u){var d=Te.isDir(c.mode),h=Te.mayDelete(r,i,d);if(h)throw new Te.ErrnoError(h);if(h=u?Te.mayDelete(n,s,d):Te.mayCreate(n,s))throw new Te.ErrnoError(h);if(!r.node_ops.rename)throw new Te.ErrnoError(63);if(Te.isMountpoint(c)||u&&Te.isMountpoint(u))throw new Te.ErrnoError(10);if(n!==r&&(h=Te.nodePermissions(r,"w")))throw new Te.ErrnoError(h);Te.hashRemoveNode(c);try{r.node_ops.rename(c,n,s)}catch(e){throw e}finally{Te.hashAddNode(c)}}},rmdir(e){var t=Te.lookupPath(e,{parent:!0}).node,r=he.basename(e),n=Te.lookupNode(t,r),o=Te.mayDelete(t,r,!0);if(o)throw new Te.ErrnoError(o);if(!t.node_ops.rmdir)throw new Te.ErrnoError(63);if(Te.isMountpoint(n))throw new Te.ErrnoError(10);t.node_ops.rmdir(t,r),Te.destroyNode(n)},readdir(e){var t=Te.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new Te.ErrnoError(54);return t.node_ops.readdir(t)},unlink(e){var t=Te.lookupPath(e,{parent:!0}).node;if(!t)throw new Te.ErrnoError(44);var r=he.basename(e),n=Te.lookupNode(t,r),o=Te.mayDelete(t,r,!1);if(o)throw new Te.ErrnoError(o);if(!t.node_ops.unlink)throw new Te.ErrnoError(63);if(Te.isMountpoint(n))throw new Te.ErrnoError(10);t.node_ops.unlink(t,r),Te.destroyNode(n)},readlink(e){var t=Te.lookupPath(e).node;if(!t)throw new Te.ErrnoError(44);if(!t.node_ops.readlink)throw new Te.ErrnoError(28);return pe.resolve(Te.getPath(t.parent),t.node_ops.readlink(t))},stat(e,t){var r=Te.lookupPath(e,{follow:!t}).node;if(!r)throw new Te.ErrnoError(44);if(!r.node_ops.getattr)throw new Te.ErrnoError(63);return r.node_ops.getattr(r)},lstat:e=>Te.stat(e,!0),chmod(e,t,r){var n;if(!(n="string"==typeof e?Te.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new Te.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod(e,t){Te.chmod(e,t,!0)},fchmod(e,t){var r=Te.getStreamChecked(e);Te.chmod(r.node,t)},chown(e,t,r,n){var o;if(!(o="string"==typeof e?Te.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new Te.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown(e,t,r){Te.chown(e,t,r,!0)},fchown(e,t,r){var n=Te.getStreamChecked(e);Te.chown(n.node,t,r)},truncate(e,t){if(t<0)throw new Te.ErrnoError(28);var r;if(!(r="string"==typeof e?Te.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new Te.ErrnoError(63);if(Te.isDir(r.mode))throw new Te.ErrnoError(31);if(!Te.isFile(r.mode))throw new Te.ErrnoError(28);var n=Te.nodePermissions(r,"w");if(n)throw new Te.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate(e,t){var r=Te.getStreamChecked(e);if(0==(2097155&r.flags))throw new Te.ErrnoError(28);Te.truncate(r.node,t)},utime(e,t,r){var n=Te.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open(e,t,r){if(""===e)throw new Te.ErrnoError(44);var n;if(r="undefined"==typeof r?438:r,r=64&(t="string"==typeof t?(e=>{var t={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if("undefined"==typeof t)throw new Error(`Unknown file open mode: ${e}`);return t})(t):t)?4095&r|32768:0,"object"==typeof e)n=e;else{e=he.normalize(e);try{n=Te.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var o=!1;if(64&t)if(n){if(128&t)throw new Te.ErrnoError(20)}else n=Te.mknod(e,r,0),o=!0;if(!n)throw new Te.ErrnoError(44);if(Te.isChrdev(n.mode)&&(t&=-513),65536&t&&!Te.isDir(n.mode))throw new Te.ErrnoError(54);if(!o){var a=Te.mayOpen(n,t);if(a)throw new Te.ErrnoError(a)}512&t&&!o&&Te.truncate(n,0),t&=-131713;var i=Te.createStream({node:n,path:Te.getPath(n),flags:t,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return i.stream_ops.open&&i.stream_ops.open(i),!h.logReadFiles||1&t||(Te.readFiles||(Te.readFiles={}),e in Te.readFiles||(Te.readFiles[e]=1)),i},close(e){if(Te.isClosed(e))throw new Te.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{Te.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek(e,t,r){if(Te.isClosed(e))throw new Te.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new Te.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new Te.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read(e,t,r,n,o){if(n<0||o<0)throw new Te.ErrnoError(28);if(Te.isClosed(e))throw new Te.ErrnoError(8);if(1==(2097155&e.flags))throw new Te.ErrnoError(8);if(Te.isDir(e.node.mode))throw new Te.ErrnoError(31);if(!e.stream_ops.read)throw new Te.ErrnoError(28);var a="undefined"!=typeof o;if(a){if(!e.seekable)throw new Te.ErrnoError(70)}else o=e.position;var i=e.stream_ops.read(e,t,r,n,o);return a||(e.position+=i),i},write(e,t,r,n,o,a){if(n<0||o<0)throw new Te.ErrnoError(28);if(Te.isClosed(e))throw new Te.ErrnoError(8);if(0==(2097155&e.flags))throw new Te.ErrnoError(8);if(Te.isDir(e.node.mode))throw new Te.ErrnoError(31);if(!e.stream_ops.write)throw new Te.ErrnoError(28);e.seekable&&1024&e.flags&&Te.llseek(e,0,2);var i="undefined"!=typeof o;if(i){if(!e.seekable)throw new Te.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,t,r,n,o,a);return i||(e.position+=s),s},allocate(e,t,r){if(Te.isClosed(e))throw new Te.ErrnoError(8);if(t<0||r<=0)throw new Te.ErrnoError(28);if(0==(2097155&e.flags))throw new Te.ErrnoError(8);if(!Te.isFile(e.node.mode)&&!Te.isDir(e.node.mode))throw new Te.ErrnoError(43);if(!e.stream_ops.allocate)throw new Te.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap(e,t,r,n,o){if(0!=(2&n)&&0==(2&o)&&2!=(2097155&e.flags))throw new Te.ErrnoError(2);if(1==(2097155&e.flags))throw new Te.ErrnoError(2);if(!e.stream_ops.mmap)throw new Te.ErrnoError(43);return e.stream_ops.mmap(e,t,r,n,o)},msync:(e,t,r,n,o)=>e.stream_ops.msync?e.stream_ops.msync(e,t,r,n,o):0,munmap:e=>0,ioctl(e,t,r){if(!e.stream_ops.ioctl)throw new Te.ErrnoError(59);return e.stream_ops.ioctl(e,t,r)},readFile(e,t={}){if(t.flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error(`Invalid encoding type "${t.encoding}"`);var r,n=Te.open(e,t.flags),o=Te.stat(e).size,a=new Uint8Array(o);return Te.read(n,a,0,o,0),"utf8"===t.encoding?r=ve(a,0):"binary"===t.encoding&&(r=a),Te.close(n),r},writeFile(e,t,r={}){r.flags=r.flags||577;var n=Te.open(e,r.flags,r.mode);if("string"==typeof t){var o=new Uint8Array(ge(t)+1),a=we(t,o,0,o.length);Te.write(n,o,0,a,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");Te.write(n,t,0,t.byteLength,void 0,r.canOwn)}Te.close(n)},cwd:()=>Te.currentPath,chdir(e){var t=Te.lookupPath(e,{follow:!0});if(null===t.node)throw new Te.ErrnoError(44);if(!Te.isDir(t.node.mode))throw new Te.ErrnoError(54);var r=Te.nodePermissions(t.node,"x");if(r)throw new Te.ErrnoError(r);Te.currentPath=t.path},createDefaultDirectories(){Te.mkdir("/tmp"),Te.mkdir("/home"),Te.mkdir("/home/web_user")},createDefaultDevices(){Te.mkdir("/dev"),Te.registerDevice(Te.makedev(1,3),{read:()=>0,write:(e,t,r,n,o)=>n}),Te.mkdev("/dev/null",Te.makedev(1,3)),_e.register(Te.makedev(5,0),_e.default_tty_ops),_e.register(Te.makedev(6,0),_e.default_tty1_ops),Te.mkdev("/dev/tty",Te.makedev(5,0)),Te.mkdev("/dev/tty1",Te.makedev(6,0));var e=new Uint8Array(1024),t=0,r=()=>(0===t&&(t=fe(e).byteLength),e[--t]);Te.createDevice("/dev","random",r),Te.createDevice("/dev","urandom",r),Te.mkdir("/dev/shm"),Te.mkdir("/dev/shm/tmp")},createSpecialDirectories(){Te.mkdir("/proc");var e=Te.mkdir("/proc/self");Te.mkdir("/proc/self/fd"),Te.mount({mount(){var t=Te.createNode(e,"fd",16895,73);return t.node_ops={lookup(e,t){var r=+t,n=Te.getStreamChecked(r),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},t}},{},"/proc/self/fd")},createStandardStreams(){h.stdin?Te.createDevice("/dev","stdin",h.stdin):Te.symlink("/dev/tty","/dev/stdin"),h.stdout?Te.createDevice("/dev","stdout",null,h.stdout):Te.symlink("/dev/tty","/dev/stdout"),h.stderr?Te.createDevice("/dev","stderr",null,h.stderr):Te.symlink("/dev/tty1","/dev/stderr"),Te.open("/dev/stdin",0),Te.open("/dev/stdout",1),Te.open("/dev/stderr",1)},ensureErrnoError(){Te.ErrnoError||(Te.ErrnoError=function(e,t){this.name="ErrnoError",this.node=t,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},Te.ErrnoError.prototype=new Error,Te.ErrnoError.prototype.constructor=Te.ErrnoError,[44].forEach((e=>{Te.genericErrors[e]=new Te.ErrnoError(e),Te.genericErrors[e].stack="<generic error, no stack>"})))},staticInit(){Te.ensureErrnoError(),Te.nameTable=new Array(4096),Te.mount(ke,{},"/"),Te.createDefaultDirectories(),Te.createDefaultDevices(),Te.createSpecialDirectories(),Te.filesystems={MEMFS:ke}},init(e,t,r){Te.init.initialized=!0,Te.ensureErrnoError(),h.stdin=e||h.stdin,h.stdout=t||h.stdout,h.stderr=r||h.stderr,Te.createStandardStreams()},quit(){Te.init.initialized=!1;for(var e=0;e<Te.streams.length;e++){var t=Te.streams[e];t&&Te.close(t)}},findObject(e,t){var r=Te.analyzePath(e,t);return r.exists?r.object:null},analyzePath(e,t){try{e=(n=Te.lookupPath(e,{follow:!t})).path}catch(e){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=Te.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=he.basename(e),n=Te.lookupPath(e,{follow:!t}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot="/"===n.path}catch(e){r.error=e.errno}return r},createPath(e,t,r,n){e="string"==typeof e?e:Te.getPath(e);for(var o=t.split("/").reverse();o.length;){var a=o.pop();if(a){var i=he.join2(e,a);try{Te.mkdir(i)}catch(e){}e=i}}return i},createFile(e,t,r,n,o){var a=he.join2("string"==typeof e?e:Te.getPath(e),t),i=We(n,o);return Te.create(a,i)},createDataFile(e,t,r,n,o,a){var i=t;e&&(e="string"==typeof e?e:Te.getPath(e),i=t?he.join2(e,t):e);var s=We(n,o),u=Te.create(i,s);if(r){if("string"==typeof r){for(var c=new Array(r.length),l=0,d=r.length;l<d;++l)c[l]=r.charCodeAt(l);r=c}Te.chmod(u,146|s);var h=Te.open(u,577);Te.write(h,r,0,r.length,0,a),Te.close(h),Te.chmod(u,s)}return u},createDevice(e,t,r,n){var o=he.join2("string"==typeof e?e:Te.getPath(e),t),a=We(!!r,!!n);Te.createDevice.major||(Te.createDevice.major=64);var i=Te.makedev(Te.createDevice.major++,0);return Te.registerDevice(i,{open(e){e.seekable=!1},close(e){n&&n.buffer&&n.buffer.length&&n(10)},read(e,t,n,o,a){for(var i=0,s=0;s<o;s++){var u;try{u=r()}catch(e){throw new Te.ErrnoError(29)}if(void 0===u&&0===i)throw new Te.ErrnoError(6);if(null==u)break;i++,t[n+s]=u}return i&&(e.node.timestamp=Date.now()),i},write(e,t,r,o,a){for(var i=0;i<o;i++)try{n(t[r+i])}catch(e){throw new Te.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),i}}),Te.mkdev(o,a,i)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!f)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=be(f(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new Te.ErrnoError(29)}},createLazyFile(e,r,n,o,a){function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,r=e/this.chunkSize|0;return this.getter(r)[t]}},i.prototype.setDataGetter=function(e){this.getter=e},i.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",n,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+n+". Status: "+e.status);var t,r=Number(e.getResponseHeader("Content-length")),o=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,a=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,i=1048576;o||(i=r);var s=this;s.setDataGetter((e=>{var t=e*i,o=(e+1)*i-1;if(o=Math.min(o,r-1),"undefined"==typeof s.chunks[e]&&(s.chunks[e]=((e,t)=>{if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>r-1)throw new Error("only "+r+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",n,!1),r!==i&&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 "+n+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):be(o.responseText||"",!0)})(t,o)),"undefined"==typeof s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!a&&r||(i=r=1,r=this.getter(0).length,i=r,k("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=r,this._chunkSize=i,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){var s=new i;Object.defineProperties(s,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var u={isDevice:!1,contents:s}}else u={isDevice:!1,url:n};var c=Te.createFile(e,r,u,o,a);u.contents?c.contents=u.contents:u.url&&(c.contents=null,c.url=u.url),Object.defineProperties(c,{usedBytes:{get:function(){return this.contents.length}}});var l={};function d(e,t,r,n,o){var a=e.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(a.slice)for(var s=0;s<i;s++)t[r+s]=a[o+s];else for(s=0;s<i;s++)t[r+s]=a.get(o+s);return i}return Object.keys(c.stream_ops).forEach((e=>{var t=c.stream_ops[e];l[e]=function(){return Te.forceLoadFile(c),t.apply(null,arguments)}})),l.read=(e,t,r,n,o)=>(Te.forceLoadFile(c),d(e,t,r,n,o)),l.mmap=(e,r,n,o,a)=>{Te.forceLoadFile(c);var i=Ee(r);if(!i)throw new Te.ErrnoError(48);return d(e,t(),i,r,n),{ptr:i,allocated:!0}},c.stream_ops=l,c}},Ce=(e,t)=>e?ve(o(),e,t):"",Fe={DEFAULT_POLLMASK:5,calculateAt(e,t,r){if(he.isAbs(t))return t;var n;if(n=-100===e?Te.cwd():Fe.getStreamFromFD(e).path,0==t.length){if(!r)throw new Te.ErrnoError(44);return n}return he.join2(n,t)},doStat(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&he.normalize(t)!==he.normalize(Te.getPath(e.node)))return-54;throw e}s()[r>>2]=n.dev,s()[r+4>>2]=n.mode,u()[r+8>>2]=n.nlink,s()[r+12>>2]=n.uid,s()[r+16>>2]=n.gid,s()[r+20>>2]=n.rdev,J=[n.size>>>0,(K=n.size,+Math.abs(K)>=1?K>0?+Math.floor(K/4294967296)>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],s()[r+24>>2]=J[0],s()[r+28>>2]=J[1],s()[r+32>>2]=4096,s()[r+36>>2]=n.blocks;var o=n.atime.getTime(),a=n.mtime.getTime(),i=n.ctime.getTime();return J=[Math.floor(o/1e3)>>>0,(K=Math.floor(o/1e3),+Math.abs(K)>=1?K>0?+Math.floor(K/4294967296)>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],s()[r+40>>2]=J[0],s()[r+44>>2]=J[1],u()[r+48>>2]=o%1e3*1e3,J=[Math.floor(a/1e3)>>>0,(K=Math.floor(a/1e3),+Math.abs(K)>=1?K>0?+Math.floor(K/4294967296)>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],s()[r+56>>2]=J[0],s()[r+60>>2]=J[1],u()[r+64>>2]=a%1e3*1e3,J=[Math.floor(i/1e3)>>>0,(K=Math.floor(i/1e3),+Math.abs(K)>=1?K>0?+Math.floor(K/4294967296)>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],s()[r+72>>2]=J[0],s()[r+76>>2]=J[1],u()[r+80>>2]=i%1e3*1e3,J=[n.ino>>>0,(K=n.ino,+Math.abs(K)>=1?K>0?+Math.floor(K/4294967296)>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],s()[r+88>>2]=J[0],s()[r+92>>2]=J[1],0},doMsync(e,t,r,n,a){if(!Te.isFile(t.node.mode))throw new Te.ErrnoError(43);if(2&n)return 0;var i=o().slice(e,e+r);Te.msync(t,i,a,r,n)},varargs:void 0,get(){var e=s()[Fe.varargs>>2];return Fe.varargs+=4,e},getp:()=>Fe.get(),getStr:e=>Ce(e),getStreamFromFD:e=>Te.getStreamChecked(e)};function Se(e){if(w)return Dr(0,1,e);F=e,X()||($e.terminateAllThreads(),h.onExit&&h.onExit(e),I=!0),g(e,new ue(e))}var Pe=(e,t)=>{if(F=e,w)throw De(e),"unwind";Se(e)},je=e=>{if(e instanceof ue||"unwind"==e)return F;g(1,e)},$e={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],pthreads:{},init(){w?$e.initWorker():$e.initMainThread()},initMainThread(){for(var e=Math.min(4,Math.max(1,navigator.hardwareConcurrency-1));e--;)$e.allocateUnusedWorker();B((()=>{te(),$e.loadWasmModuleToAllWorkers((()=>re()))}))},initWorker(){C=!1},setExitStatus:e=>{F=e},terminateAllThreads__deps:["$terminateWorker"],terminateAllThreads:()=>{for(var e of $e.runningWorkers)ce(e);for(var e of $e.unusedWorkers)ce(e);$e.unusedWorkers=[],$e.runningWorkers=[],$e.pthreads=[]},returnWorkerToPool:e=>{var t=e.pthread_ptr;delete $e.pthreads[t],$e.unusedWorkers.push(e),$e.runningWorkers.splice($e.runningWorkers.indexOf(e),1),e.pthread_ptr=0,$n(t)},receiveObjectTransfer(e){},threadInitTLS(){$e.tlsInitFunctions.forEach((e=>e()))},loadWasmModuleToWorker:e=>new Promise((t=>{e.onmessage=r=>{var n=r.data,o=n.cmd;if(n.targetThread&&n.targetThread!=Tn()){var a=$e.pthreads[n.targetThread];a?a.postMessage(n,n.transferList):M(`Internal error! Worker sent a message "${o}" to target pthread ${n.targetThread}, but that thread no longer exists!`)}else{var i;"checkMailbox"===o?$r():"spawnThread"===o?de(n):"cleanupThread"===o?le(n.thread):"killThread"===o?(e=>{var t=$e.pthreads[e];delete $e.pthreads[e],ce(t),$n(e),$e.runningWorkers.splice($e.runningWorkers.indexOf(t),1),t.pthread_ptr=0})(n.thread):"cancelThread"===o?(i=n.thread,$e.pthreads[i].postMessage({cmd:"cancel"})):"loaded"===o?(e.loaded=!0,t(e)):"alert"===o?alert(`Thread ${n.threadId}: ${n.text}`):"setimmediate"===n.target?e.postMessage(n):"callHandler"===o?h[n.handler](...n.args):o&&M(`worker sent an unknown command ${o}`)}},e.onerror=e=>{throw M(`worker sent an error! ${e.filename}:${e.lineno}: ${e.message}`),e};var r=[];for(var o of["onExit","onAbort","print","printErr"])h.hasOwnProperty(o)&&r.push(o);e.postMessage({cmd:"load",handlers:r,urlOrBlob:h.mainScriptUrlOrBlob||n,wasmMemory:W,wasmModule:T})})),loadWasmModuleToAllWorkers(e){if(w)return e();Promise.all($e.unusedWorkers.map($e.loadWasmModuleToWorker)).then(e)},allocateUnusedWorker(){var e,t=_("ScanbotSDK.Asm-simd-threads.worker.js");e=new Worker(t),$e.unusedWorkers.push(e)},getNewWorker:()=>(0==$e.unusedWorkers.length&&($e.allocateUnusedWorker(),$e.loadWasmModuleToWorker($e.unusedWorkers[0])),$e.unusedWorkers.pop())};h.PThread=$e;var Ae=e=>{for(;e.length>0;)e.shift()(h)};function De(e){if(w)return Dr(1,0,e);Pe(e)}h.establishStackSpace=()=>{var e=Tn(),t=s()[e+52>>2],r=s()[e+56>>2];Rn(t,t-r),Vn(t)};var xe=e=>O.get(e);h.invokeEntryPoint=(e,t)=>{!function(e){X()?$e.setExitStatus(e):An(e)}(xe(e)(t))};var Re=e=>{$e.tlsInitFunctions.push(e)},Ie=[],Ve=0,Ze=0;function Oe(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){u()[this.ptr+4>>2]=e},this.get_type=function(){return u()[this.ptr+4>>2]},this.set_destructor=function(e){u()[this.ptr+8>>2]=e},this.get_destructor=function(){return u()[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,t()[this.ptr+12>>0]=e},this.get_caught=function(){return 0!=t()[this.ptr+12>>0]},this.set_rethrown=function(e){e=e?1:0,t()[this.ptr+13>>0]=e},this.get_rethrown=function(){return 0!=t()[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){u()[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return u()[this.ptr+16>>2]},this.get_exception_ptr=function(){if(Gn(this.get_type()))return u()[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}var Ne=e=>{var t=Ze;if(!t)return Cn(0),0;var r=new Oe(t);r.set_adjusted_ptr(t);var n=r.get_type();if(!n)return Cn(0),t;for(var o in e){var a=e[o];if(0===a||a===n)break;var i=r.ptr+16;if(zn(a,n,i))return Cn(a),t}return Cn(n),t},ze=()=>{var e=Ie.pop();e||ne("no exception to throw");var t=e.excPtr;throw e.get_rethrown()||(Ie.push(e),e.set_rethrown(!0),e.set_caught(!1),Ve++),Ze=t};function Ge(e,t,r,n){return w?Dr(2,1,e,t,r,n):Ue(e,t,r,n)}var Ue=(e,t,r,n)=>{if("undefined"==typeof SharedArrayBuffer)return M("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var o=[];if(w&&0===o.length)return Ge(e,t,r,n);var a={startRoutine:r,pthread_ptr:e,arg:n,transferList:o};return w?(a.cmd="spawnThread",postMessage(a,o),0):de(a)};function Le(e,t,r,n,o){if(w)return Dr(3,1,e,t,r,n,o);try{for(var a=0,i=t?s()[t>>2]:0,u=t?s()[t+4>>2]:0,c=r?s()[r>>2]:0,l=r?s()[r+4>>2]:0,d=n?s()[n>>2]:0,h=n?s()[n+4>>2]:0,f=0,p=0,m=0,v=0,y=0,g=0,b=(t?s()[t>>2]:0)|(r?s()[r>>2]:0)|(n?s()[n>>2]:0),_=(t?s()[t+4>>2]:0)|(r?s()[r+4>>2]:0)|(n?s()[n+4>>2]:0),E=function(e,t,r,n){return e<32?t&n:r&n},k=0;k<e;k++){var M=1<<k%32;if(E(k,b,_,M)){var W=Fe.getStreamFromFD(k),T=Fe.DEFAULT_POLLMASK;if(W.stream_ops.poll){var C=-1;o&&(C=1e3*((t?s()[o>>2]:0)+(t?s()[o+8>>2]:0)/1e6)),T=W.stream_ops.poll(W,C)}1&T&&E(k,i,u,M)&&(k<32?f|=M:p|=M,a++),4&T&&E(k,c,l,M)&&(k<32?m|=M:v|=M,a++),2&T&&E(k,d,h,M)&&(k<32?y|=M:g|=M,a++)}}return t&&(s()[t>>2]=f,s()[t+4>>2]=p),r&&(s()[r>>2]=m,s()[r+4>>2]=v),n&&(s()[n>>2]=y,s()[n+4>>2]=g),a}catch(e){if("undefined"==typeof Te||"ErrnoError"!==e.name)throw e;return-e.errno}}function Xe(e,t){if(w)return Dr(4,1,e,t);try{return e=Fe.getStr(e),Te.chmod(e,t),0}catch(e){if("undefined"==typeof Te||"ErrnoError"!==e.name)throw e;return-e.errno}}function Ye(e,t){if(w)return Dr(5,1,e,t);try{return Te.fchmod(e,t),0}catch(e){if("undefined"==typeof Te||"ErrnoError"!==e.name)throw e;return-e.errno}}function Be(e,t,r){if(w)return Dr(6,1,e,t,r);Fe.varargs=r;try{var n=Fe.getStreamFromFD(e);switch(t){case 0:if((o=Fe.get())<0)return-28;for(;Te.streams[o];)o++;return Te.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=Fe.get();return n.flags|=o,0;case 5:return o=Fe.getp(),a()[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return i=28,s()[Wn()>>2]=i,-1}}catch(e){if("undefined"==typeof Te||"ErrnoError"!==e.name)throw e;return-e.errno}var i}function He(e,t){if(w)return Dr(7,1,e,t);try{var r=Fe.getStreamFromFD(e);return Fe.doStat(Te.stat,r.path,t)}catch(e){if("undefined"==typeof Te||"ErrnoError"!==e.name)throw e;return-e.errno}}var Ke=(e,t)=>t+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*t:NaN;function Je(e,t,r){if(w)return Dr(8,1,e,t,r);var n=Ke(t,r);try{return isNaN(n)?61:(Te.ftruncate(e,n),0)}catch(e){if("undefined"==typeof Te||"ErrnoError"!==e.name)throw e;return-e.errno}}var Qe=(e,t,r)=>we(e,o(),t,r);function qe(e,t){if(w)return Dr(9,1,e,t);try{if(0===t)return-28;var r=Te.cwd(),n=ge(r)+1;return t<n?-68:(Qe(r,e,t),n)}catch(e){if("undefined"==typeof Te||"ErrnoError"!==e.name)throw e;return-e.errno}}function et(e,r,n){if(w)return Dr(10,1,e,r,n);try{var o=Fe.getStreamFromFD(e);o.getdents||(o.getdents=Te.readdir(o.path));for(var i=280,u=0,c=Te.llseek(o,0,1),l=Math.floor(c/i);l<o.getdents.length&&u+i<=n;){var d,h,f=o.getdents[l];if("."===f)d=o.node.id,h=4;else if(".."===f)d=Te.lookupPath(o.path,{parent:!0}).node.id,h=4;else{var p=Te.lookupNode(o.node,f);d=p.id,h=Te.isChrdev(p.mode)?2:Te.isDir(p.mode)?4:Te.isLink(p.mode)?10:8}J=[d>>>0,(K=d,+Math.abs(K)>=1?K>0?+Math.floor(K/4294967296)>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],s()[r+u>>2]=J[0],s()[r+u+4>>2]=J[1],J=[(l+1)*i>>>0,(K=(l+1)*i,+Math.abs(K)>=1?K>0?+Math.floor(K/4294967296)>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],s()[r+u+8>>2]=J[0],s()[r+u+12>>2]=J[1],a()[r+u+16>>1]=280,t()[r+u+18>>0]=h,Qe(f,r+u+19,256),u+=i,l+=1}return Te.llseek(o,l*i,0),u}catch(e){if("undefined"==typeof Te||"ErrnoError"!==e.name)throw e;return-e.errno}}function tt(e,r,n){if(w)return Dr(11,1,e,r,n);Fe.varargs=n;try{var o=Fe.getStreamFromFD(e);switch(r){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return o.tty?0:-59;case 21505:if(!o.tty)return-59;if(o.tty.ops.ioctl_tcgets){var i=o.tty.ops.ioctl_tcgets(o),u=Fe.getp();s()[u>>2]=i.c_iflag||0,s()[u+4>>2]=i.c_oflag||0,s()[u+8>>2]=i.c_cflag||0,s()[u+12>>2]=i.c_lflag||0;for(var c=0;c<32;c++)t()[u+c+17>>0]=i.c_cc[c]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!o.tty)return-59;if(o.tty.ops.ioctl_tcsets){u=Fe.getp();var l=s()[u>>2],d=s()[u+4>>2],h=s()[u+8>>2],f=s()[u+12>>2],p=[];for(c=0;c<32;c++)p.push(t()[u+c+17>>0]);return o.tty.ops.ioctl_tcsets(o.tty,r,{c_iflag:l,c_oflag:d,c_cflag:h,c_lflag:f,c_cc:p})}return 0;case 21519:return o.tty?(u=Fe.getp(),s()[u>>2]=0,0):-59;case 21520:return o.tty?-28:-59;case 21531:return u=Fe.getp(),Te.ioctl(o,r,u);case 21523:if(!o.tty)return-59;if(o.tty.ops.ioctl_tiocgwinsz){var m=o.tty.ops.ioctl_tiocgwinsz(o.tty);u=Fe.getp(),a()[u>>1]=m[0],a()[u+2>>1]=m[1]}return 0;default:return-28}}catch(e){if("undefined"==typeof Te||"ErrnoError"!==e.name)throw e;return-e.errno}}function rt(e,t){if(w)return Dr(12,1,e,t);try{return e=Fe.getStr(e),Fe.doStat(Te.lstat,e,t)}catch(e){if("undefined"==typeof Te||"ErrnoError"!==e.name)throw e;return-e.errno}}function nt(e,t,r){if(w)return Dr(13,1,e,t,r);try{return t=Fe.getStr(t),t=Fe.calculateAt(e,t),"/"===(t=he.normalize(t))[t.length-1]&&(t=t.substr(0,t.length-1)),Te.mkdir(t,r,0),0}catch(e){if("undefined"==typeof Te||"ErrnoError"!==e.name)throw e;return-e.errno}}function ot(e,t,r,n){if(w)return Dr(14,1,e,t,r,n);try{t=Fe.getStr(t);var o=256&n,a=4096&n;return n&=-6401,t=Fe.calculateAt(e,t,a),Fe.doStat(o?Te.lstat:Te.stat,t,r)}catch(e){if("undefined"==typeof Te||"ErrnoError"!==e.name)throw e;return-e.errno}}function at(e,t,r,n){if(w)return Dr(15,1,e,t,r,n);Fe.varargs=n;try{t=Fe.getStr(t),t=Fe.calculateAt(e,t);var o=n?Fe.get():0;return Te.open(t,r,o).fd}catch(e){if("undefined"==typeof Te||"ErrnoError"!==e.name)throw e;return-e.errno}}function it(e,r,n,o){if(w)return Dr(16,1,e,r,n,o);try{if(r=Fe.getStr(r),r=Fe.calculateAt(e,r),o<=0)return-28;var a=Te.readlink(r),i=Math.min(o,ge(a)),s=t()[n+i];return Qe(a,n,o+1),t()[n+i]=s,i}catch(e){if("undefined"==typeof Te||"ErrnoError"!==e.name)throw e;return-e.errno}}function st(e){if(w)return Dr(17,1,e);try{return e=Fe.getStr(e),Te.rmdir(e),0}catch(e){if("undefined"==typeof Te||"ErrnoError"!==e.name)throw e;return-e.errno}}function ut(e,t){if(w)return Dr(18,1,e,t);try{return e=Fe.getStr(e),Fe.doStat(Te.stat,e,t)}catch(e){if("undefined"==typeof Te||"ErrnoError"!==e.name)throw e;return-e.errno}}function ct(e,t){if(w)return Dr(19,1,e,t);try{return e=Fe.getStr(e),t=Fe.getStr(t),Te.symlink(e,t),0}catch(e){if("undefined"==typeof Te||"ErrnoError"!==e.name)throw e;return-e.errno}}function lt(e,t,r){if(w)return Dr(20,1,e,t,r);try{return t=Fe.getStr(t),t=Fe.calculateAt(e,t),0===r?Te.unlink(t):512===r?Te.rmdir(t):ne("Invalid flags passed to unlinkat"),0}catch(e){if("undefined"==typeof Te||"ErrnoError"!==e.name)throw e;return-e.errno}}var dt=void 0,ht=e=>{for(var t="",r=e;o()[r];)t+=dt[o()[r++]];return t},ft={},pt={},mt={},vt=void 0,yt=e=>{throw new vt(e)},gt=void 0,wt=e=>{throw new gt(e)},bt=(e,t,r)=>{function n(t){var n=r(t);n.length!==e.length&&wt("Mismatched type converter count");for(var o=0;o<e.length;++o)_t(e[o],n[o])}e.forEach((function(e){mt[e]=t}));var o=new Array(t.length),a=[],i=0;t.forEach(((e,t)=>{pt.hasOwnProperty(e)?o[t]=pt[e]:(a.push(e),ft.hasOwnProperty(e)||(ft[e]=[]),ft[e].push((()=>{o[t]=pt[e],++i===a.length&&n(o)})))})),0===a.length&&n(o)};function _t(e,t,r={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(e,t,r={}){var n=t.name;if(e||yt(`type "${n}" must have a positive integer typeid pointer`),pt.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;yt(`Cannot register type '${n}' twice`)}if(pt[e]=t,delete mt[e],ft.hasOwnProperty(e)){var o=ft[e];delete ft[e],o.forEach((e=>e()))}}(e,t,r)}function Et(e){if(!(this instanceof Ut))return!1;if(!(e instanceof Ut))return!1;for(var t=this.$$.ptrType.registeredClass,r=this.$$.ptr,n=e.$$.ptrType.registeredClass,o=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return t===n&&r===o}var kt=e=>{yt(e.$$.ptrType.registeredClass.name+" instance already deleted")},Mt=!1,Wt=e=>{},Tt=e=>{e.count.value-=1,0===e.count.value&&(e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)})(e)},Ct=(e,t,r)=>{if(t===r)return e;if(void 0===r.baseClass)return null;var n=Ct(e,t,r.baseClass);return null===n?null:r.downcast(n)},Ft={},St=()=>Object.keys(xt).length,Pt=()=>{var e=[];for(var t in xt)xt.hasOwnProperty(t)&&e.push(xt[t]);return e},jt=[],$t=()=>{for(;jt.length;){var e=jt.pop();e.$$.deleteScheduled=!1,e.delete()}},At=void 0,Dt=e=>{At=e,jt.length&&At&&At($t)},xt={},Rt=(e,t)=>(t=((e,t)=>{for(void 0===t&&yt("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t})(e,t),xt[t]),It=(e,t)=>(t.ptrType&&t.ptr||wt("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&wt("Both smartPtrType and smartPtr must be specified"),t.count={value:1},Zt(Object.create(e,{$$:{value:t}})));function Vt(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=Rt(this.registeredClass,t);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var n=r.clone();return this.destructor(e),n}function o(){return this.isSmartPointer?It(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):It(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var a,i=this.registeredClass.getActualType(t),s=Ft[i];if(!s)return o.call(this);a=this.isConst?s.constPointerType:s.pointerType;var u=Ct(t,this.registeredClass,a.registeredClass);return null===u?o.call(this):this.isSmartPointer?It(a.registeredClass.instancePrototype,{ptrType:a,ptr:u,smartPtrType:this,smartPtr:e}):It(a.registeredClass.instancePrototype,{ptrType:a,ptr:u})}var Zt=e=>"undefined"==typeof FinalizationRegistry?(Zt=e=>e,e):(Mt=new FinalizationRegistry((e=>{Tt(e.$$)})),Zt=e=>{var t=e.$$;if(t.smartPtr){var r={$$:t};Mt.register(e,r,e)}return e},Wt=e=>Mt.unregister(e),Zt(e));function Ot(){if(this.$$.ptr||kt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,t=Zt(Object.create(Object.getPrototypeOf(this),{$$:{value:(e=this.$$,{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType})}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t}function Nt(){this.$$.ptr||kt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&yt("Object already scheduled for deletion"),Wt(this),Tt(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function zt(){return!this.$$.ptr}function Gt(){return this.$$.ptr||kt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&yt("Object already scheduled for deletion"),jt.push(this),1===jt.length&&At&&At($t),this.$$.deleteScheduled=!0,this}function Ut(){}var Lt=e=>{if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=48&&t<=57?`_${e}`:e};function Xt(e,t){return{[e=Lt(e)]:function(){return t.apply(this,arguments)}}[e]}var Yt=(e,t,r)=>{if(void 0===e[t].overloadTable){var n=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||yt(`Function '${r}' called with an invalid number of arguments (${arguments.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[arguments.length].apply(this,arguments)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}},Bt=(e,t,r)=>{h.hasOwnProperty(e)?((void 0===r||void 0!==h[e].overloadTable&&void 0!==h[e].overloadTable[r])&&yt(`Cannot register public name '${e}' twice`),Yt(h,e,e),h.hasOwnProperty(r)&&yt(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),h[e].overloadTable[r]=t):(h[e]=t,void 0!==r&&(h[e].numArguments=r))};function Ht(e,t,r,n,o,a,i,s){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=o,this.getActualType=a,this.upcast=i,this.downcast=s,this.pureVirtualFunctions=[]}var Kt=(e,t,r)=>{for(;t!==r;)t.upcast||yt(`Expected null or instance of ${r.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e};function Jt(e,t){if(null===t)return this.isReference&&yt(`null is not a valid ${this.name}`),0;t.$$||yt(`Cannot pass "${br(t)}" as a ${this.name}`),t.$$.ptr||yt(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=t.$$.ptrType.registeredClass;return Kt(t.$$.ptr,r,this.registeredClass)}function Qt(e,t){var r;if(null===t)return this.isReference&&yt(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,r),r):0;t.$$||yt(`Cannot pass "${br(t)}" as a ${this.name}`),t.$$.ptr||yt(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&yt(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);var n=t.$$.ptrType.registeredClass;if(r=Kt(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&yt("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:yt(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:r=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)r=t.$$.smartPtr;else{var o=t.clone();r=this.rawShare(r,gr.toHandle((()=>o.delete()))),null!==e&&e.push(this.rawDestructor,r)}break;default:yt("Unsupporting sharing policy")}return r}function qt(e,t){if(null===t)return this.isReference&&yt(`null is not a valid ${this.name}`),0;t.$$||yt(`Cannot pass "${br(t)}" as a ${this.name}`),t.$$.ptr||yt(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&yt(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass;return Kt(t.$$.ptr,r,this.registeredClass)}function er(e){return this.fromWireType(u()[e>>2])}function tr(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e}function rr(e){this.rawDestructor&&this.rawDestructor(e)}var nr=e=>{null!==e&&e.delete()};function or(e,t,r,n,o,a,i,s,u,c,l){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=o,this.pointeeType=a,this.sharingPolicy=i,this.rawGetPointee=s,this.rawConstructor=u,this.rawShare=c,this.rawDestructor=l,o||void 0!==t.baseClass?this.toWireType=Qt:n?(this.toWireType=Jt,this.destructorFunction=null):(this.toWireType=qt,this.destructorFunction=null)}var ar=(e,t,r)=>{h.hasOwnProperty(e)||wt("Replacing nonexistant public symbol"),void 0!==h[e].overloadTable&&void 0!==r?h[e].overloadTable[r]=t:(h[e]=t,h[e].argCount=r)},ir=(e,t,r)=>e.includes("j")?((e,t,r)=>{var n=h["dynCall_"+e];return r&&r.length?n.apply(null,[t].concat(r)):n.call(null,t)})(e,t,r):xe(t).apply(null,r),sr=(e,t)=>{var r,n,o,a=(e=ht(e)).includes("j")?(r=e,n=t,o=[],function(){return o.length=0,Object.assign(o,arguments),ir(r,n,o)}):xe(t);return"function"!=typeof a&&yt(`unknown function pointer with signature ${e}: ${t}`),a},ur=void 0,cr=e=>{var t=Sn(e),r=ht(t);return Mn(t),r},lr=(e,t)=>{var r=[],n={};throw t.forEach((function e(t){n[t]||pt[t]||(mt[t]?mt[t].forEach(e):(r.push(t),n[t]=!0))})),new ur(`${e}: `+r.map(cr).join([", "]))},dr=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function hr(e,t,r,n,o,a){var i=t.length;i<2&&yt("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var s=null!==t[1]&&null!==r,u=!1,c=1;c<t.length;++c)if(null!==t[c]&&void 0===t[c].destructorFunction){u=!0;break}var l="void"!==t[0].name,d=i-2,h=new Array(d),f=[],p=[];return function(){var r;arguments.length!==d&&yt(`function ${e} called with ${arguments.length} arguments, expected ${d}`),p.length=0,f.length=s?2:1,f[0]=o,s&&(r=t[1].toWireType(p,this),f[1]=r);for(var a=0;a<d;++a)h[a]=t[a+2].toWireType(p,arguments[a]),f.push(h[a]);var i=n.apply(null,f);function c(e){if(u)dr(p);else for(var n=s?1:2;n<t.length;n++){var o=1===n?r:h[n-2];null!==t[n].destructorFunction&&t[n].destructorFunction(o)}if(l)return t[0].fromWireType(e)}return c(i)}}var fr=(e,t)=>{for(var r=[],n=0;n<e;n++)r.push(u()[t+4*n>>2]);return r};function pr(){this.allocated=[void 0],this.freelist=[]}var mr=new pr,vr=e=>{e>=mr.reserved&&0==--mr.get(e).refcount&&mr.free(e)},yr=()=>{for(var e=0,t=mr.reserved;t<mr.allocated.length;++t)void 0!==mr.allocated[t]&&++e;return e},gr={toValue:e=>(e||yt("Cannot use deleted val. handle = "+e),mr.get(e).value),toHandle:e=>{switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return mr.allocate({refcount:1,value:e})}}};function wr(e){return this.fromWireType(s()[e>>2])}var br=e=>{if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e},_r=(e,t)=>{switch(t){case 4:return function(e){return this.fromWireType((W.buffer!=S.buffer&&Z(),x)[e>>2])};case 8:return function(e){return this.fromWireType(c()[e>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},Er=(e,r,n)=>{switch(r){case 1:return n?e=>t()[e>>0]:e=>o()[e>>0];case 2:return n?e=>a()[e>>1]:e=>i()[e>>1];case 4:return n?e=>s()[e>>2]:e=>u()[e>>2];default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},kr="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,Mr=(e,t)=>{for(var r=e,n=r>>1,s=n+t/2;!(n>=s)&&i()[n];)++n;if((r=n<<1)-e>32&&kr)return kr.decode(o().slice(e,r));for(var u="",c=0;!(c>=t/2);++c){var l=a()[e+2*c>>1];if(0==l)break;u+=String.fromCharCode(l)}return u},Wr=(e,t,r)=>{if(void 0===r&&(r=2147483647),r<2)return 0;for(var n=t,o=(r-=2)<2*e.length?r/2:e.length,i=0;i<o;++i){var s=e.charCodeAt(i);a()[t>>1]=s,t+=2}return a()[t>>1]=0,t-n},Tr=e=>2*e.length,Cr=(e,t)=>{for(var r=0,n="";!(r>=t/4);){var o=s()[e+4*r>>2];if(0==o)break;if(++r,o>=65536){var a=o-65536;n+=String.fromCharCode(55296|a>>10,56320|1023&a)}else n+=String.fromCharCode(o)}return n},Fr=(e,t,r)=>{if(void 0===r&&(r=2147483647),r<4)return 0;for(var n=t,o=n+r-4,a=0;a<e.length;++a){var i=e.charCodeAt(a);if(i>=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++a)),s()[t>>2]=i,(t+=4)+4>o)break}return s()[t>>2]=0,t-n},Sr=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&++r,t+=4}return t},Pr=e=>{if(!I)try{e(),(()=>{if(!X())try{w?An(F):Pe(F)}catch(e){je(e)}})()}catch(e){je(e)}},jr=e=>{if("function"==typeof Atomics.waitAsync){Atomics.waitAsync(s(),e>>2,e).value.then($r);var t=e+128;Atomics.store(s(),t>>2,1)}};h.__emscripten_thread_mailbox_await=jr;var $r=()=>{var e=Tn();e&&(jr(e),Pr((()=>Dn())))};h.checkMailbox=$r;var Ar=e=>{var t=In(),r=e();return Vn(t),r},Dr=function(e,t){var r=arguments.length-2,n=arguments;return Ar((()=>{for(var o=r,a=Zn(8*o),i=a>>3,s=0;s<r;s++){var u=n[2+s];c()[i+s]=u}return jn(e,o,a,t)}))},xr=[],Rr=(e,t)=>{var r=pt[e];return void 0===r&&yt(t+" has unknown type "+cr(e)),r},Ir={},Vr=e=>{var t=Ir[e];return void 0===t?ht(e):t},Zr=[],Or=()=>{if("object"==typeof globalThis)return globalThis;function e(e){e.$$$embind_global$$$=e;var t="object"==typeof $$$embind_global$$$&&e.$$$embind_global$$$==e;return t||delete e.$$$embind_global$$$,t}if("object"==typeof $$$embind_global$$$)return $$$embind_global$$$;if("object"==typeof r.g&&e(r.g)?$$$embind_global$$$=r.g:"object"==typeof self&&e(self)&&($$$embind_global$$$=self),"object"==typeof $$$embind_global$$$)return $$$embind_global$$$;throw Error("unable to get global object.")},Nr=[],zr=e=>e%4==0&&(e%100!=0||e%400==0),Gr=[0,31,60,91,121,152,182,213,244,274,305,335],Ur=[0,31,59,90,120,151,181,212,243,273,304,334];function Lr(e,t,r,n,o,a,i,c){if(w)return Dr(21,1,e,t,r,n,o,a,i,c);var l=Ke(o,a);try{if(isNaN(l))return 61;var d=Fe.getStreamFromFD(n),h=Te.mmap(d,e,l,t,r),f=h.ptr;return s()[i>>2]=h.allocated,u()[c>>2]=f,0}catch(e){if("undefined"==typeof Te||"ErrnoError"!==e.name)throw e;return-e.errno}}function Xr(e,t,r,n,o,a,i){if(w)return Dr(22,1,e,t,r,n,o,a,i);var s=Ke(a,i);try{if(isNaN(s))return 61;var u=Fe.getStreamFromFD(o);2&r&&Fe.doMsync(e,u,t,n,s),Te.munmap(u)}catch(e){if("undefined"==typeof Te||"ErrnoError"!==e.name)throw e;return-e.errno}}var Yr,Br=e=>{var t=ge(e)+1,r=kn(t);return r&&Qe(e,r,t),r},Hr=[],Kr=(e,t,r)=>{var n=((e,t)=>{var r;for(Hr.length=0;r=o()[e++];)t+=105!=r&&t%8?4:0,Hr.push(105==r?s()[t>>2]:c()[t>>3]),t+=105==r?4:8;return Hr})(t,r);return se[e].apply(null,n)};Yr=()=>performance.timeOrigin+performance.now();var Jr=e=>{ne("OOM")},Qr=e=>{var t=(e-W.buffer.byteLength+65535)/65536;try{return W.grow(t),Z(),1}catch(e){}},qr={},en=()=>{if(!en.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:y||"./this.program"};for(var t in qr)void 0===qr[t]?delete e[t]:e[t]=qr[t];var r=[];for(var t in e)r.push(`${t}=${e[t]}`);en.strings=r}return en.strings},tn=function(e,r){if(w)return Dr(23,1,e,r);var n=0;return en().forEach(((o,a)=>{var i=r+n;u()[e+4*a>>2]=i,((e,r)=>{for(var n=0;n<e.length;++n)t()[r++>>0]=e.charCodeAt(n);t()[r>>0]=0})(o,i),n+=o.length+1})),0},rn=function(e,t){if(w)return Dr(24,1,e,t);var r=en();u()[e>>2]=r.length;var n=0;return r.forEach((e=>n+=e.length+1)),u()[t>>2]=n,0};function nn(e){if(w)return Dr(25,1,e);try{var t=Fe.getStreamFromFD(e);return Te.close(t),0}catch(e){if("undefined"==typeof Te||"ErrnoError"!==e.name)throw e;return e.errno}}function on(e,r){if(w)return Dr(26,1,e,r);try{var n=Fe.getStreamFromFD(e),o=n.tty?2:Te.isDir(n.mode)?3:Te.isLink(n.mode)?7:4;return t()[r>>0]=o,a()[r+2>>1]=0,J=[0,(K=0,+Math.abs(K)>=1?K>0?+Math.floor(K/4294967296)>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],s()[r+8>>2]=J[0],s()[r+12>>2]=J[1],J=[0,(K=0,+Math.abs(K)>=1?K>0?+Math.floor(K/4294967296)>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],s()[r+16>>2]=J[0],s()[r+20>>2]=J[1],0}catch(e){if("undefined"==typeof Te||"ErrnoError"!==e.name)throw e;return e.errno}}function an(e,r,n,o){if(w)return Dr(27,1,e,r,n,o);try{var a=((e,r,n,o)=>{for(var a=0,i=0;i<n;i++){var s=u()[r>>2],c=u()[r+4>>2];r+=8;var l=Te.read(e,t(),s,c,o);if(l<0)return-1;if(a+=l,l<c)break;"undefined"!=typeof o&&(o+=l)}return a})(Fe.getStreamFromFD(e),r,n);return u()[o>>2]=a,0}catch(e){if("undefined"==typeof Te||"ErrnoError"!==e.name)throw e;return e.errno}}function sn(e,t,r,n,o){if(w)return Dr(28,1,e,t,r,n,o);var a=Ke(t,r);try{if(isNaN(a))return 61;var i=Fe.getStreamFromFD(e);return Te.llseek(i,a,n),J=[i.position>>>0,(K=i.position,+Math.abs(K)>=1?K>0?+Math.floor(K/4294967296)>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],s()[o>>2]=J[0],s()[o+4>>2]=J[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0}catch(e){if("undefined"==typeof Te||"ErrnoError"!==e.name)throw e;return e.errno}}function un(e,r,n,o){if(w)return Dr(29,1,e,r,n,o);try{var a=((e,r,n,o)=>{for(var a=0,i=0;i<n;i++){var s=u()[r>>2],c=u()[r+4>>2];r+=8;var l=Te.write(e,t(),s,c,o);if(l<0)return-1;a+=l,"undefined"!=typeof o&&(o+=l)}return a})(Fe.getStreamFromFD(e),r,n);return u()[o>>2]=a,0}catch(e){if("undefined"==typeof Te||"ErrnoError"!==e.name)throw e;return e.errno}}var cn=[31,29,31,30,31,30,31,31,30,31,30,31],ln=[31,28,31,30,31,30,31,31,30,31,30,31],dn=(e,r,n,o)=>{var a=u()[o+40>>2],i={tm_sec:s()[o>>2],tm_min:s()[o+4>>2],tm_hour:s()[o+8>>2],tm_mday:s()[o+12>>2],tm_mon:s()[o+16>>2],tm_year:s()[o+20>>2],tm_wday:s()[o+24>>2],tm_yday:s()[o+28>>2],tm_isdst:s()[o+32>>2],tm_gmtoff:s()[o+36>>2],tm_zone:a?Ce(a):""},c=Ce(n),l={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var d in l)c=c.replace(new RegExp(d,"g"),l[d]);var h=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],f=["January","February","March","April","May","June","July","August","September","October","November","December"];function p(e,t,r){for(var n="number"==typeof e?e.toString():e||"";n.length<t;)n=r[0]+n;return n}function m(e,t){return p(e,t,"0")}function v(e,t){function r(e){return e<0?-1:e>0?1:0}var n;return 0===(n=r(e.getFullYear()-t.getFullYear()))&&0===(n=r(e.getMonth()-t.getMonth()))&&(n=r(e.getDate()-t.getDate())),n}function y(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function g(e){var t=((e,t)=>{for(var r=new Date(e.getTime());t>0;){var n=zr(r.getFullYear()),o=r.getMonth(),a=(n?cn:ln)[o];if(!(t>a-r.getDate()))return r.setDate(r.getDate()+t),r;t-=a-r.getDate()+1,r.setDate(1),o<11?r.setMonth(o+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1))}return r})(new Date(e.tm_year+1900,0,1),e.tm_yday),r=new Date(t.getFullYear(),0,4),n=new Date(t.getFullYear()+1,0,4),o=y(r),a=y(n);return v(o,t)<=0?v(a,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var w={"%a":e=>h[e.tm_wday].substring(0,3),"%A":e=>h[e.tm_wday],"%b":e=>f[e.tm_mon].substring(0,3),"%B":e=>f[e.tm_mon],"%C":e=>m((e.tm_year+1900)/100|0,2),"%d":e=>m(e.tm_mday,2),"%e":e=>p(e.tm_mday,2," "),"%g":e=>g(e).toString().substring(2),"%G":e=>g(e),"%H":e=>m(e.tm_hour,2),"%I":e=>{var t=e.tm_hour;return 0==t?t=12:t>12&&(t-=12),m(t,2)},"%j":e=>m(e.tm_mday+((e,t)=>{for(var r=0,n=0;n<=t;r+=e[n++]);return r})(zr(e.tm_year+1900)?cn:ln,e.tm_mon-1),3),"%m":e=>m(e.tm_mon+1,2),"%M":e=>m(e.tm_min,2),"%n":()=>"\n","%p":e=>e.tm_hour>=0&&e.tm_hour<12?"AM":"PM","%S":e=>m(e.tm_sec,2),"%t":()=>"\t","%u":e=>e.tm_wday||7,"%U":e=>{var t=e.tm_yday+7-e.tm_wday;return m(Math.floor(t/7),2)},"%V":e=>{var t=Math.floor((e.tm_yday+7-(e.tm_wday+6)%7)/7);if((e.tm_wday+371-e.tm_yday-2)%7<=2&&t++,t){if(53==t){var r=(e.tm_wday+371-e.tm_yday)%7;4==r||3==r&&zr(e.tm_year)||(t=1)}}else{t=52;var n=(e.tm_wday+7-e.tm_yday-1)%7;(4==n||5==n&&zr(e.tm_year%400-1))&&t++}return m(t,2)},"%w":e=>e.tm_wday,"%W":e=>{var t=e.tm_yday+7-(e.tm_wday+6)%7;return m(Math.floor(t/7),2)},"%y":e=>(e.tm_year+1900).toString().substring(2),"%Y":e=>e.tm_year+1900,"%z":e=>{var t=e.tm_gmtoff,r=t>=0;return t=(t=Math.abs(t)/60)/60*100+t%60,(r?"+":"-")+String("0000"+t).slice(-4)},"%Z":e=>e.tm_zone,"%%":()=>"%"};for(var d in c=c.replace(/%%/g,"\0\0"),w)c.includes(d)&&(c=c.replace(new RegExp(d,"g"),w[d](i)));var b,_,E=be(c=c.replace(/\0\0/g,"%"),!1);return E.length>r?0:(b=E,_=e,t().set(b,_),E.length-1)},hn=Br;$e.init();var fn,pn,mn,vn=function(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=Te.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n},yn=365,gn=146;Object.defineProperties(vn.prototype,{read:{get:function(){return(this.mode&yn)===yn},set:function(e){e?this.mode|=yn:this.mode&=-366}},write:{get:function(){return(this.mode&gn)===gn},set:function(e){e?this.mode|=gn:this.mode&=-147}},isFolder:{get:function(){return Te.isDir(this.mode)}},isDevice:{get:function(){return Te.isChrdev(this.mode)}}}),Te.FSNode=vn,Te.createPreloadedFile=(e,t,r,n,o,a,i,s,u,c)=>{var l=t?pe.resolve(he.join2(e,t)):e;function d(r){function d(r){c&&c(),s||Te.createDataFile(e,t,r,n,o,u),a&&a(),re()}((e,t,r,n)=>{"undefined"!=typeof Browser&&Browser.init();var o=!1;return Me.forEach((a=>{o||a.canHandle(t)&&(a.handle(e,t,r,n),o=!0)})),o})(r,l,d,(()=>{i&&i(),re()}))||d(r)}te(),"string"==typeof r?((e,t,r,n)=>{var o=n?"":`al ${e}`;p(e,(r=>{V(r,`Loading data file "${e}" failed (no arrayBuffer).`),t(new Uint8Array(r)),o&&re()}),(t=>{if(!r)throw`Loading data file "${e}" failed.`;r()})),o&&te()})(r,(e=>d(e)),i):d(r)},Te.staticInit(),(()=>{for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);dt=e})(),vt=h.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},gt=h.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},Ut.prototype.isAliasOf=Et,Ut.prototype.clone=Ot,Ut.prototype.delete=Nt,Ut.prototype.isDeleted=zt,Ut.prototype.deleteLater=Gt,h.getInheritedInstanceCount=St,h.getLiveInheritedInstances=Pt,h.flushPendingDeletes=$t,h.setDelayFunction=Dt,or.prototype.getPointee=tr,or.prototype.destructor=rr,or.prototype.argPackAdvance=8,or.prototype.readValueFromPointer=er,or.prototype.deleteObject=nr,or.prototype.fromWireType=Vt,ur=h.UnboundTypeError=(fn=Error,(mn=Xt(pn="UnboundTypeError",(function(e){this.name=pn,this.message=e;var t=new Error(e).stack;void 0!==t&&(this.stack=this.toString()+"\n"+t.replace(/^Error(:[^\n]*)?\n/,""))}))).prototype=Object.create(fn.prototype),mn.prototype.constructor=mn,mn.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},mn),Object.assign(pr.prototype,{get(e){return this.allocated[e]},has(e){return void 0!==this.allocated[e]},allocate(e){var t=this.freelist.pop()||this.allocated.length;return this.allocated[t]=e,t},free(e){this.allocated[e]=void 0,this.freelist.push(e)}}),mr.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),mr.reserved=mr.allocated.length,h.count_emval_handles=yr;var wn,bn=[Se,De,Ge,Le,Xe,Ye,Be,He,Je,qe,et,tt,rt,nt,ot,at,it,st,ut,ct,lt,Lr,Xr,tn,rn,nn,on,an,sn,un],_n={m:(e,t,r,n)=>{ne(`Assertion failed: ${Ce(e)}, at: `+[t?Ce(t):"unknown filename",r,n?Ce(n):"unknown function"])},t:e=>{var t=new Oe(e);return t.get_caught()||(t.set_caught(!0),Ve--),t.set_rethrown(!1),Ie.push(t),Nn(t.excPtr),t.get_exception_ptr()},Fb:()=>{if(!Ie.length)return 0;var e=Ie[Ie.length-1];return Nn(e.excPtr),e.excPtr},w:()=>{xn(0,0);var e=Ie.pop();On(e.excPtr),Ze=0},b:()=>Ne([]),h:e=>Ne([e]),q:(e,t)=>Ne([e,t]),ka:ze,Eb:e=>{if(e){var t=new Oe(e);Ie.push(t),t.set_rethrown(!0),ze()}},r:(e,t,r)=>{throw new Oe(e).init(t,r),Ve++,Ze=e},Gb:()=>Ve,Tb:e=>{Pn(e,!1,1,!0,4194304,!1),$e.threadInitTLS()},za:e=>{w?postMessage({cmd:"cleanupThread",thread:e}):le(e)},Pb:Ue,c:e=>{throw Ze||(Ze=e),Ze},Mb:Le,wb:Xe,xb:Ye,Da:Be,_b:He,gb:Je,Ab:qe,yb:et,$b:tt,Xb:rt,Rb:nt,Yb:ot,Ea:at,zb:it,Nb:st,Zb:ut,vb:ct,Ob:lt,pb:(e,t,r,n,o)=>{},Ha:(e,t,r,n)=>{_t(e,{name:t=ht(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?r:n},argPackAdvance:8,readValueFromPointer:function(e){return this.fromWireType(o()[e])},destructorFunction:null})},W:(e,t,r,n,o,a,i,s,u,c,l,d,h)=>{l=ht(l),a=sr(o,a),s&&(s=sr(i,s)),c&&(c=sr(u,c)),h=sr(d,h);var f=Lt(l);Bt(f,(function(){lr(`Cannot construct ${l} due to unbound types`,[n])})),bt([e,t,r],n?[n]:[],(function(t){var r,o;t=t[0],o=n?(r=t.registeredClass).instancePrototype:Ut.prototype;var i=Xt(f,(function(){if(Object.getPrototypeOf(this)!==u)throw new vt("Use 'new' to construct "+l);if(void 0===d.constructor_body)throw new vt(l+" has no accessible constructor");var e=d.constructor_body[arguments.length];if(void 0===e)throw new vt(`Tried to invoke ctor of ${l} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(d.constructor_body).toString()}) parameters instead!`);return e.apply(this,arguments)})),u=Object.create(o,{constructor:{value:i}});i.prototype=u;var d=new Ht(l,i,u,h,r,a,s,c);d.baseClass&&(void 0===d.baseClass.__derivedClasses&&(d.baseClass.__derivedClasses=[]),d.baseClass.__derivedClasses.push(d));var p=new or(l,d,!0,!1,!1),m=new or(l+"*",d,!1,!1,!1),v=new or(l+" const*",d,!1,!0,!1);return Ft[e]={pointerType:m,constPointerType:v},ar(f,i),[p,m,v]}))},V:(e,t,r,n,o,a,i,s)=>{var u=fr(r,n);t=ht(t),a=sr(o,a),bt([],[e],(function(e){var n=`${(e=e[0]).name}.${t}`;function o(){lr(`Cannot call ${n} due to unbound types`,u)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]);var s=e.registeredClass.constructor;return void 0===s[t]?(o.argCount=r-1,s[t]=o):(Yt(s,t,n),s[t].overloadTable[r-1]=o),bt([],u,(function(o){var u=[o[0],null].concat(o.slice(1)),c=hr(n,u,null,a,i);if(void 0===s[t].overloadTable?(c.argCount=r-1,s[t]=c):s[t].overloadTable[r-1]=c,e.registeredClass.__derivedClasses)for(const r of e.registeredClass.__derivedClasses)r.constructor.hasOwnProperty(t)||(r.constructor[t]=c);return[]})),[]}))},E:(e,t,r,n,o,a,i,s,u)=>{var c=fr(r,n);t=ht(t),a=sr(o,a),bt([],[e],(function(e){var n=`${(e=e[0]).name}.${t}`;function o(){lr(`Cannot call ${n} due to unbound types`,c)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(t);var u=e.registeredClass.instancePrototype,l=u[t];return void 0===l||void 0===l.overloadTable&&l.className!==e.name&&l.argCount===r-2?(o.argCount=r-2,o.className=e.name,u[t]=o):(Yt(u,t,n),u[t].overloadTable[r-2]=o),bt([],c,(function(o){var s=hr(n,o,e,a,i);return void 0===u[t].overloadTable?(s.argCount=r-2,u[t]=s):u[t].overloadTable[r-2]=s,[]})),[]}))},dc:(e,t)=>{_t(e,{name:t=ht(t),fromWireType:e=>{var t=gr.toValue(e);return vr(e),t},toWireType:(e,t)=>gr.toHandle(t),argPackAdvance:8,readValueFromPointer:wr,destructorFunction:null})},Ga:(e,t,r)=>{_t(e,{name:t=ht(t),fromWireType:e=>e,toWireType:(e,t)=>t,argPackAdvance:8,readValueFromPointer:_r(t,r),destructorFunction:null})},Y:(e,t,r,n,o,a,i)=>{var s=fr(t,r);e=ht(e),o=sr(n,o),Bt(e,(function(){lr(`Cannot call ${e} due to unbound types`,s)}),t-1),bt([],s,(function(r){var n=[r[0],null].concat(r.slice(1));return ar(e,hr(e,n,null,o,a),t-1),[]}))},M:(e,t,r,n,o)=>{t=ht(t),-1===o&&(o=4294967295);var a=e=>e;if(0===n){var i=32-8*r;a=e=>e<<i>>>i}var s=t.includes("unsigned");_t(e,{name:t,fromWireType:a,toWireType:s?function(e,t){return this.name,t>>>0}:function(e,t){return this.name,t},argPackAdvance:8,readValueFromPointer:Er(t,r,0!==n),destructorFunction:null})},F:(e,r,n)=>{var o=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][r];function a(e){var r=u()[e>>2],n=u()[e+4>>2];return new o(t().buffer,n,r)}_t(e,{name:n=ht(n),fromWireType:a,argPackAdvance:8,readValueFromPointer:a},{ignoreDuplicateRegistrations:!0})},Fa:(e,t)=>{var r="std::string"===(t=ht(t));_t(e,{name:t,fromWireType:e=>{var t,n=u()[e>>2],a=e+4;if(r)for(var i=a,s=0;s<=n;++s){var c=a+s;if(s==n||0==o()[c]){var l=Ce(i,c-i);void 0===t?t=l:(t+=String.fromCharCode(0),t+=l),i=c+1}}else{var d=new Array(n);for(s=0;s<n;++s)d[s]=String.fromCharCode(o()[a+s]);t=d.join("")}return Mn(e),t},toWireType:(e,t)=>{var n;t instanceof ArrayBuffer&&(t=new Uint8Array(t));var a="string"==typeof t;a||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array||yt("Cannot pass non-string to std::string"),n=r&&a?ge(t):t.length;var i=kn(4+n+1),s=i+4;if(u()[i>>2]=n,r&&a)Qe(t,s,n+1);else if(a)for(var c=0;c<n;++c){var l=t.charCodeAt(c);l>255&&(Mn(s),yt("String has UTF-16 code units that do not fit in 8 bits")),o()[s+c]=l}else for(c=0;c<n;++c)o()[s+c]=t[c];return null!==e&&e.push(Mn,i),i},argPackAdvance:8,readValueFromPointer:er,destructorFunction:e=>Mn(e)})},ta:(e,t,r)=>{var n,o,a,s,c;r=ht(r),2===t?(n=Mr,o=Wr,s=Tr,a=()=>i(),c=1):4===t&&(n=Cr,o=Fr,s=Sr,a=()=>u(),c=2),_t(e,{name:r,fromWireType:e=>{for(var r,o=u()[e>>2],i=a(),s=e+4,l=0;l<=o;++l){var d=e+4+l*t;if(l==o||0==i[d>>c]){var h=n(s,d-s);void 0===r?r=h:(r+=String.fromCharCode(0),r+=h),s=d+t}}return Mn(e),r},toWireType:(e,n)=>{"string"!=typeof n&&yt(`Cannot pass non-string to C++ string type ${r}`);var a=s(n),i=kn(4+a+t);return u()[i>>2]=a>>c,o(n,i+4,a+t),null!==e&&e.push(Mn,i),i},argPackAdvance:8,readValueFromPointer:wr,destructorFunction:e=>Mn(e)})},Ia:(e,t)=>{_t(e,{isVoid:!0,name:t=ht(t),argPackAdvance:0,fromWireType:()=>{},toWireType:(e,t)=>{}})},cc:()=>!0,Kb:(e,t,r)=>{if(e==t)setTimeout((()=>$r()));else if(w)postMessage({targetThread:e,cmd:"checkMailbox"});else{var n=$e.pthreads[e];if(!n)return;n.postMessage({cmd:"checkMailbox"})}},Qb:(e,t,r,n)=>{xr.length=r;for(var o=n>>3,a=0;a<r;a++)xr[a]=c()[o+a];var i=e<0?se[-e-1]:bn[e];$e.currentProxiedOperationCallerThread=t;var s=i.apply(null,xr);return $e.currentProxiedOperationCallerThread=0,s},Sb:jr,bc:e=>{},Hb:()=>{throw 1/0},Z:(e,t,r)=>{e=gr.toValue(e),t=Rr(t,"emval::as");var n=[],o=gr.toHandle(n);return u()[r>>2]=o,t.toWireType(n,e)},fa:(e,t,r,n,o)=>(e=Zr[e])(t=gr.toValue(t),r=Vr(r),(e=>{var t=[];return u()[e>>2]=gr.toHandle(t),t})(n),o),qa:(e,t,r,n)=>{(e=Zr[e])(t=gr.toValue(t),r=Vr(r),null,n)},Db:vr,ra:e=>0===e?gr.toHandle(Or()):(e=Vr(e),gr.toHandle(Or()[e])),S:(e,t)=>{var r=((e,t)=>{for(var r=new Array(e),n=0;n<e;++n)r[n]=Rr(u()[t+4*n>>2],"parameter "+n);return r})(e,t),n=r[0],o=n.name+"_$"+r.slice(1).map((function(e){return e.name})).join("_")+"$",a=Nr[o];if(void 0!==a)return a;var i,s,c=new Array(e-1);return i=(t,o,a,i)=>{for(var s=0,u=0;u<e-1;++u)c[u]=r[u+1].readValueFromPointer(i+s),s+=r[u+1].argPackAdvance;var l=t[o].apply(t,c);for(u=0;u<e-1;++u)r[u+1].deleteObject&&r[u+1].deleteObject(c[u]);if(!n.isVoid)return n.toWireType(a,l)},s=Zr.length,Zr.push(i),a=s,Nr[o]=a,a},fb:(e,t)=>(e=gr.toValue(e),t=gr.toValue(t),gr.toHandle(e[t])),v:e=>{e>4&&(mr.get(e).refcount+=1)},db:(e,t)=>(e=gr.toValue(e))instanceof(t=gr.toValue(t)),_:e=>"number"==typeof(e=gr.toValue(e)),I:e=>"string"==typeof(e=gr.toValue(e)),X:()=>gr.toHandle([]),K:e=>gr.toHandle(Vr(e)),z:()=>gr.toHandle({}),eb:e=>{var t=gr.toValue(e);dr(t),vr(e)},Vb:(e,t,r)=>{e=gr.toValue(e),t=gr.toValue(t),r=gr.toValue(r),e[t]=r},L:(e,t)=>{var r=(e=Rr(e,"_emval_take_value")).readValueFromPointer(t);return gr.toHandle(r)},C:e=>(e=gr.toValue(e),gr.toHandle(typeof e)),mb:function(e,t,r){var n=Ke(e,t),o=new Date(1e3*n);s()[r>>2]=o.getUTCSeconds(),s()[r+4>>2]=o.getUTCMinutes(),s()[r+8>>2]=o.getUTCHours(),s()[r+12>>2]=o.getUTCDate(),s()[r+16>>2]=o.getUTCMonth(),s()[r+20>>2]=o.getUTCFullYear()-1900,s()[r+24>>2]=o.getUTCDay();var a=Date.UTC(o.getUTCFullYear(),0,1,0,0,0,0),i=(o.getTime()-a)/864e5|0;s()[r+28>>2]=i},nb:function(e,t,r){var n=Ke(e,t),o=new Date(1e3*n);s()[r>>2]=o.getSeconds(),s()[r+4>>2]=o.getMinutes(),s()[r+8>>2]=o.getHours(),s()[r+12>>2]=o.getDate(),s()[r+16>>2]=o.getMonth(),s()[r+20>>2]=o.getFullYear()-1900,s()[r+24>>2]=o.getDay();var a=0|(e=>(zr(e.getFullYear())?Gr:Ur)[e.getMonth()]+e.getDate()-1)(o);s()[r+28>>2]=a,s()[r+36>>2]=-60*o.getTimezoneOffset();var i=new Date(o.getFullYear(),0,1),u=new Date(o.getFullYear(),6,1).getTimezoneOffset(),c=i.getTimezoneOffset(),l=0|(u!=c&&o.getTimezoneOffset()==Math.min(c,u));s()[r+32>>2]=l},kb:Lr,lb:Xr,Jb:(e,t,r)=>{var n=(new Date).getFullYear(),o=new Date(n,0,1),a=new Date(n,6,1),i=o.getTimezoneOffset(),c=a.getTimezoneOffset(),l=Math.max(i,c);function d(e){var t=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return t?t[1]:"GMT"}u()[e>>2]=60*l,s()[t>>2]=Number(i!=c);var h=d(o),f=d(a),p=Br(h),m=Br(f);c<i?(u()[r>>2]=p,u()[r+4>>2]=m):(u()[r>>2]=m,u()[r+4>>2]=p)},B:()=>{ne("")},ab:(e,t,r)=>Kr(e,t,r),Aa:()=>{},$:()=>Date.now(),ac:()=>{throw L+=1,"unwind"},Lb:()=>2147483648,J:Yr,va:()=>navigator.hardwareConcurrency,Ib:e=>{var t=o().length;if((e>>>=0)<=t)return!1;var r=2147483648;e>r&&Jr();for(var n,a,i=1;i<=4;i*=2){var s=t*(1+.2/i);s=Math.min(s,e+100663296);var u=Math.min(r,(n=Math.max(e,s))+((a=65536)-n%a)%a);if(Qr(u))return!0}Jr()},Ub:tn,Wb:rn,ua:Pe,ia:nn,Ba:on,Ca:an,ob:sn,sa:un,cb:function(){return hn(location.toString())},ub:(e,t)=>(fe(o().subarray(e,e+t)),0),bb:function(){return hn((e=Qn,self[e(354,"Z887")][e(349,"ne%t")]()));var e},Ta:function(e,t){var r=In();try{return xe(e)(t)}catch(e){if(Vn(r),e!==e+0)throw e;xn(1,0)}},Va:function(e,t,r){var n=In();try{return xe(e)(t,r)}catch(e){if(Vn(n),e!==e+0)throw e;xn(1,0)}},Q:function(e,t,r,n,o,a){var i=In();try{return xe(e)(t,r,n,o,a)}catch(e){if(Vn(i),e!==e+0)throw e;xn(1,0)}},T:function(e,t,r,n){var o=In();try{return xe(e)(t,r,n)}catch(e){if(Vn(o),e!==e+0)throw e;xn(1,0)}},pa:function(e,t,r,n,o){var a=In();try{return xe(e)(t,r,n,o)}catch(e){if(Vn(a),e!==e+0)throw e;xn(1,0)}},Ua:function(e,t){var r=In();try{return xe(e)(t)}catch(e){if(Vn(r),e!==e+0)throw e;xn(1,0)}},_a:function(e,t,r){var n=In();try{return xe(e)(t,r)}catch(e){if(Vn(n),e!==e+0)throw e;xn(1,0)}},ca:function(e,t,r,n){var o=In();try{return xe(e)(t,r,n)}catch(e){if(Vn(o),e!==e+0)throw e;xn(1,0)}},u:function(e){var t=In();try{return xe(e)()}catch(e){if(Vn(t),e!==e+0)throw e;xn(1,0)}},j:function(e,t){var r=In();try{return xe(e)(t)}catch(e){if(Vn(r),e!==e+0)throw e;xn(1,0)}},xa:function(e,t,r,n){var o=In();try{return xe(e)(t,r,n)}catch(e){if(Vn(o),e!==e+0)throw e;xn(1,0)}},Xa:function(e,t,r,n){var o=In();try{return xe(e)(t,r,n)}catch(e){if(Vn(o),e!==e+0)throw e;xn(1,0)}},Za:function(e,t,r,n,o){var a=In();try{return xe(e)(t,r,n,o)}catch(e){if(Vn(a),e!==e+0)throw e;xn(1,0)}},Ya:function(e,t,r,n,o,a,i,s){var u=In();try{return xe(e)(t,r,n,o,a,i,s)}catch(e){if(Vn(u),e!==e+0)throw e;xn(1,0)}},d:function(e,t,r){var n=In();try{return xe(e)(t,r)}catch(e){if(Vn(n),e!==e+0)throw e;xn(1,0)}},$a:function(e,t,r,n){var o=In();try{return xe(e)(t,r,n)}catch(e){if(Vn(o),e!==e+0)throw e;xn(1,0)}},k:function(e,t,r,n){var o=In();try{return xe(e)(t,r,n)}catch(e){if(Vn(o),e!==e+0)throw e;xn(1,0)}},U:function(e,t,r,n,o){var a=In();try{return xe(e)(t,r,n,o)}catch(e){if(Vn(a),e!==e+0)throw e;xn(1,0)}},l:function(e,t,r,n,o){var a=In();try{return xe(e)(t,r,n,o)}catch(e){if(Vn(a),e!==e+0)throw e;xn(1,0)}},Cb:function(e,t,r,n,o,a){var i=In();try{return xe(e)(t,r,n,o,a)}catch(e){if(Vn(i),e!==e+0)throw e;xn(1,0)}},ya:function(e,t,r,n,o,a,i){var s=In();try{return xe(e)(t,r,n,o,a,i)}catch(e){if(Vn(s),e!==e+0)throw e;xn(1,0)}},p:function(e,t,r,n,o,a){var i=In();try{return xe(e)(t,r,n,o,a)}catch(e){if(Vn(i),e!==e+0)throw e;xn(1,0)}},G:function(e,t,r,n,o,a,i){var s=In();try{return xe(e)(t,r,n,o,a,i)}catch(e){if(Vn(s),e!==e+0)throw e;xn(1,0)}},ja:function(e,t,r,n,o,a,i,s){var u=In();try{return xe(e)(t,r,n,o,a,i,s)}catch(e){if(Vn(u),e!==e+0)throw e;xn(1,0)}},Ka:function(e,t,r,n,o,a,i,s,u){var c=In();try{return xe(e)(t,r,n,o,a,i,s,u)}catch(e){if(Vn(c),e!==e+0)throw e;xn(1,0)}},Ja:function(e,t,r,n,o,a,i,s,u,c){var l=In();try{return xe(e)(t,r,n,o,a,i,s,u,c)}catch(e){if(Vn(l),e!==e+0)throw e;xn(1,0)}},Wa:function(e,t,r,n,o,a,i,s,u,c,l){var d=In();try{return xe(e)(t,r,n,o,a,i,s,u,c,l)}catch(e){if(Vn(d),e!==e+0)throw e;xn(1,0)}},ha:function(e,t,r,n,o,a,i,s,u,c,l,d){var h=In();try{return xe(e)(t,r,n,o,a,i,s,u,c,l,d)}catch(e){if(Vn(h),e!==e+0)throw e;xn(1,0)}},rb:function(e,t,r,n){var o=In();try{return Ln(e,t,r,n)}catch(e){if(Vn(o),e!==e+0)throw e;xn(1,0)}},jb:function(e){var t=In();try{return Yn(e)}catch(e){if(Vn(t),e!==e+0)throw e;xn(1,0)}},tb:function(e,t){var r=In();try{return Un(e,t)}catch(e){if(Vn(r),e!==e+0)throw e;xn(1,0)}},ib:function(e,t,r){var n=In();try{return Bn(e,t,r)}catch(e){if(Vn(n),e!==e+0)throw e;xn(1,0)}},hb:function(e,t,r,n,o){var a=In();try{return Kn(e,t,r,n,o)}catch(e){if(Vn(a),e!==e+0)throw e;xn(1,0)}},o:function(e){var t=In();try{xe(e)()}catch(e){if(Vn(t),e!==e+0)throw e;xn(1,0)}},e:function(e,t){var r=In();try{xe(e)(t)}catch(e){if(Vn(r),e!==e+0)throw e;xn(1,0)}},ea:function(e,t,r){var n=In();try{xe(e)(t,r)}catch(e){if(Vn(n),e!==e+0)throw e;xn(1,0)}},Pa:function(e,t,r,n){var o=In();try{xe(e)(t,r,n)}catch(e){if(Vn(o),e!==e+0)throw e;xn(1,0)}},Sa:function(e,t,r,n,o,a,i,s){var u=In();try{xe(e)(t,r,n,o,a,i,s)}catch(e){if(Vn(u),e!==e+0)throw e;xn(1,0)}},f:function(e,t,r){var n=In();try{xe(e)(t,r)}catch(e){if(Vn(n),e!==e+0)throw e;xn(1,0)}},x:function(e,t,r,n){var o=In();try{xe(e)(t,r,n)}catch(e){if(Vn(o),e!==e+0)throw e;xn(1,0)}},oa:function(e,t,r,n,o){var a=In();try{xe(e)(t,r,n,o)}catch(e){if(Vn(a),e!==e+0)throw e;xn(1,0)}},aa:function(e,t,r,n,o,a){var i=In();try{xe(e)(t,r,n,o,a)}catch(e){if(Vn(i),e!==e+0)throw e;xn(1,0)}},Ra:function(e,t,r,n,o,a,i){var s=In();try{xe(e)(t,r,n,o,a,i)}catch(e){if(Vn(s),e!==e+0)throw e;xn(1,0)}},ba:function(e,t,r,n,o,a,i,s){var u=In();try{xe(e)(t,r,n,o,a,i,s)}catch(e){if(Vn(u),e!==e+0)throw e;xn(1,0)}},Qa:function(e,t,r,n,o){var a=In();try{xe(e)(t,r,n,o)}catch(e){if(Vn(a),e!==e+0)throw e;xn(1,0)}},ma:function(e,t,r,n){var o=In();try{xe(e)(t,r,n)}catch(e){if(Vn(o),e!==e+0)throw e;xn(1,0)}},g:function(e,t,r,n){var o=In();try{xe(e)(t,r,n)}catch(e){if(Vn(o),e!==e+0)throw e;xn(1,0)}},N:function(e,t,r,n,o){var a=In();try{xe(e)(t,r,n,o)}catch(e){if(Vn(a),e!==e+0)throw e;xn(1,0)}},H:function(e,t,r,n,o,a){var i=In();try{xe(e)(t,r,n,o,a)}catch(e){if(Vn(i),e!==e+0)throw e;xn(1,0)}},D:function(e,t,r,n,o,a,i){var s=In();try{xe(e)(t,r,n,o,a,i)}catch(e){if(Vn(s),e!==e+0)throw e;xn(1,0)}},P:function(e,t,r,n,o,a){var i=In();try{xe(e)(t,r,n,o,a)}catch(e){if(Vn(i),e!==e+0)throw e;xn(1,0)}},i:function(e,t,r,n,o){var a=In();try{xe(e)(t,r,n,o)}catch(e){if(Vn(a),e!==e+0)throw e;xn(1,0)}},na:function(e,t,r,n,o,a,i,s){var u=In();try{xe(e)(t,r,n,o,a,i,s)}catch(e){if(Vn(u),e!==e+0)throw e;xn(1,0)}},La:function(e,t,r,n,o,a,i,s){var u=In();try{xe(e)(t,r,n,o,a,i,s)}catch(e){if(Vn(u),e!==e+0)throw e;xn(1,0)}},la:function(e,t,r,n,o,a){var i=In();try{xe(e)(t,r,n,o,a)}catch(e){if(Vn(i),e!==e+0)throw e;xn(1,0)}},n:function(e,t,r,n,o,a){var i=In();try{xe(e)(t,r,n,o,a)}catch(e){if(Vn(i),e!==e+0)throw e;xn(1,0)}},s:function(e,t,r,n,o,a,i){var s=In();try{xe(e)(t,r,n,o,a,i)}catch(e){if(Vn(s),e!==e+0)throw e;xn(1,0)}},Oa:function(e,t,r,n,o,a,i,s,u,c,l){var d=In();try{xe(e)(t,r,n,o,a,i,s,u,c,l)}catch(e){if(Vn(d),e!==e+0)throw e;xn(1,0)}},A:function(e,t,r,n,o,a,i,s){var u=In();try{xe(e)(t,r,n,o,a,i,s)}catch(e){if(Vn(u),e!==e+0)throw e;xn(1,0)}},Na:function(e,t,r,n,o,a,i,s,u,c,l,d){var h=In();try{xe(e)(t,r,n,o,a,i,s,u,c,l,d)}catch(e){if(Vn(h),e!==e+0)throw e;xn(1,0)}},Ma:function(e,t,r,n,o,a,i,s,u,c,l){var d=In();try{xe(e)(t,r,n,o,a,i,s,u,c,l)}catch(e){if(Vn(d),e!==e+0)throw e;xn(1,0)}},R:function(e,t,r,n,o,a,i,s,u){var c=In();try{xe(e)(t,r,n,o,a,i,s,u)}catch(e){if(Vn(c),e!==e+0)throw e;xn(1,0)}},da:function(e,t,r,n,o,a,i,s,u,c){var l=In();try{xe(e)(t,r,n,o,a,i,s,u,c)}catch(e){if(Vn(l),e!==e+0)throw e;xn(1,0)}},O:function(e,t,r,n,o,a,i,s,u,c,l){var d=In();try{xe(e)(t,r,n,o,a,i,s,u,c,l)}catch(e){if(Vn(d),e!==e+0)throw e;xn(1,0)}},ga:function(e,t,r,n,o,a,i,s,u,c,l,d,h,f,p,m){var v=In();try{xe(e)(t,r,n,o,a,i,s,u,c,l,d,h,f,p,m)}catch(e){if(Vn(v),e!==e+0)throw e;xn(1,0)}},sb:function(e,t,r,n,o,a,i){var s=In();try{Hn(e,t,r,n,o,a,i)}catch(e){if(Vn(s),e!==e+0)throw e;xn(1,0)}},qb:function(e,t,r,n,o){var a=In();try{Xn(e,t,r,n,o)}catch(e){if(Vn(a),e!==e+0)throw e;xn(1,0)}},y:e=>e,a:W||h.wasmMemory,wa:dn,Bb:(e,t,r,n,o)=>dn(e,t,r,n)},En=function(){var e,t,r,n,o={a:_n};function a(e,t){var r,n=e.exports;return Re((En=n).lc),O=En.gc,r=En.ec,G.unshift(r),T=t,re(),n}if(te(),h.instantiateWasm)try{return h.instantiateWasm(o,a)}catch(e){M(`Module.instantiateWasm callback failed with error: ${e}`),d(e)}return(e=E,t=H,r=o,n=function(e){a(e.instance,e.module)},e||"function"!=typeof WebAssembly.instantiateStreaming||oe(t)||"function"!=typeof fetch?ie(t,r,n):fetch(t,{credentials:"same-origin"}).then((e=>WebAssembly.instantiateStreaming(e,r).then(n,(function(e){return M(`wasm streaming compile failed: ${e}`),M("falling back to ArrayBuffer instantiation"),ie(t,r,n)}))))).catch(d),{}}(),kn=h._malloc=e=>(kn=h._malloc=En.fc)(e),Mn=h._free=e=>(Mn=h._free=En.hc)(e),Wn=()=>(Wn=En.ic)(),Tn=h._pthread_self=()=>(Tn=h._pthread_self=En.jc)(),Cn=e=>(Cn=En.kc)(e),Fn=(h.__emscripten_tls_init=()=>(h.__emscripten_tls_init=En.lc)(),(e,t)=>(Fn=En.mc)(e,t)),Sn=e=>(Sn=En.nc)(e),Pn=(h.__embind_initialize_bindings=()=>(h.__embind_initialize_bindings=En.oc)(),h.__emscripten_thread_init=(e,t,r,n,o,a)=>(Pn=h.__emscripten_thread_init=En.pc)(e,t,r,n,o,a)),jn=(h.__emscripten_thread_crashed=()=>(h.__emscripten_thread_crashed=En.qc)(),(e,t,r,n)=>(jn=En.rc)(e,t,r,n)),$n=e=>($n=En.sc)(e),An=h.__emscripten_thread_exit=e=>(An=h.__emscripten_thread_exit=En.tc)(e),Dn=h.__emscripten_check_mailbox=()=>(Dn=h.__emscripten_check_mailbox=En.uc)(),xn=(e,t)=>(xn=En.vc)(e,t),Rn=(e,t)=>(Rn=En.wc)(e,t),In=()=>(In=En.xc)(),Vn=e=>(Vn=En.yc)(e),Zn=e=>(Zn=En.zc)(e),On=e=>(On=En.Ac)(e),Nn=e=>(Nn=En.Bc)(e),zn=(e,t,r)=>(zn=En.Cc)(e,t,r),Gn=e=>(Gn=En.Dc)(e),Un=h.dynCall_ji=(e,t)=>(Un=h.dynCall_ji=En.Ec)(e,t),Ln=(h.dynCall_jiji=(e,t,r,n,o)=>(h.dynCall_jiji=En.Fc)(e,t,r,n,o),h.dynCall_viij=(e,t,r,n,o)=>(h.dynCall_viij=En.Gc)(e,t,r,n,o),h.dynCall_iji=(e,t,r,n)=>(Ln=h.dynCall_iji=En.Hc)(e,t,r,n)),Xn=h.dynCall_viji=(e,t,r,n,o)=>(Xn=h.dynCall_viji=En.Ic)(e,t,r,n,o),Yn=(h.dynCall_iiiijj=(e,t,r,n,o,a,i,s)=>(h.dynCall_iiiijj=En.Jc)(e,t,r,n,o,a,i,s),h.dynCall_viijj=(e,t,r,n,o,a,i)=>(h.dynCall_viijj=En.Kc)(e,t,r,n,o,a,i),h.dynCall_viiijjj=(e,t,r,n,o,a,i,s,u,c)=>(h.dynCall_viiijjj=En.Lc)(e,t,r,n,o,a,i,s,u,c),h.dynCall_j=e=>(Yn=h.dynCall_j=En.Mc)(e)),Bn=h.dynCall_jii=(e,t,r)=>(Bn=h.dynCall_jii=En.Nc)(e,t,r),Hn=h.dynCall_viijii=(e,t,r,n,o,a,i)=>(Hn=h.dynCall_viijii=En.Oc)(e,t,r,n,o,a,i),Kn=h.dynCall_jiiii=(e,t,r,n,o)=>(Kn=h.dynCall_jiiii=En.Pc)(e,t,r,n,o);function Jn(){if(!(Q>0)){if(w)return l(h),Y(),void startWorker(h);!function(){if(h.preRun)for("function"==typeof h.preRun&&(h.preRun=[h.preRun]);h.preRun.length;)B(h.preRun.shift());Ae(z)}(),Q>0||(h.setStatus?(h.setStatus("Running..."),setTimeout((function(){setTimeout((function(){h.setStatus("")}),1),e()}),1)):e())}function e(){wn||(wn=!0,h.calledRun=!0,I||(Y(),l(h),h.onRuntimeInitialized&&h.onRuntimeInitialized(),function(){if(!w){if(h.postRun)for("function"==typeof h.postRun&&(h.postRun=[h.postRun]);h.postRun.length;)e=h.postRun.shift(),U.unshift(e);var e;Ae(U)}}()))}}if(h.dynCall_iiiiij=(e,t,r,n,o,a,i)=>(h.dynCall_iiiiij=En.Qc)(e,t,r,n,o,a,i),h.dynCall_iiiiijj=(e,t,r,n,o,a,i,s,u)=>(h.dynCall_iiiiijj=En.Rc)(e,t,r,n,o,a,i,s,u),h.dynCall_iiiiiijj=(e,t,r,n,o,a,i,s,u,c)=>(h.dynCall_iiiiiijj=En.Sc)(e,t,r,n,o,a,i,s,u,c),h.___start_em_js=1460272,h.___stop_em_js=1460380,h.keepRuntimeAlive=X,h.wasmMemory=W,h.UTF8ToString=Ce,h.stringToUTF8=Qe,h.lengthBytesUTF8=ge,h.ExitStatus=ue,h.allocateUTF8=hn,h.PThread=$e,ee=function e(){wn||Jn(),wn||(ee=e)},h.preInit)for("function"==typeof h.preInit&&(h.preInit=[h.preInit]);h.preInit.length>0;)h.preInit.pop()();function Qn(e,t){var r=qn();return Qn=function(t,n){var o=r[t-=344];if(void 0===Qn.sXgARH){var a=function(e){for(var t,r,n="",o="",a=0,i=0;r=e.charAt(i++);~r&&(t=a%4?64*t+r:r,a++%4)?n+=String.fromCharCode(255&t>>(-2*a&6)):0)r="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=".indexOf(r);for(var s=0,u=n.length;s<u;s++)o+="%"+("00"+n.charCodeAt(s).toString(16)).slice(-2);return decodeURIComponent(o)},i=function(e,t){var r,n,o=[],i=0,s="";for(e=a(e),n=0;n<256;n++)o[n]=n;for(n=0;n<256;n++)i=(i+o[n]+t.charCodeAt(n%t.length))%256,r=o[n],o[n]=o[i],o[i]=r;n=0,i=0;for(var u=0;u<e.length;u++)i=(i+o[n=(n+1)%256])%256,r=o[n],o[n]=o[i],o[i]=r,s+=String.fromCharCode(e.charCodeAt(u)^o[(o[n]+o[i])%256]);return s};Qn.vixuwT=i,e=arguments,Qn.sXgARH=!0}var s=r[0],u=t+s,c=e[u];return c?o=c:(void 0===Qn.VXprZA&&(Qn.VXprZA=!0),o=Qn.vixuwT(o,n),e[u]=o),o},Qn(e,t)}function qn(){var e=["WRWNWP3cLYRcK3NdImoXb8oZda","vSoxpCkvqmoLiKZcR8oZWRRcLd8","W5mPhSoTWOVcP8oOfq","lSkEBKtcMSo0lM8","pmoOkgxdLSk1yHpcImkjCXfd","W4fLW5/cLZddQSkVpIhcU1C2","W55qWO1uE8kkW5y","b8k0sJddJ8oLWPfQWRdcKCooc8kVW5O","b8oVumk4W4uuiXavW4a8kSow","jComW70qzCkDWQTpW6VdO0eC","WOpcSCkypCknoCo6kgDirqldGq","CW97WRmlW5ZcIcuFWOWaW6i","W5RcNSo6W6G9v8oCWPO","dIetW5BcGSoYbwrKkIfWyW","mJ7cKN7cN8oYWOJdRwVdICk7W5ZcRq","ymksW7fHD2rw","EWf+WRagW53dSYmmWPqsW6dcOG","WOGLvmk5W5uNWPFdPG","WRBdP37cOCoArSocf8kZWOdcMHxdQa"];return(qn=function(){return e})()}Jn(),function(e,t){for(var r=Qn,n=e();;)try{if(546325==-parseInt(r(348,"b2eW"))/1+parseInt(r(350,"mejV"))/2+-parseInt(r(345,"oCNF"))/3+parseInt(r(347,"A@jQ"))/4+-parseInt(r(356,"%InO"))/5*(parseInt(r(359,"idRt"))/6)+parseInt(r(352,"fA%T"))/7*(-parseInt(r(357,"Ir$H"))/8)+parseInt(r(344,"EixA"))/9)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(qn);var ighnua,eo=(ighnua=!0,function(ovjrup,Euvnak){var Ovjrup=ighnua?function(){if(Euvnak){var Ighnua=Euvnak.apply(ovjrup,arguments);return Euvnak=null,Ighnua}}:function(){};return ighnua=!1,Ovjrup}),to=eo(this,(function(){return!/" + this + "/.constructor("^([^ ]+( +[^ ]+)+)+[^ ]}").test(to)}));return to(),e.ready});e.exports=o}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";function e(e){const{allowSimd:t=!0,allowThreads:r=!0}=e||{};let n="";if(t&&function(){try{const e=WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11])),t=WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,5,3,1,0,1,11,9,1,0,65,1,65,2,106,11,0]));return e&&t}catch(e){return!1}}()){n+="-simd";r&&function(){if("undefined"!=typeof process&&"undefined"!=typeof process.versions&&"undefined"!=typeof process.versions.node)return!1;if(/(iPad|iPhone|iPod)/g.test(navigator.userAgent))return!1;try{return(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(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]))}catch(e){return!1}}()&&(n+="-threads")}return n}class t extends Error{constructor(){super(...arguments),this.errorType="UnknownError"}}class n extends Error{constructor(){super(...arguments),this.errorType="InvalidLicense"}}class o extends Error{constructor(){super(...arguments),this.errorType="NullPointer"}}class a extends Error{constructor(){super(...arguments),this.errorType="InvalidArgument"}}class i extends Error{constructor(){super(...arguments),this.errorType="InvalidImageRef"}}class s extends Error{constructor(){super(...arguments),this.errorType="ComponentUnavailable"}}class u extends Error{constructor(){super(...arguments),this.errorType="IllegalState"}}class c extends Error{constructor(){super(...arguments),this.errorType="IoError"}}class l extends Error{constructor(){super(...arguments),this.errorType="InvalidData"}}class d extends Error{constructor(){super(...arguments),this.errorType="OperationCanceled"}}class h extends Error{constructor(){super(...arguments),this.errorType="OutOfMemory"}}class f extends Error{constructor(){super(...arguments),this.errorType="Timeout"}}class p{constructor(e){this.id=e}}class m{constructor(){this._map=new Map,this._nextId=0,this._unique=Math.random().toString(36)}add(e){const t=this._nextId.toString()+"_"+this._unique;return this._map.set(t,e),this._nextId++,new p(t)}get(e){return this._map.get(e.id)}delete(e){this._map.delete(e.id)}}function v(e){if(e.errorMessage)throw function(e,r,p){const m=p?{cause:p}:void 0;switch(e){case"UnknownError":return new t(r,m);case"InvalidLicense":return new n("Your license is not valid to use this feature of the ScanbotSDK. This can be because of one of the following reasons: \n 1) You did not successfully initialize the SDK with your license. \n 2) Your license expired \n 3) Your license does not allow the use of this feature of the ScanbotSDK",m);case"NullPointer":return new o(r,m);case"InvalidArgument":return new a(r,m);case"InvalidImageRef":return new i(r,m);case"ComponentUnavailable":return new s(r,m);case"IllegalState":return new u(r,m);case"IoError":return new c(r,m);case"InvalidData":return new l(r,m);case"OperationCanceled":return new d(r,m);case"OutOfMemory":return new h(r,m);case"Timeout":return new f(r,m);default:throw new Error(r)}}(e.errorType,e.errorMessage);return e.result}var y;!function(e){e.from=function(e){const t=e._type;switch(t){case"LegacyFilter":return new g(e);case"ScanbotBinarizationFilter":return new w(e);case"CustomBinarizationFilter":return new b(e);case"ColorDocumentFilter":return new _(e);case"BrightnessFilter":return new E(e);case"ContrastFilter":return new k(e);case"GrayscaleFilter":return new M(e);case"WhiteBlackPointFilter":return new W(e);default:throw new Error(`Unknown child class name: ${t}`)}}}(y||(y={}));class g{constructor(e={}){this._type="LegacyFilter",this.filterType=0,void 0!==e.filterType&&(this.filterType=e.filterType)}}class w{constructor(e={}){this._type="ScanbotBinarizationFilter",this.outputMode="BINARY",void 0!==e.outputMode&&(this.outputMode=e.outputMode)}}class b{constructor(e={}){this._type="CustomBinarizationFilter",this.outputMode="BINARY",this.denoise=.5,this.radius=32,this.preset="PRESET_4",void 0!==e.outputMode&&(this.outputMode=e.outputMode),void 0!==e.denoise&&(this.denoise=e.denoise),void 0!==e.radius&&(this.radius=e.radius),void 0!==e.preset&&(this.preset=e.preset)}}class _{constructor(e={}){this._type="ColorDocumentFilter",this.contrastEnhancement=.5,this.colorEnhancement=.5,this.paperWhitening=1,this.paperWhiteningBias=0,void 0!==e.contrastEnhancement&&(this.contrastEnhancement=e.contrastEnhancement),void 0!==e.colorEnhancement&&(this.colorEnhancement=e.colorEnhancement),void 0!==e.paperWhitening&&(this.paperWhitening=e.paperWhitening),void 0!==e.paperWhiteningBias&&(this.paperWhiteningBias=e.paperWhiteningBias)}}class E{constructor(e={}){this._type="BrightnessFilter",this.brightness=0,void 0!==e.brightness&&(this.brightness=e.brightness)}}class k{constructor(e={}){this._type="ContrastFilter",this.contrast=0,void 0!==e.contrast&&(this.contrast=e.contrast)}}class M{constructor(e={}){this._type="GrayscaleFilter",this.borderWidthFraction=.06,this.blackOutliersFraction=0,this.whiteOutliersFraction=.02,void 0!==e.borderWidthFraction&&(this.borderWidthFraction=e.borderWidthFraction),void 0!==e.blackOutliersFraction&&(this.blackOutliersFraction=e.blackOutliersFraction),void 0!==e.whiteOutliersFraction&&(this.whiteOutliersFraction=e.whiteOutliersFraction)}}class W{constructor(e={}){this._type="WhiteBlackPointFilter",this.blackPoint=0,this.whitePoint=1,void 0!==e.blackPoint&&(this.blackPoint=e.blackPoint),void 0!==e.whitePoint&&(this.whitePoint=e.whitePoint)}}class T{constructor(e={}){this.author="Created with Scanbot SDK",this.creator="",this.title="",this.subject="",this.keywords="",void 0!==e.author&&(this.author=e.author),void 0!==e.creator&&(this.creator=e.creator),void 0!==e.title&&(this.title=e.title),void 0!==e.subject&&(this.subject=e.subject),void 0!==e.keywords&&(this.keywords=e.keywords)}}class C{constructor(e={}){this.attributes=new T({}),this.pageSize="A4",this.pageDirection="PORTRAIT",this.pageFit="FIT_IN",this.dpi=72,this.jpegQuality=80,this.resamplingMethod="NONE",this.binarizationFilter=null,void 0!==e.attributes&&(this.attributes=new T(e.attributes)),void 0!==e.pageSize&&(this.pageSize=e.pageSize),void 0!==e.pageDirection&&(this.pageDirection=e.pageDirection),void 0!==e.pageFit&&(this.pageFit=e.pageFit),void 0!==e.dpi&&(this.dpi=e.dpi),void 0!==e.jpegQuality&&(this.jpegQuality=e.jpegQuality),void 0!==e.resamplingMethod&&(this.resamplingMethod=e.resamplingMethod),void 0!==e.binarizationFilter&&(this.binarizationFilter=null!=e.binarizationFilter?y.from(e.binarizationFilter):null)}}var F;!function(e){e.from=function(e){const t=e._type;switch(t){case"UserFieldDoubleValue":return new S(e);case"UserFieldStringValue":return new P(e);case"UserFieldIntValue":return new j(e);default:throw new Error(`Unknown child class name: ${t}`)}}}(F||(F={}));class S{constructor(e={}){if(this._type="UserFieldDoubleValue",void 0===e.value)throw new Error("value must be present in constructor argument");this.value=e.value}}class P{constructor(e={}){if(this._type="UserFieldStringValue",void 0===e.value)throw new Error("value must be present in constructor argument");this.value=e.value}}class j{constructor(e={}){if(this._type="UserFieldIntValue",void 0===e.value)throw new Error("value must be present in constructor argument");this.value=e.value}}class ${constructor(e={}){if(void 0===e.tag)throw new Error("tag must be present in constructor argument");if(this.tag=e.tag,void 0===e.name)throw new Error("name must be present in constructor argument");if(this.name=e.name,void 0===e.value)throw new Error("value must be present in constructor argument");this.value=F.from(e.value)}}class A{constructor(e={}){this.compression="LZW",this.jpegQuality=80,this.zipCompressionLevel=6,this.dpi=72,this.userFields=[],this.binarizationFilter=null,void 0!==e.compression&&(this.compression=e.compression),void 0!==e.jpegQuality&&(this.jpegQuality=e.jpegQuality),void 0!==e.zipCompressionLevel&&(this.zipCompressionLevel=e.zipCompressionLevel),void 0!==e.dpi&&(this.dpi=e.dpi),void 0!==e.userFields&&(this.userFields=e.userFields.map((e=>new $(e)))),void 0!==e.binarizationFilter&&(this.binarizationFilter=null!=e.binarizationFilter?y.from(e.binarizationFilter):null)}}function D(e,t){const r=e[t];if(!r)throw new s(`You have initialized ScanbotSDK with "document-scanner" flavor but are trying to access a feature, "${t}", not available in this flavor.\nPlease make sure you've copied over the correct binaries and pointed the "enginePath" parameter to the correct flavor.\nFor more information see Web SDK initialization section on https://docs.scanbot.io`);return r}!function(e){e.defaultCompression="LZW",e.binaryDocumentOptimizedCompression="CCITT_T6"}(A||(A={}));var x=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};class R{constructor(e){this.getWasmModule=e,this.objectMap=new m}create(e){return x(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create(e);return t=v(t),this.objectMap.add(t)}))}parse(e,t){return x(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).parse(t);return r=v(r),r}))}destroy(e){return x(this,void 0,void 0,(function*(){this.objectMap.get(e).delete(),this.objectMap.delete(e)}))}getWasmComponent(){return D(this.getWasmModule(),"BarcodeDocumentParser")}}var I=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};class V{constructor(e){this.getWasmModule=e,this.objectMap=new m}create(e){return I(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create(e);return t=v(t),this.objectMap.add(t)}))}run(e,t){return I(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).run(t);return r=v(r),{result:r,originalImage:t}}))}clearFrameAccumulationCache(e){return I(this,void 0,void 0,(function*(){return this.objectMap.get(e).clearFrameAccumulationCache()}))}destroy(e){return I(this,void 0,void 0,(function*(){this.objectMap.get(e).delete(),this.objectMap.delete(e)}))}getWasmComponent(){return D(this.getWasmModule(),"BarcodeScanner")}}var Z=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};class O{constructor(e){this.getWasmModule=e,this.objectMap=new m}create(e){return Z(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create(e);return t=v(t),this.objectMap.add(t)}))}run(e,t){return Z(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).run(t);return r=v(r),{result:r,originalImage:t}}))}destroy(e){return Z(this,void 0,void 0,(function*(){this.objectMap.get(e).delete(),this.objectMap.delete(e)}))}getWasmComponent(){return D(this.getWasmModule(),"CheckScanner")}}var N=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};class z{constructor(e){this.getWasmModule=e,this.objectMap=new m}create(e){return N(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create(e);return t=v(t),this.objectMap.add(t)}))}run(e,t){return N(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).run(t);return r=v(r),{result:r,originalImage:t}}))}clearResult(e){return N(this,void 0,void 0,(function*(){return this.objectMap.get(e).clearResult()}))}destroy(e){return N(this,void 0,void 0,(function*(){this.objectMap.get(e).delete(),this.objectMap.delete(e)}))}getWasmComponent(){return D(this.getWasmModule(),"CreditCardScanner")}}var G=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};class U{constructor(e){this.getWasmModule=e,this.objectMap=new m}create(e){return G(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create(e);return t=v(t),this.objectMap.add(t)}))}run(e,t){return G(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).run(t);return r=v(r),{result:r,originalImage:t}}))}destroy(e){return G(this,void 0,void 0,(function*(){this.objectMap.get(e).delete(),this.objectMap.delete(e)}))}getWasmComponent(){return D(this.getWasmModule(),"DocumentClassifier")}}var L=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};class X{constructor(e){this.getWasmModule=e,this.objectMap=new m}create(e){return L(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create(e);return t=v(t),this.objectMap.add(t)}))}run(e,t){return L(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).run(t);return r=v(r),{result:r,originalImage:t}}))}clearResult(e){return L(this,void 0,void 0,(function*(){return this.objectMap.get(e).clearResult()}))}verifyDocument(e,t){return L(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).verifyDocument(t);return r=v(r),r}))}destroy(e){return L(this,void 0,void 0,(function*(){this.objectMap.get(e).delete(),this.objectMap.delete(e)}))}getWasmComponent(){return D(this.getWasmModule(),"DocumentDataExtractor")}}var Y=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};class B{constructor(e){this.getWasmModule=e,this.objectMap=new m}create(e){return Y(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create(e);return t=v(t),this.objectMap.add(t)}))}run(e,t){return Y(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).run(t);return r=v(r),{result:r,originalImage:t}}))}destroy(e){return Y(this,void 0,void 0,(function*(){this.objectMap.get(e).delete(),this.objectMap.delete(e)}))}getWasmComponent(){return D(this.getWasmModule(),"DocumentQualityAnalyzer")}}var H=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};class K{constructor(e){this.getWasmModule=e,this.objectMap=new m}create(e){return H(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create(e);return t=v(t),this.objectMap.add(t)}))}run(e,t){return H(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).run(t);return r=v(r),{result:r,originalImage:t}}))}scan(e,t){return H(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).scan(t);return r=v(r),{result:r,originalImage:t}}))}clearResult(e){return H(this,void 0,void 0,(function*(){return this.objectMap.get(e).clearResult()}))}destroy(e){return H(this,void 0,void 0,(function*(){this.objectMap.get(e).delete(),this.objectMap.delete(e)}))}getWasmComponent(){return D(this.getWasmModule(),"DocumentScanner")}}var J=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};class Q{constructor(e){this.getWasmModule=e,this.objectMap=new m}create(){return J(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create();return this.objectMap.add(e)}))}cropRect(e,t,r){return J(this,void 0,void 0,(function*(){let n=this.objectMap.get(e).cropRect(t,r);return n=v(n),{result:n,originalImage:t}}))}rotate(e,t,r){return J(this,void 0,void 0,(function*(){let n=this.objectMap.get(e).rotate(t,r);return n=v(n),{result:n,originalImage:t}}))}flip(e,t,r){return J(this,void 0,void 0,(function*(){let n=this.objectMap.get(e).flip(t,r);return n=v(n),{result:n,originalImage:t}}))}resize(e,t,r){return J(this,void 0,void 0,(function*(){let n=this.objectMap.get(e).resize(t,r);return n=v(n),{result:n,originalImage:t}}))}destroy(e){return J(this,void 0,void 0,(function*(){this.objectMap.get(e).delete(),this.objectMap.delete(e)}))}getWasmComponent(){return D(this.getWasmModule(),"ImageManipulator")}}var q=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};class ee{constructor(e){this.getWasmModule=e,this.objectMap=new m}create(){return q(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create();return this.objectMap.add(e)}))}crop(e,t,r){return q(this,void 0,void 0,(function*(){let n=this.objectMap.get(e).crop(t,r);return n=v(n),{result:n,originalImage:t}}))}resize(e,t,r){return q(this,void 0,void 0,(function*(){let n=this.objectMap.get(e).resize(t,r);return n=v(n),{result:n,originalImage:t}}))}rotate(e,t,r){return q(this,void 0,void 0,(function*(){let n=this.objectMap.get(e).rotate(t,r);return n=v(n),{result:n,originalImage:t}}))}applyFilter(e,t,r){return q(this,void 0,void 0,(function*(){let n=this.objectMap.get(e).applyFilter(t,r);return n=v(n),{result:n,originalImage:t}}))}destroy(e){return q(this,void 0,void 0,(function*(){this.objectMap.get(e).delete(),this.objectMap.delete(e)}))}getWasmComponent(){return D(this.getWasmModule(),"ImageProcessor")}}var te=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};class re{constructor(e){this.getWasmModule=e,this.objectMap=new m}create(e){return te(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create(e);return t=v(t),this.objectMap.add(t)}))}run(e,t){return te(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).run(t);return r=v(r),{result:r,originalImage:t}}))}clearResult(e){return te(this,void 0,void 0,(function*(){return this.objectMap.get(e).clearResult()}))}destroy(e){return te(this,void 0,void 0,(function*(){this.objectMap.get(e).delete(),this.objectMap.delete(e)}))}getWasmComponent(){return D(this.getWasmModule(),"MrzScanner")}}class ne{constructor(e){this.getWasmModule=e,this.objectMap=new m}create(e){return te(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create(e);return t=v(t),this.objectMap.add(t)}))}parse(e,t){return te(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).parse(t);return r=v(r),r}))}destroy(e){return te(this,void 0,void 0,(function*(){this.objectMap.get(e).delete(),this.objectMap.delete(e)}))}getWasmComponent(){return D(this.getWasmModule(),"MrzParser")}}var oe=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};class ae{constructor(e){this.getWasmModule=e,this.objectMap=new m}create(){return oe(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create();return e=v(e),this.objectMap.add(e)}))}run(e,t){return oe(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).run(t);return r=v(r),{result:r,originalImage:t}}))}destroy(e){return oe(this,void 0,void 0,(function*(){this.objectMap.get(e).delete(),this.objectMap.delete(e)}))}getWasmComponent(){return D(this.getWasmModule(),"OcrEngine")}}var ie=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};class se{constructor(e){this.getWasmModule=e,this.objectMap=new m}create(e){return ie(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create(e);return t=v(t),this.objectMap.add(t)}))}run(e,t){return ie(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).run(t);return r=v(r),{result:r,originalImage:t}}))}cleanRecognitionQueue(e){return ie(this,void 0,void 0,(function*(){return this.objectMap.get(e).cleanRecognitionQueue()}))}destroy(e){return ie(this,void 0,void 0,(function*(){this.objectMap.get(e).delete(),this.objectMap.delete(e)}))}getWasmComponent(){return D(this.getWasmModule(),"TextPatternScanner")}}var ue=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};class ce{constructor(e){this.getWasmModule=e,this.objectMap=new m}create(e){return ue(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create(e);return t=v(t),this.objectMap.add(t)}))}run(e,t){return ue(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).run(t);return r=v(r),{result:r,originalImage:t}}))}cleanRecognitionQueue(e){return ue(this,void 0,void 0,(function*(){return this.objectMap.get(e).cleanRecognitionQueue()}))}destroy(e){return ue(this,void 0,void 0,(function*(){this.objectMap.get(e).delete(),this.objectMap.delete(e)}))}getWasmComponent(){return D(this.getWasmModule(),"VinScanner")}}var le=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};let de;class he extends Error{}const fe={};function pe(e){const t=Math.random().toString(36);return fe[t]=e,new p(t)}function me(e){if(!fe.hasOwnProperty(e.id))throw new Error(`Object ${e.id} does not exist`);return fe[e.id]}function ve(e){const t=me(e);t.delete&&t.delete(),delete fe[e.id]}const ye=Object.assign(Object.assign({initialize:function(t,n,o,a){return le(this,void 0,void 0,(function*(){try{const{captureConsole:i,requestSuffix:s=""}=a||{};i&&(console.log=function(...e){self.postMessage({log:e})},console.error=function(...e){self.postMessage({logError:e})});const u=r(709),c=r(290),l={locateFile:function(e,t){let r;return r=function(e){return e.startsWith("http:")||e.startsWith("https:")}(n)?n:"",e.endsWith(".worker.js")&&c?c.default:new URL(r+e+s,location.href).href}},d=e(a),h=d.includes("-threads");l.mainScriptUrlOrBlob=l.locateFile(`ScanbotSDK.Asm${d}.js`);let f;if(!!navigator.userAgentData&&navigator.userAgentData.brands.some((e=>"Chromium"===e.brand))&&h){let e=[2147483648,805306368,536870912],t=134217728;const r=67108864;["barcode-scanner"].includes("document-scanner")&&(t=r,e.push(4*r));for(let r=0;r<e.length;r++){const n=e[r];try{f=new WebAssembly.Memory({initial:0,maximum:n/65536,shared:!0}),f.grow(t/65536);break}catch(t){if(r===e.length-1)throw t}}}return f&&(l.wasmMemory=f),l.onAbort=function(e){const t="\nNo further calls to the SDK are possible.";throw new he("OOM"===e?"ScanbotSDK ran out of memory. "+t:"ScanbotSDK ran into an unexpected error: "+e+t)},yield u(l),de=l,v(de.initialize(t||"",o))}catch(e){throw console.error(e),e}}))},getLicenseInfo:function(){return le(this,void 0,void 0,(function*(){return v(de.getLicenseInfo())}))},encodeJpeg:function(e,t=80){return le(this,void 0,void 0,(function*(){return v(de.encodeJpeg(e,t))}))},beginPdf:function(e){return le(this,void 0,void 0,(function*(){return pe(v(D(de,"PdfGenerationContext").create(new C(e))))}))},addPageToPdf:function(e,t,r="ENABLED_IF_BINARIZATION_FILTER_SET"){return le(this,void 0,void 0,(function*(){v(me(e).addPage(t,r))}))},addPageToPdfWithOcr:function(e,t,r="ENABLED_IF_BINARIZATION_FILTER_SET"){return le(this,void 0,void 0,(function*(){v(me(e).addPageWithOcr(t,r))}))},completePdf:function(e){return le(this,void 0,void 0,(function*(){try{const t=me(e);return v(t.complete())}finally{ve(e)}}))},beginTiff:function(e){return le(this,void 0,void 0,(function*(){const t=v(D(de,"TiffGenerationContext").create(new A(e)));return v(t.begin()),pe(t)}))},addPageToTiff:function(e,t,r){return le(this,void 0,void 0,(function*(){v(me(e).addPage(t,r))}))},completeTiff:function(e){return le(this,void 0,void 0,(function*(){try{const t=me(e);return v(t.complete())}finally{ve(e)}}))},releaseObject:function(e){return le(this,void 0,void 0,(function*(){ve(e)}))},version:function(){return le(this,void 0,void 0,(function*(){return"8.1.0-alpha.1"}))}},{BarcodeDocumentParser:new R(ge=()=>de),BarcodeScanner:new V(ge),CheckScanner:new O(ge),CreditCardScanner:new z(ge),DocumentClassifier:new U(ge),DocumentDataExtractor:new X(ge),DocumentQualityAnalyzer:new B(ge),DocumentScanner:new K(ge),ImageManipulator:new Q(ge),ImageProcessor:new ee(ge),MrzScanner:new re(ge),MrzParser:new ne(ge),OcrEngine:new ae(ge),TextPatternScanner:new se(ge),VinScanner:new ce(ge)}),{__hasModuleFunction:function(e){return le(this,void 0,void 0,(function*(){return de.hasOwnProperty(e)}))},__callModuleFunction:function(e,t=[]){return le(this,void 0,void 0,(function*(){return de[e](...t)}))}});var ge;onmessage=function(e){const{command:t,args:r,ticket:n}=e.data;if(!de&&"initialize"!==t)return void self.postMessage({ticket:n,recoverableError:new Error("WASM module not loaded yet.")});let o;o=t.includes(".")?ye[t.split(".")[0]][t.split(".")[1]](...r):ye[t](...r),(()=>le(this,void 0,void 0,(function*(){return yield o})))().then((e=>{const t=function(e,t=!1){const r=[];return t||function e(t){if(t)if(t.constructor===ImageData)r.push(t.data.buffer);else if(t.constructor===ArrayBuffer)r.push(t);else if(ArrayBuffer.isView(t))r.push(t.buffer);else if(Array.isArray(t))for(let r=0;r<t.length;++r)e(t[r]);else if("object"==typeof t)for(const r in t)t.hasOwnProperty(r)&&e(t[r])}(e),r}(e);self.postMessage({ticket:n,result:e},t)})).catch((e=>{if(e instanceof he)self.postMessage({ticket:n,unrecoverableError:e});else{const t="number"==typeof e?Error(de.stringFromException(e)):e;console.error(t),self.postMessage({ticket:n,recoverableError:t,errorType:null==t?void 0:t.errorType})}}))}})()})();
1
+ (()=>{var e={290:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});const n="data:application/javascript;charset=utf-8;base64,InVzZSBzdHJpY3QiO3ZhciBNb2R1bGU9e307dmFyIGluaXRpYWxpemVkSlM9ZmFsc2U7ZnVuY3Rpb24gdGhyZWFkUHJpbnRFcnIoKXt2YXIgdGV4dD1BcnJheS5wcm90b3R5cGUuc2xpY2UuY2FsbChhcmd1bWVudHMpLmpvaW4oIiAiKTtjb25zb2xlLmVycm9yKHRleHQpfWZ1bmN0aW9uIHRocmVhZEFsZXJ0KCl7dmFyIHRleHQ9QXJyYXkucHJvdG90eXBlLnNsaWNlLmNhbGwoYXJndW1lbnRzKS5qb2luKCIgIik7cG9zdE1lc3NhZ2Uoe2NtZDoiYWxlcnQiLHRleHQ6dGV4dCx0aHJlYWRJZDpNb2R1bGVbIl9wdGhyZWFkX3NlbGYiXSgpfSl9dmFyIGVycj10aHJlYWRQcmludEVycjtzZWxmLmFsZXJ0PXRocmVhZEFsZXJ0O01vZHVsZVsiaW5zdGFudGlhdGVXYXNtIl09KGluZm8scmVjZWl2ZUluc3RhbmNlKT0+e3ZhciBtb2R1bGU9TW9kdWxlWyJ3YXNtTW9kdWxlIl07TW9kdWxlWyJ3YXNtTW9kdWxlIl09bnVsbDt2YXIgaW5zdGFuY2U9bmV3IFdlYkFzc2VtYmx5Lkluc3RhbmNlKG1vZHVsZSxpbmZvKTtyZXR1cm4gcmVjZWl2ZUluc3RhbmNlKGluc3RhbmNlKX07c2VsZi5vbnVuaGFuZGxlZHJlamVjdGlvbj1lPT57dGhyb3cgZS5yZWFzb258fGV9O2Z1bmN0aW9uIGhhbmRsZU1lc3NhZ2UoZSl7dHJ5e2lmKGUuZGF0YS5jbWQ9PT0ibG9hZCIpe2xldCBtZXNzYWdlUXVldWU9W107c2VsZi5vbm1lc3NhZ2U9ZT0+bWVzc2FnZVF1ZXVlLnB1c2goZSk7c2VsZi5zdGFydFdvcmtlcj1pbnN0YW5jZT0+e01vZHVsZT1pbnN0YW5jZTtwb3N0TWVzc2FnZSh7ImNtZCI6ImxvYWRlZCJ9KTtmb3IobGV0IG1zZyBvZiBtZXNzYWdlUXVldWUpe2hhbmRsZU1lc3NhZ2UobXNnKX1zZWxmLm9ubWVzc2FnZT1oYW5kbGVNZXNzYWdlfTtNb2R1bGVbIndhc21Nb2R1bGUiXT1lLmRhdGEud2FzbU1vZHVsZTtmb3IoY29uc3QgaGFuZGxlciBvZiBlLmRhdGEuaGFuZGxlcnMpe01vZHVsZVtoYW5kbGVyXT0oLi4uYXJncyk9Pntwb3N0TWVzc2FnZSh7Y21kOiJjYWxsSGFuZGxlciIsaGFuZGxlcjpoYW5kbGVyLGFyZ3M6YXJnc30pfX1Nb2R1bGVbIndhc21NZW1vcnkiXT1lLmRhdGEud2FzbU1lbW9yeTtNb2R1bGVbImJ1ZmZlciJdPU1vZHVsZVsid2FzbU1lbW9yeSJdLmJ1ZmZlcjtNb2R1bGVbIkVOVklST05NRU5UX0lTX1BUSFJFQUQiXT10cnVlO2lmKHR5cGVvZiBlLmRhdGEudXJsT3JCbG9iPT0ic3RyaW5nIil7aW1wb3J0U2NyaXB0cyhlLmRhdGEudXJsT3JCbG9iKX1lbHNle3ZhciBvYmplY3RVcmw9VVJMLmNyZWF0ZU9iamVjdFVSTChlLmRhdGEudXJsT3JCbG9iKTtpbXBvcnRTY3JpcHRzKG9iamVjdFVybCk7VVJMLnJldm9rZU9iamVjdFVSTChvYmplY3RVcmwpfWluaXRNb2R1bGUoTW9kdWxlKX1lbHNlIGlmKGUuZGF0YS5jbWQ9PT0icnVuIil7TW9kdWxlWyJfX2Vtc2NyaXB0ZW5fdGhyZWFkX2luaXQiXShlLmRhdGEucHRocmVhZF9wdHIsMCwwLDEpO01vZHVsZVsiX19lbXNjcmlwdGVuX3RocmVhZF9tYWlsYm94X2F3YWl0Il0oZS5kYXRhLnB0aHJlYWRfcHRyKTtNb2R1bGVbImVzdGFibGlzaFN0YWNrU3BhY2UiXSgpO01vZHVsZVsiUFRocmVhZCJdLnJlY2VpdmVPYmplY3RUcmFuc2ZlcihlLmRhdGEpO01vZHVsZVsiUFRocmVhZCJdLnRocmVhZEluaXRUTFMoKTtpZighaW5pdGlhbGl6ZWRKUyl7TW9kdWxlWyJfX2VtYmluZF9pbml0aWFsaXplX2JpbmRpbmdzIl0oKTtpbml0aWFsaXplZEpTPXRydWV9dHJ5e01vZHVsZVsiaW52b2tlRW50cnlQb2ludCJdKGUuZGF0YS5zdGFydF9yb3V0aW5lLGUuZGF0YS5hcmcpfWNhdGNoKGV4KXtpZihleCE9InVud2luZCIpe3Rocm93IGV4fX19ZWxzZSBpZihlLmRhdGEuY21kPT09ImNhbmNlbCIpe2lmKE1vZHVsZVsiX3B0aHJlYWRfc2VsZiJdKCkpe01vZHVsZVsiX19lbXNjcmlwdGVuX3RocmVhZF9leGl0Il0oLTEpfX1lbHNlIGlmKGUuZGF0YS50YXJnZXQ9PT0ic2V0aW1tZWRpYXRlIil7fWVsc2UgaWYoZS5kYXRhLmNtZD09PSJjaGVja01haWxib3giKXtpZihpbml0aWFsaXplZEpTKXtNb2R1bGVbImNoZWNrTWFpbGJveCJdKCl9fWVsc2UgaWYoZS5kYXRhLmNtZCl7ZXJyKGB3b3JrZXIuanMgcmVjZWl2ZWQgdW5rbm93biBjb21tYW5kICR7ZS5kYXRhLmNtZH1gKTtlcnIoZS5kYXRhKX19Y2F0Y2goZXgpe2lmKE1vZHVsZVsiX19lbXNjcmlwdGVuX3RocmVhZF9jcmFzaGVkIl0pe01vZHVsZVsiX19lbXNjcmlwdGVuX3RocmVhZF9jcmFzaGVkIl0oKX10aHJvdyBleH19c2VsZi5vbm1lc3NhZ2U9aGFuZGxlTWVzc2FnZTsK"},709:(e,t,r)=>{var n,o=(n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(e={}){function t(){return T.buffer!=S.buffer&&O(),S}function o(){return T.buffer!=S.buffer&&O(),P}function a(){return T.buffer!=S.buffer&&O(),$}function i(){return T.buffer!=S.buffer&&O(),j}function s(){return T.buffer!=S.buffer&&O(),D}function u(){return T.buffer!=S.buffer&&O(),A}function c(){return T.buffer!=S.buffer&&O(),R}var l,d,h=e;h.ready=new Promise(((e,t)=>{l=e,d=t}));var f,p,m,v=Object.assign({},h),y="./this.program",g=(e,t)=>{throw t},w=h.ENVIRONMENT_IS_PTHREAD||!1,b="";function E(e){return h.locateFile?h.locateFile(e,b):b+e}b=self.location.href,n&&(b=n),b=0!==b.indexOf("blob:")?b.substr(0,b.replace(/[?#].*/,"").lastIndexOf("/")+1):"",f=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},m=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)},p=(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 _,k=h.print||console.log.bind(console),W=h.printErr||console.error.bind(console);Object.assign(h,v),v=null,h.arguments&&h.arguments,h.thisProgram&&(y=h.thisProgram),h.quit&&(g=h.quit),h.wasmBinary&&(_=h.wasmBinary);var T,C,M=h.noExitRuntime||!0;"object"!=typeof WebAssembly&&ne("no native wasm support detected");var F,S,P,$,j,D,A,x,R,I=!1;function V(e,t){e||ne(t)}function O(){var e=T.buffer;h.HEAP8=S=new Int8Array(e),h.HEAP16=$=new Int16Array(e),h.HEAPU8=P=new Uint8Array(e),h.HEAPU16=j=new Uint16Array(e),h.HEAP32=D=new Int32Array(e),h.HEAPU32=A=new Uint32Array(e),h.HEAPF32=x=new Float32Array(e),h.HEAPF64=R=new Float64Array(e)}var Z,N=h.INITIAL_MEMORY||134217728;if(V(N>=4194304,"INITIAL_MEMORY should be larger than STACK_SIZE, was "+N+"! (STACK_SIZE=4194304)"),w)T=h.wasmMemory;else if(h.wasmMemory)T=h.wasmMemory;else if(!((T=new WebAssembly.Memory({initial:N/65536,maximum:32768,shared:!0})).buffer instanceof SharedArrayBuffer))throw W("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),Error("bad memory");O(),N=T.buffer.byteLength;var z=[],U=[],G=[],L=0;function B(){return M||L>0}function H(){w||(h.noFSInit||Ce.init.initialized||Ce.init(),Ce.ignorePermissions=!1,Ee.init(),De(U))}function Y(e){z.unshift(e)}var X,J,K,Q=0,q=null,ee=null;function te(e){Q++,h.monitorRunDependencies&&h.monitorRunDependencies(Q)}function re(e){if(Q--,h.monitorRunDependencies&&h.monitorRunDependencies(Q),0==Q&&(null!==q&&(clearInterval(q),q=null),ee)){var t=ee;ee=null,t()}}function ne(e){h.onAbort&&h.onAbort(e),W(e="Aborted("+e+")"),I=!0,F=1,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw d(t),t}function oe(e){return e.startsWith("data:application/octet-stream;base64,")}function ae(e){if(e==X&&_)return new Uint8Array(_);if(m)return m(e);throw"both async and sync fetching of the wasm failed"}function ie(e,t,r){return function(e){return _||"function"!=typeof fetch?Promise.resolve().then((()=>ae(e))):fetch(e,{credentials:"same-origin"}).then((t=>{if(!t.ok)throw"failed to load wasm binary file at '"+e+"'";return t.arrayBuffer()})).catch((()=>ae(e)))}(e).then((e=>WebAssembly.instantiate(e,t))).then((e=>e)).then(r,(e=>{W(`failed to asynchronously prepare wasm: ${e}`),ne(e)}))}oe(X="ScanbotSDK.Asm-simd-threads.wasm")||(X=E(X));var se={1472444:e=>hn(function(){return this[Me(e)].toString()}.apply(function(){return this}.call(void 0)))};function ue(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var ce=e=>{e.terminate(),e.onmessage=e=>{}},le=e=>{var t=je.pthreads[e];V(t),je.returnWorkerToPool(t)},de=e=>{var t=je.getNewWorker();if(!t)return 6;je.runningWorkers.push(t),je.pthreads[e.pthread_ptr]=t,t.pthread_ptr=e.pthread_ptr;var r={cmd:"run",start_routine:e.startRoutine,arg:e.arg,pthread_ptr:e.pthread_ptr};return t.postMessage(r,e.transferList),0},he={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,t)=>{for(var r=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:e=>{var t=he.isAbs(e),r="/"===e.substr(-1);return(e=he.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=he.splitPath(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:e=>{if("/"===e)return"/";var t=(e=(e=he.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments);return he.normalize(e.join("/"))},join2:(e,t)=>he.normalize(e+"/"+t)},fe=e=>(fe=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>(e.set(crypto.getRandomValues(new Uint8Array(e.byteLength))),e);ne("initRandomDevice")})())(e),pe={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:Ce.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,t=he.isAbs(n)}return(t?"/":"")+(e=he.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||"."},relative:(e,t)=>{function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=pe.resolve(e).substr(1),t=pe.resolve(t).substr(1);for(var n=r(e.split("/")),o=r(t.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s<a;s++)if(n[s]!==o[s]){i=s;break}var u=[];for(s=i;s<n.length;s++)u.push("..");return(u=u.concat(o.slice(i))).join("/")}},me="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,ve=(e,t,r)=>{for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.buffer&&me)return me.decode(e.buffer instanceof SharedArrayBuffer?e.slice(t,o):e.subarray(t,o));for(var a="";t<o;){var i=e[t++];if(128&i){var s=63&e[t++];if(192!=(224&i)){var u=63&e[t++];if((i=224==(240&i)?(15&i)<<12|s<<6|u:(7&i)<<18|s<<12|u<<6|63&e[t++])<65536)a+=String.fromCharCode(i);else{var c=i-65536;a+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a},ye=[],ge=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},we=(e,t,r,n)=>{if(!(n>0))return 0;for(var o=r,a=r+n-1,i=0;i<e.length;++i){var s=e.charCodeAt(i);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++i)),s<=127){if(r>=a)break;t[r++]=s}else if(s<=2047){if(r+1>=a)break;t[r++]=192|s>>6,t[r++]=128|63&s}else if(s<=65535){if(r+2>=a)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|63&s}else{if(r+3>=a)break;t[r++]=240|s>>18,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}}return t[r]=0,r-o};function be(e,t,r){var n=r>0?r:ge(e)+1,o=new Array(n),a=we(e,o,0,o.length);return t&&(o.length=a),o}var Ee={ttys:[],init(){},shutdown(){},register(e,t){Ee.ttys[e]={input:[],output:[],ops:t},Ce.registerDevice(e,Ee.stream_ops)},stream_ops:{open(e){var t=Ee.ttys[e.node.rdev];if(!t)throw new Ce.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 Ce.ErrnoError(60);for(var a=0,i=0;i<n;i++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new Ce.ErrnoError(29)}if(void 0===s&&0===a)throw new Ce.ErrnoError(6);if(null==s)break;a++,t[r+i]=s}return a&&(e.node.timestamp=Date.now()),a},write(e,t,r,n,o){if(!e.tty||!e.tty.ops.put_char)throw new Ce.ErrnoError(60);try{for(var a=0;a<n;a++)e.tty.ops.put_char(e.tty,t[r+a])}catch(e){throw new Ce.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),a}},default_tty_ops:{get_char:e=>(()=>{if(!ye.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;ye=be(e,!0)}return ye.shift()})(),put_char(e,t){null===t||10===t?(k(ve(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(k(ve(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?(W(ve(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(W(ve(e.output,0)),e.output=[])}}},_e=e=>{e=((e,t)=>Math.ceil(e/t)*t)(e,65536);var t=Fn(65536,e);return t?((e,t)=>(o().fill(0,e,e+t),e))(t,e):0},ke={ops_table:null,mount:e=>ke.createNode(null,"/",16895,0),createNode(e,t,r,n){if(Ce.isBlkdev(r)||Ce.isFIFO(r))throw new Ce.ErrnoError(63);ke.ops_table||(ke.ops_table={dir:{node:{getattr:ke.node_ops.getattr,setattr:ke.node_ops.setattr,lookup:ke.node_ops.lookup,mknod:ke.node_ops.mknod,rename:ke.node_ops.rename,unlink:ke.node_ops.unlink,rmdir:ke.node_ops.rmdir,readdir:ke.node_ops.readdir,symlink:ke.node_ops.symlink},stream:{llseek:ke.stream_ops.llseek}},file:{node:{getattr:ke.node_ops.getattr,setattr:ke.node_ops.setattr},stream:{llseek:ke.stream_ops.llseek,read:ke.stream_ops.read,write:ke.stream_ops.write,allocate:ke.stream_ops.allocate,mmap:ke.stream_ops.mmap,msync:ke.stream_ops.msync}},link:{node:{getattr:ke.node_ops.getattr,setattr:ke.node_ops.setattr,readlink:ke.node_ops.readlink},stream:{}},chrdev:{node:{getattr:ke.node_ops.getattr,setattr:ke.node_ops.setattr},stream:Ce.chrdev_stream_ops}});var o=Ce.createNode(e,t,r,n);return Ce.isDir(o.mode)?(o.node_ops=ke.ops_table.dir.node,o.stream_ops=ke.ops_table.dir.stream,o.contents={}):Ce.isFile(o.mode)?(o.node_ops=ke.ops_table.file.node,o.stream_ops=ke.ops_table.file.stream,o.usedBytes=0,o.contents=null):Ce.isLink(o.mode)?(o.node_ops=ke.ops_table.link.node,o.stream_ops=ke.ops_table.link.stream):Ce.isChrdev(o.mode)&&(o.node_ops=ke.ops_table.chrdev.node,o.stream_ops=ke.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[t]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:e=>e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0),expandFileStorage(e,t){var r=e.contents?e.contents.length:0;if(!(r>=t)){t=Math.max(t,r*(r<1048576?2:1.125)>>>0),0!=r&&(t=Math.max(t,256));var n=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,t){if(e.usedBytes!=t)if(0==t)e.contents=null,e.usedBytes=0;else{var r=e.contents;e.contents=new Uint8Array(t),r&&e.contents.set(r.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr(e){var t={};return t.dev=Ce.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,Ce.isDir(e.mode)?t.size=4096:Ce.isFile(e.mode)?t.size=e.usedBytes:Ce.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&ke.resizeFileStorage(e,t.size)},lookup(e,t){throw Ce.genericErrors[44]},mknod:(e,t,r,n)=>ke.createNode(e,t,r,n),rename(e,t,r){if(Ce.isDir(e.mode)){var n;try{n=Ce.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new Ce.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=Ce.lookupNode(e,t);for(var n in r.contents)throw new Ce.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir(e){var t=[".",".."];for(var r in e.contents)e.contents.hasOwnProperty(r)&&t.push(r);return t},symlink(e,t,r){var n=ke.createNode(e,t,41471,0);return n.link=r,n},readlink(e){if(!Ce.isLink(e.mode))throw new Ce.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 i=Math.min(e.node.usedBytes-o,n);if(i>8&&a.subarray)t.set(a.subarray(o,o+i),r);else for(var s=0;s<i;s++)t[r+s]=a[o+s];return i},write(e,r,n,o,a,i){if(r.buffer===t().buffer&&(i=!1),!o)return 0;var s=e.node;if(s.timestamp=Date.now(),r.subarray&&(!s.contents||s.contents.subarray)){if(i)return s.contents=r.subarray(n,n+o),s.usedBytes=o,o;if(0===s.usedBytes&&0===a)return s.contents=r.slice(n,n+o),s.usedBytes=o,o;if(a+o<=s.usedBytes)return s.contents.set(r.subarray(n,n+o),a),o}if(ke.expandFileStorage(s,a+o),s.contents.subarray&&r.subarray)s.contents.set(r.subarray(n,n+o),a);else for(var u=0;u<o;u++)s.contents[a+u]=r[n+u];return s.usedBytes=Math.max(s.usedBytes,a+o),o},llseek(e,t,r){var n=t;if(1===r?n+=e.position:2===r&&Ce.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new Ce.ErrnoError(28);return n},allocate(e,t,r){ke.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap(e,r,n,o,a){if(!Ce.isFile(e.node.mode))throw new Ce.ErrnoError(43);var i,s,u=e.node.contents;if(2&a||u.buffer!==t().buffer){if((n>0||n+r<u.length)&&(u=u.subarray?u.subarray(n,n+r):Array.prototype.slice.call(u,n,n+r)),s=!0,!(i=_e(r)))throw new Ce.ErrnoError(48);t().set(u,i)}else s=!1,i=u.byteOffset;return{ptr:i,allocated:s}},msync:(e,t,r,n,o)=>(ke.stream_ops.write(e,t,0,n,r,!1),0)}},We=h.preloadPlugins||[],Te=(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},Ce={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=pe.resolve(e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new Ce.ErrnoError(32);for(var r=e.split("/").filter((e=>!!e)),n=Ce.root,o="/",a=0;a<r.length;a++){var i=a===r.length-1;if(i&&t.parent)break;if(n=Ce.lookupNode(n,r[a]),o=he.join2(o,r[a]),Ce.isMountpoint(n)&&(!i||i&&t.follow_mount)&&(n=n.mounted.root),!i||t.follow)for(var s=0;Ce.isLink(n.mode);){var u=Ce.readlink(o);if(o=pe.resolve(he.dirname(o),u),n=Ce.lookupPath(o,{recurse_count:t.recurse_count+1}).node,s++>40)throw new Ce.ErrnoError(32)}}return{path:o,node:n}},getPath(e){for(var t;;){if(Ce.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)%Ce.nameTable.length},hashAddNode(e){var t=Ce.hashName(e.parent.id,e.name);e.name_next=Ce.nameTable[t],Ce.nameTable[t]=e},hashRemoveNode(e){var t=Ce.hashName(e.parent.id,e.name);if(Ce.nameTable[t]===e)Ce.nameTable[t]=e.name_next;else for(var r=Ce.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode(e,t){var r=Ce.mayLookup(e);if(r)throw new Ce.ErrnoError(r,e);for(var n=Ce.hashName(e.id,t),o=Ce.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===e.id&&a===t)return o}return Ce.lookup(e,t)},createNode(e,t,r,n){var o=new Ce.FSNode(e,t,r,n);return Ce.hashAddNode(o),o},destroyNode(e){Ce.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>49152==(49152&e),flagsToPermissionString(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:(e,t)=>Ce.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=Ce.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate(e,t){try{return Ce.lookupNode(e,t),20}catch(e){}return Ce.nodePermissions(e,"wx")},mayDelete(e,t,r){var n;try{n=Ce.lookupNode(e,t)}catch(e){return e.errno}var o=Ce.nodePermissions(e,"wx");if(o)return o;if(r){if(!Ce.isDir(n.mode))return 54;if(Ce.isRoot(n)||Ce.getPath(n)===Ce.cwd())return 10}else if(Ce.isDir(n.mode))return 31;return 0},mayOpen:(e,t)=>e?Ce.isLink(e.mode)?32:Ce.isDir(e.mode)&&("r"!==Ce.flagsToPermissionString(t)||512&t)?31:Ce.nodePermissions(e,Ce.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=Ce.MAX_OPEN_FDS;e++)if(!Ce.streams[e])return e;throw new Ce.ErrnoError(33)},getStreamChecked(e){var t=Ce.getStream(e);if(!t)throw new Ce.ErrnoError(8);return t},getStream:e=>Ce.streams[e],createStream:(e,t=-1)=>(Ce.FSStream||(Ce.FSStream=function(){this.shared={}},Ce.FSStream.prototype={},Object.defineProperties(Ce.FSStream.prototype,{object:{get(){return this.node},set(e){this.node=e}},isRead:{get(){return 1!=(2097155&this.flags)}},isWrite:{get(){return 0!=(2097155&this.flags)}},isAppend:{get(){return 1024&this.flags}},flags:{get(){return this.shared.flags},set(e){this.shared.flags=e}},position:{get(){return this.shared.position},set(e){this.shared.position=e}}})),e=Object.assign(new Ce.FSStream,e),-1==t&&(t=Ce.nextfd()),e.fd=t,Ce.streams[t]=e,e),closeStream(e){Ce.streams[e]=null},chrdev_stream_ops:{open(e){var t=Ce.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek(){throw new Ce.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice(e,t){Ce.devices[e]={stream_ops:t}},getDevice:e=>Ce.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),Ce.syncFSRequests++,Ce.syncFSRequests>1&&W(`warning: ${Ce.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var r=Ce.getMounts(Ce.root.mount),n=0;function o(e){return Ce.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&&Ce.root)throw new Ce.ErrnoError(10);if(!o&&!a){var i=Ce.lookupPath(r,{follow_mount:!1});if(r=i.path,n=i.node,Ce.isMountpoint(n))throw new Ce.ErrnoError(10);if(!Ce.isDir(n.mode))throw new Ce.ErrnoError(54)}var s={type:e,opts:t,mountpoint:r,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,o?Ce.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount(e){var t=Ce.lookupPath(e,{follow_mount:!1});if(!Ce.isMountpoint(t.node))throw new Ce.ErrnoError(28);var r=t.node,n=r.mounted,o=Ce.getMounts(n);Object.keys(Ce.nameTable).forEach((e=>{for(var t=Ce.nameTable[e];t;){var r=t.name_next;o.includes(t.mount)&&Ce.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=Ce.lookupPath(e,{parent:!0}).node,o=he.basename(e);if(!o||"."===o||".."===o)throw new Ce.ErrnoError(28);var a=Ce.mayCreate(n,o);if(a)throw new Ce.ErrnoError(a);if(!n.node_ops.mknod)throw new Ce.ErrnoError(63);return n.node_ops.mknod(n,o,t,r)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,Ce.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,Ce.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{Ce.mkdir(n,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,r)=>("undefined"==typeof r&&(r=t,t=438),t|=8192,Ce.mknod(e,t,r)),symlink(e,t){if(!pe.resolve(e))throw new Ce.ErrnoError(44);var r=Ce.lookupPath(t,{parent:!0}).node;if(!r)throw new Ce.ErrnoError(44);var n=he.basename(t),o=Ce.mayCreate(r,n);if(o)throw new Ce.ErrnoError(o);if(!r.node_ops.symlink)throw new Ce.ErrnoError(63);return r.node_ops.symlink(r,n,e)},rename(e,t){var r,n,o=he.dirname(e),a=he.dirname(t),i=he.basename(e),s=he.basename(t);if(r=Ce.lookupPath(e,{parent:!0}).node,n=Ce.lookupPath(t,{parent:!0}).node,!r||!n)throw new Ce.ErrnoError(44);if(r.mount!==n.mount)throw new Ce.ErrnoError(75);var u,c=Ce.lookupNode(r,i),l=pe.relative(e,a);if("."!==l.charAt(0))throw new Ce.ErrnoError(28);if("."!==(l=pe.relative(t,o)).charAt(0))throw new Ce.ErrnoError(55);try{u=Ce.lookupNode(n,s)}catch(e){}if(c!==u){var d=Ce.isDir(c.mode),h=Ce.mayDelete(r,i,d);if(h)throw new Ce.ErrnoError(h);if(h=u?Ce.mayDelete(n,s,d):Ce.mayCreate(n,s))throw new Ce.ErrnoError(h);if(!r.node_ops.rename)throw new Ce.ErrnoError(63);if(Ce.isMountpoint(c)||u&&Ce.isMountpoint(u))throw new Ce.ErrnoError(10);if(n!==r&&(h=Ce.nodePermissions(r,"w")))throw new Ce.ErrnoError(h);Ce.hashRemoveNode(c);try{r.node_ops.rename(c,n,s)}catch(e){throw e}finally{Ce.hashAddNode(c)}}},rmdir(e){var t=Ce.lookupPath(e,{parent:!0}).node,r=he.basename(e),n=Ce.lookupNode(t,r),o=Ce.mayDelete(t,r,!0);if(o)throw new Ce.ErrnoError(o);if(!t.node_ops.rmdir)throw new Ce.ErrnoError(63);if(Ce.isMountpoint(n))throw new Ce.ErrnoError(10);t.node_ops.rmdir(t,r),Ce.destroyNode(n)},readdir(e){var t=Ce.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new Ce.ErrnoError(54);return t.node_ops.readdir(t)},unlink(e){var t=Ce.lookupPath(e,{parent:!0}).node;if(!t)throw new Ce.ErrnoError(44);var r=he.basename(e),n=Ce.lookupNode(t,r),o=Ce.mayDelete(t,r,!1);if(o)throw new Ce.ErrnoError(o);if(!t.node_ops.unlink)throw new Ce.ErrnoError(63);if(Ce.isMountpoint(n))throw new Ce.ErrnoError(10);t.node_ops.unlink(t,r),Ce.destroyNode(n)},readlink(e){var t=Ce.lookupPath(e).node;if(!t)throw new Ce.ErrnoError(44);if(!t.node_ops.readlink)throw new Ce.ErrnoError(28);return pe.resolve(Ce.getPath(t.parent),t.node_ops.readlink(t))},stat(e,t){var r=Ce.lookupPath(e,{follow:!t}).node;if(!r)throw new Ce.ErrnoError(44);if(!r.node_ops.getattr)throw new Ce.ErrnoError(63);return r.node_ops.getattr(r)},lstat:e=>Ce.stat(e,!0),chmod(e,t,r){var n;if(!(n="string"==typeof e?Ce.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new Ce.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod(e,t){Ce.chmod(e,t,!0)},fchmod(e,t){var r=Ce.getStreamChecked(e);Ce.chmod(r.node,t)},chown(e,t,r,n){var o;if(!(o="string"==typeof e?Ce.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new Ce.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown(e,t,r){Ce.chown(e,t,r,!0)},fchown(e,t,r){var n=Ce.getStreamChecked(e);Ce.chown(n.node,t,r)},truncate(e,t){if(t<0)throw new Ce.ErrnoError(28);var r;if(!(r="string"==typeof e?Ce.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new Ce.ErrnoError(63);if(Ce.isDir(r.mode))throw new Ce.ErrnoError(31);if(!Ce.isFile(r.mode))throw new Ce.ErrnoError(28);var n=Ce.nodePermissions(r,"w");if(n)throw new Ce.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate(e,t){var r=Ce.getStreamChecked(e);if(0==(2097155&r.flags))throw new Ce.ErrnoError(28);Ce.truncate(r.node,t)},utime(e,t,r){var n=Ce.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open(e,t,r){if(""===e)throw new Ce.ErrnoError(44);var n;if(r="undefined"==typeof r?438:r,r=64&(t="string"==typeof t?(e=>{var t={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if("undefined"==typeof t)throw new Error(`Unknown file open mode: ${e}`);return t})(t):t)?4095&r|32768:0,"object"==typeof e)n=e;else{e=he.normalize(e);try{n=Ce.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var o=!1;if(64&t)if(n){if(128&t)throw new Ce.ErrnoError(20)}else n=Ce.mknod(e,r,0),o=!0;if(!n)throw new Ce.ErrnoError(44);if(Ce.isChrdev(n.mode)&&(t&=-513),65536&t&&!Ce.isDir(n.mode))throw new Ce.ErrnoError(54);if(!o){var a=Ce.mayOpen(n,t);if(a)throw new Ce.ErrnoError(a)}512&t&&!o&&Ce.truncate(n,0),t&=-131713;var i=Ce.createStream({node:n,path:Ce.getPath(n),flags:t,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return i.stream_ops.open&&i.stream_ops.open(i),!h.logReadFiles||1&t||(Ce.readFiles||(Ce.readFiles={}),e in Ce.readFiles||(Ce.readFiles[e]=1)),i},close(e){if(Ce.isClosed(e))throw new Ce.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{Ce.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek(e,t,r){if(Ce.isClosed(e))throw new Ce.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new Ce.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new Ce.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 Ce.ErrnoError(28);if(Ce.isClosed(e))throw new Ce.ErrnoError(8);if(1==(2097155&e.flags))throw new Ce.ErrnoError(8);if(Ce.isDir(e.node.mode))throw new Ce.ErrnoError(31);if(!e.stream_ops.read)throw new Ce.ErrnoError(28);var a="undefined"!=typeof o;if(a){if(!e.seekable)throw new Ce.ErrnoError(70)}else o=e.position;var i=e.stream_ops.read(e,t,r,n,o);return a||(e.position+=i),i},write(e,t,r,n,o,a){if(n<0||o<0)throw new Ce.ErrnoError(28);if(Ce.isClosed(e))throw new Ce.ErrnoError(8);if(0==(2097155&e.flags))throw new Ce.ErrnoError(8);if(Ce.isDir(e.node.mode))throw new Ce.ErrnoError(31);if(!e.stream_ops.write)throw new Ce.ErrnoError(28);e.seekable&&1024&e.flags&&Ce.llseek(e,0,2);var i="undefined"!=typeof o;if(i){if(!e.seekable)throw new Ce.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,t,r,n,o,a);return i||(e.position+=s),s},allocate(e,t,r){if(Ce.isClosed(e))throw new Ce.ErrnoError(8);if(t<0||r<=0)throw new Ce.ErrnoError(28);if(0==(2097155&e.flags))throw new Ce.ErrnoError(8);if(!Ce.isFile(e.node.mode)&&!Ce.isDir(e.node.mode))throw new Ce.ErrnoError(43);if(!e.stream_ops.allocate)throw new Ce.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap(e,t,r,n,o){if(0!=(2&n)&&0==(2&o)&&2!=(2097155&e.flags))throw new Ce.ErrnoError(2);if(1==(2097155&e.flags))throw new Ce.ErrnoError(2);if(!e.stream_ops.mmap)throw new Ce.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 Ce.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=Ce.open(e,t.flags),o=Ce.stat(e).size,a=new Uint8Array(o);return Ce.read(n,a,0,o,0),"utf8"===t.encoding?r=ve(a,0):"binary"===t.encoding&&(r=a),Ce.close(n),r},writeFile(e,t,r={}){r.flags=r.flags||577;var n=Ce.open(e,r.flags,r.mode);if("string"==typeof t){var o=new Uint8Array(ge(t)+1),a=we(t,o,0,o.length);Ce.write(n,o,0,a,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");Ce.write(n,t,0,t.byteLength,void 0,r.canOwn)}Ce.close(n)},cwd:()=>Ce.currentPath,chdir(e){var t=Ce.lookupPath(e,{follow:!0});if(null===t.node)throw new Ce.ErrnoError(44);if(!Ce.isDir(t.node.mode))throw new Ce.ErrnoError(54);var r=Ce.nodePermissions(t.node,"x");if(r)throw new Ce.ErrnoError(r);Ce.currentPath=t.path},createDefaultDirectories(){Ce.mkdir("/tmp"),Ce.mkdir("/home"),Ce.mkdir("/home/web_user")},createDefaultDevices(){Ce.mkdir("/dev"),Ce.registerDevice(Ce.makedev(1,3),{read:()=>0,write:(e,t,r,n,o)=>n}),Ce.mkdev("/dev/null",Ce.makedev(1,3)),Ee.register(Ce.makedev(5,0),Ee.default_tty_ops),Ee.register(Ce.makedev(6,0),Ee.default_tty1_ops),Ce.mkdev("/dev/tty",Ce.makedev(5,0)),Ce.mkdev("/dev/tty1",Ce.makedev(6,0));var e=new Uint8Array(1024),t=0,r=()=>(0===t&&(t=fe(e).byteLength),e[--t]);Ce.createDevice("/dev","random",r),Ce.createDevice("/dev","urandom",r),Ce.mkdir("/dev/shm"),Ce.mkdir("/dev/shm/tmp")},createSpecialDirectories(){Ce.mkdir("/proc");var e=Ce.mkdir("/proc/self");Ce.mkdir("/proc/self/fd"),Ce.mount({mount(){var t=Ce.createNode(e,"fd",16895,73);return t.node_ops={lookup(e,t){var r=+t,n=Ce.getStreamChecked(r),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},t}},{},"/proc/self/fd")},createStandardStreams(){h.stdin?Ce.createDevice("/dev","stdin",h.stdin):Ce.symlink("/dev/tty","/dev/stdin"),h.stdout?Ce.createDevice("/dev","stdout",null,h.stdout):Ce.symlink("/dev/tty","/dev/stdout"),h.stderr?Ce.createDevice("/dev","stderr",null,h.stderr):Ce.symlink("/dev/tty1","/dev/stderr"),Ce.open("/dev/stdin",0),Ce.open("/dev/stdout",1),Ce.open("/dev/stderr",1)},ensureErrnoError(){Ce.ErrnoError||(Ce.ErrnoError=function(e,t){this.name="ErrnoError",this.node=t,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},Ce.ErrnoError.prototype=new Error,Ce.ErrnoError.prototype.constructor=Ce.ErrnoError,[44].forEach((e=>{Ce.genericErrors[e]=new Ce.ErrnoError(e),Ce.genericErrors[e].stack="<generic error, no stack>"})))},staticInit(){Ce.ensureErrnoError(),Ce.nameTable=new Array(4096),Ce.mount(ke,{},"/"),Ce.createDefaultDirectories(),Ce.createDefaultDevices(),Ce.createSpecialDirectories(),Ce.filesystems={MEMFS:ke}},init(e,t,r){Ce.init.initialized=!0,Ce.ensureErrnoError(),h.stdin=e||h.stdin,h.stdout=t||h.stdout,h.stderr=r||h.stderr,Ce.createStandardStreams()},quit(){Ce.init.initialized=!1;for(var e=0;e<Ce.streams.length;e++){var t=Ce.streams[e];t&&Ce.close(t)}},findObject(e,t){var r=Ce.analyzePath(e,t);return r.exists?r.object:null},analyzePath(e,t){try{e=(n=Ce.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=Ce.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=he.basename(e),n=Ce.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:Ce.getPath(e);for(var o=t.split("/").reverse();o.length;){var a=o.pop();if(a){var i=he.join2(e,a);try{Ce.mkdir(i)}catch(e){}e=i}}return i},createFile(e,t,r,n,o){var a=he.join2("string"==typeof e?e:Ce.getPath(e),t),i=Te(n,o);return Ce.create(a,i)},createDataFile(e,t,r,n,o,a){var i=t;e&&(e="string"==typeof e?e:Ce.getPath(e),i=t?he.join2(e,t):e);var s=Te(n,o),u=Ce.create(i,s);if(r){if("string"==typeof r){for(var c=new Array(r.length),l=0,d=r.length;l<d;++l)c[l]=r.charCodeAt(l);r=c}Ce.chmod(u,146|s);var h=Ce.open(u,577);Ce.write(h,r,0,r.length,0,a),Ce.close(h),Ce.chmod(u,s)}return u},createDevice(e,t,r,n){var o=he.join2("string"==typeof e?e:Ce.getPath(e),t),a=Te(!!r,!!n);Ce.createDevice.major||(Ce.createDevice.major=64);var i=Ce.makedev(Ce.createDevice.major++,0);return Ce.registerDevice(i,{open(e){e.seekable=!1},close(e){n&&n.buffer&&n.buffer.length&&n(10)},read(e,t,n,o,a){for(var i=0,s=0;s<o;s++){var u;try{u=r()}catch(e){throw new Ce.ErrnoError(29)}if(void 0===u&&0===i)throw new Ce.ErrnoError(6);if(null==u)break;i++,t[n+s]=u}return i&&(e.node.timestamp=Date.now()),i},write(e,t,r,o,a){for(var i=0;i<o;i++)try{n(t[r+i])}catch(e){throw new Ce.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),i}}),Ce.mkdev(o,a,i)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!f)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=be(f(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new Ce.ErrnoError(29)}},createLazyFile(e,r,n,o,a){function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,r=e/this.chunkSize|0;return this.getter(r)[t]}},i.prototype.setDataGetter=function(e){this.getter=e},i.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",n,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+n+". Status: "+e.status);var t,r=Number(e.getResponseHeader("Content-length")),o=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,a=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,i=1048576;o||(i=r);var s=this;s.setDataGetter((e=>{var t=e*i,o=(e+1)*i-1;if(o=Math.min(o,r-1),"undefined"==typeof s.chunks[e]&&(s.chunks[e]=((e,t)=>{if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>r-1)throw new Error("only "+r+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",n,!1),r!==i&&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 "+n+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):be(o.responseText||"",!0)})(t,o)),"undefined"==typeof s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!a&&r||(i=r=1,r=this.getter(0).length,i=r,k("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=r,this._chunkSize=i,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){var s=new i;Object.defineProperties(s,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var u={isDevice:!1,contents:s}}else u={isDevice:!1,url:n};var c=Ce.createFile(e,r,u,o,a);u.contents?c.contents=u.contents:u.url&&(c.contents=null,c.url=u.url),Object.defineProperties(c,{usedBytes:{get:function(){return this.contents.length}}});var l={};function d(e,t,r,n,o){var a=e.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(a.slice)for(var s=0;s<i;s++)t[r+s]=a[o+s];else for(s=0;s<i;s++)t[r+s]=a.get(o+s);return i}return Object.keys(c.stream_ops).forEach((e=>{var t=c.stream_ops[e];l[e]=function(){return Ce.forceLoadFile(c),t.apply(null,arguments)}})),l.read=(e,t,r,n,o)=>(Ce.forceLoadFile(c),d(e,t,r,n,o)),l.mmap=(e,r,n,o,a)=>{Ce.forceLoadFile(c);var i=_e(r);if(!i)throw new Ce.ErrnoError(48);return d(e,t(),i,r,n),{ptr:i,allocated:!0}},c.stream_ops=l,c}},Me=(e,t)=>e?ve(o(),e,t):"",Fe={DEFAULT_POLLMASK:5,calculateAt(e,t,r){if(he.isAbs(t))return t;var n;if(n=-100===e?Ce.cwd():Fe.getStreamFromFD(e).path,0==t.length){if(!r)throw new Ce.ErrnoError(44);return n}return he.join2(n,t)},doStat(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&he.normalize(t)!==he.normalize(Ce.getPath(e.node)))return-54;throw e}s()[r>>2]=n.dev,s()[r+4>>2]=n.mode,u()[r+8>>2]=n.nlink,s()[r+12>>2]=n.uid,s()[r+16>>2]=n.gid,s()[r+20>>2]=n.rdev,K=[n.size>>>0,(J=n.size,+Math.abs(J)>=1?J>0?+Math.floor(J/4294967296)>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],s()[r+24>>2]=K[0],s()[r+28>>2]=K[1],s()[r+32>>2]=4096,s()[r+36>>2]=n.blocks;var o=n.atime.getTime(),a=n.mtime.getTime(),i=n.ctime.getTime();return K=[Math.floor(o/1e3)>>>0,(J=Math.floor(o/1e3),+Math.abs(J)>=1?J>0?+Math.floor(J/4294967296)>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],s()[r+40>>2]=K[0],s()[r+44>>2]=K[1],u()[r+48>>2]=o%1e3*1e3,K=[Math.floor(a/1e3)>>>0,(J=Math.floor(a/1e3),+Math.abs(J)>=1?J>0?+Math.floor(J/4294967296)>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],s()[r+56>>2]=K[0],s()[r+60>>2]=K[1],u()[r+64>>2]=a%1e3*1e3,K=[Math.floor(i/1e3)>>>0,(J=Math.floor(i/1e3),+Math.abs(J)>=1?J>0?+Math.floor(J/4294967296)>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],s()[r+72>>2]=K[0],s()[r+76>>2]=K[1],u()[r+80>>2]=i%1e3*1e3,K=[n.ino>>>0,(J=n.ino,+Math.abs(J)>=1?J>0?+Math.floor(J/4294967296)>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],s()[r+88>>2]=K[0],s()[r+92>>2]=K[1],0},doMsync(e,t,r,n,a){if(!Ce.isFile(t.node.mode))throw new Ce.ErrnoError(43);if(2&n)return 0;var i=o().slice(e,e+r);Ce.msync(t,i,a,r,n)},varargs:void 0,get(){var e=s()[Fe.varargs>>2];return Fe.varargs+=4,e},getp:()=>Fe.get(),getStr:e=>Me(e),getStreamFromFD:e=>Ce.getStreamChecked(e)};function Se(e){if(w)return Ar(0,1,e);F=e,B()||(je.terminateAllThreads(),h.onExit&&h.onExit(e),I=!0),g(e,new ue(e))}var Pe=(e,t)=>{if(F=e,w)throw Ae(e),"unwind";Se(e)},$e=e=>{if(e instanceof ue||"unwind"==e)return F;g(1,e)},je={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],pthreads:{},init(){w?je.initWorker():je.initMainThread()},initMainThread(){for(var e=Math.min(4,Math.max(1,navigator.hardwareConcurrency-1));e--;)je.allocateUnusedWorker();Y((()=>{te(),je.loadWasmModuleToAllWorkers((()=>re()))}))},initWorker(){M=!1},setExitStatus:e=>{F=e},terminateAllThreads__deps:["$terminateWorker"],terminateAllThreads:()=>{for(var e of je.runningWorkers)ce(e);for(var e of je.unusedWorkers)ce(e);je.unusedWorkers=[],je.runningWorkers=[],je.pthreads=[]},returnWorkerToPool:e=>{var t=e.pthread_ptr;delete je.pthreads[t],je.unusedWorkers.push(e),je.runningWorkers.splice(je.runningWorkers.indexOf(e),1),e.pthread_ptr=0,jn(t)},receiveObjectTransfer(e){},threadInitTLS(){je.tlsInitFunctions.forEach((e=>e()))},loadWasmModuleToWorker:e=>new Promise((t=>{e.onmessage=r=>{var n=r.data,o=n.cmd;if(n.targetThread&&n.targetThread!=Cn()){var a=je.pthreads[n.targetThread];a?a.postMessage(n,n.transferList):W(`Internal error! Worker sent a message "${o}" to target pthread ${n.targetThread}, but that thread no longer exists!`)}else{var i;"checkMailbox"===o?jr():"spawnThread"===o?de(n):"cleanupThread"===o?le(n.thread):"killThread"===o?(e=>{var t=je.pthreads[e];delete je.pthreads[e],ce(t),jn(e),je.runningWorkers.splice(je.runningWorkers.indexOf(t),1),t.pthread_ptr=0})(n.thread):"cancelThread"===o?(i=n.thread,je.pthreads[i].postMessage({cmd:"cancel"})):"loaded"===o?(e.loaded=!0,t(e)):"alert"===o?alert(`Thread ${n.threadId}: ${n.text}`):"setimmediate"===n.target?e.postMessage(n):"callHandler"===o?h[n.handler](...n.args):o&&W(`worker sent an unknown command ${o}`)}},e.onerror=e=>{throw W(`worker sent an error! ${e.filename}:${e.lineno}: ${e.message}`),e};var r=[];for(var o of["onExit","onAbort","print","printErr"])h.hasOwnProperty(o)&&r.push(o);e.postMessage({cmd:"load",handlers:r,urlOrBlob:h.mainScriptUrlOrBlob||n,wasmMemory:T,wasmModule:C})})),loadWasmModuleToAllWorkers(e){if(w)return e();Promise.all(je.unusedWorkers.map(je.loadWasmModuleToWorker)).then(e)},allocateUnusedWorker(){var e,t=E("ScanbotSDK.Asm-simd-threads.worker.js");e=new Worker(t),je.unusedWorkers.push(e)},getNewWorker:()=>(0==je.unusedWorkers.length&&(je.allocateUnusedWorker(),je.loadWasmModuleToWorker(je.unusedWorkers[0])),je.unusedWorkers.pop())};h.PThread=je;var De=e=>{for(;e.length>0;)e.shift()(h)};function Ae(e){if(w)return Ar(1,0,e);Pe(e)}h.establishStackSpace=()=>{var e=Cn(),t=s()[e+52>>2],r=s()[e+56>>2];Rn(t,t-r),Vn(t)};var xe=e=>Z.get(e);h.invokeEntryPoint=(e,t)=>{!function(e){B()?je.setExitStatus(e):Dn(e)}(xe(e)(t))};var Re=e=>{je.tlsInitFunctions.push(e)},Ie=[],Ve=0,Oe=0;function Ze(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){u()[this.ptr+4>>2]=e},this.get_type=function(){return u()[this.ptr+4>>2]},this.set_destructor=function(e){u()[this.ptr+8>>2]=e},this.get_destructor=function(){return u()[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,t()[this.ptr+12>>0]=e},this.get_caught=function(){return 0!=t()[this.ptr+12>>0]},this.set_rethrown=function(e){e=e?1:0,t()[this.ptr+13>>0]=e},this.get_rethrown=function(){return 0!=t()[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){u()[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return u()[this.ptr+16>>2]},this.get_exception_ptr=function(){if(Un(this.get_type()))return u()[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}var Ne=e=>{var t=Oe;if(!t)return Mn(0),0;var r=new Ze(t);r.set_adjusted_ptr(t);var n=r.get_type();if(!n)return Mn(0),t;for(var o in e){var a=e[o];if(0===a||a===n)break;var i=r.ptr+16;if(zn(a,n,i))return Mn(a),t}return Mn(n),t},ze=()=>{var e=Ie.pop();e||ne("no exception to throw");var t=e.excPtr;throw e.get_rethrown()||(Ie.push(e),e.set_rethrown(!0),e.set_caught(!1),Ve++),Oe=t};function Ue(e,t,r,n){return w?Ar(2,1,e,t,r,n):Ge(e,t,r,n)}var Ge=(e,t,r,n)=>{if("undefined"==typeof SharedArrayBuffer)return W("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var o=[];if(w&&0===o.length)return Ue(e,t,r,n);var a={startRoutine:r,pthread_ptr:e,arg:n,transferList:o};return w?(a.cmd="spawnThread",postMessage(a,o),0):de(a)};function Le(e,t,r,n,o){if(w)return Ar(3,1,e,t,r,n,o);try{for(var a=0,i=t?s()[t>>2]:0,u=t?s()[t+4>>2]:0,c=r?s()[r>>2]:0,l=r?s()[r+4>>2]:0,d=n?s()[n>>2]:0,h=n?s()[n+4>>2]:0,f=0,p=0,m=0,v=0,y=0,g=0,b=(t?s()[t>>2]:0)|(r?s()[r>>2]:0)|(n?s()[n>>2]:0),E=(t?s()[t+4>>2]:0)|(r?s()[r+4>>2]:0)|(n?s()[n+4>>2]:0),_=function(e,t,r,n){return e<32?t&n:r&n},k=0;k<e;k++){var W=1<<k%32;if(_(k,b,E,W)){var T=Fe.getStreamFromFD(k),C=Fe.DEFAULT_POLLMASK;if(T.stream_ops.poll){var M=-1;o&&(M=1e3*((t?s()[o>>2]:0)+(t?s()[o+8>>2]:0)/1e6)),C=T.stream_ops.poll(T,M)}1&C&&_(k,i,u,W)&&(k<32?f|=W:p|=W,a++),4&C&&_(k,c,l,W)&&(k<32?m|=W:v|=W,a++),2&C&&_(k,d,h,W)&&(k<32?y|=W:g|=W,a++)}}return t&&(s()[t>>2]=f,s()[t+4>>2]=p),r&&(s()[r>>2]=m,s()[r+4>>2]=v),n&&(s()[n>>2]=y,s()[n+4>>2]=g),a}catch(e){if("undefined"==typeof Ce||"ErrnoError"!==e.name)throw e;return-e.errno}}function Be(e,t){if(w)return Ar(4,1,e,t);try{return e=Fe.getStr(e),Ce.chmod(e,t),0}catch(e){if("undefined"==typeof Ce||"ErrnoError"!==e.name)throw e;return-e.errno}}function He(e,t){if(w)return Ar(5,1,e,t);try{return Ce.fchmod(e,t),0}catch(e){if("undefined"==typeof Ce||"ErrnoError"!==e.name)throw e;return-e.errno}}function Ye(e,t,r){if(w)return Ar(6,1,e,t,r);Fe.varargs=r;try{var n=Fe.getStreamFromFD(e);switch(t){case 0:if((o=Fe.get())<0)return-28;for(;Ce.streams[o];)o++;return Ce.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=Fe.get();return n.flags|=o,0;case 5:return o=Fe.getp(),a()[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return i=28,s()[Tn()>>2]=i,-1}}catch(e){if("undefined"==typeof Ce||"ErrnoError"!==e.name)throw e;return-e.errno}var i}function Xe(e,t){if(w)return Ar(7,1,e,t);try{var r=Fe.getStreamFromFD(e);return Fe.doStat(Ce.stat,r.path,t)}catch(e){if("undefined"==typeof Ce||"ErrnoError"!==e.name)throw e;return-e.errno}}var Je=(e,t)=>t+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*t:NaN;function Ke(e,t,r){if(w)return Ar(8,1,e,t,r);var n=Je(t,r);try{return isNaN(n)?61:(Ce.ftruncate(e,n),0)}catch(e){if("undefined"==typeof Ce||"ErrnoError"!==e.name)throw e;return-e.errno}}var Qe=(e,t,r)=>we(e,o(),t,r);function qe(e,t){if(w)return Ar(9,1,e,t);try{if(0===t)return-28;var r=Ce.cwd(),n=ge(r)+1;return t<n?-68:(Qe(r,e,t),n)}catch(e){if("undefined"==typeof Ce||"ErrnoError"!==e.name)throw e;return-e.errno}}function et(e,r,n){if(w)return Ar(10,1,e,r,n);try{var o=Fe.getStreamFromFD(e);o.getdents||(o.getdents=Ce.readdir(o.path));for(var i=280,u=0,c=Ce.llseek(o,0,1),l=Math.floor(c/i);l<o.getdents.length&&u+i<=n;){var d,h,f=o.getdents[l];if("."===f)d=o.node.id,h=4;else if(".."===f)d=Ce.lookupPath(o.path,{parent:!0}).node.id,h=4;else{var p=Ce.lookupNode(o.node,f);d=p.id,h=Ce.isChrdev(p.mode)?2:Ce.isDir(p.mode)?4:Ce.isLink(p.mode)?10:8}K=[d>>>0,(J=d,+Math.abs(J)>=1?J>0?+Math.floor(J/4294967296)>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],s()[r+u>>2]=K[0],s()[r+u+4>>2]=K[1],K=[(l+1)*i>>>0,(J=(l+1)*i,+Math.abs(J)>=1?J>0?+Math.floor(J/4294967296)>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],s()[r+u+8>>2]=K[0],s()[r+u+12>>2]=K[1],a()[r+u+16>>1]=280,t()[r+u+18>>0]=h,Qe(f,r+u+19,256),u+=i,l+=1}return Ce.llseek(o,l*i,0),u}catch(e){if("undefined"==typeof Ce||"ErrnoError"!==e.name)throw e;return-e.errno}}function tt(e,r,n){if(w)return Ar(11,1,e,r,n);Fe.varargs=n;try{var o=Fe.getStreamFromFD(e);switch(r){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return o.tty?0:-59;case 21505:if(!o.tty)return-59;if(o.tty.ops.ioctl_tcgets){var i=o.tty.ops.ioctl_tcgets(o),u=Fe.getp();s()[u>>2]=i.c_iflag||0,s()[u+4>>2]=i.c_oflag||0,s()[u+8>>2]=i.c_cflag||0,s()[u+12>>2]=i.c_lflag||0;for(var c=0;c<32;c++)t()[u+c+17>>0]=i.c_cc[c]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!o.tty)return-59;if(o.tty.ops.ioctl_tcsets){u=Fe.getp();var l=s()[u>>2],d=s()[u+4>>2],h=s()[u+8>>2],f=s()[u+12>>2],p=[];for(c=0;c<32;c++)p.push(t()[u+c+17>>0]);return o.tty.ops.ioctl_tcsets(o.tty,r,{c_iflag:l,c_oflag:d,c_cflag:h,c_lflag:f,c_cc:p})}return 0;case 21519:return o.tty?(u=Fe.getp(),s()[u>>2]=0,0):-59;case 21520:return o.tty?-28:-59;case 21531:return u=Fe.getp(),Ce.ioctl(o,r,u);case 21523:if(!o.tty)return-59;if(o.tty.ops.ioctl_tiocgwinsz){var m=o.tty.ops.ioctl_tiocgwinsz(o.tty);u=Fe.getp(),a()[u>>1]=m[0],a()[u+2>>1]=m[1]}return 0;default:return-28}}catch(e){if("undefined"==typeof Ce||"ErrnoError"!==e.name)throw e;return-e.errno}}function rt(e,t){if(w)return Ar(12,1,e,t);try{return e=Fe.getStr(e),Fe.doStat(Ce.lstat,e,t)}catch(e){if("undefined"==typeof Ce||"ErrnoError"!==e.name)throw e;return-e.errno}}function nt(e,t,r){if(w)return Ar(13,1,e,t,r);try{return t=Fe.getStr(t),t=Fe.calculateAt(e,t),"/"===(t=he.normalize(t))[t.length-1]&&(t=t.substr(0,t.length-1)),Ce.mkdir(t,r,0),0}catch(e){if("undefined"==typeof Ce||"ErrnoError"!==e.name)throw e;return-e.errno}}function ot(e,t,r,n){if(w)return Ar(14,1,e,t,r,n);try{t=Fe.getStr(t);var o=256&n,a=4096&n;return n&=-6401,t=Fe.calculateAt(e,t,a),Fe.doStat(o?Ce.lstat:Ce.stat,t,r)}catch(e){if("undefined"==typeof Ce||"ErrnoError"!==e.name)throw e;return-e.errno}}function at(e,t,r,n){if(w)return Ar(15,1,e,t,r,n);Fe.varargs=n;try{t=Fe.getStr(t),t=Fe.calculateAt(e,t);var o=n?Fe.get():0;return Ce.open(t,r,o).fd}catch(e){if("undefined"==typeof Ce||"ErrnoError"!==e.name)throw e;return-e.errno}}function it(e,r,n,o){if(w)return Ar(16,1,e,r,n,o);try{if(r=Fe.getStr(r),r=Fe.calculateAt(e,r),o<=0)return-28;var a=Ce.readlink(r),i=Math.min(o,ge(a)),s=t()[n+i];return Qe(a,n,o+1),t()[n+i]=s,i}catch(e){if("undefined"==typeof Ce||"ErrnoError"!==e.name)throw e;return-e.errno}}function st(e){if(w)return Ar(17,1,e);try{return e=Fe.getStr(e),Ce.rmdir(e),0}catch(e){if("undefined"==typeof Ce||"ErrnoError"!==e.name)throw e;return-e.errno}}function ut(e,t){if(w)return Ar(18,1,e,t);try{return e=Fe.getStr(e),Fe.doStat(Ce.stat,e,t)}catch(e){if("undefined"==typeof Ce||"ErrnoError"!==e.name)throw e;return-e.errno}}function ct(e,t){if(w)return Ar(19,1,e,t);try{return e=Fe.getStr(e),t=Fe.getStr(t),Ce.symlink(e,t),0}catch(e){if("undefined"==typeof Ce||"ErrnoError"!==e.name)throw e;return-e.errno}}function lt(e,t,r){if(w)return Ar(20,1,e,t,r);try{return t=Fe.getStr(t),t=Fe.calculateAt(e,t),0===r?Ce.unlink(t):512===r?Ce.rmdir(t):ne("Invalid flags passed to unlinkat"),0}catch(e){if("undefined"==typeof Ce||"ErrnoError"!==e.name)throw e;return-e.errno}}var dt=void 0,ht=e=>{for(var t="",r=e;o()[r];)t+=dt[o()[r++]];return t},ft={},pt={},mt={},vt=void 0,yt=e=>{throw new vt(e)},gt=void 0,wt=e=>{throw new gt(e)},bt=(e,t,r)=>{function n(t){var n=r(t);n.length!==e.length&&wt("Mismatched type converter count");for(var o=0;o<e.length;++o)Et(e[o],n[o])}e.forEach((function(e){mt[e]=t}));var o=new Array(t.length),a=[],i=0;t.forEach(((e,t)=>{pt.hasOwnProperty(e)?o[t]=pt[e]:(a.push(e),ft.hasOwnProperty(e)||(ft[e]=[]),ft[e].push((()=>{o[t]=pt[e],++i===a.length&&n(o)})))})),0===a.length&&n(o)};function Et(e,t,r={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(e,t,r={}){var n=t.name;if(e||yt(`type "${n}" must have a positive integer typeid pointer`),pt.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;yt(`Cannot register type '${n}' twice`)}if(pt[e]=t,delete mt[e],ft.hasOwnProperty(e)){var o=ft[e];delete ft[e],o.forEach((e=>e()))}}(e,t,r)}function _t(e){if(!(this instanceof Gt))return!1;if(!(e instanceof Gt))return!1;for(var t=this.$$.ptrType.registeredClass,r=this.$$.ptr,n=e.$$.ptrType.registeredClass,o=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return t===n&&r===o}var kt=e=>{yt(e.$$.ptrType.registeredClass.name+" instance already deleted")},Wt=!1,Tt=e=>{},Ct=e=>{e.count.value-=1,0===e.count.value&&(e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)})(e)},Mt=(e,t,r)=>{if(t===r)return e;if(void 0===r.baseClass)return null;var n=Mt(e,t,r.baseClass);return null===n?null:r.downcast(n)},Ft={},St=()=>Object.keys(xt).length,Pt=()=>{var e=[];for(var t in xt)xt.hasOwnProperty(t)&&e.push(xt[t]);return e},$t=[],jt=()=>{for(;$t.length;){var e=$t.pop();e.$$.deleteScheduled=!1,e.delete()}},Dt=void 0,At=e=>{Dt=e,$t.length&&Dt&&Dt(jt)},xt={},Rt=(e,t)=>(t=((e,t)=>{for(void 0===t&&yt("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t})(e,t),xt[t]),It=(e,t)=>(t.ptrType&&t.ptr||wt("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&wt("Both smartPtrType and smartPtr must be specified"),t.count={value:1},Ot(Object.create(e,{$$:{value:t}})));function Vt(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=Rt(this.registeredClass,t);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var n=r.clone();return this.destructor(e),n}function o(){return this.isSmartPointer?It(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):It(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var a,i=this.registeredClass.getActualType(t),s=Ft[i];if(!s)return o.call(this);a=this.isConst?s.constPointerType:s.pointerType;var u=Mt(t,this.registeredClass,a.registeredClass);return null===u?o.call(this):this.isSmartPointer?It(a.registeredClass.instancePrototype,{ptrType:a,ptr:u,smartPtrType:this,smartPtr:e}):It(a.registeredClass.instancePrototype,{ptrType:a,ptr:u})}var Ot=e=>"undefined"==typeof FinalizationRegistry?(Ot=e=>e,e):(Wt=new FinalizationRegistry((e=>{Ct(e.$$)})),Ot=e=>{var t=e.$$;if(t.smartPtr){var r={$$:t};Wt.register(e,r,e)}return e},Tt=e=>Wt.unregister(e),Ot(e));function Zt(){if(this.$$.ptr||kt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,t=Ot(Object.create(Object.getPrototypeOf(this),{$$:{value:(e=this.$$,{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType})}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t}function Nt(){this.$$.ptr||kt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&yt("Object already scheduled for deletion"),Tt(this),Ct(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function zt(){return!this.$$.ptr}function Ut(){return this.$$.ptr||kt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&yt("Object already scheduled for deletion"),$t.push(this),1===$t.length&&Dt&&Dt(jt),this.$$.deleteScheduled=!0,this}function Gt(){}var Lt=e=>{if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=48&&t<=57?`_${e}`:e};function Bt(e,t){return{[e=Lt(e)]:function(){return t.apply(this,arguments)}}[e]}var Ht=(e,t,r)=>{if(void 0===e[t].overloadTable){var n=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||yt(`Function '${r}' called with an invalid number of arguments (${arguments.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[arguments.length].apply(this,arguments)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}},Yt=(e,t,r)=>{h.hasOwnProperty(e)?((void 0===r||void 0!==h[e].overloadTable&&void 0!==h[e].overloadTable[r])&&yt(`Cannot register public name '${e}' twice`),Ht(h,e,e),h.hasOwnProperty(r)&&yt(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),h[e].overloadTable[r]=t):(h[e]=t,void 0!==r&&(h[e].numArguments=r))};function Xt(e,t,r,n,o,a,i,s){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=o,this.getActualType=a,this.upcast=i,this.downcast=s,this.pureVirtualFunctions=[]}var Jt=(e,t,r)=>{for(;t!==r;)t.upcast||yt(`Expected null or instance of ${r.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e};function Kt(e,t){if(null===t)return this.isReference&&yt(`null is not a valid ${this.name}`),0;t.$$||yt(`Cannot pass "${br(t)}" as a ${this.name}`),t.$$.ptr||yt(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=t.$$.ptrType.registeredClass;return Jt(t.$$.ptr,r,this.registeredClass)}function Qt(e,t){var r;if(null===t)return this.isReference&&yt(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,r),r):0;t.$$||yt(`Cannot pass "${br(t)}" as a ${this.name}`),t.$$.ptr||yt(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&yt(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);var n=t.$$.ptrType.registeredClass;if(r=Jt(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&yt("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:yt(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:r=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)r=t.$$.smartPtr;else{var o=t.clone();r=this.rawShare(r,gr.toHandle((()=>o.delete()))),null!==e&&e.push(this.rawDestructor,r)}break;default:yt("Unsupporting sharing policy")}return r}function qt(e,t){if(null===t)return this.isReference&&yt(`null is not a valid ${this.name}`),0;t.$$||yt(`Cannot pass "${br(t)}" as a ${this.name}`),t.$$.ptr||yt(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&yt(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass;return Jt(t.$$.ptr,r,this.registeredClass)}function er(e){return this.fromWireType(u()[e>>2])}function tr(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e}function rr(e){this.rawDestructor&&this.rawDestructor(e)}var nr=e=>{null!==e&&e.delete()};function or(e,t,r,n,o,a,i,s,u,c,l){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=o,this.pointeeType=a,this.sharingPolicy=i,this.rawGetPointee=s,this.rawConstructor=u,this.rawShare=c,this.rawDestructor=l,o||void 0!==t.baseClass?this.toWireType=Qt:n?(this.toWireType=Kt,this.destructorFunction=null):(this.toWireType=qt,this.destructorFunction=null)}var ar=(e,t,r)=>{h.hasOwnProperty(e)||wt("Replacing nonexistant public symbol"),void 0!==h[e].overloadTable&&void 0!==r?h[e].overloadTable[r]=t:(h[e]=t,h[e].argCount=r)},ir=(e,t,r)=>e.includes("j")?((e,t,r)=>{var n=h["dynCall_"+e];return r&&r.length?n.apply(null,[t].concat(r)):n.call(null,t)})(e,t,r):xe(t).apply(null,r),sr=(e,t)=>{var r,n,o,a=(e=ht(e)).includes("j")?(r=e,n=t,o=[],function(){return o.length=0,Object.assign(o,arguments),ir(r,n,o)}):xe(t);return"function"!=typeof a&&yt(`unknown function pointer with signature ${e}: ${t}`),a},ur=void 0,cr=e=>{var t=Sn(e),r=ht(t);return Wn(t),r},lr=(e,t)=>{var r=[],n={};throw t.forEach((function e(t){n[t]||pt[t]||(mt[t]?mt[t].forEach(e):(r.push(t),n[t]=!0))})),new ur(`${e}: `+r.map(cr).join([", "]))},dr=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function hr(e,t,r,n,o,a){var i=t.length;i<2&&yt("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var s=null!==t[1]&&null!==r,u=!1,c=1;c<t.length;++c)if(null!==t[c]&&void 0===t[c].destructorFunction){u=!0;break}var l="void"!==t[0].name,d=i-2,h=new Array(d),f=[],p=[];return function(){var r;arguments.length!==d&&yt(`function ${e} called with ${arguments.length} arguments, expected ${d}`),p.length=0,f.length=s?2:1,f[0]=o,s&&(r=t[1].toWireType(p,this),f[1]=r);for(var a=0;a<d;++a)h[a]=t[a+2].toWireType(p,arguments[a]),f.push(h[a]);var i=n.apply(null,f);function c(e){if(u)dr(p);else for(var n=s?1:2;n<t.length;n++){var o=1===n?r:h[n-2];null!==t[n].destructorFunction&&t[n].destructorFunction(o)}if(l)return t[0].fromWireType(e)}return c(i)}}var fr=(e,t)=>{for(var r=[],n=0;n<e;n++)r.push(u()[t+4*n>>2]);return r};function pr(){this.allocated=[void 0],this.freelist=[]}var mr=new pr,vr=e=>{e>=mr.reserved&&0==--mr.get(e).refcount&&mr.free(e)},yr=()=>{for(var e=0,t=mr.reserved;t<mr.allocated.length;++t)void 0!==mr.allocated[t]&&++e;return e},gr={toValue:e=>(e||yt("Cannot use deleted val. handle = "+e),mr.get(e).value),toHandle:e=>{switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return mr.allocate({refcount:1,value:e})}}};function wr(e){return this.fromWireType(s()[e>>2])}var br=e=>{if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e},Er=(e,t)=>{switch(t){case 4:return function(e){return this.fromWireType((T.buffer!=S.buffer&&O(),x)[e>>2])};case 8:return function(e){return this.fromWireType(c()[e>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},_r=(e,r,n)=>{switch(r){case 1:return n?e=>t()[e>>0]:e=>o()[e>>0];case 2:return n?e=>a()[e>>1]:e=>i()[e>>1];case 4:return n?e=>s()[e>>2]:e=>u()[e>>2];default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},kr="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,Wr=(e,t)=>{for(var r=e,n=r>>1,s=n+t/2;!(n>=s)&&i()[n];)++n;if((r=n<<1)-e>32&&kr)return kr.decode(o().slice(e,r));for(var u="",c=0;!(c>=t/2);++c){var l=a()[e+2*c>>1];if(0==l)break;u+=String.fromCharCode(l)}return u},Tr=(e,t,r)=>{if(void 0===r&&(r=2147483647),r<2)return 0;for(var n=t,o=(r-=2)<2*e.length?r/2:e.length,i=0;i<o;++i){var s=e.charCodeAt(i);a()[t>>1]=s,t+=2}return a()[t>>1]=0,t-n},Cr=e=>2*e.length,Mr=(e,t)=>{for(var r=0,n="";!(r>=t/4);){var o=s()[e+4*r>>2];if(0==o)break;if(++r,o>=65536){var a=o-65536;n+=String.fromCharCode(55296|a>>10,56320|1023&a)}else n+=String.fromCharCode(o)}return n},Fr=(e,t,r)=>{if(void 0===r&&(r=2147483647),r<4)return 0;for(var n=t,o=n+r-4,a=0;a<e.length;++a){var i=e.charCodeAt(a);if(i>=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++a)),s()[t>>2]=i,(t+=4)+4>o)break}return s()[t>>2]=0,t-n},Sr=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&++r,t+=4}return t},Pr=e=>{if(!I)try{e(),(()=>{if(!B())try{w?Dn(F):Pe(F)}catch(e){$e(e)}})()}catch(e){$e(e)}},$r=e=>{if("function"==typeof Atomics.waitAsync){Atomics.waitAsync(s(),e>>2,e).value.then(jr);var t=e+128;Atomics.store(s(),t>>2,1)}};h.__emscripten_thread_mailbox_await=$r;var jr=()=>{var e=Cn();e&&($r(e),Pr((()=>An())))};h.checkMailbox=jr;var Dr=e=>{var t=In(),r=e();return Vn(t),r},Ar=function(e,t){var r=arguments.length-2,n=arguments;return Dr((()=>{for(var o=r,a=On(8*o),i=a>>3,s=0;s<r;s++){var u=n[2+s];c()[i+s]=u}return $n(e,o,a,t)}))},xr=[],Rr=(e,t)=>{var r=pt[e];return void 0===r&&yt(t+" has unknown type "+cr(e)),r},Ir={},Vr=e=>{var t=Ir[e];return void 0===t?ht(e):t},Or=[],Zr=()=>{if("object"==typeof globalThis)return globalThis;function e(e){e.$$$embind_global$$$=e;var t="object"==typeof $$$embind_global$$$&&e.$$$embind_global$$$==e;return t||delete e.$$$embind_global$$$,t}if("object"==typeof $$$embind_global$$$)return $$$embind_global$$$;if("object"==typeof r.g&&e(r.g)?$$$embind_global$$$=r.g:"object"==typeof self&&e(self)&&($$$embind_global$$$=self),"object"==typeof $$$embind_global$$$)return $$$embind_global$$$;throw Error("unable to get global object.")},Nr=[],zr=e=>e%4==0&&(e%100!=0||e%400==0),Ur=[0,31,60,91,121,152,182,213,244,274,305,335],Gr=[0,31,59,90,120,151,181,212,243,273,304,334];function Lr(e,t,r,n,o,a,i,c){if(w)return Ar(21,1,e,t,r,n,o,a,i,c);var l=Je(o,a);try{if(isNaN(l))return 61;var d=Fe.getStreamFromFD(n),h=Ce.mmap(d,e,l,t,r),f=h.ptr;return s()[i>>2]=h.allocated,u()[c>>2]=f,0}catch(e){if("undefined"==typeof Ce||"ErrnoError"!==e.name)throw e;return-e.errno}}function Br(e,t,r,n,o,a,i){if(w)return Ar(22,1,e,t,r,n,o,a,i);var s=Je(a,i);try{if(isNaN(s))return 61;var u=Fe.getStreamFromFD(o);2&r&&Fe.doMsync(e,u,t,n,s),Ce.munmap(u)}catch(e){if("undefined"==typeof Ce||"ErrnoError"!==e.name)throw e;return-e.errno}}var Hr,Yr=e=>{var t=ge(e)+1,r=kn(t);return r&&Qe(e,r,t),r},Xr=[],Jr=(e,t,r)=>{var n=((e,t)=>{var r;for(Xr.length=0;r=o()[e++];)t+=105!=r&&t%8?4:0,Xr.push(105==r?s()[t>>2]:c()[t>>3]),t+=105==r?4:8;return Xr})(t,r);return se[e].apply(null,n)};Hr=()=>performance.timeOrigin+performance.now();var Kr=e=>{ne("OOM")},Qr=e=>{var t=(e-T.buffer.byteLength+65535)/65536;try{return T.grow(t),O(),1}catch(e){}},qr={},en=()=>{if(!en.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:y||"./this.program"};for(var t in qr)void 0===qr[t]?delete e[t]:e[t]=qr[t];var r=[];for(var t in e)r.push(`${t}=${e[t]}`);en.strings=r}return en.strings},tn=function(e,r){if(w)return Ar(23,1,e,r);var n=0;return en().forEach(((o,a)=>{var i=r+n;u()[e+4*a>>2]=i,((e,r)=>{for(var n=0;n<e.length;++n)t()[r++>>0]=e.charCodeAt(n);t()[r>>0]=0})(o,i),n+=o.length+1})),0},rn=function(e,t){if(w)return Ar(24,1,e,t);var r=en();u()[e>>2]=r.length;var n=0;return r.forEach((e=>n+=e.length+1)),u()[t>>2]=n,0};function nn(e){if(w)return Ar(25,1,e);try{var t=Fe.getStreamFromFD(e);return Ce.close(t),0}catch(e){if("undefined"==typeof Ce||"ErrnoError"!==e.name)throw e;return e.errno}}function on(e,r){if(w)return Ar(26,1,e,r);try{var n=Fe.getStreamFromFD(e),o=n.tty?2:Ce.isDir(n.mode)?3:Ce.isLink(n.mode)?7:4;return t()[r>>0]=o,a()[r+2>>1]=0,K=[0,(J=0,+Math.abs(J)>=1?J>0?+Math.floor(J/4294967296)>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],s()[r+8>>2]=K[0],s()[r+12>>2]=K[1],K=[0,(J=0,+Math.abs(J)>=1?J>0?+Math.floor(J/4294967296)>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],s()[r+16>>2]=K[0],s()[r+20>>2]=K[1],0}catch(e){if("undefined"==typeof Ce||"ErrnoError"!==e.name)throw e;return e.errno}}function an(e,r,n,o){if(w)return Ar(27,1,e,r,n,o);try{var a=((e,r,n,o)=>{for(var a=0,i=0;i<n;i++){var s=u()[r>>2],c=u()[r+4>>2];r+=8;var l=Ce.read(e,t(),s,c,o);if(l<0)return-1;if(a+=l,l<c)break;"undefined"!=typeof o&&(o+=l)}return a})(Fe.getStreamFromFD(e),r,n);return u()[o>>2]=a,0}catch(e){if("undefined"==typeof Ce||"ErrnoError"!==e.name)throw e;return e.errno}}function sn(e,t,r,n,o){if(w)return Ar(28,1,e,t,r,n,o);var a=Je(t,r);try{if(isNaN(a))return 61;var i=Fe.getStreamFromFD(e);return Ce.llseek(i,a,n),K=[i.position>>>0,(J=i.position,+Math.abs(J)>=1?J>0?+Math.floor(J/4294967296)>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],s()[o>>2]=K[0],s()[o+4>>2]=K[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0}catch(e){if("undefined"==typeof Ce||"ErrnoError"!==e.name)throw e;return e.errno}}function un(e,r,n,o){if(w)return Ar(29,1,e,r,n,o);try{var a=((e,r,n,o)=>{for(var a=0,i=0;i<n;i++){var s=u()[r>>2],c=u()[r+4>>2];r+=8;var l=Ce.write(e,t(),s,c,o);if(l<0)return-1;a+=l,"undefined"!=typeof o&&(o+=l)}return a})(Fe.getStreamFromFD(e),r,n);return u()[o>>2]=a,0}catch(e){if("undefined"==typeof Ce||"ErrnoError"!==e.name)throw e;return e.errno}}var cn=[31,29,31,30,31,30,31,31,30,31,30,31],ln=[31,28,31,30,31,30,31,31,30,31,30,31],dn=(e,r,n,o)=>{var a=u()[o+40>>2],i={tm_sec:s()[o>>2],tm_min:s()[o+4>>2],tm_hour:s()[o+8>>2],tm_mday:s()[o+12>>2],tm_mon:s()[o+16>>2],tm_year:s()[o+20>>2],tm_wday:s()[o+24>>2],tm_yday:s()[o+28>>2],tm_isdst:s()[o+32>>2],tm_gmtoff:s()[o+36>>2],tm_zone:a?Me(a):""},c=Me(n),l={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var d in l)c=c.replace(new RegExp(d,"g"),l[d]);var h=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],f=["January","February","March","April","May","June","July","August","September","October","November","December"];function p(e,t,r){for(var n="number"==typeof e?e.toString():e||"";n.length<t;)n=r[0]+n;return n}function m(e,t){return p(e,t,"0")}function v(e,t){function r(e){return e<0?-1:e>0?1:0}var n;return 0===(n=r(e.getFullYear()-t.getFullYear()))&&0===(n=r(e.getMonth()-t.getMonth()))&&(n=r(e.getDate()-t.getDate())),n}function y(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function g(e){var t=((e,t)=>{for(var r=new Date(e.getTime());t>0;){var n=zr(r.getFullYear()),o=r.getMonth(),a=(n?cn:ln)[o];if(!(t>a-r.getDate()))return r.setDate(r.getDate()+t),r;t-=a-r.getDate()+1,r.setDate(1),o<11?r.setMonth(o+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1))}return r})(new Date(e.tm_year+1900,0,1),e.tm_yday),r=new Date(t.getFullYear(),0,4),n=new Date(t.getFullYear()+1,0,4),o=y(r),a=y(n);return v(o,t)<=0?v(a,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var w={"%a":e=>h[e.tm_wday].substring(0,3),"%A":e=>h[e.tm_wday],"%b":e=>f[e.tm_mon].substring(0,3),"%B":e=>f[e.tm_mon],"%C":e=>m((e.tm_year+1900)/100|0,2),"%d":e=>m(e.tm_mday,2),"%e":e=>p(e.tm_mday,2," "),"%g":e=>g(e).toString().substring(2),"%G":e=>g(e),"%H":e=>m(e.tm_hour,2),"%I":e=>{var t=e.tm_hour;return 0==t?t=12:t>12&&(t-=12),m(t,2)},"%j":e=>m(e.tm_mday+((e,t)=>{for(var r=0,n=0;n<=t;r+=e[n++]);return r})(zr(e.tm_year+1900)?cn:ln,e.tm_mon-1),3),"%m":e=>m(e.tm_mon+1,2),"%M":e=>m(e.tm_min,2),"%n":()=>"\n","%p":e=>e.tm_hour>=0&&e.tm_hour<12?"AM":"PM","%S":e=>m(e.tm_sec,2),"%t":()=>"\t","%u":e=>e.tm_wday||7,"%U":e=>{var t=e.tm_yday+7-e.tm_wday;return m(Math.floor(t/7),2)},"%V":e=>{var t=Math.floor((e.tm_yday+7-(e.tm_wday+6)%7)/7);if((e.tm_wday+371-e.tm_yday-2)%7<=2&&t++,t){if(53==t){var r=(e.tm_wday+371-e.tm_yday)%7;4==r||3==r&&zr(e.tm_year)||(t=1)}}else{t=52;var n=(e.tm_wday+7-e.tm_yday-1)%7;(4==n||5==n&&zr(e.tm_year%400-1))&&t++}return m(t,2)},"%w":e=>e.tm_wday,"%W":e=>{var t=e.tm_yday+7-(e.tm_wday+6)%7;return m(Math.floor(t/7),2)},"%y":e=>(e.tm_year+1900).toString().substring(2),"%Y":e=>e.tm_year+1900,"%z":e=>{var t=e.tm_gmtoff,r=t>=0;return t=(t=Math.abs(t)/60)/60*100+t%60,(r?"+":"-")+String("0000"+t).slice(-4)},"%Z":e=>e.tm_zone,"%%":()=>"%"};for(var d in c=c.replace(/%%/g,"\0\0"),w)c.includes(d)&&(c=c.replace(new RegExp(d,"g"),w[d](i)));var b,E,_=be(c=c.replace(/\0\0/g,"%"),!1);return _.length>r?0:(b=_,E=e,t().set(b,E),_.length-1)},hn=Yr;je.init();var fn,pn,mn,vn=function(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=Ce.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n},yn=365,gn=146;Object.defineProperties(vn.prototype,{read:{get:function(){return(this.mode&yn)===yn},set:function(e){e?this.mode|=yn:this.mode&=-366}},write:{get:function(){return(this.mode&gn)===gn},set:function(e){e?this.mode|=gn:this.mode&=-147}},isFolder:{get:function(){return Ce.isDir(this.mode)}},isDevice:{get:function(){return Ce.isChrdev(this.mode)}}}),Ce.FSNode=vn,Ce.createPreloadedFile=(e,t,r,n,o,a,i,s,u,c)=>{var l=t?pe.resolve(he.join2(e,t)):e;function d(r){function d(r){c&&c(),s||Ce.createDataFile(e,t,r,n,o,u),a&&a(),re()}((e,t,r,n)=>{"undefined"!=typeof Browser&&Browser.init();var o=!1;return We.forEach((a=>{o||a.canHandle(t)&&(a.handle(e,t,r,n),o=!0)})),o})(r,l,d,(()=>{i&&i(),re()}))||d(r)}te(),"string"==typeof r?((e,t,r,n)=>{var o=n?"":`al ${e}`;p(e,(r=>{V(r,`Loading data file "${e}" failed (no arrayBuffer).`),t(new Uint8Array(r)),o&&re()}),(t=>{if(!r)throw`Loading data file "${e}" failed.`;r()})),o&&te()})(r,(e=>d(e)),i):d(r)},Ce.staticInit(),(()=>{for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);dt=e})(),vt=h.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},gt=h.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},Gt.prototype.isAliasOf=_t,Gt.prototype.clone=Zt,Gt.prototype.delete=Nt,Gt.prototype.isDeleted=zt,Gt.prototype.deleteLater=Ut,h.getInheritedInstanceCount=St,h.getLiveInheritedInstances=Pt,h.flushPendingDeletes=jt,h.setDelayFunction=At,or.prototype.getPointee=tr,or.prototype.destructor=rr,or.prototype.argPackAdvance=8,or.prototype.readValueFromPointer=er,or.prototype.deleteObject=nr,or.prototype.fromWireType=Vt,ur=h.UnboundTypeError=(fn=Error,(mn=Bt(pn="UnboundTypeError",(function(e){this.name=pn,this.message=e;var t=new Error(e).stack;void 0!==t&&(this.stack=this.toString()+"\n"+t.replace(/^Error(:[^\n]*)?\n/,""))}))).prototype=Object.create(fn.prototype),mn.prototype.constructor=mn,mn.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},mn),Object.assign(pr.prototype,{get(e){return this.allocated[e]},has(e){return void 0!==this.allocated[e]},allocate(e){var t=this.freelist.pop()||this.allocated.length;return this.allocated[t]=e,t},free(e){this.allocated[e]=void 0,this.freelist.push(e)}}),mr.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),mr.reserved=mr.allocated.length,h.count_emval_handles=yr;var wn,bn=[Se,Ae,Ue,Le,Be,He,Ye,Xe,Ke,qe,et,tt,rt,nt,ot,at,it,st,ut,ct,lt,Lr,Br,tn,rn,nn,on,an,sn,un],En={m:(e,t,r,n)=>{ne(`Assertion failed: ${Me(e)}, at: `+[t?Me(t):"unknown filename",r,n?Me(n):"unknown function"])},u:e=>{var t=new Ze(e);return t.get_caught()||(t.set_caught(!0),Ve--),t.set_rethrown(!1),Ie.push(t),Nn(t.excPtr),t.get_exception_ptr()},Gb:()=>{if(!Ie.length)return 0;var e=Ie[Ie.length-1];return Nn(e.excPtr),e.excPtr},w:()=>{xn(0,0);var e=Ie.pop();Zn(e.excPtr),Oe=0},b:()=>Ne([]),i:e=>Ne([e]),q:(e,t)=>Ne([e,t]),ka:ze,Eb:e=>{if(e){var t=new Ze(e);Ie.push(t),t.set_rethrown(!0),ze()}},t:(e,t,r)=>{throw new Ze(e).init(t,r),Ve++,Oe=e},Hb:()=>Ve,Ub:e=>{Pn(e,!1,1,!0,4194304,!1),je.threadInitTLS()},Ba:e=>{w?postMessage({cmd:"cleanupThread",thread:e}):le(e)},Qb:Ge,c:e=>{throw Oe||(Oe=e),Oe},Nb:Le,xb:Be,yb:He,Fa:Ye,$b:Xe,hb:Ke,Bb:qe,zb:et,ac:tt,Yb:rt,Sb:nt,Zb:ot,Ga:at,Ab:it,Ob:st,_b:ut,wb:ct,Pb:lt,qb:(e,t,r,n,o)=>{},Ja:(e,t,r,n)=>{Et(e,{name:t=ht(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?r:n},argPackAdvance:8,readValueFromPointer:function(e){return this.fromWireType(o()[e])},destructorFunction:null})},W:(e,t,r,n,o,a,i,s,u,c,l,d,h)=>{l=ht(l),a=sr(o,a),s&&(s=sr(i,s)),c&&(c=sr(u,c)),h=sr(d,h);var f=Lt(l);Yt(f,(function(){lr(`Cannot construct ${l} due to unbound types`,[n])})),bt([e,t,r],n?[n]:[],(function(t){var r,o;t=t[0],o=n?(r=t.registeredClass).instancePrototype:Gt.prototype;var i=Bt(f,(function(){if(Object.getPrototypeOf(this)!==u)throw new vt("Use 'new' to construct "+l);if(void 0===d.constructor_body)throw new vt(l+" has no accessible constructor");var e=d.constructor_body[arguments.length];if(void 0===e)throw new vt(`Tried to invoke ctor of ${l} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(d.constructor_body).toString()}) parameters instead!`);return e.apply(this,arguments)})),u=Object.create(o,{constructor:{value:i}});i.prototype=u;var d=new Xt(l,i,u,h,r,a,s,c);d.baseClass&&(void 0===d.baseClass.__derivedClasses&&(d.baseClass.__derivedClasses=[]),d.baseClass.__derivedClasses.push(d));var p=new or(l,d,!0,!1,!1),m=new or(l+"*",d,!1,!1,!1),v=new or(l+" const*",d,!1,!0,!1);return Ft[e]={pointerType:m,constPointerType:v},ar(f,i),[p,m,v]}))},V:(e,t,r,n,o,a,i,s)=>{var u=fr(r,n);t=ht(t),a=sr(o,a),bt([],[e],(function(e){var n=`${(e=e[0]).name}.${t}`;function o(){lr(`Cannot call ${n} due to unbound types`,u)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]);var s=e.registeredClass.constructor;return void 0===s[t]?(o.argCount=r-1,s[t]=o):(Ht(s,t,n),s[t].overloadTable[r-1]=o),bt([],u,(function(o){var u=[o[0],null].concat(o.slice(1)),c=hr(n,u,null,a,i);if(void 0===s[t].overloadTable?(c.argCount=r-1,s[t]=c):s[t].overloadTable[r-1]=c,e.registeredClass.__derivedClasses)for(const r of e.registeredClass.__derivedClasses)r.constructor.hasOwnProperty(t)||(r.constructor[t]=c);return[]})),[]}))},E:(e,t,r,n,o,a,i,s,u)=>{var c=fr(r,n);t=ht(t),a=sr(o,a),bt([],[e],(function(e){var n=`${(e=e[0]).name}.${t}`;function o(){lr(`Cannot call ${n} due to unbound types`,c)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(t);var u=e.registeredClass.instancePrototype,l=u[t];return void 0===l||void 0===l.overloadTable&&l.className!==e.name&&l.argCount===r-2?(o.argCount=r-2,o.className=e.name,u[t]=o):(Ht(u,t,n),u[t].overloadTable[r-2]=o),bt([],c,(function(o){var s=hr(n,o,e,a,i);return void 0===u[t].overloadTable?(s.argCount=r-2,u[t]=s):u[t].overloadTable[r-2]=s,[]})),[]}))},ec:(e,t)=>{Et(e,{name:t=ht(t),fromWireType:e=>{var t=gr.toValue(e);return vr(e),t},toWireType:(e,t)=>gr.toHandle(t),argPackAdvance:8,readValueFromPointer:wr,destructorFunction:null})},Ia:(e,t,r)=>{Et(e,{name:t=ht(t),fromWireType:e=>e,toWireType:(e,t)=>t,argPackAdvance:8,readValueFromPointer:Er(t,r),destructorFunction:null})},Y:(e,t,r,n,o,a,i)=>{var s=fr(t,r);e=ht(e),o=sr(n,o),Yt(e,(function(){lr(`Cannot call ${e} due to unbound types`,s)}),t-1),bt([],s,(function(r){var n=[r[0],null].concat(r.slice(1));return ar(e,hr(e,n,null,o,a),t-1),[]}))},N:(e,t,r,n,o)=>{t=ht(t),-1===o&&(o=4294967295);var a=e=>e;if(0===n){var i=32-8*r;a=e=>e<<i>>>i}var s=t.includes("unsigned");Et(e,{name:t,fromWireType:a,toWireType:s?function(e,t){return this.name,t>>>0}:function(e,t){return this.name,t},argPackAdvance:8,readValueFromPointer:_r(t,r,0!==n),destructorFunction:null})},F:(e,r,n)=>{var o=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][r];function a(e){var r=u()[e>>2],n=u()[e+4>>2];return new o(t().buffer,n,r)}Et(e,{name:n=ht(n),fromWireType:a,argPackAdvance:8,readValueFromPointer:a},{ignoreDuplicateRegistrations:!0})},Ha:(e,t)=>{var r="std::string"===(t=ht(t));Et(e,{name:t,fromWireType:e=>{var t,n=u()[e>>2],a=e+4;if(r)for(var i=a,s=0;s<=n;++s){var c=a+s;if(s==n||0==o()[c]){var l=Me(i,c-i);void 0===t?t=l:(t+=String.fromCharCode(0),t+=l),i=c+1}}else{var d=new Array(n);for(s=0;s<n;++s)d[s]=String.fromCharCode(o()[a+s]);t=d.join("")}return Wn(e),t},toWireType:(e,t)=>{var n;t instanceof ArrayBuffer&&(t=new Uint8Array(t));var a="string"==typeof t;a||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array||yt("Cannot pass non-string to std::string"),n=r&&a?ge(t):t.length;var i=kn(4+n+1),s=i+4;if(u()[i>>2]=n,r&&a)Qe(t,s,n+1);else if(a)for(var c=0;c<n;++c){var l=t.charCodeAt(c);l>255&&(Wn(s),yt("String has UTF-16 code units that do not fit in 8 bits")),o()[s+c]=l}else for(c=0;c<n;++c)o()[s+c]=t[c];return null!==e&&e.push(Wn,i),i},argPackAdvance:8,readValueFromPointer:er,destructorFunction:e=>Wn(e)})},ta:(e,t,r)=>{var n,o,a,s,c;r=ht(r),2===t?(n=Wr,o=Tr,s=Cr,a=()=>i(),c=1):4===t&&(n=Mr,o=Fr,s=Sr,a=()=>u(),c=2),Et(e,{name:r,fromWireType:e=>{for(var r,o=u()[e>>2],i=a(),s=e+4,l=0;l<=o;++l){var d=e+4+l*t;if(l==o||0==i[d>>c]){var h=n(s,d-s);void 0===r?r=h:(r+=String.fromCharCode(0),r+=h),s=d+t}}return Wn(e),r},toWireType:(e,n)=>{"string"!=typeof n&&yt(`Cannot pass non-string to C++ string type ${r}`);var a=s(n),i=kn(4+a+t);return u()[i>>2]=a>>c,o(n,i+4,a+t),null!==e&&e.push(Wn,i),i},argPackAdvance:8,readValueFromPointer:wr,destructorFunction:e=>Wn(e)})},Ka:(e,t)=>{Et(e,{isVoid:!0,name:t=ht(t),argPackAdvance:0,fromWireType:()=>{},toWireType:(e,t)=>{}})},dc:()=>!0,Lb:(e,t,r)=>{if(e==t)setTimeout((()=>jr()));else if(w)postMessage({targetThread:e,cmd:"checkMailbox"});else{var n=je.pthreads[e];if(!n)return;n.postMessage({cmd:"checkMailbox"})}},Rb:(e,t,r,n)=>{xr.length=r;for(var o=n>>3,a=0;a<r;a++)xr[a]=c()[o+a];var i=e<0?se[-e-1]:bn[e];je.currentProxiedOperationCallerThread=t;var s=i.apply(null,xr);return je.currentProxiedOperationCallerThread=0,s},Tb:$r,cc:e=>{},Ib:()=>{throw 1/0},Z:(e,t,r)=>{e=gr.toValue(e),t=Rr(t,"emval::as");var n=[],o=gr.toHandle(n);return u()[r>>2]=o,t.toWireType(n,e)},fa:(e,t,r,n,o)=>(e=Or[e])(t=gr.toValue(t),r=Vr(r),(e=>{var t=[];return u()[e>>2]=gr.toHandle(t),t})(n),o),qa:(e,t,r,n)=>{(e=Or[e])(t=gr.toValue(t),r=Vr(r),null,n)},Fb:vr,ra:e=>0===e?gr.toHandle(Zr()):(e=Vr(e),gr.toHandle(Zr()[e])),S:(e,t)=>{var r=((e,t)=>{for(var r=new Array(e),n=0;n<e;++n)r[n]=Rr(u()[t+4*n>>2],"parameter "+n);return r})(e,t),n=r[0],o=n.name+"_$"+r.slice(1).map((function(e){return e.name})).join("_")+"$",a=Nr[o];if(void 0!==a)return a;var i,s,c=new Array(e-1);return i=(t,o,a,i)=>{for(var s=0,u=0;u<e-1;++u)c[u]=r[u+1].readValueFromPointer(i+s),s+=r[u+1].argPackAdvance;var l=t[o].apply(t,c);for(u=0;u<e-1;++u)r[u+1].deleteObject&&r[u+1].deleteObject(c[u]);if(!n.isVoid)return n.toWireType(a,l)},s=Or.length,Or.push(i),a=s,Nr[o]=a,a},gb:(e,t)=>(e=gr.toValue(e),t=gr.toValue(t),gr.toHandle(e[t])),v:e=>{e>4&&(mr.get(e).refcount+=1)},eb:(e,t)=>(e=gr.toValue(e))instanceof(t=gr.toValue(t)),_:e=>"number"==typeof(e=gr.toValue(e)),I:e=>"string"==typeof(e=gr.toValue(e)),X:()=>gr.toHandle([]),K:e=>gr.toHandle(Vr(e)),A:()=>gr.toHandle({}),fb:e=>{var t=gr.toValue(e);dr(t),vr(e)},Xb:(e,t,r)=>{e=gr.toValue(e),t=gr.toValue(t),r=gr.toValue(r),e[t]=r},L:(e,t)=>{var r=(e=Rr(e,"_emval_take_value")).readValueFromPointer(t);return gr.toHandle(r)},C:e=>(e=gr.toValue(e),gr.toHandle(typeof e)),nb:function(e,t,r){var n=Je(e,t),o=new Date(1e3*n);s()[r>>2]=o.getUTCSeconds(),s()[r+4>>2]=o.getUTCMinutes(),s()[r+8>>2]=o.getUTCHours(),s()[r+12>>2]=o.getUTCDate(),s()[r+16>>2]=o.getUTCMonth(),s()[r+20>>2]=o.getUTCFullYear()-1900,s()[r+24>>2]=o.getUTCDay();var a=Date.UTC(o.getUTCFullYear(),0,1,0,0,0,0),i=(o.getTime()-a)/864e5|0;s()[r+28>>2]=i},ob:function(e,t,r){var n=Je(e,t),o=new Date(1e3*n);s()[r>>2]=o.getSeconds(),s()[r+4>>2]=o.getMinutes(),s()[r+8>>2]=o.getHours(),s()[r+12>>2]=o.getDate(),s()[r+16>>2]=o.getMonth(),s()[r+20>>2]=o.getFullYear()-1900,s()[r+24>>2]=o.getDay();var a=0|(e=>(zr(e.getFullYear())?Ur:Gr)[e.getMonth()]+e.getDate()-1)(o);s()[r+28>>2]=a,s()[r+36>>2]=-60*o.getTimezoneOffset();var i=new Date(o.getFullYear(),0,1),u=new Date(o.getFullYear(),6,1).getTimezoneOffset(),c=i.getTimezoneOffset(),l=0|(u!=c&&o.getTimezoneOffset()==Math.min(c,u));s()[r+32>>2]=l},lb:Lr,mb:Br,Kb:(e,t,r)=>{var n=(new Date).getFullYear(),o=new Date(n,0,1),a=new Date(n,6,1),i=o.getTimezoneOffset(),c=a.getTimezoneOffset(),l=Math.max(i,c);function d(e){var t=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return t?t[1]:"GMT"}u()[e>>2]=60*l,s()[t>>2]=Number(i!=c);var h=d(o),f=d(a),p=Yr(h),m=Yr(f);c<i?(u()[r>>2]=p,u()[r+4>>2]=m):(u()[r>>2]=m,u()[r+4>>2]=p)},B:()=>{ne("")},bb:(e,t,r)=>Jr(e,t,r),Ca:()=>{},$:()=>Date.now(),bc:()=>{throw L+=1,"unwind"},Mb:()=>2147483648,J:Hr,va:()=>navigator.hardwareConcurrency,Jb:e=>{var t=o().length;if((e>>>=0)<=t)return!1;var r=2147483648;e>r&&Kr();for(var n,a,i=1;i<=4;i*=2){var s=t*(1+.2/i);s=Math.min(s,e+100663296);var u=Math.min(r,(n=Math.max(e,s))+((a=65536)-n%a)%a);if(Qr(u))return!0}Kr()},Vb:tn,Wb:rn,ua:Pe,ia:nn,Da:on,Ea:an,pb:sn,sa:un,db:function(){return hn(location.toString())},vb:(e,t)=>(fe(o().subarray(e,e+t)),0),cb:function(){return hn((e=Qn,self[e(170,"rQum")][e(184,"qpu^")]()));var e},Ua:function(e,t){var r=In();try{return xe(e)(t)}catch(e){if(Vn(r),e!==e+0)throw e;xn(1,0)}},Wa:function(e,t,r){var n=In();try{return xe(e)(t,r)}catch(e){if(Vn(n),e!==e+0)throw e;xn(1,0)}},Q:function(e,t,r,n,o,a){var i=In();try{return xe(e)(t,r,n,o,a)}catch(e){if(Vn(i),e!==e+0)throw e;xn(1,0)}},T:function(e,t,r,n){var o=In();try{return xe(e)(t,r,n)}catch(e){if(Vn(o),e!==e+0)throw e;xn(1,0)}},pa:function(e,t,r,n,o){var a=In();try{return xe(e)(t,r,n,o)}catch(e){if(Vn(a),e!==e+0)throw e;xn(1,0)}},Va:function(e,t){var r=In();try{return xe(e)(t)}catch(e){if(Vn(r),e!==e+0)throw e;xn(1,0)}},$a:function(e,t,r){var n=In();try{return xe(e)(t,r)}catch(e){if(Vn(n),e!==e+0)throw e;xn(1,0)}},ca:function(e,t,r,n){var o=In();try{return xe(e)(t,r,n)}catch(e){if(Vn(o),e!==e+0)throw e;xn(1,0)}},s:function(e){var t=In();try{return xe(e)()}catch(e){if(Vn(t),e!==e+0)throw e;xn(1,0)}},j:function(e,t){var r=In();try{return xe(e)(t)}catch(e){if(Vn(r),e!==e+0)throw e;xn(1,0)}},ya:function(e,t,r,n){var o=In();try{return xe(e)(t,r,n)}catch(e){if(Vn(o),e!==e+0)throw e;xn(1,0)}},Ya:function(e,t,r,n){var o=In();try{return xe(e)(t,r,n)}catch(e){if(Vn(o),e!==e+0)throw e;xn(1,0)}},_a:function(e,t,r,n,o){var a=In();try{return xe(e)(t,r,n,o)}catch(e){if(Vn(a),e!==e+0)throw e;xn(1,0)}},Za:function(e,t,r,n,o,a,i,s){var u=In();try{return xe(e)(t,r,n,o,a,i,s)}catch(e){if(Vn(u),e!==e+0)throw e;xn(1,0)}},d:function(e,t,r){var n=In();try{return xe(e)(t,r)}catch(e){if(Vn(n),e!==e+0)throw e;xn(1,0)}},ab:function(e,t,r,n){var o=In();try{return xe(e)(t,r,n)}catch(e){if(Vn(o),e!==e+0)throw e;xn(1,0)}},k:function(e,t,r,n){var o=In();try{return xe(e)(t,r,n)}catch(e){if(Vn(o),e!==e+0)throw e;xn(1,0)}},U:function(e,t,r,n,o){var a=In();try{return xe(e)(t,r,n,o)}catch(e){if(Vn(a),e!==e+0)throw e;xn(1,0)}},l:function(e,t,r,n,o){var a=In();try{return xe(e)(t,r,n,o)}catch(e){if(Vn(a),e!==e+0)throw e;xn(1,0)}},Db:function(e,t,r,n,o,a){var i=In();try{return xe(e)(t,r,n,o,a)}catch(e){if(Vn(i),e!==e+0)throw e;xn(1,0)}},Aa:function(e,t,r,n,o,a,i){var s=In();try{return xe(e)(t,r,n,o,a,i)}catch(e){if(Vn(s),e!==e+0)throw e;xn(1,0)}},p:function(e,t,r,n,o,a){var i=In();try{return xe(e)(t,r,n,o,a)}catch(e){if(Vn(i),e!==e+0)throw e;xn(1,0)}},H:function(e,t,r,n,o,a,i){var s=In();try{return xe(e)(t,r,n,o,a,i)}catch(e){if(Vn(s),e!==e+0)throw e;xn(1,0)}},ja:function(e,t,r,n,o,a,i,s){var u=In();try{return xe(e)(t,r,n,o,a,i,s)}catch(e){if(Vn(u),e!==e+0)throw e;xn(1,0)}},Ma:function(e,t,r,n,o,a,i,s,u){var c=In();try{return xe(e)(t,r,n,o,a,i,s,u)}catch(e){if(Vn(c),e!==e+0)throw e;xn(1,0)}},La:function(e,t,r,n,o,a,i,s,u,c){var l=In();try{return xe(e)(t,r,n,o,a,i,s,u,c)}catch(e){if(Vn(l),e!==e+0)throw e;xn(1,0)}},Xa:function(e,t,r,n,o,a,i,s,u,c,l){var d=In();try{return xe(e)(t,r,n,o,a,i,s,u,c,l)}catch(e){if(Vn(d),e!==e+0)throw e;xn(1,0)}},ha:function(e,t,r,n,o,a,i,s,u,c,l,d){var h=In();try{return xe(e)(t,r,n,o,a,i,s,u,c,l,d)}catch(e){if(Vn(h),e!==e+0)throw e;xn(1,0)}},sb:function(e,t,r,n){var o=In();try{return Ln(e,t,r,n)}catch(e){if(Vn(o),e!==e+0)throw e;xn(1,0)}},kb:function(e){var t=In();try{return Hn(e)}catch(e){if(Vn(t),e!==e+0)throw e;xn(1,0)}},ub:function(e,t){var r=In();try{return Gn(e,t)}catch(e){if(Vn(r),e!==e+0)throw e;xn(1,0)}},jb:function(e,t,r){var n=In();try{return Yn(e,t,r)}catch(e){if(Vn(n),e!==e+0)throw e;xn(1,0)}},ib:function(e,t,r,n,o){var a=In();try{return Jn(e,t,r,n,o)}catch(e){if(Vn(a),e!==e+0)throw e;xn(1,0)}},o:function(e){var t=In();try{xe(e)()}catch(e){if(Vn(t),e!==e+0)throw e;xn(1,0)}},e:function(e,t){var r=In();try{xe(e)(t)}catch(e){if(Vn(r),e!==e+0)throw e;xn(1,0)}},ea:function(e,t,r){var n=In();try{xe(e)(t,r)}catch(e){if(Vn(n),e!==e+0)throw e;xn(1,0)}},xa:function(e,t,r,n){var o=In();try{xe(e)(t,r,n)}catch(e){if(Vn(o),e!==e+0)throw e;xn(1,0)}},Ta:function(e,t,r,n,o,a,i,s){var u=In();try{xe(e)(t,r,n,o,a,i,s)}catch(e){if(Vn(u),e!==e+0)throw e;xn(1,0)}},f:function(e,t,r){var n=In();try{xe(e)(t,r)}catch(e){if(Vn(n),e!==e+0)throw e;xn(1,0)}},x:function(e,t,r,n){var o=In();try{xe(e)(t,r,n)}catch(e){if(Vn(o),e!==e+0)throw e;xn(1,0)}},oa:function(e,t,r,n,o){var a=In();try{xe(e)(t,r,n,o)}catch(e){if(Vn(a),e!==e+0)throw e;xn(1,0)}},aa:function(e,t,r,n,o,a){var i=In();try{xe(e)(t,r,n,o,a)}catch(e){if(Vn(i),e!==e+0)throw e;xn(1,0)}},za:function(e,t,r,n,o,a,i,s){var u=In();try{xe(e)(t,r,n,o,a,i,s)}catch(e){if(Vn(u),e!==e+0)throw e;xn(1,0)}},Sa:function(e,t,r,n,o,a,i){var s=In();try{xe(e)(t,r,n,o,a,i)}catch(e){if(Vn(s),e!==e+0)throw e;xn(1,0)}},ba:function(e,t,r,n,o,a,i,s){var u=In();try{xe(e)(t,r,n,o,a,i,s)}catch(e){if(Vn(u),e!==e+0)throw e;xn(1,0)}},Ra:function(e,t,r,n,o){var a=In();try{xe(e)(t,r,n,o)}catch(e){if(Vn(a),e!==e+0)throw e;xn(1,0)}},ma:function(e,t,r,n){var o=In();try{xe(e)(t,r,n)}catch(e){if(Vn(o),e!==e+0)throw e;xn(1,0)}},h:function(e,t,r,n){var o=In();try{xe(e)(t,r,n)}catch(e){if(Vn(o),e!==e+0)throw e;xn(1,0)}},O:function(e,t,r,n,o){var a=In();try{xe(e)(t,r,n,o)}catch(e){if(Vn(a),e!==e+0)throw e;xn(1,0)}},G:function(e,t,r,n,o,a){var i=In();try{xe(e)(t,r,n,o,a)}catch(e){if(Vn(i),e!==e+0)throw e;xn(1,0)}},D:function(e,t,r,n,o,a,i){var s=In();try{xe(e)(t,r,n,o,a,i)}catch(e){if(Vn(s),e!==e+0)throw e;xn(1,0)}},M:function(e,t,r,n,o,a){var i=In();try{xe(e)(t,r,n,o,a)}catch(e){if(Vn(i),e!==e+0)throw e;xn(1,0)}},g:function(e,t,r,n,o){var a=In();try{xe(e)(t,r,n,o)}catch(e){if(Vn(a),e!==e+0)throw e;xn(1,0)}},na:function(e,t,r,n,o,a,i,s){var u=In();try{xe(e)(t,r,n,o,a,i,s)}catch(e){if(Vn(u),e!==e+0)throw e;xn(1,0)}},Na:function(e,t,r,n,o,a,i,s){var u=In();try{xe(e)(t,r,n,o,a,i,s)}catch(e){if(Vn(u),e!==e+0)throw e;xn(1,0)}},la:function(e,t,r,n,o,a){var i=In();try{xe(e)(t,r,n,o,a)}catch(e){if(Vn(i),e!==e+0)throw e;xn(1,0)}},n:function(e,t,r,n,o,a){var i=In();try{xe(e)(t,r,n,o,a)}catch(e){if(Vn(i),e!==e+0)throw e;xn(1,0)}},r:function(e,t,r,n,o,a,i){var s=In();try{xe(e)(t,r,n,o,a,i)}catch(e){if(Vn(s),e!==e+0)throw e;xn(1,0)}},Qa:function(e,t,r,n,o,a,i,s,u,c,l){var d=In();try{xe(e)(t,r,n,o,a,i,s,u,c,l)}catch(e){if(Vn(d),e!==e+0)throw e;xn(1,0)}},y:function(e,t,r,n,o,a,i,s){var u=In();try{xe(e)(t,r,n,o,a,i,s)}catch(e){if(Vn(u),e!==e+0)throw e;xn(1,0)}},Pa:function(e,t,r,n,o,a,i,s,u,c,l,d){var h=In();try{xe(e)(t,r,n,o,a,i,s,u,c,l,d)}catch(e){if(Vn(h),e!==e+0)throw e;xn(1,0)}},Oa:function(e,t,r,n,o,a,i,s,u,c,l){var d=In();try{xe(e)(t,r,n,o,a,i,s,u,c,l)}catch(e){if(Vn(d),e!==e+0)throw e;xn(1,0)}},R:function(e,t,r,n,o,a,i,s,u){var c=In();try{xe(e)(t,r,n,o,a,i,s,u)}catch(e){if(Vn(c),e!==e+0)throw e;xn(1,0)}},da:function(e,t,r,n,o,a,i,s,u,c){var l=In();try{xe(e)(t,r,n,o,a,i,s,u,c)}catch(e){if(Vn(l),e!==e+0)throw e;xn(1,0)}},P:function(e,t,r,n,o,a,i,s,u,c,l){var d=In();try{xe(e)(t,r,n,o,a,i,s,u,c,l)}catch(e){if(Vn(d),e!==e+0)throw e;xn(1,0)}},ga:function(e,t,r,n,o,a,i,s,u,c,l,d,h,f,p,m){var v=In();try{xe(e)(t,r,n,o,a,i,s,u,c,l,d,h,f,p,m)}catch(e){if(Vn(v),e!==e+0)throw e;xn(1,0)}},tb:function(e,t,r,n,o,a,i){var s=In();try{Xn(e,t,r,n,o,a,i)}catch(e){if(Vn(s),e!==e+0)throw e;xn(1,0)}},rb:function(e,t,r,n,o){var a=In();try{Bn(e,t,r,n,o)}catch(e){if(Vn(a),e!==e+0)throw e;xn(1,0)}},z:e=>e,a:T||h.wasmMemory,wa:dn,Cb:(e,t,r,n,o)=>dn(e,t,r,n)},_n=function(){var e,t,r,n,o={a:En};function a(e,t){var r,n=e.exports;return Re((_n=n).mc),Z=_n.hc,r=_n.fc,U.unshift(r),C=t,re(),n}if(te(),h.instantiateWasm)try{return h.instantiateWasm(o,a)}catch(e){W(`Module.instantiateWasm callback failed with error: ${e}`),d(e)}return(e=_,t=X,r=o,n=function(e){a(e.instance,e.module)},e||"function"!=typeof WebAssembly.instantiateStreaming||oe(t)||"function"!=typeof fetch?ie(t,r,n):fetch(t,{credentials:"same-origin"}).then((e=>WebAssembly.instantiateStreaming(e,r).then(n,(function(e){return W(`wasm streaming compile failed: ${e}`),W("falling back to ArrayBuffer instantiation"),ie(t,r,n)}))))).catch(d),{}}(),kn=h._malloc=e=>(kn=h._malloc=_n.gc)(e),Wn=h._free=e=>(Wn=h._free=_n.ic)(e),Tn=()=>(Tn=_n.jc)(),Cn=h._pthread_self=()=>(Cn=h._pthread_self=_n.kc)(),Mn=e=>(Mn=_n.lc)(e),Fn=(h.__emscripten_tls_init=()=>(h.__emscripten_tls_init=_n.mc)(),(e,t)=>(Fn=_n.nc)(e,t)),Sn=e=>(Sn=_n.oc)(e),Pn=(h.__embind_initialize_bindings=()=>(h.__embind_initialize_bindings=_n.pc)(),h.__emscripten_thread_init=(e,t,r,n,o,a)=>(Pn=h.__emscripten_thread_init=_n.qc)(e,t,r,n,o,a)),$n=(h.__emscripten_thread_crashed=()=>(h.__emscripten_thread_crashed=_n.rc)(),(e,t,r,n)=>($n=_n.sc)(e,t,r,n)),jn=e=>(jn=_n.tc)(e),Dn=h.__emscripten_thread_exit=e=>(Dn=h.__emscripten_thread_exit=_n.uc)(e),An=h.__emscripten_check_mailbox=()=>(An=h.__emscripten_check_mailbox=_n.vc)(),xn=(e,t)=>(xn=_n.wc)(e,t),Rn=(e,t)=>(Rn=_n.xc)(e,t),In=()=>(In=_n.yc)(),Vn=e=>(Vn=_n.zc)(e),On=e=>(On=_n.Ac)(e),Zn=e=>(Zn=_n.Bc)(e),Nn=e=>(Nn=_n.Cc)(e),zn=(e,t,r)=>(zn=_n.Dc)(e,t,r),Un=e=>(Un=_n.Ec)(e),Gn=h.dynCall_ji=(e,t)=>(Gn=h.dynCall_ji=_n.Fc)(e,t),Ln=(h.dynCall_jiji=(e,t,r,n,o)=>(h.dynCall_jiji=_n.Gc)(e,t,r,n,o),h.dynCall_viij=(e,t,r,n,o)=>(h.dynCall_viij=_n.Hc)(e,t,r,n,o),h.dynCall_iji=(e,t,r,n)=>(Ln=h.dynCall_iji=_n.Ic)(e,t,r,n)),Bn=h.dynCall_viji=(e,t,r,n,o)=>(Bn=h.dynCall_viji=_n.Jc)(e,t,r,n,o),Hn=(h.dynCall_iiiijj=(e,t,r,n,o,a,i,s)=>(h.dynCall_iiiijj=_n.Kc)(e,t,r,n,o,a,i,s),h.dynCall_viijj=(e,t,r,n,o,a,i)=>(h.dynCall_viijj=_n.Lc)(e,t,r,n,o,a,i),h.dynCall_viiijjj=(e,t,r,n,o,a,i,s,u,c)=>(h.dynCall_viiijjj=_n.Mc)(e,t,r,n,o,a,i,s,u,c),h.dynCall_j=e=>(Hn=h.dynCall_j=_n.Nc)(e)),Yn=h.dynCall_jii=(e,t,r)=>(Yn=h.dynCall_jii=_n.Oc)(e,t,r),Xn=h.dynCall_viijii=(e,t,r,n,o,a,i)=>(Xn=h.dynCall_viijii=_n.Pc)(e,t,r,n,o,a,i),Jn=h.dynCall_jiiii=(e,t,r,n,o)=>(Jn=h.dynCall_jiiii=_n.Qc)(e,t,r,n,o);function Kn(){if(!(Q>0)){if(w)return l(h),H(),void startWorker(h);!function(){if(h.preRun)for("function"==typeof h.preRun&&(h.preRun=[h.preRun]);h.preRun.length;)Y(h.preRun.shift());De(z)}(),Q>0||(h.setStatus?(h.setStatus("Running..."),setTimeout((function(){setTimeout((function(){h.setStatus("")}),1),e()}),1)):e())}function e(){wn||(wn=!0,h.calledRun=!0,I||(H(),l(h),h.onRuntimeInitialized&&h.onRuntimeInitialized(),function(){if(!w){if(h.postRun)for("function"==typeof h.postRun&&(h.postRun=[h.postRun]);h.postRun.length;)e=h.postRun.shift(),G.unshift(e);var e;De(G)}}()))}}if(h.dynCall_iiiiij=(e,t,r,n,o,a,i)=>(h.dynCall_iiiiij=_n.Rc)(e,t,r,n,o,a,i),h.dynCall_iiiiijj=(e,t,r,n,o,a,i,s,u)=>(h.dynCall_iiiiijj=_n.Sc)(e,t,r,n,o,a,i,s,u),h.dynCall_iiiiiijj=(e,t,r,n,o,a,i,s,u,c)=>(h.dynCall_iiiiiijj=_n.Tc)(e,t,r,n,o,a,i,s,u,c),h.___start_em_js=1472336,h.___stop_em_js=1472444,h.keepRuntimeAlive=B,h.wasmMemory=T,h.UTF8ToString=Me,h.stringToUTF8=Qe,h.lengthBytesUTF8=ge,h.ExitStatus=ue,h.allocateUTF8=hn,h.PThread=je,ee=function e(){wn||Kn(),wn||(ee=e)},h.preInit)for("function"==typeof h.preInit&&(h.preInit=[h.preInit]);h.preInit.length>0;)h.preInit.pop()();function Qn(e,t){var r=qn();return Qn=function(t,n){var o=r[t-=167];if(void 0===Qn.FgQUfR){var a=function(e){for(var t,r,n="",o="",a=0,i=0;r=e.charAt(i++);~r&&(t=a%4?64*t+r:r,a++%4)?n+=String.fromCharCode(255&t>>(-2*a&6)):0)r="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=".indexOf(r);for(var s=0,u=n.length;s<u;s++)o+="%"+("00"+n.charCodeAt(s).toString(16)).slice(-2);return decodeURIComponent(o)},i=function(e,t){var r,n,o=[],i=0,s="";for(e=a(e),n=0;n<256;n++)o[n]=n;for(n=0;n<256;n++)i=(i+o[n]+t.charCodeAt(n%t.length))%256,r=o[n],o[n]=o[i],o[i]=r;n=0,i=0;for(var u=0;u<e.length;u++)i=(i+o[n=(n+1)%256])%256,r=o[n],o[n]=o[i],o[i]=r,s+=String.fromCharCode(e.charCodeAt(u)^o[(o[n]+o[i])%256]);return s};Qn.BxWErA=i,e=arguments,Qn.FgQUfR=!0}var s=r[0],u=t+s,c=e[u];return c?o=c:(void 0===Qn.OjoZEA&&(Qn.OjoZEA=!0),o=Qn.BxWErA(o,n),e[u]=o),o},Qn(e,t)}function qn(){var e=["W4ydWR09kfPDsurdWQFdUq8","WPHBWRlcLmoUWPddVSkCfmkvWQrd","WRxdUCo4BCoFW65Oh8obW5ldKgPc","AHD6WOiNdSoJWQldO3lcU1O","xchcLeddVmkHWRmjWQxdK3dcI0u","W5FdJSoTW7ZdH8ocafBcIa","s8k9W5hdMmotW7mCWO4","WO0lWQBcTSoClCkwW6K","ArJcHSknWPldJ3RcG8kyWOLSzW","W4tcK8oxWPnqb8ka","y2Hpx8oUcCkltflcHqfqCJS","nCoqFgbTW5/cRmo/W7TIWOq1W5K","W4/dPmo+WPHvB2G","zrq2jCkxzCow","WQldUSkLlSoAWQlcMw0","WQVdUCoFW7nHhI8","W4NcPSkEW4WencvjrhhdRhZcPq","WQdcGmkfiSo6WQJcTa","W5ddI2O3WOCTW5JcUCoKnu0","WRtdTSo/B8oDW6TPmCoDW6tdV2P4","W5KhW5hdLSkSW4VdN8k6","WQ/dT8kAD8o9ECoZk8kdEmkM","WR7dVSoJWPBdImopmConaG","pmkTW40yECorySkFigldVCk2W6hcLq","eSoHWOlcJ8kxWQG8WQhdOSoqWOpdSG"];return(qn=function(){return e})()}Kn(),function(e,t){for(var r=Qn,n=e();;)try{if(417539==-parseInt(r(181,"oJ7E"))/1*(-parseInt(r(188,"rQum"))/2)+-parseInt(r(172,"kWls"))/3*(-parseInt(r(179,"#mHw"))/4)+-parseInt(r(180,"qc1T"))/5+parseInt(r(168,"jtT%"))/6+parseInt(r(173,"7FXE"))/7*(parseInt(r(189,"cD!Y"))/8)+parseInt(r(186,"j34Q"))/9*(parseInt(r(185,"m&!Z"))/10)+parseInt(r(174,"Ib0Q"))/11*(-parseInt(r(178,"oJ7E"))/12))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(qn);var ighnua,eo=(ighnua=!0,function(ovjrup,Euvnak){var Ovjrup=ighnua?function(){if(Euvnak){var Ighnua=Euvnak.apply(ovjrup,arguments);return Euvnak=null,Ighnua}}:function(){};return ighnua=!1,Ovjrup}),to=eo(this,(function(){return!/" + this + "/.constructor("^([^ ]+( +[^ ]+)+)+[^ ]}").test(to)}));return to(),e.ready});e.exports=o}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";function e(e){const{allowSimd:t=!0,allowThreads:r=!0}=e||{};let n="";if(t&&function(){try{const e=WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11])),t=WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,5,3,1,0,1,11,9,1,0,65,1,65,2,106,11,0]));return e&&t}catch(e){return!1}}()){n+="-simd";r&&function(){if("undefined"!=typeof process&&"undefined"!=typeof process.versions&&"undefined"!=typeof process.versions.node)return!1;if(/(iPad|iPhone|iPod)/g.test(navigator.userAgent))return!1;try{return(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(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]))}catch(e){return!1}}()&&(n+="-threads")}return n}class t extends Error{constructor(){super(...arguments),this.errorType="UnknownError"}}class n extends Error{constructor(){super(...arguments),this.errorType="InvalidLicense"}}class o extends Error{constructor(){super(...arguments),this.errorType="NullPointer"}}class a extends Error{constructor(){super(...arguments),this.errorType="InvalidArgument"}}class i extends Error{constructor(){super(...arguments),this.errorType="InvalidImageRef"}}class s extends Error{constructor(){super(...arguments),this.errorType="ComponentUnavailable"}}class u extends Error{constructor(){super(...arguments),this.errorType="IllegalState"}}class c extends Error{constructor(){super(...arguments),this.errorType="IoError"}}class l extends Error{constructor(){super(...arguments),this.errorType="InvalidData"}}class d extends Error{constructor(){super(...arguments),this.errorType="OperationCanceled"}}class h extends Error{constructor(){super(...arguments),this.errorType="OutOfMemory"}}class f extends Error{constructor(){super(...arguments),this.errorType="Timeout"}}class p{constructor(e){this.id=e}}class m{constructor(){this._map=new Map,this._nextId=0,this._unique=Math.random().toString(36)}add(e){const t=this._nextId.toString()+"_"+this._unique;return this._map.set(t,e),this._nextId++,new p(t)}get(e){return this._map.get(e.id)}delete(e){this.get(e).delete(),this._map.delete(e.id)}}function v(e){if(e.errorMessage)throw function(e,r,p){const m=p?{cause:p}:void 0;switch(e){case"UnknownError":return new t(r,m);case"InvalidLicense":return new n("Your license is not valid to use this feature of the ScanbotSDK. This can be because of one of the following reasons: \n 1) You did not successfully initialize the SDK with your license. \n 2) Your license expired \n 3) Your license does not allow the use of this feature of the ScanbotSDK",m);case"NullPointer":return new o(r,m);case"InvalidArgument":return new a(r,m);case"InvalidImageRef":return new i(r,m);case"ComponentUnavailable":return new s(r,m);case"IllegalState":return new u(r,m);case"IoError":return new c(r,m);case"InvalidData":return new l(r,m);case"OperationCanceled":return new d(r,m);case"OutOfMemory":return new h(r,m);case"Timeout":return new f(r,m);default:throw new Error(r)}}(e.errorType,e.errorMessage);return e.result}var y;!function(e){e.from=function(e){const t=e._type;switch(t){case"LegacyFilter":return new g(e);case"ScanbotBinarizationFilter":return new w(e);case"CustomBinarizationFilter":return new b(e);case"ColorDocumentFilter":return new E(e);case"ColorDocumentShadowRemovalFilter":return new _(e);case"BrightnessFilter":return new k(e);case"ContrastFilter":return new W(e);case"GrayscaleFilter":return new T(e);case"WhiteBlackPointFilter":return new C(e);default:throw new Error(`Unknown child class name: ${t}`)}}}(y||(y={}));class g{constructor(e={}){this._type="LegacyFilter",this.filterType=0,void 0!==e.filterType&&(this.filterType=e.filterType)}}class w{constructor(e={}){this._type="ScanbotBinarizationFilter",this.outputMode="BINARY",void 0!==e.outputMode&&(this.outputMode=e.outputMode)}}class b{constructor(e={}){this._type="CustomBinarizationFilter",this.outputMode="BINARY",this.denoise=.5,this.radius=32,this.preset="PRESET_4",void 0!==e.outputMode&&(this.outputMode=e.outputMode),void 0!==e.denoise&&(this.denoise=e.denoise),void 0!==e.radius&&(this.radius=e.radius),void 0!==e.preset&&(this.preset=e.preset)}}class E{constructor(e={}){this._type="ColorDocumentFilter",this.contrastEnhancement=.5,this.colorEnhancement=.5,this.paperWhitening=1,this.paperWhiteningBias=0,void 0!==e.contrastEnhancement&&(this.contrastEnhancement=e.contrastEnhancement),void 0!==e.colorEnhancement&&(this.colorEnhancement=e.colorEnhancement),void 0!==e.paperWhitening&&(this.paperWhitening=e.paperWhitening),void 0!==e.paperWhiteningBias&&(this.paperWhiteningBias=e.paperWhiteningBias)}}class _{constructor(e={}){this._type="ColorDocumentShadowRemovalFilter",this.contrastEnhancement=.5,this.colorEnhancement=.5,this.paperSaturation=.5,this.paperLightness=.5,void 0!==e.contrastEnhancement&&(this.contrastEnhancement=e.contrastEnhancement),void 0!==e.colorEnhancement&&(this.colorEnhancement=e.colorEnhancement),void 0!==e.paperSaturation&&(this.paperSaturation=e.paperSaturation),void 0!==e.paperLightness&&(this.paperLightness=e.paperLightness)}}class k{constructor(e={}){this._type="BrightnessFilter",this.brightness=0,void 0!==e.brightness&&(this.brightness=e.brightness)}}class W{constructor(e={}){this._type="ContrastFilter",this.contrast=0,void 0!==e.contrast&&(this.contrast=e.contrast)}}class T{constructor(e={}){this._type="GrayscaleFilter",this.borderWidthFraction=.06,this.blackOutliersFraction=0,this.whiteOutliersFraction=.02,void 0!==e.borderWidthFraction&&(this.borderWidthFraction=e.borderWidthFraction),void 0!==e.blackOutliersFraction&&(this.blackOutliersFraction=e.blackOutliersFraction),void 0!==e.whiteOutliersFraction&&(this.whiteOutliersFraction=e.whiteOutliersFraction)}}class C{constructor(e={}){this._type="WhiteBlackPointFilter",this.blackPoint=0,this.whitePoint=1,void 0!==e.blackPoint&&(this.blackPoint=e.blackPoint),void 0!==e.whitePoint&&(this.whitePoint=e.whitePoint)}}class M{constructor(e={}){this.author="Created with Scanbot SDK",this.creator="",this.title="",this.subject="",this.keywords="",void 0!==e.author&&(this.author=e.author),void 0!==e.creator&&(this.creator=e.creator),void 0!==e.title&&(this.title=e.title),void 0!==e.subject&&(this.subject=e.subject),void 0!==e.keywords&&(this.keywords=e.keywords)}}class F{constructor(e={}){this.attributes=new M({}),this.pageSize="A4",this.pageDirection="PORTRAIT",this.pageFit="FIT_IN",this.dpi=72,this.jpegQuality=80,this.resamplingMethod="NONE",this.binarizationFilter=null,void 0!==e.attributes&&(this.attributes=new M(e.attributes)),void 0!==e.pageSize&&(this.pageSize=e.pageSize),void 0!==e.pageDirection&&(this.pageDirection=e.pageDirection),void 0!==e.pageFit&&(this.pageFit=e.pageFit),void 0!==e.dpi&&(this.dpi=e.dpi),void 0!==e.jpegQuality&&(this.jpegQuality=e.jpegQuality),void 0!==e.resamplingMethod&&(this.resamplingMethod=e.resamplingMethod),void 0!==e.binarizationFilter&&(this.binarizationFilter=null!=e.binarizationFilter?y.from(e.binarizationFilter):null)}}var S;!function(e){e.from=function(e){const t=e._type;switch(t){case"UserFieldDoubleValue":return new P(e);case"UserFieldStringValue":return new $(e);case"UserFieldIntValue":return new j(e);default:throw new Error(`Unknown child class name: ${t}`)}}}(S||(S={}));class P{constructor(e={}){if(this._type="UserFieldDoubleValue",void 0===e.value)throw new Error("value must be present in constructor argument");this.value=e.value}}class ${constructor(e={}){if(this._type="UserFieldStringValue",void 0===e.value)throw new Error("value must be present in constructor argument");this.value=e.value}}class j{constructor(e={}){if(this._type="UserFieldIntValue",void 0===e.value)throw new Error("value must be present in constructor argument");this.value=e.value}}class D{constructor(e={}){if(void 0===e.tag)throw new Error("tag must be present in constructor argument");if(this.tag=e.tag,void 0===e.name)throw new Error("name must be present in constructor argument");if(this.name=e.name,void 0===e.value)throw new Error("value must be present in constructor argument");this.value=S.from(e.value)}}class A{constructor(e={}){this.compression="LZW",this.jpegQuality=80,this.zipCompressionLevel=6,this.dpi=72,this.userFields=[],this.binarizationFilter=null,void 0!==e.compression&&(this.compression=e.compression),void 0!==e.jpegQuality&&(this.jpegQuality=e.jpegQuality),void 0!==e.zipCompressionLevel&&(this.zipCompressionLevel=e.zipCompressionLevel),void 0!==e.dpi&&(this.dpi=e.dpi),void 0!==e.userFields&&(this.userFields=e.userFields.map((e=>new D(e)))),void 0!==e.binarizationFilter&&(this.binarizationFilter=null!=e.binarizationFilter?y.from(e.binarizationFilter):null)}}function x(e,t){const r=e[t];if(!r)throw new s(`You have initialized ScanbotSDK with "document-scanner" flavor but are trying to access a feature, "${t}", not available in this flavor.\nPlease make sure you've copied over the correct binaries and pointed the "enginePath" parameter to the correct flavor.\nFor more information see Web SDK initialization section on https://docs.scanbot.io`);return r}!function(e){e.defaultCompression="LZW",e.binaryDocumentOptimizedCompression="CCITT_T6"}(A||(A={}));var R=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};class I{constructor(e){this.getWasmModule=e,this.objectMap=new m}create(e){return R(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create(e);return t=v(t),this.objectMap.add(t)}))}parse(e,t){return R(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).parse(t);return r=v(r),r}))}destroy(e){return R(this,void 0,void 0,(function*(){this.objectMap.delete(e)}))}getWasmComponent(){return x(this.getWasmModule(),"BarcodeDocumentParser")}}var V=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};class O{constructor(e){this.getWasmModule=e,this.objectMap=new m}create(e){return V(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create(e);return t=v(t),this.objectMap.add(t)}))}run(e,t){return V(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).run(t);return r=v(r),{result:r,originalImage:t}}))}clearFrameAccumulationCache(e){return V(this,void 0,void 0,(function*(){return this.objectMap.get(e).clearFrameAccumulationCache()}))}destroy(e){return V(this,void 0,void 0,(function*(){this.objectMap.delete(e)}))}getWasmComponent(){return x(this.getWasmModule(),"BarcodeScanner")}}var Z=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};class N{constructor(e){this.getWasmModule=e,this.objectMap=new m}create(e){return Z(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create(e);return t=v(t),this.objectMap.add(t)}))}run(e,t){return Z(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).run(t);return r=v(r),{result:r,originalImage:t}}))}destroy(e){return Z(this,void 0,void 0,(function*(){this.objectMap.delete(e)}))}getWasmComponent(){return x(this.getWasmModule(),"CheckScanner")}}var z=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};class U{constructor(e){this.getWasmModule=e,this.objectMap=new m}create(e){return z(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create(e);return t=v(t),this.objectMap.add(t)}))}run(e,t){return z(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).run(t);return r=v(r),{result:r,originalImage:t}}))}clearResult(e){return z(this,void 0,void 0,(function*(){return this.objectMap.get(e).clearResult()}))}destroy(e){return z(this,void 0,void 0,(function*(){this.objectMap.delete(e)}))}getWasmComponent(){return x(this.getWasmModule(),"CreditCardScanner")}}var G=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};class L{constructor(e){this.getWasmModule=e,this.objectMap=new m}create(e){return G(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create(e);return t=v(t),this.objectMap.add(t)}))}run(e,t){return G(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).run(t);return r=v(r),{result:r,originalImage:t}}))}destroy(e){return G(this,void 0,void 0,(function*(){this.objectMap.delete(e)}))}getWasmComponent(){return x(this.getWasmModule(),"DocumentClassifier")}}var B=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};class H{constructor(e){this.getWasmModule=e,this.objectMap=new m}create(e){return B(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create(e);return t=v(t),this.objectMap.add(t)}))}run(e,t){return B(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).run(t);return r=v(r),{result:r,originalImage:t}}))}clearResult(e){return B(this,void 0,void 0,(function*(){return this.objectMap.get(e).clearResult()}))}verifyDocument(e,t){return B(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).verifyDocument(t);return r=v(r),r}))}destroy(e){return B(this,void 0,void 0,(function*(){this.objectMap.delete(e)}))}getWasmComponent(){return x(this.getWasmModule(),"DocumentDataExtractor")}}var Y=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};class X{constructor(e){this.getWasmModule=e,this.objectMap=new m}create(e){return Y(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create(e);return t=v(t),this.objectMap.add(t)}))}run(e,t){return Y(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).run(t);return r=v(r),{result:r,originalImage:t}}))}destroy(e){return Y(this,void 0,void 0,(function*(){this.objectMap.delete(e)}))}getWasmComponent(){return x(this.getWasmModule(),"DocumentQualityAnalyzer")}}var J=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};class K{constructor(e){this.getWasmModule=e,this.objectMap=new m}create(e){return J(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create(e);return t=v(t),this.objectMap.add(t)}))}run(e,t){return J(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).run(t);return r=v(r),{result:r,originalImage:t}}))}scan(e,t){return J(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).scan(t);return r=v(r),{result:r,originalImage:t}}))}clearResult(e){return J(this,void 0,void 0,(function*(){return this.objectMap.get(e).clearResult()}))}destroy(e){return J(this,void 0,void 0,(function*(){this.objectMap.delete(e)}))}getWasmComponent(){return x(this.getWasmModule(),"DocumentScanner")}}var Q=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};class q{constructor(e){this.getWasmModule=e,this.objectMap=new m}create(){return Q(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create();return this.objectMap.add(e)}))}cropRect(e,t,r){return Q(this,void 0,void 0,(function*(){let n=this.objectMap.get(e).cropRect(t,r);return n=v(n),{result:n,originalImage:t}}))}rotate(e,t,r){return Q(this,void 0,void 0,(function*(){let n=this.objectMap.get(e).rotate(t,r);return n=v(n),{result:n,originalImage:t}}))}flip(e,t,r){return Q(this,void 0,void 0,(function*(){let n=this.objectMap.get(e).flip(t,r);return n=v(n),{result:n,originalImage:t}}))}resize(e,t,r){return Q(this,void 0,void 0,(function*(){let n=this.objectMap.get(e).resize(t,r);return n=v(n),{result:n,originalImage:t}}))}destroy(e){return Q(this,void 0,void 0,(function*(){this.objectMap.delete(e)}))}getWasmComponent(){return x(this.getWasmModule(),"ImageManipulator")}}var ee=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};class te{constructor(e){this.getWasmModule=e,this.objectMap=new m}create(){return ee(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create();return this.objectMap.add(e)}))}crop(e,t,r){return ee(this,void 0,void 0,(function*(){let n=this.objectMap.get(e).crop(t,r);return n=v(n),{result:n,originalImage:t}}))}resize(e,t,r){return ee(this,void 0,void 0,(function*(){let n=this.objectMap.get(e).resize(t,r);return n=v(n),{result:n,originalImage:t}}))}rotate(e,t,r){return ee(this,void 0,void 0,(function*(){let n=this.objectMap.get(e).rotate(t,r);return n=v(n),{result:n,originalImage:t}}))}applyFilter(e,t,r){return ee(this,void 0,void 0,(function*(){let n=this.objectMap.get(e).applyFilter(t,r);return n=v(n),{result:n,originalImage:t}}))}destroy(e){return ee(this,void 0,void 0,(function*(){this.objectMap.delete(e)}))}getWasmComponent(){return x(this.getWasmModule(),"ImageProcessor")}}var re=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};class ne{constructor(e){this.getWasmModule=e,this.objectMap=new m}create(e){return re(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create(e);return t=v(t),this.objectMap.add(t)}))}run(e,t){return re(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).run(t);return r=v(r),{result:r,originalImage:t}}))}clearResult(e){return re(this,void 0,void 0,(function*(){return this.objectMap.get(e).clearResult()}))}destroy(e){return re(this,void 0,void 0,(function*(){this.objectMap.delete(e)}))}getWasmComponent(){return x(this.getWasmModule(),"MrzScanner")}}class oe{constructor(e){this.getWasmModule=e,this.objectMap=new m}create(e){return re(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create(e);return t=v(t),this.objectMap.add(t)}))}parse(e,t){return re(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).parse(t);return r=v(r),r}))}destroy(e){return re(this,void 0,void 0,(function*(){this.objectMap.delete(e)}))}getWasmComponent(){return x(this.getWasmModule(),"MrzParser")}}var ae=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};class ie{constructor(e){this.getWasmModule=e,this.objectMap=new m}create(){return ae(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create();return e=v(e),this.objectMap.add(e)}))}run(e,t){return ae(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).run(t);return r=v(r),{result:r,originalImage:t}}))}destroy(e){return ae(this,void 0,void 0,(function*(){this.objectMap.delete(e)}))}getWasmComponent(){return x(this.getWasmModule(),"OcrEngine")}}var se=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};class ue{constructor(e){this.getWasmModule=e,this.objectMap=new m}create(e){return se(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create(e);return t=v(t),this.objectMap.add(t)}))}run(e,t){return se(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).run(t);return r=v(r),{result:r,originalImage:t}}))}cleanRecognitionQueue(e){return se(this,void 0,void 0,(function*(){return this.objectMap.get(e).cleanRecognitionQueue()}))}destroy(e){return se(this,void 0,void 0,(function*(){this.objectMap.delete(e)}))}getWasmComponent(){return x(this.getWasmModule(),"TextPatternScanner")}}var ce=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};class le{constructor(e){this.getWasmModule=e,this.objectMap=new m}create(e){return ce(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create(e);return t=v(t),this.objectMap.add(t)}))}run(e,t){return ce(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).run(t);return r=v(r),{result:r,originalImage:t}}))}cleanRecognitionQueue(e){return ce(this,void 0,void 0,(function*(){return this.objectMap.get(e).cleanRecognitionQueue()}))}destroy(e){return ce(this,void 0,void 0,(function*(){this.objectMap.delete(e)}))}getWasmComponent(){return x(this.getWasmModule(),"VinScanner")}}var de=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};let he;class fe extends Error{}const pe={};function me(e){const t=Math.random().toString(36);return pe[t]=e,new p(t)}function ve(e){if(!pe.hasOwnProperty(e.id))throw new Error(`Object ${e.id} does not exist`);return pe[e.id]}function ye(e){const t=ve(e);t.delete&&t.delete(),delete pe[e.id]}new m,new m;const ge=Object.assign(Object.assign({initialize:function(t,n,o,a){return de(this,void 0,void 0,(function*(){try{const{captureConsole:i,requestSuffix:s=""}=a||{};i&&(console.log=function(...e){self.postMessage({log:e})},console.error=function(...e){self.postMessage({logError:e})});const u=r(709),c=r(290),l={locateFile:function(e,t){let r;return r=function(e){return e.startsWith("http:")||e.startsWith("https:")}(n)?n:"",e.endsWith(".worker.js")&&c?c.default:new URL(r+e+s,location.href).href}},d=e(a),h=d.includes("-threads");l.mainScriptUrlOrBlob=l.locateFile(`ScanbotSDK.Asm${d}.js`);let f;if(!!navigator.userAgentData&&navigator.userAgentData.brands.some((e=>"Chromium"===e.brand))&&h){let e=[2147483648,805306368,536870912],t=134217728;const r=67108864;["barcode-scanner"].includes("document-scanner")&&(t=r,e.push(4*r));for(let r=0;r<e.length;r++){const n=e[r];try{f=new WebAssembly.Memory({initial:0,maximum:n/65536,shared:!0}),f.grow(t/65536);break}catch(t){if(r===e.length-1)throw t}}}return f&&(l.wasmMemory=f),l.onAbort=function(e){const t="\nNo further calls to the SDK are possible.";throw new fe("OOM"===e?"ScanbotSDK ran out of memory. "+t:"ScanbotSDK ran into an unexpected error: "+e+t)},yield u(l),he=l,v(he.initialize(t||"",o))}catch(e){throw console.error(e),e}}))},getLicenseInfo:function(){return de(this,void 0,void 0,(function*(){return v(he.getLicenseInfo())}))},encodeJpeg:function(e,t=80){return de(this,void 0,void 0,(function*(){return v(he.encodeJpeg(e,t))}))},beginPdf:function(e){return de(this,void 0,void 0,(function*(){return me(v(x(he,"PdfGenerationContext").create(new F(e))))}))},addPageToPdf:function(e,t,r="ENABLED_IF_BINARIZATION_FILTER_SET"){return de(this,void 0,void 0,(function*(){v(ve(e).addPage(t,r))}))},addPageToPdfWithOcr:function(e,t,r="ENABLED_IF_BINARIZATION_FILTER_SET"){return de(this,void 0,void 0,(function*(){v(ve(e).addPageWithOcr(t,r))}))},completePdf:function(e){return de(this,void 0,void 0,(function*(){try{const t=ve(e);return v(t.complete())}finally{ye(e)}}))},beginTiff:function(e){return de(this,void 0,void 0,(function*(){const t=v(x(he,"TiffGenerationContext").create(new A(e)));return v(t.begin()),me(t)}))},addPageToTiff:function(e,t,r){return de(this,void 0,void 0,(function*(){v(ve(e).addPage(t,r))}))},completeTiff:function(e){return de(this,void 0,void 0,(function*(){try{const t=ve(e);return v(t.complete())}finally{ye(e)}}))},releaseObject:function(e){return de(this,void 0,void 0,(function*(){ye(e)}))},version:function(){return de(this,void 0,void 0,(function*(){return"8.1.0-beta.2"}))}},{BarcodeDocumentParser:new I(we=()=>he),BarcodeScanner:new O(we),CheckScanner:new N(we),CreditCardScanner:new U(we),DocumentClassifier:new L(we),DocumentDataExtractor:new H(we),DocumentQualityAnalyzer:new X(we),DocumentScanner:new K(we),ImageManipulator:new q(we),ImageProcessor:new te(we),MrzScanner:new ne(we),MrzParser:new oe(we),OcrEngine:new ie(we),TextPatternScanner:new ue(we),VinScanner:new le(we)}),{__hasModuleFunction:function(e){return de(this,void 0,void 0,(function*(){return he.hasOwnProperty(e)}))},__callModuleFunction:function(e,t=[]){return de(this,void 0,void 0,(function*(){return he[e](...t)}))}});var we;onmessage=function(e){const{command:t,args:r,ticket:n}=e.data;if(!he&&"initialize"!==t)return void self.postMessage({ticket:n,recoverableError:new Error("WASM module not loaded yet.")});let o;o=t.includes(".")?ge[t.split(".")[0]][t.split(".")[1]](...r):ge[t](...r),(()=>de(this,void 0,void 0,(function*(){return yield o})))().then((e=>{const t=function(e,t=!1){const r=[];return t||function e(t){if(t)if(t.constructor===ImageData)r.push(t.data.buffer);else if(t.constructor===ArrayBuffer)r.push(t);else if(ArrayBuffer.isView(t))r.push(t.buffer);else if(Array.isArray(t))for(let r=0;r<t.length;++r)e(t[r]);else if("object"==typeof t)for(const r in t)t.hasOwnProperty(r)&&e(t[r])}(e),r}(e);self.postMessage({ticket:n,result:e},t)})).catch((e=>{if(e instanceof fe)self.postMessage({ticket:n,unrecoverableError:e});else{const t="number"==typeof e?Error(he.stringFromException(e)):e;console.error(t),self.postMessage({ticket:n,recoverableError:t,errorType:null==t?void 0:t.errorType})}}))}})()})();