@tailwindcss/oxide-wasm32-wasi 0.0.0-insiders.00ef99d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/node_modules/@emnapi/core/LICENSE +21 -0
- package/node_modules/@emnapi/core/README.md +1 -0
- package/node_modules/@emnapi/core/dist/emnapi-core.cjs.js +7746 -0
- package/node_modules/@emnapi/core/dist/emnapi-core.cjs.min.d.ts +428 -0
- package/node_modules/@emnapi/core/dist/emnapi-core.cjs.min.js +1 -0
- package/node_modules/@emnapi/core/dist/emnapi-core.d.mts +428 -0
- package/node_modules/@emnapi/core/dist/emnapi-core.d.ts +430 -0
- package/node_modules/@emnapi/core/dist/emnapi-core.esm-bundler.js +8741 -0
- package/node_modules/@emnapi/core/dist/emnapi-core.js +9777 -0
- package/node_modules/@emnapi/core/dist/emnapi-core.min.d.mts +428 -0
- package/node_modules/@emnapi/core/dist/emnapi-core.min.js +1 -0
- package/node_modules/@emnapi/core/dist/emnapi-core.min.mjs +1 -0
- package/node_modules/@emnapi/core/dist/emnapi-core.mjs +7735 -0
- package/node_modules/@emnapi/core/index.js +5 -0
- package/node_modules/@emnapi/core/package.json +49 -0
- package/node_modules/@emnapi/runtime/LICENSE +21 -0
- package/node_modules/@emnapi/runtime/README.md +1 -0
- package/node_modules/@emnapi/runtime/dist/emnapi.cjs.js +1398 -0
- package/node_modules/@emnapi/runtime/dist/emnapi.cjs.min.d.ts +671 -0
- package/node_modules/@emnapi/runtime/dist/emnapi.cjs.min.js +1 -0
- package/node_modules/@emnapi/runtime/dist/emnapi.d.mts +671 -0
- package/node_modules/@emnapi/runtime/dist/emnapi.d.ts +673 -0
- package/node_modules/@emnapi/runtime/dist/emnapi.esm-bundler.js +1457 -0
- package/node_modules/@emnapi/runtime/dist/emnapi.iife.d.ts +426 -0
- package/node_modules/@emnapi/runtime/dist/emnapi.iife.js +1528 -0
- package/node_modules/@emnapi/runtime/dist/emnapi.js +1529 -0
- package/node_modules/@emnapi/runtime/dist/emnapi.min.d.mts +671 -0
- package/node_modules/@emnapi/runtime/dist/emnapi.min.js +1 -0
- package/node_modules/@emnapi/runtime/dist/emnapi.min.mjs +1 -0
- package/node_modules/@emnapi/runtime/dist/emnapi.mjs +1367 -0
- package/node_modules/@emnapi/runtime/index.js +5 -0
- package/node_modules/@emnapi/runtime/package.json +48 -0
- package/node_modules/@emnapi/wasi-threads/LICENSE +21 -0
- package/node_modules/@emnapi/wasi-threads/README.md +203 -0
- package/node_modules/@emnapi/wasi-threads/dist/wasi-threads.cjs.js +915 -0
- package/node_modules/@emnapi/wasi-threads/dist/wasi-threads.cjs.min.d.ts +271 -0
- package/node_modules/@emnapi/wasi-threads/dist/wasi-threads.cjs.min.js +1 -0
- package/node_modules/@emnapi/wasi-threads/dist/wasi-threads.d.mts +271 -0
- package/node_modules/@emnapi/wasi-threads/dist/wasi-threads.d.ts +273 -0
- package/node_modules/@emnapi/wasi-threads/dist/wasi-threads.esm-bundler.js +975 -0
- package/node_modules/@emnapi/wasi-threads/dist/wasi-threads.js +987 -0
- package/node_modules/@emnapi/wasi-threads/dist/wasi-threads.min.d.mts +271 -0
- package/node_modules/@emnapi/wasi-threads/dist/wasi-threads.min.js +1 -0
- package/node_modules/@emnapi/wasi-threads/dist/wasi-threads.min.mjs +1 -0
- package/node_modules/@emnapi/wasi-threads/dist/wasi-threads.mjs +910 -0
- package/node_modules/@emnapi/wasi-threads/index.js +5 -0
- package/node_modules/@emnapi/wasi-threads/package.json +50 -0
- package/node_modules/@napi-rs/wasm-runtime/dist/emnapi-plugins.cjs +1826 -0
- package/node_modules/@napi-rs/wasm-runtime/dist/emnapi-plugins.js +1823 -0
- package/node_modules/@napi-rs/wasm-runtime/dist/fs-proxy.cjs +321 -0
- package/node_modules/@napi-rs/wasm-runtime/dist/fs.js +25524 -0
- package/node_modules/@napi-rs/wasm-runtime/fs-proxy.js +316 -0
- package/node_modules/@napi-rs/wasm-runtime/package.json +74 -0
- package/node_modules/@napi-rs/wasm-runtime/runtime.cjs +39 -0
- package/node_modules/@napi-rs/wasm-runtime/runtime.js +36 -0
- package/node_modules/@tybys/wasm-util/README.md +193 -0
- package/node_modules/@tybys/wasm-util/dist/tsdoc-metadata.json +11 -0
- package/node_modules/@tybys/wasm-util/dist/wasm-util.d.ts +423 -0
- package/node_modules/@tybys/wasm-util/dist/wasm-util.esm-bundler.js +2932 -0
- package/node_modules/@tybys/wasm-util/dist/wasm-util.esm.js +2932 -0
- package/node_modules/@tybys/wasm-util/dist/wasm-util.esm.min.js +1 -0
- package/node_modules/@tybys/wasm-util/dist/wasm-util.js +2954 -0
- package/node_modules/@tybys/wasm-util/dist/wasm-util.min.js +1 -0
- package/node_modules/@tybys/wasm-util/lib/cjs/asyncify.js +158 -0
- package/node_modules/@tybys/wasm-util/lib/cjs/index.js +13 -0
- package/node_modules/@tybys/wasm-util/lib/cjs/jspi.js +46 -0
- package/node_modules/@tybys/wasm-util/lib/cjs/load.js +97 -0
- package/node_modules/@tybys/wasm-util/lib/cjs/memory.js +35 -0
- package/node_modules/@tybys/wasm-util/lib/cjs/wasi/error.js +103 -0
- package/node_modules/@tybys/wasm-util/lib/cjs/wasi/fd.js +268 -0
- package/node_modules/@tybys/wasm-util/lib/cjs/wasi/fs.js +3 -0
- package/node_modules/@tybys/wasm-util/lib/cjs/wasi/index.js +192 -0
- package/node_modules/@tybys/wasm-util/lib/cjs/wasi/path.js +316 -0
- package/node_modules/@tybys/wasm-util/lib/cjs/wasi/preview1.js +1599 -0
- package/node_modules/@tybys/wasm-util/lib/cjs/wasi/rights.js +141 -0
- package/node_modules/@tybys/wasm-util/lib/cjs/wasi/types.js +220 -0
- package/node_modules/@tybys/wasm-util/lib/cjs/wasi/util.js +128 -0
- package/node_modules/@tybys/wasm-util/lib/cjs/webassembly.js +13 -0
- package/node_modules/@tybys/wasm-util/lib/mjs/asyncify.mjs +153 -0
- package/node_modules/@tybys/wasm-util/lib/mjs/index.mjs +9 -0
- package/node_modules/@tybys/wasm-util/lib/mjs/jspi.mjs +39 -0
- package/node_modules/@tybys/wasm-util/lib/mjs/load.mjs +89 -0
- package/node_modules/@tybys/wasm-util/lib/mjs/memory.mjs +28 -0
- package/node_modules/@tybys/wasm-util/lib/mjs/wasi/error.mjs +97 -0
- package/node_modules/@tybys/wasm-util/lib/mjs/wasi/fd.mjs +256 -0
- package/node_modules/@tybys/wasm-util/lib/mjs/wasi/fs.mjs +1 -0
- package/node_modules/@tybys/wasm-util/lib/mjs/wasi/index.mjs +186 -0
- package/node_modules/@tybys/wasm-util/lib/mjs/wasi/path.mjs +310 -0
- package/node_modules/@tybys/wasm-util/lib/mjs/wasi/preview1.mjs +1593 -0
- package/node_modules/@tybys/wasm-util/lib/mjs/wasi/rights.mjs +135 -0
- package/node_modules/@tybys/wasm-util/lib/mjs/wasi/types.mjs +216 -0
- package/node_modules/@tybys/wasm-util/lib/mjs/wasi/util.mjs +113 -0
- package/node_modules/@tybys/wasm-util/lib/mjs/webassembly.mjs +9 -0
- package/node_modules/@tybys/wasm-util/package.json +58 -0
- package/node_modules/tslib/CopyrightNotice.txt +15 -0
- package/node_modules/tslib/LICENSE.txt +12 -0
- package/node_modules/tslib/README.md +164 -0
- package/node_modules/tslib/SECURITY.md +41 -0
- package/node_modules/tslib/modules/index.d.ts +38 -0
- package/node_modules/tslib/modules/index.js +70 -0
- package/node_modules/tslib/modules/package.json +3 -0
- package/node_modules/tslib/package.json +47 -0
- package/node_modules/tslib/tslib.d.ts +460 -0
- package/node_modules/tslib/tslib.es6.html +1 -0
- package/node_modules/tslib/tslib.es6.js +402 -0
- package/node_modules/tslib/tslib.es6.mjs +401 -0
- package/node_modules/tslib/tslib.html +1 -0
- package/node_modules/tslib/tslib.js +484 -0
- package/package.json +42 -0
- package/tailwindcss-oxide.wasi-browser.js +67 -0
- package/tailwindcss-oxide.wasi.cjs +123 -0
- package/tailwindcss-oxide.wasm32-wasi.wasm +0 -0
- package/wasi-worker-browser.mjs +41 -0
- package/wasi-worker.mjs +72 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=require("@emnapi/wasi-threads");const r="undefined"!=typeof WebAssembly?WebAssembly:"undefined"!=typeof WXWebAssembly?WXWebAssembly:void 0;function t(e){if(e&&"object"!=typeof e)throw new TypeError("imports must be an object or undefined");return!0}function n(e,a){if(!e)throw new TypeError("Invalid wasm source");t(a),a=null!=a?a:{};try{const r="object"==typeof e&&null!==e&&"then"in e?e.then:void 0;if("function"==typeof r)return r.call(e,e=>n(e,a))}catch(e){}if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))return r.instantiate(e,a);if(e instanceof r.Module)return r.instantiate(e,a).then(r=>({instance:r,module:e}));if("undefined"!=typeof Response&&e instanceof Response)return e.arrayBuffer().then(e=>r.instantiate(e,a));const o="string"==typeof e;if(o||"undefined"!=typeof URL&&e instanceof URL){if(o&&"undefined"!=typeof wx&&"undefined"!=typeof __wxConfig)return r.instantiate(e,a);if("function"!=typeof fetch)throw new TypeError("wasm source can not be a string or URL in this environment");if("function"!=typeof r.instantiateStreaming)return n(fetch(e),a);try{return r.instantiateStreaming(fetch(e),a).catch(()=>n(fetch(e),a))}catch(r){return n(fetch(e),a)}}throw new TypeError("Invalid wasm source")}function a(t){var n=function(){var n,a,o,i,s,f="object"==typeof process&&null!==process&&"object"==typeof process.versions&&null!==process.versions&&"string"==typeof process.versions.node,u=Boolean(t.childThread),c="number"==typeof t.waitThreadStart?t.waitThreadStart:Boolean(t.waitThreadStart);function l(e){if("function"==typeof r.RuntimeError)throw new r.RuntimeError(e);throw Error(e)}var d,v,p,y={imports:{env:{},napi:{},emnapi:{}},exports:{},emnapi:{},loaded:!1,filename:"",childThread:u,initWorker:void 0,waitThreadStart:c,PThread:void 0,init:function(e){if(y.loaded)return y.exports;if(!e)throw new TypeError("Invalid napi init options");var t=e.instance;if(!(null==t?void 0:t.exports))throw new TypeError("Invalid wasm instance");n=t;var f=t.exports,u=e.module,c=e.memory||f.memory,p=e.table||f.__indirect_function_table;if(!(u instanceof r.Module))throw new TypeError("Invalid wasm module");if(!(c instanceof r.Memory))throw new TypeError("Invalid wasm memory");if(!(p instanceof r.Table))throw new TypeError("Invalid wasm table");if(a=c,o=p,"function"!=typeof f.malloc)throw new TypeError("malloc is not exported");if("function"!=typeof f.free)throw new TypeError("free is not exported");if(i=f.malloc,s=f.free,!y.childThread){var g=8,w=t.exports.node_api_module_get_api_version_v1;"function"==typeof w&&(g=w());var b=y.envObject||(y.envObject=d.createEnv(y.filename,g,function(e){return o.get(e)},function(e){return o.get(e)},l,v)),h=d.openScope(b);try{b.callIntoModule(function(e){var r=y.exports,n=h.add(r),a=(0,t.exports.napi_register_wasm_v1)(e.id,n.id);y.exports=a?d.handleStore.get(a).value:r})}catch(e){if("unwind"!==e)throw e}finally{d.closeScope(b,h)}return y.loaded=!0,delete y.envObject,y.exports}}},g=void 0;if(u){d=null==t?void 0:t.context;var w="function"==typeof t.postMessage?t.postMessage:"function"==typeof postMessage?postMessage:void 0;if("function"!=typeof w)throw new TypeError("No postMessage found");y.postMessage=w}else{var b=t.context;if("object"!=typeof b||null===b)throw new TypeError("Invalid `options.context`. Use `import { getDefaultContext } from '@emnapi/runtime'`");d=b}if("string"==typeof t.filename&&(y.filename=t.filename),"function"==typeof t.onCreateWorker&&(g=t.onCreateWorker),"function"==typeof t.print?t.print:console.log.bind(console),p="function"==typeof t.printErr?t.printErr:console.warn.bind(console),"nodeBinding"in t){var h=t.nodeBinding;if("object"!=typeof h||null===h)throw new TypeError("Invalid `options.nodeBinding`. Use @emnapi/node-binding package");v=h}var _=0;if("asyncWorkPoolSize"in t){if("number"!=typeof t.asyncWorkPoolSize)throw new TypeError("options.asyncWorkPoolSize must be a integer");(_=t.asyncWorkPoolSize|0)>1024?_=1024:_<-1024&&(_=-1024)}var E=!u&&_<=0;function L(){return Math.abs(_)}function m(e){if(!e)return!1;if(e._emnapiSendListener)return!0;var r=function(e){var r=(f?e:e.data).__emnapi__;if(r&&"async-send"===r.type)if(u){(0,y.postMessage)({__emnapi__:r})}else{var t=r.payload.callback;o.get(t)(r.payload.data)}};return e._emnapiSendListener={handler:r,dispose:function(){f?e.off("message",r):e.removeEventListener("message",r,!1),delete e._emnapiSendListener}},f?e.on("message",r):e.addEventListener("message",r,!1),!0}y.imports.env._emnapi_async_work_pool_size=L,y.emnapi.addSendListener=m;var S=new e.ThreadManager(u?{printErr:p,childThread:!0}:{printErr:p,beforeLoad:function(e){m(e)},reuseWorker:t.reuseWorker,onCreateWorker:g});function A(e,r){d.feature.setImmediate(function(){o.get(e)(r)})}function C(e,r){Promise.resolve().then(function(){o.get(e)(r)})}function V(e,r){var t,n=[r>>>0,(t=r,+Math.abs(t)>=1?t>0?(0|Math.min(+Math.floor(t/4294967296),4294967295))>>>0:~~+Math.ceil((t-+(~~t>>>0))/4294967296)>>>0:0)],o=new DataView(a.buffer),i=function(){return o.buffer===a.buffer?o:o=new DataView(a.buffer)};i().setInt32(e,n[0],!0),i().setInt32(e+4,n[1],!0)}y.PThread=S;var I,D=Object.freeze({__proto__:null,$emnapiSetValueI64:V,_emnapi_call_finalizer:function(e,r,t,n,a){t>>>=0,d.envStore.get(r).callFinalizerInternal(e,t,n,a)},_emnapi_callback_into_module:function(e,r,t,n,a){var i=d.envStore.get(r),s=d.openScope(i);try{i.callbackIntoModule(Boolean(e),function(){o.get(t)(r,n)})}catch(e){throw d.closeScope(i,s),a&&d.closeScope(i),e}d.closeScope(i,s)},_emnapi_close_handle_scope:function(e){return d.closeScope()},_emnapi_ctx_decrease_waiting_request_counter:function(){d.decreaseWaitingRequestCounter()},_emnapi_ctx_increase_waiting_request_counter:function(){d.increaseWaitingRequestCounter()},_emnapi_get_node_version:function(e,r,t){e>>>=0,r>>>=0,t>>>=0;var n="object"==typeof process&&null!==process&&"object"==typeof process.versions&&null!==process.versions&&"string"==typeof process.versions.node?process.versions.node.split(".").map(function(e){return Number(e)}):[0,0,0],o=new DataView(a.buffer),i=function(){return o.buffer===a.buffer?o:o=new DataView(a.buffer)};i().setUint32(e,n[0],!0),i().setUint32(r,n[1],!0),i().setUint32(t,n[2],!0)},_emnapi_get_now:function(){return performance.timeOrigin+performance.now()},_emnapi_is_main_browser_thread:function(){return"undefined"==typeof window||"undefined"==typeof document||f?0:1},_emnapi_is_main_runtime_thread:function(){return u?0:1},_emnapi_next_tick:C,_emnapi_open_handle_scope:function(){return d.openScope().id},_emnapi_runtime_keepalive_pop:function(){},_emnapi_runtime_keepalive_push:function(){},_emnapi_set_immediate:A,_emnapi_unwind:function(){throw"unwind"},napi_clear_last_error:function(e){return d.envStore.get(e).clearLastError()},napi_set_last_error:function(e,r,t,n){return d.envStore.get(e).setLastError(r,t,n)}});function k(e){var r=new DataView(a.buffer).getInt32(e+20,!0);return S.pthreads[r]}var U=new Promise(function(e){I=function(){U.ready=!0,e()}});U.ready=!1;var B=Object.freeze({__proto__:null,_emnapi_after_uvthreadpool_ready:function(e,r,t){U.ready?o.get(e)(r,t):U.then(function(){o.get(e)(r,t)})},_emnapi_async_send_js:function(e,r,t){if(u)(0,y.postMessage)({__emnapi__:{type:"async-send",payload:{callback:r,data:t}}});else switch(e){case 0:A(r,t);break;case 1:C(r,t)}},_emnapi_emit_async_thread_ready:function(){u&&(0,y.postMessage)({__emnapi__:{type:"async-thread-ready",payload:{}}})},_emnapi_tell_js_uvthreadpool:function(e,r){for(var t=[],n=new DataView(a.buffer),o=function(r){var o=k((n.buffer===a.buffer?n:n=new DataView(a.buffer)).getUint32(e+4*r,!0));t.push(new Promise(function(e){var r=function(t){var n=(f?t:t.data).__emnapi__;n&&"async-thread-ready"===n.type&&(e(),o&&"function"==typeof o.unref&&o.unref(),f?o.off("message",r):o.removeEventListener("message",r))};f?o.on("message",r):o.addEventListener("message",r)}))},i=0;i<r;i++)o(i);Promise.all(t).then(I)},_emnapi_worker_ref:function(e){if(!u){var r=k(e>>>=0);r&&"function"==typeof r.ref&&r.ref()}},_emnapi_worker_unref:function(e){if(!u){var r=k(e>>>=0);r&&"function"==typeof r.unref&&r.unref()}}});var T=Object.freeze({__proto__:null,napi_adjust_external_memory:function(e,r,t){if(!e)return 1;var n=d.envStore.get(e);if(!t)return n.setLastError(1);var o=d.adjustAmountOfExternalAllocatedMemory(r);if(t>>>=0,d.feature.supportBigInt){var i=new DataView(a.buffer);(i.buffer===a.buffer?i:i=new DataView(a.buffer)).setBigInt64(t,BigInt(o),!0)}else V(t,Number(o));return n.clearLastError()}}),F={idGen:{},values:[void 0],queued:new Set,pending:[],init:function(){var e={nextId:1,list:[],generate:function(){var r;return e.list.length?r=e.list.shift():(r=e.nextId,e.nextId++),r},reuse:function(r){e.list.push(r)}};F.idGen=e,F.values=[void 0],F.queued=new Set,F.pending=[]},create:function(e,r,t,n,a,o){var i=0,s=0;if(v){var f=v.node.emitAsyncInit(r,t,-1);i=f.asyncId,s=f.triggerAsyncId}var u=F.idGen.generate();return F.values[u]={env:e,id:u,resource:r,asyncId:i,triggerAsyncId:s,status:0,execute:n,complete:a,data:o},u},callComplete:function(e,r){var t=e.complete,n=e.env,a=e.data,i=function(){if(t){var e=d.envStore.get(n),i=d.openScope(e);try{e.callbackIntoModule(!0,function(){o.get(t)(n,r,a)})}finally{d.closeScope(e,i)}}};v?v.node.makeCallback(e.resource,i,[],{asyncId:e.asyncId,triggerAsyncId:e.triggerAsyncId}):i()},queue:function(e){var r=F.values[e];if(r&&0===r.status){if(r.status=1,F.queued.size>=(Math.abs(_)||4))return void F.pending.push(e);F.queued.add(e);var t=r.env,n=r.data,a=r.execute;r.status=2,d.feature.setImmediate(function(){if(o.get(a)(t,n),F.queued.delete(e),r.status=3,d.feature.setImmediate(function(){F.callComplete(r,0)}),F.pending.length>0){var i=F.pending.shift();F.values[i].status=0,F.queue(i)}})}},cancel:function(e){var r=F.pending.indexOf(e);if(-1!==r){var t=F.values[e];return t&&1===t.status?(t.status=4,F.pending.splice(r,1),d.feature.setImmediate(function(){F.callComplete(t,11)}),0):9}return 9},remove:function(e){var r=F.values[e];r&&(v&&v.node.emitAsyncDestroy({asyncId:r.asyncId,triggerAsyncId:r.triggerAsyncId}),F.values[e]=void 0,F.idGen.reuse(e))}};function O(e,r,t,n){if(v){var o=d.handleStore.get(e).value,i=d.handleStore.get(r).value,s=v.node.emitAsyncInit(o,i,t),f=s.asyncId,u=s.triggerAsyncId;if(n){n>>>=0;var c=new DataView(a.buffer),l=function(){return c.buffer===a.buffer?c:c=new DataView(a.buffer)};l().setFloat64(n,f,!0),l().setFloat64(n+8,u,!0)}}}function x(e,r){v&&v.node.emitAsyncDestroy({asyncId:e,triggerAsyncId:r})}var j=Object.freeze({__proto__:null,_emnapi_async_destroy_js:function(e){if(!v)return 9;e>>>=0;var r=new DataView(a.buffer),t=function(){return r.buffer===a.buffer?r:r=new DataView(a.buffer)},n=t().getInt32(e,!0),o=t().getInt32(e+4,!0),i=BigInt(n>>>0)|BigInt(o)<<BigInt(32),s=v.napi.asyncDestroy(i);return 0!==s.status?s.status:0},_emnapi_async_init_js:function(e,r,t){if(!v)return 9;var n;e&&(n=Object(d.handleStore.get(e).value));var o=d.handleStore.get(r).value,i=v.napi.asyncInit(n,o);if(0!==i.status)return i.status;var s=i.value;s>=BigInt(-1)*(BigInt(1)<<BigInt(63))&&s<BigInt(1)<<BigInt(63)||(s&=(BigInt(1)<<BigInt(64))-BigInt(1))>=BigInt(1)<<BigInt(63)&&(s-=BigInt(1)<<BigInt(64));var f=Number(s&BigInt(4294967295)),u=Number(s>>BigInt(32));t>>>=0;var c=new DataView(a.buffer),l=function(){return c.buffer===a.buffer?c:c=new DataView(a.buffer)};return l().setInt32(t,f,!0),l().setInt32(t+4,u,!0),0},_emnapi_env_check_gc_access:function(e){d.envStore.get(e).checkGCAccess()},_emnapi_node_emit_async_destroy:x,_emnapi_node_emit_async_init:O,_emnapi_node_make_callback:function(e,r,t,n,o,i,s,f){var u,c=0;if(v){var l=d.handleStore.get(r).value,p=d.handleStore.get(t).value;n>>>=0,o>>>=0,o>>>=0;for(var y=Array(o),g=new DataView(a.buffer),w=function(){return g.buffer===a.buffer?g:g=new DataView(a.buffer)};c<o;c++){var b=w().getUint32(n+4*c,!0);y[c]=d.handleStore.get(b).value}var h=v.node.makeCallback(l,p,y,{asyncId:i,triggerAsyncId:s});if(f)f>>>=0,u=d.envStore.get(e).ensureHandleId(h),w().setUint32(f,u,!0)}},napi_close_callback_scope:function(e,r){throw new Error("napi_close_callback_scope has not been implemented yet")},napi_make_callback:function(e,r,t,n,o,i,s){var f,u=0;if(!e)return 1;var c=d.envStore.get(e);if(c.checkGCAccess(),!c.tryCatch.isEmpty())return c.setLastError(10);if(!c.canCallIntoJs())return c.setLastError(c.moduleApiVersion>=10?23:10);c.clearLastError();try{if(!v)return c.setLastError(9);if(!t)return c.setLastError(1);if(o>0&&!i)return c.setLastError(1);var l=Object(d.handleStore.get(t).value),p=d.handleStore.get(n).value;if("function"!=typeof p)return c.setLastError(1);r>>>=0;var y=new DataView(a.buffer),g=function(){return y.buffer===a.buffer?y:y=new DataView(a.buffer)},w=g().getInt32(r,!0),b=g().getInt32(r+4,!0),h=BigInt(w>>>0)|BigInt(b)<<BigInt(32);i>>>=0,o>>>=0,o>>>=0;for(var _=Array(o);u<o;u++){var E=g().getUint32(i+4*u,!0);_[u]=d.handleStore.get(E).value}var L=v.napi.makeCallback(h,l,p,_);if(L.error)throw L.error;return 0!==L.status?c.setLastError(L.status):(s&&(s>>>=0,f=c.ensureHandleId(L.value),g().setUint32(s,f,!0)),c.getReturnStatus())}catch(e){return c.tryCatch.setError(e),c.setLastError(10)}},napi_open_callback_scope:function(e,r,t,n){throw new Error("napi_open_callback_scope has not been implemented yet")}}),R={_liveSet:{},offset:{__size__:0,resource:0,async_id:0,trigger_async_id:0,queue_size:0,is_some:0,queue:0,async_pending:0,async_u_fd:0,thread_count:0,state:0,dispatch_state:0,context:0,max_queue_size:0,ref:0,env:0,finalize_data:0,finalize_cb:0,call_js_cb:0,handles_closing:0,async_ref:0,mutex:0,cond:0},init:function(){if(R._liveSet=new Set,R.offset.__size__=184,R.offset.resource=0,R.offset.async_id=8,R.offset.trigger_async_id=16,R.offset.queue_size=60,R.offset.is_some=24,R.offset.queue=64,R.offset.async_pending=132,R.offset.async_u_fd=96,R.offset.thread_count=136,R.offset.state=140,R.offset.dispatch_state=144,R.offset.context=148,R.offset.max_queue_size=152,R.offset.ref=156,R.offset.env=160,R.offset.finalize_data=164,R.offset.finalize_cb=168,R.offset.call_js_cb=172,R.offset.handles_closing=176,R.offset.async_ref=180,R.offset.mutex=32,R.offset.cond=56,R.offset.mutex=R.offset.mutex+4,void 0!==S){S.unusedWorkers.forEach(R.addListener),Object.values(S.pthreads).forEach(R.addListener);var e=S.getNewWorker;S.getNewWorker=function(){var r=e.apply(this,arguments);return R.addListener(r),r}}},addListener:function(e){if(!e)return!1;if(e._emnapiTSFNListener)return!0;var r=function(e){var r=(f?e:e.data).__emnapi__;if(r){var t=r.type,n=r.payload;if("tsfn-send"===t){var a=n.tsfn+R.offset.async_pending;0!==Atomics.load(new Int32Array(R.ensureBufferFor(a+4)),a>>>2)&&R.enqueue(n.tsfn)}}};return e._emnapiTSFNListener={handler:r,dispose:function(){f?e.off("message",r):e.removeEventListener("message",r,!1),delete e._emnapiTSFNListener}},f?e.on("message",r):e.addEventListener("message",r,!1),!0},ensureBufferFor:function(e){var r=a.buffer;return e>r.byteLength&&(a.grow(0),r=a.buffer),r},initQueue:function(e){var r=i(8);return!!r&&(r>>>=0,new Uint8Array(R.ensureBufferFor(r+8),r,8).fill(0),R.storeSizeTypeValue(e+R.offset.queue,r,!1),!0)},destroyQueue:function(e){var r=R.loadSizeTypeValue(e+R.offset.queue,!1);if(r){for(var t=R.loadSizeTypeValue(r,!1);0!==t;){var n=R.loadSizeTypeValue(t+4,!1);s(t),t=n}s(r)}},pushQueue:function(e,r){var t=R.loadSizeTypeValue(e+R.offset.queue,!1),n=R.loadSizeTypeValue(t,!1),a=R.loadSizeTypeValue(t+4,!1),o=i(8);if(!o)throw new Error("OOM");o>>>=0,R.storeSizeTypeValue(o,r,!1),R.storeSizeTypeValue(o+4,0,!1),0===n&&0===a?(R.storeSizeTypeValue(t,o,!1),R.storeSizeTypeValue(t+4,o,!1)):(R.storeSizeTypeValue(a+4,o,!1),R.storeSizeTypeValue(t+4,o,!1)),R.addQueueSize(e)},shiftQueue:function(e){var r=R.loadSizeTypeValue(e+R.offset.queue,!1),t=R.loadSizeTypeValue(r,!1);if(0===t)return 0;var n=t,a=R.loadSizeTypeValue(t+4,!1);R.storeSizeTypeValue(r,a,!1),0===a&&R.storeSizeTypeValue(r+4,0,!1),R.storeSizeTypeValue(n+4,0,!1);var o=R.loadSizeTypeValue(n,!1);return s(n),R.subQueueSize(e),o},push:function(e,r,t){var n=R.getMutex(e),a=R.getCond(e),o=function(){var r=R.getQueueSize(e),t=R.getMaxQueueSize(e);return r>=t&&t>0&&0===R.getState(e)},i="undefined"!=typeof window&&"undefined"!=typeof document&&!f,s=!1,u=n.execute(function(){for(;o();){if(0===t)return 15;if(i)return 21;a.wait()}return 0===R.getState(e)?(R.pushQueue(e,r),R.send(e),0):0===R.getThreadCount(e)?1:(R.subThreadCount(e),2!==R.getState(e)||0!==R.getThreadCount(e)||(s=!0),16)});return s&&R.destroy(e),u},getMutex:function(e){var r=e+R.offset.mutex,t={lock:function(){var e="undefined"!=typeof window&&"undefined"!=typeof document&&!f,t=new Int32Array(R.ensureBufferFor(r+4),r,1);if(e)for(;;){if(0===Atomics.compareExchange(t,0,0,10))return}else for(;;){if(0===Atomics.compareExchange(t,0,0,10))return;Atomics.wait(t,0,10)}},unlock:function(){var e=new Int32Array(R.ensureBufferFor(r+4),r,1);if(10!==Atomics.compareExchange(e,0,10,0))throw new Error("Tried to unlock while not holding the mutex");Atomics.notify(e,0,1)},execute:function(e){t.lock();try{return e()}finally{t.unlock()}}};return t},getCond:function(e){var r=e+R.offset.cond,t=R.getMutex(e);return{wait:function(){var e=new Int32Array(R.ensureBufferFor(r+4),r,1),n=Atomics.load(e,0);t.unlock(),Atomics.wait(e,0,n),t.lock()},signal:function(){var e=new Int32Array(R.ensureBufferFor(r+4),r,1);Atomics.add(e,0,1),Atomics.notify(e,0,1)}}},getQueueSize:function(e){return R.loadSizeTypeValue(e+R.offset.queue_size,!0)},addQueueSize:function(e){var r,t,n=R.offset.queue_size;r=new Uint32Array(R.ensureBufferFor(e+n+4)),t=e+n>>>2,Atomics.add(r,t,1)},subQueueSize:function(e){var r,t,n=R.offset.queue_size;r=new Uint32Array(R.ensureBufferFor(e+n+4)),t=e+n>>>2,Atomics.sub(r,t,1)},getThreadCount:function(e){return R.loadSizeTypeValue(e+R.offset.thread_count,!0)},addThreadCount:function(e){var r,t,n=R.offset.thread_count;r=new Uint32Array(R.ensureBufferFor(e+n+4)),t=e+n>>>2,Atomics.add(r,t,1)},subThreadCount:function(e){var r,t,n=R.offset.thread_count;r=new Uint32Array(R.ensureBufferFor(e+n+4)),t=e+n>>>2,Atomics.sub(r,t,1)},getState:function(e){return Atomics.load(new Int32Array(R.ensureBufferFor(e+R.offset.state+4)),e+R.offset.state>>>2)},setState:function(e,r){Atomics.store(new Int32Array(R.ensureBufferFor(e+R.offset.state+4)),e+R.offset.state>>>2,r)},getHandlesClosing:function(e){return Atomics.load(new Int8Array(R.ensureBufferFor(e+R.offset.handles_closing+1)),e+R.offset.handles_closing)},setHandlesClosing:function(e,r){Atomics.store(new Int8Array(R.ensureBufferFor(e+R.offset.handles_closing+1)),e+R.offset.handles_closing,r)},getDispatchState:function(e){return Atomics.load(new Uint32Array(R.ensureBufferFor(e+R.offset.dispatch_state+4)),e+R.offset.dispatch_state>>>2)},getContext:function(e){return R.loadSizeTypeValue(e+R.offset.context,!1)},getMaxQueueSize:function(e){return R.loadSizeTypeValue(e+R.offset.max_queue_size,!0)},getEnv:function(e){return R.loadSizeTypeValue(e+R.offset.env,!1)},getCallJSCb:function(e){return R.loadSizeTypeValue(e+R.offset.call_js_cb,!1)},getRef:function(e){return R.loadSizeTypeValue(e+R.offset.ref,!1)},getResource:function(e){return R.loadSizeTypeValue(e+R.offset.resource,!1)},getFinalizeCb:function(e){return R.loadSizeTypeValue(e+R.offset.finalize_cb,!1)},getFinalizeData:function(e){return R.loadSizeTypeValue(e+R.offset.finalize_data,!1)},loadSizeTypeValue:function(e,r){var t;return r?(t=new Uint32Array(R.ensureBufferFor(e+4)),Atomics.load(t,e>>>2)):(t=new Int32Array(R.ensureBufferFor(e+4)),Atomics.load(t,e>>>2))},storeSizeTypeValue:function(e,r,t){var n;return t?(n=new Uint32Array(R.ensureBufferFor(e+4)),void Atomics.store(n,e>>>2,r)):(n=new Int32Array(R.ensureBufferFor(e+4)),void Atomics.store(n,e>>>2,r>>>0))},releaseResources:function(e){if(2!==R.getState(e)){R.setState(e,2);var r=R.getEnv(e),t=d.envStore.get(r),n=R.getRef(e);n&&d.refStore.get(n).dispose();var o=R.getResource(e);d.refStore.get(o).dispose(),R.ensureBufferFor(e+R.offset.is_some+1);var i=new DataView(a.buffer);(i.buffer===a.buffer?i:i=new DataView(a.buffer)).setInt8(e+R.offset.is_some,0,!0),d.removeCleanupHook(t,R.cleanup,e),t.unref();var s=e+R.offset.async_ref,f=s>>>2,u=new Uint32Array(R.ensureBufferFor(s+4));if(Atomics.load(u,f)>0&&(Atomics.store(u,f,0),d.decreaseWaitingRequestCounter()),v){var c=new DataView(R.ensureBufferFor(e+R.offset.trigger_async_id+8));x(c.getFloat64(e+R.offset.async_id,!0),c.getFloat64(e+R.offset.trigger_async_id,!0))}}},destroy:function(e){R._liveSet.delete(e),R.destroyQueue(e),R.releaseResources(e),s(e)},emptyQueue:function(e){var r=[];R.getMutex(e).execute(function(){for(;R.getQueueSize(e)>0;)r.push(R.shiftQueue(e))});for(var t,n=R.getCallJSCb(e),a=R.getContext(e),i=0;i<r.length;i++)t=r[i],n&&o.get(n)(0,0,a,t)},maybeDelete:function(e){var r=!1;R.getMutex(e).execute(function(){R.getThreadCount(e)>0?R.releaseResources(e):r=!0}),r&&R.destroy(e)},finalize:function(e){var r=R.getEnv(e),t=d.envStore.get(r);d.openScope(t);var n=R.getFinalizeCb(e),a=R.getFinalizeData(e),o=R.getContext(e),i=function(){t.callFinalizerInternal(0,n,a,o)};try{if(R.emptyQueue(e),n)if(v){var s=R.getResource(e),f=d.refStore.get(s).get(),u=d.handleStore.get(f).value,c=new DataView(R.ensureBufferFor(e+R.offset.trigger_async_id+8)),l=c.getFloat64(e+R.offset.async_id,!0),p=c.getFloat64(e+R.offset.trigger_async_id,!0);v.node.makeCallback(u,i,[],{asyncId:l,triggerAsyncId:p})}else i();R.maybeDelete(e)}finally{d.closeScope(t)}},cleanup:function(e){R.closeHandlesAndMaybeDelete(e,1)},closeHandlesAndMaybeDelete:function(e,r){var t=R.getEnv(e),n=d.envStore.get(t);d.openScope(n);try{if(r&&R.getMutex(e).execute(function(){R.setState(e,1),R.getMaxQueueSize(e)>0&&R.getCond(e).signal()}),R.getHandlesClosing(e))return;R.setHandlesClosing(e,1),Atomics.store(new Int32Array(R.ensureBufferFor(e+R.offset.async_pending+4)),e+R.offset.async_pending>>>2,1),d.feature.setImmediate(function(){R.finalize(e)})}finally{d.closeScope(n)}},dispatchOne:function(e){var r=0,t=!1,n=!1,a=R.getMutex(e),i=R.getCond(e);if(a.execute(function(){if(0===R.getState(e)){var a=R.getQueueSize(e);if(a>0){r=R.shiftQueue(e),t=!0;var o=R.getMaxQueueSize(e);a===o&&o>0&&i.signal(),a--}0===a?0===R.getThreadCount(e)&&(R.setState(e,1),R.getMaxQueueSize(e)>0&&i.signal(),R.closeHandlesAndMaybeDelete(e,0)):n=!0}else R.closeHandlesAndMaybeDelete(e,0)}),t){var s=R.getEnv(e),f=d.envStore.get(s);d.openScope(f);var u=function(){f.callbackIntoModule(!1,function(){var t=R.getCallJSCb(e),n=R.getRef(e),a=n?d.refStore.get(n).get():0;if(t){var i=R.getContext(e);o.get(t)(s,a,i,r)}else{var f=a?d.handleStore.get(a).value:null;"function"==typeof f&&f()}})};try{if(v){var c=R.getResource(e),l=d.refStore.get(c).get(),p=d.handleStore.get(l).value,y=new DataView(R.ensureBufferFor(e+R.offset.trigger_async_id+8));v.node.makeCallback(p,u,[],{asyncId:y.getFloat64(e+R.offset.async_id,!0),triggerAsyncId:y.getFloat64(e+R.offset.trigger_async_id,!0)})}else u()}finally{d.closeScope(f)}}return n},dispatch:function(e){for(var r=!0,t=1e3,n=e+R.offset.dispatch_state,a=n>>>2;r&&0!==--t;){Atomics.store(new Uint32Array(R.ensureBufferFor(n+4)),a,1);try{r=R.dispatchOne(e)}catch(r){throw R._liveSet.has(e)&&(Atomics.exchange(new Uint32Array(R.ensureBufferFor(n+4)),a,0),R.send(e)),r}1!==Atomics.exchange(new Uint32Array(R.ensureBufferFor(n+4)),a,0)&&(r=!0)}r&&R.send(e)},enqueue:function(e){var r=e+R.offset.async_pending,t=e+R.offset.async_u_fd,n=Math.max(r,t)+4,a=function(){return new Int32Array(R.ensureBufferFor(n))};0===Atomics.exchange(a(),t>>>2,1)&&d.feature.setImmediate(function(){R._liveSet.has(e)&&(0!==Atomics.load(a(),r>>>2)?d.feature.setImmediate(function(){if(R._liveSet.has(e))try{if(0===Atomics.exchange(a(),r>>>2,0))return;R.dispatch(e)}finally{R._liveSet.has(e)&&(Atomics.store(a(),t>>>2,0),0!==Atomics.load(a(),r>>>2)&&R.enqueue(e))}}):Atomics.store(a(),t>>>2,0))})},send:function(e){var r=e+R.offset.dispatch_state;if(1&~Atomics.or(new Uint32Array(R.ensureBufferFor(r+4)),r>>>2,2)){var t=e+R.offset.async_pending;0===Atomics.load(new Int32Array(R.ensureBufferFor(t+4)),t>>>2)&&0===Atomics.exchange(new Int32Array(R.ensureBufferFor(t+4)),t>>>2,1)&&(void 0!==u&&u?postMessage({__emnapi__:{type:"tsfn-send",payload:{tsfn:e}}}):R.enqueue(e))}}};var z={pool:[],workerReady:null,globalAddress:0,globalOffset:{idle_threads:0,q:4,next:4,prev:8,mutex:12,cond:16,exit_message:20,end:28},offset:{resource:0,async_id:8,trigger_async_id:16,env:24,status:28,queue:32,queue_next:32,queue_prev:36,data:40,execute:44,complete:48,end:52},ensureBufferFor:function(e){var r=a.buffer;return e>r.byteLength&&(a.grow(0),r=a.buffer),r},init:function(){if(z.pool=[],z.workerReady=null,void 0!==S){S.unusedWorkers.forEach(z.addListener),Object.values(S.pthreads).forEach(z.addListener);var e=S.getNewWorker;S.getNewWorker=function(){var r=e.apply(this,arguments);return z.addListener(r),r}}},addListener:function(e){if(!e)return!1;if(e._emnapiAWMTListener)return!0;var r=function(e){var r=(f?e:e.data).__emnapi__;if(r){var t=r.type,n=r.payload;"async-work-complete"===t&&z.callComplete(n.work,0)}};return e._emnapiAWMTListener={handler:r,dispose:function(){f?e.off("message",r):e.removeEventListener("message",r,!1),delete e._emnapiAWMTListener}},f?e.on("message",r):e.addEventListener("message",r,!1),!0},initGlobal:function(){if(!z.globalAddress){z.globalAddress=i(z.globalOffset.end),z.globalAddress>>>=0;var e=z.globalOffset.end,r=z.globalAddress;new Uint8Array(z.ensureBufferFor(r+e),r,e).fill(0),z.queueInit(z.globalAddress+z.globalOffset.q),z.queueInit(z.globalAddress+z.globalOffset.exit_message)}},terminateWorkers:function(){z.pool.forEach(function(e){var r,t;null===(r=e._emnapiAWMTListener)||void 0===r||r.dispose(),null===(t=e._emnapiTSFNListener)||void 0===t||t.dispose(),e.terminate()}),z.pool.length=0},initWorkers:function(e){if(u)return z.workerReady||(z.workerReady=Promise.resolve());if(z.workerReady)return z.workerReady;if(!("emnapi_async_worker_create"in n.exports))throw new TypeError("`emnapi_async_worker_create` is not exported, please try to add `--export=emnapi_async_worker_create` to linker flags");var r=n.exports.emnapi_async_worker_create,t=[];z.initGlobal();for(var a=0;a<e;++a)t.push(r(1,z.globalAddress));var o=t.map(function(e){if(0===e)return Promise.reject(new Error("Failed to create async worker"));var r;if(e<0&&(r=z.pool[-e-1]))return r.whenLoaded;e>>>=0;var t=new DataView(z.ensureBufferFor(e+20+4)).getInt32(e+20,!0);return(r=S.pthreads[t]).whenLoaded});return z.workerReady=Promise.all(o),z.workerReady},getResource:function(e){z.ensureBufferFor(e+z.offset.resource+4);var r=new DataView(a.buffer);return(r.buffer===a.buffer?r:r=new DataView(a.buffer)).getUint32(e+z.offset.resource,!0)},getExecute:function(e){z.ensureBufferFor(e+z.offset.execute+4);var r=new DataView(a.buffer);return(r.buffer===a.buffer?r:r=new DataView(a.buffer)).getUint32(e+z.offset.execute,!0)},getComplete:function(e){z.ensureBufferFor(e+z.offset.complete+4);var r=new DataView(a.buffer);return(r.buffer===a.buffer?r:r=new DataView(a.buffer)).getUint32(e+z.offset.complete,!0)},getEnv:function(e){z.ensureBufferFor(e+z.offset.env+4);var r=new DataView(a.buffer);return(r.buffer===a.buffer?r:r=new DataView(a.buffer)).getUint32(e+z.offset.env,!0)},getData:function(e){z.ensureBufferFor(e+z.offset.data+4);var r=new DataView(a.buffer);return(r.buffer===a.buffer?r:r=new DataView(a.buffer)).getUint32(e+z.offset.data,!0)},getMutex:function(){var e=z.globalAddress+z.globalOffset.mutex,r={lock:function(){var r="undefined"!=typeof window&&"undefined"!=typeof document&&!f,t=new Int32Array(z.ensureBufferFor(e+4),e,1);if(r)for(;;){if(0===Atomics.compareExchange(t,0,0,10))return}else for(;;){if(0===Atomics.compareExchange(t,0,0,10))return;Atomics.wait(t,0,10)}},unlock:function(){var r=new Int32Array(z.ensureBufferFor(e+4),e,1);if(10!==Atomics.compareExchange(r,0,10,0))throw new Error("Tried to unlock while not holding the mutex");Atomics.notify(r,0,1)},execute:function(e){r.lock();try{return e()}finally{r.unlock()}}};return r},getCond:function(){var e=z.globalAddress+z.globalOffset.cond,r=z.getMutex();return{wait:function(){var t=new Int32Array(z.ensureBufferFor(e+4),e,1),n=Atomics.load(t,0);r.unlock(),Atomics.wait(t,0,n),r.lock()},signal:function(){var r=new Int32Array(z.ensureBufferFor(e+4),e,1);Atomics.add(r,0,1),Atomics.notify(r,0,1)}}},queueInit:function(e){z.ensureBufferFor(e+4+4);var r=new DataView(a.buffer),t=function(){return r.buffer===a.buffer?r:r=new DataView(a.buffer)};t().setUint32(e,e,!0),t().setUint32(e+4,e,!0)},queueInsertTail:function(e,r){z.ensureBufferFor(e+4+4),z.ensureBufferFor(r+4+4);var t=new DataView(a.buffer),n=function(){return t.buffer===a.buffer?t:t=new DataView(a.buffer)};n().setUint32(r,e,!0);var o=n().getUint32(e+4,!0);n().setUint32(r+4,o,!0);var i=n().getUint32(r+4,!0);n().setUint32(i,r,!0),n().setUint32(e+4,r,!0)},queueRemove:function(e){z.ensureBufferFor(e+4+4);var r=new DataView(a.buffer),t=function(){return r.buffer===a.buffer?r:r=new DataView(a.buffer)},n=t().getUint32(e+4,!0),o=t().getUint32(e,!0);t().setUint32(n,o,!0),t().setUint32(o+4,n,!0)},queueEmpty:function(e){z.ensureBufferFor(e+4);var r=new DataView(a.buffer);return e==(r.buffer===a.buffer?r:r=new DataView(a.buffer)).getUint32(e,!0)},scheduleWork:function(e){var r;(null===(r=z.workerReady)||void 0===r?void 0:r.ready)||z.initWorkers(L()).then(function(){z.workerReady.ready=!0}).catch(function(e){throw z.workerReady=null,e}),d.increaseWaitingRequestCounter();var t=new Int32Array(z.ensureBufferFor(e+z.offset.status+4),e+z.offset.status,1);Atomics.store(t,0,0);var n=z.getMutex(),o=z.getCond();n.lock();try{z.queueInsertTail(z.globalAddress+z.globalOffset.q,e+z.offset.queue)}catch(e){throw d.decreaseWaitingRequestCounter(),n.unlock(),e}z.ensureBufferFor(z.globalAddress+z.globalOffset.idle_threads+4);var i=new DataView(a.buffer);(i.buffer===a.buffer?i:i=new DataView(a.buffer)).getUint32(z.globalAddress+z.globalOffset.idle_threads,!0)>0&&o.signal(),n.unlock()},cancelWork:function(e){var r=!1;return z.getMutex().execute(function(){z.ensureBufferFor(e+z.offset.status+4);var t=new DataView(a.buffer);(r=!z.queueEmpty(e+z.offset.queue)&&2!==(t.buffer===a.buffer?t:t=new DataView(a.buffer)).getInt32(e+z.offset.status,!0))&&z.queueRemove(e+z.offset.queue)}),r?0!==Atomics.compareExchange(new Int32Array(z.ensureBufferFor(e+z.offset.status+4),e+z.offset.status,1),0,0,1)?9:(d.feature.setImmediate(function(){z.callComplete(e,11)}),0):9},callComplete:function(e,r){d.decreaseWaitingRequestCounter();var t=z.getComplete(e),n=z.getEnv(e),a=z.getData(e),i=d.envStore.get(n),s=d.openScope(i),f=function(){t&&i.callbackIntoModule(!0,function(){o.get(t)(n,r,a)})};try{if(v){var u=z.getResource(e),c=d.refStore.get(u).get(),l=d.handleStore.get(c).value,p=new DataView(z.ensureBufferFor(e+z.offset.trigger_async_id+8)),y=p.getFloat64(e+z.offset.async_id,!0),g=p.getFloat64(e+z.offset.trigger_async_id,!0);v.node.makeCallback(l,f,[],{asyncId:y,triggerAsyncId:g})}else f()}finally{d.closeScope(i,s)}}};z.init();var G=E?function(e,r,t,n,o,i,s){if(!e)return 1;var f,u=d.envStore.get(e);if(u.checkGCAccess(),!n)return u.setLastError(1);if(!s)return u.setLastError(1);if(f=r?Object(d.handleStore.get(r).value):{},!t)return u.setLastError(1);var c=String(d.handleStore.get(t).value),l=F.create(e,f,c,n,o,i);s>>>=0;var v=new DataView(a.buffer);return(v.buffer===a.buffer?v:v=new DataView(a.buffer)).setUint32(s,l,!0),u.clearLastError()}:function(e,r,t,n,o,s,f){if(!e)return 1;var u,c=d.envStore.get(e);if(c.checkGCAccess(),!n)return c.setLastError(1);if(!f)return c.setLastError(1);if(u=r?Object(d.handleStore.get(r).value):{},!t)return c.setLastError(1);var l=z.offset.end,v=i(l);if(!v)return c.setLastError(9);v>>>=0,new Uint8Array(z.ensureBufferFor(v+l)).subarray(v,v+l).fill(0);var p=c.ensureHandleId(u),y=d.createReference(c,p,1,1).id,g=new DataView(a.buffer),w=function(){return g.buffer===a.buffer?g:g=new DataView(a.buffer)};return w().setUint32(v,y,!0),O(p,t,-1,v+z.offset.async_id),w().setUint32(v+z.offset.env,e,!0),w().setUint32(v+z.offset.execute,n,!0),w().setUint32(v+z.offset.complete,o,!0),w().setUint32(v+z.offset.data,s,!0),z.queueInit(v+z.offset.queue),f>>>=0,w().setUint32(f,v,!0),c.clearLastError()},M=E?function(e,r){if(!e)return 1;var t=d.envStore.get(e);return t.checkGCAccess(),r?(r>>>=0,F.remove(r),t.clearLastError()):t.setLastError(1)}:function(e,r){if(!e)return 1;var t=d.envStore.get(e);if(t.checkGCAccess(),!r)return t.setLastError(1);r>>>=0;var n=z.getResource(r);if(d.refStore.get(n).dispose(),v){var a=new DataView(z.ensureBufferFor(r+z.offset.trigger_async_id+8));x(a.getFloat64(r+z.offset.async_id,!0),a.getFloat64(r+z.offset.trigger_async_id,!0))}return s(r),t.clearLastError()},P=E?function(e,r){if(!e)return 1;var t=d.envStore.get(e);return r?(r>>>=0,F.queue(r),t.clearLastError()):t.setLastError(1)}:function(e,r){if(!e)return 1;var t=d.envStore.get(e);return r?(r>>>=0,z.scheduleWork(r),t.clearLastError()):t.setLastError(1)},q=E?function(e,r){if(!e)return 1;var t=d.envStore.get(e);if(!r)return t.setLastError(1);r>>>=0;var n=F.cancel(r);return 0===n?t.clearLastError():t.setLastError(n)}:function(e,r){if(!e)return 1;var t=d.envStore.get(e);if(!r)return t.setLastError(1);r>>>=0;var n=z.cancelWork(r);return 0===n?t.clearLastError():t.setLastError(n)};y.initWorker=function(e,r){if(!y.childThread)throw new Error("startThread is only available in child threads");if("function"!=typeof n.exports.emnapi_async_worker_init)throw new TypeError("`emnapi_async_worker_init` is not exported, please try to add `--export=emnapi_async_worker_init` to linker flags");n.exports.emnapi_async_worker_init(e),o.get(r[0])(r[1])};var W=Object.freeze({__proto__:null,_emnapi_async_worker:function(e){e>>>=0,z.globalAddress=e;var r=z.getMutex(),t=z.getCond();r.lock();for(var n=e+z.globalOffset.exit_message,i=e+z.globalOffset.idle_threads,s=e+z.globalOffset.q,f=new DataView(a.buffer),u=function(){return f.buffer===a.buffer?f:f=new DataView(a.buffer)};;){for(z.ensureBufferFor(s+4);z.queueEmpty(s);)Atomics.add(new Int32Array(z.ensureBufferFor(i+4),i,1),0,1),t.wait(),Atomics.sub(new Int32Array(z.ensureBufferFor(i+4),i,1),0,1);var c=u().getUint32(s,!0);if(c===n){t.signal(),r.unlock();break}var d=c-z.offset.queue;z.queueRemove(c),z.queueInit(c),r.unlock();var v=new Int32Array(z.ensureBufferFor(d+z.offset.status+4),d+z.offset.status,1);1===Atomics.load(v,0)&&l("unreachable");var p=z.getExecute(d),g=z.getEnv(d),w=z.getData(d);o.get(p)(g,w),Atomics.store(v,0,2),(0,y.postMessage)({__emnapi__:{type:"async-work-complete",payload:{work:d}}}),r.lock()}return 0},_emnapi_spawn_worker:function(e,r){if("function"!=typeof g)throw new TypeError("`options.onCreateWorker` is not a function");var t=[];if(!("emnapi_async_worker_create"in n.exports))throw new TypeError("`emnapi_async_worker_create` is not exported, please try to add `--export=emnapi_async_worker_create` to linker flags");t.push(n.exports.emnapi_async_worker_create(0,0));var a,o=function(e){!("message"in e)||-1===e.message.indexOf("RuntimeError")&&-1===e.message.indexOf("unreachable")||z.terminateWorkers()};try{var i=g({type:"async-work",name:"emnapi-async-worker"}),u=S.loadWasmModuleToWorker(i);f?i.on("error",o):i.addEventListener("error",o,!1),z.addListener(i),R.addListener(i),[].push(u.then(function(){"function"==typeof i.unref&&i.unref()})),a=z.pool.push(i)-1;var c=t[0];i.threadBlockBase=c,i.postMessage({__emnapi__:{type:"async-worker-init",payload:{arg:c,func:[e,r]}}})}catch(e){c=t[0];throw s(c),e}return a},napi_cancel_async_work:q,napi_create_async_work:G,napi_delete_async_work:M,napi_queue_async_work:P}),N={registry:"function"==typeof FinalizationRegistry?new FinalizationRegistry(function(e){s(e)}):void 0,table:new WeakMap,wasmMemoryViewTable:new WeakMap,intrinsics:void 0,init:function(){var e;N.registry="function"==typeof FinalizationRegistry?new FinalizationRegistry(function(e){s(e)}):void 0,N.table=new WeakMap,N.wasmMemoryViewTable=new WeakMap;var r="function"==typeof SharedArrayBuffer?null===(e=Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype,"byteLength"))||void 0===e?void 0:e.get:void 0;N.intrinsics={isView:ArrayBuffer.isView,typedArray:{buffer:Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array.prototype),"buffer").get,byteOffset:Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array.prototype),"byteOffset").get,length:Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array.prototype),"length").get,tag:Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array.prototype),Symbol.toStringTag).get},dataView:{buffer:Object.getOwnPropertyDescriptor(DataView.prototype,"buffer").get,byteOffset:Object.getOwnPropertyDescriptor(DataView.prototype,"byteOffset").get,byteLength:Object.getOwnPropertyDescriptor(DataView.prototype,"byteLength").get},arrayBuffer:{byteLength:Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get},sharedArrayBuffer:void 0!==r?{byteLength:r}:void 0,ctors:{Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float16Array:"function"==typeof Float16Array?Float16Array:void 0,Float32Array:Float32Array,Float64Array:Float64Array,BigInt64Array:BigInt64Array,BigUint64Array:BigUint64Array},bufferFrom:void 0}},isSharedArrayBuffer:function(e){var r=N.intrinsics.sharedArrayBuffer;if(void 0!==r){if("function"==typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer)return!0;try{return r.byteLength.call(e),!0}catch(e){return!1}}try{return N.intrinsics.arrayBuffer.byteLength.call(e),!1}catch(e){}return"[object SharedArrayBuffer]"===Object.prototype.toString.call(e)},isDetachedArrayBuffer:function(e){if(0===N.bufferByteLength(e))try{new Uint8Array(e)}catch(e){return!0}return!1},bufferByteLength:function(e){var r,t=N.intrinsics;try{return t.arrayBuffer.byteLength.call(e)}catch(i){var n=t.sharedArrayBuffer;if(void 0!==n)return n.byteLength.call(e);var a=Object.getPrototypeOf(e),o=null!=a?null===(r=Object.getOwnPropertyDescriptor(a,"byteLength"))||void 0===r?void 0:r.get:void 0;if(void 0===o)throw i;return o.call(e)}},viewBuffer:function(e){var r=N.intrinsics;return void 0===r.typedArray.tag.call(e)?r.dataView.buffer.call(e):r.typedArray.buffer.call(e)},viewByteOffset:function(e){var r=N.intrinsics;return void 0===r.typedArray.tag.call(e)?r.dataView.byteOffset.call(e):r.typedArray.byteOffset.call(e)},viewLength:function(e){var r=N.intrinsics;return void 0===r.typedArray.tag.call(e)?r.dataView.byteLength.call(e):r.typedArray.length.call(e)},getBufferFrom:function(){var e;return null!==(e=N.intrinsics.bufferFrom)&&void 0!==e?e:N.intrinsics.bufferFrom=d.feature.Buffer.from},getArrayBufferPointer:function(e,r){var t,n={address:0,ownership:0,runtimeAllocated:0};if(e===a.buffer)return n;var o=N.isDetachedArrayBuffer(e);if(N.table.has(e)){var s=N.table.get(e);return o?(s.address=0,s):(r&&0===s.ownership&&1===s.runtimeAllocated&&new Uint8Array(a.buffer).set(new Uint8Array(e),s.address),s)}var f=N.bufferByteLength(e);if(o||0===f)return n;if(!r)return n;var u=i(f);if(!u)throw new Error("Out of memory");return u>>>=0,new Uint8Array(a.buffer).set(new Uint8Array(e),u),n.address=u,n.ownership=N.registry?0:1,n.runtimeAllocated=1,N.table.set(e,n),null===(t=N.registry)||void 0===t||t.register(e,u),n},getOrUpdateMemoryView:function(e){var r=N.intrinsics,t=r.typedArray.tag.call(e),n=void 0===t,o=n?r.dataView.buffer.call(e):r.typedArray.buffer.call(e);if(o===a.buffer)return N.wasmMemoryViewTable.has(e)||N.wasmMemoryViewTable.set(e,{Ctor:n?DataView:r.ctors[t],address:n?r.dataView.byteOffset.call(e):r.typedArray.byteOffset.call(e),length:n?r.dataView.byteLength.call(e):r.typedArray.length.call(e),ownership:1,runtimeAllocated:0}),e;if((N.isDetachedArrayBuffer(o)||N.isSharedArrayBuffer(o))&&N.wasmMemoryViewTable.has(e)){var i=N.wasmMemoryViewTable.get(e),s=i.Ctor,f=void 0,u=d.feature.Buffer;return f="function"==typeof u&&s===u?N.getBufferFrom()(a.buffer,i.address,i.length):new s(a.buffer,i.address,i.length),N.wasmMemoryViewTable.set(f,i),f}return e},getViewPointer:function(e,r){e=N.getOrUpdateMemoryView(e);var t=N.viewBuffer(e);if(t===a.buffer){if(N.wasmMemoryViewTable.has(e)){var n=N.wasmMemoryViewTable.get(e);return{address:n.address,ownership:n.ownership,runtimeAllocated:n.runtimeAllocated,view:e}}return{address:N.viewByteOffset(e),ownership:1,runtimeAllocated:0,view:e}}var o=N.getArrayBufferPointer(t,r),i=o.address,s=o.ownership,f=o.runtimeAllocated;return{address:0===i?0:i+N.viewByteOffset(e),ownership:s,runtimeAllocated:f,view:e}}},J={registry:void 0,handleTable:new WeakMap,init:function(){J.handleTable=new WeakMap,J.registry="function"==typeof FinalizationRegistry?new FinalizationRegistry(function(e){J.release(e)}):void 0},allocMeta:function(e,r,t,n,o){var s=i(24);if(!s)throw new Error("Out of memory");s>>>=0,Atomics.store(new Int32Array(a.buffer,s,1),0,1);var f=new DataView(a.buffer),u=function(){return f.buffer===a.buffer?f:f=new DataView(a.buffer)};return u().setUint32(s+4,e,!0),u().setUint32(s+8,r,!0),u().setUint32(s+12,t,!0),u().setUint32(s+16,n,!0),u().setUint32(s+20,o,!0),s},readMeta:function(e){var r=new DataView(a.buffer),t=function(){return r.buffer===a.buffer?r:r=new DataView(a.buffer)};return{external_data:t().getUint32(e+4,!0),byte_length:t().getUint32(e+8,!0),finalize_cb:t().getUint32(e+12,!0),finalize_data:t().getUint32(e+16,!0),finalize_hint:t().getUint32(e+20,!0)}},release:function(e){if(1===Atomics.sub(new Int32Array(a.buffer,e,1),0,1)){var r=J.readMeta(e),t=r.finalize_cb;if(t){var n=r.finalize_data,i=r.finalize_hint;o.get(t)(n,i)}s(e)}}},H={utf8Decoder:void 0,utf16Decoder:void 0,init:function(){var e,r={decode:function(e){for(var r=0,t=Math.min(4096,e.length+1),n=new Uint16Array(t),a=[],o=0;;){var i=r<e.length;if(!i||o>=t-1){var s=n.subarray(0,o);if(a.push(String.fromCharCode.apply(null,s)),!i)return a.join("");e=e.subarray(r),r=0,o=0}var f=e[r++];if(128&f){if(192==(224&f)){var u=63&e[r++];n[o++]=(31&f)<<6|u}else if(224==(240&f)){u=63&e[r++];var c=63&e[r++];n[o++]=(31&f)<<12|u<<6|c}else if(240==(248&f)){var l=(7&f)<<18|(u=63&e[r++])<<12|(c=63&e[r++])<<6|63&e[r++];l>65535&&(l-=65536,n[o++]=l>>>10&1023|55296,l=56320|1023&l),n[o++]=l}}else n[o++]=f}}};e="function"==typeof TextDecoder?new TextDecoder:r,H.utf8Decoder=e;var t,n={decode:function(e){var r=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2);if(r.length<=4096)return String.fromCharCode.apply(null,r);for(var t=[],n=0,a=0;n<r.length;n+=a)a=Math.min(4096,r.length-n),t.push(String.fromCharCode.apply(null,r.subarray(n,n+a)));return t.join("")}};t="function"==typeof TextDecoder?new TextDecoder("utf-16le"):n,H.utf16Decoder=t},lengthBytesUTF8:function(e){for(var r,t=0,n=0;n<e.length;++n)(r=e.charCodeAt(n))<=127?t++:r<=2047?t+=2:r>=55296&&r<=57343?(t+=4,++n):t+=3;return t},UTF8ToString:function(e,r){if(!e||!r)return"";e>>>=0;var t=new Uint8Array(a.buffer),n=e;if(-1===r||4294967295===r)for(;t[n];)++n;else n=e+(r>>>0);if((r=n-e)<=16){for(var o=e,i="";o<n;){var s=t[o++];if(128&s){var f=63&t[o++];if(192!=(224&s)){var u=63&t[o++];if((s=224==(240&s)?(15&s)<<12|f<<6|u:(7&s)<<18|f<<12|u<<6|63&t[o++])<65536)i+=String.fromCharCode(s);else{var c=s-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&s)<<6|f)}else i+=String.fromCharCode(s)}return i}return H.utf8Decoder.decode("function"==typeof SharedArrayBuffer&&t.buffer instanceof SharedArrayBuffer||"[object SharedArrayBuffer]"===Object.prototype.toString.call(t.buffer)?t.slice(e,n):t.subarray(e,n))},stringToUTF8:function(e,r,t){var n=new Uint8Array(a.buffer),o=r;if(!(t>0))return 0;for(var i=o>>>=0,s=o+t-1,f=0;f<e.length;++f){var u=e.charCodeAt(f);if(u>=55296&&u<=57343)u=65536+((1023&u)<<10)|1023&e.charCodeAt(++f);if(u<=127){if(o>=s)break;n[o++]=u}else if(u<=2047){if(o+1>=s)break;n[o++]=192|u>>6,n[o++]=128|63&u}else if(u<=65535){if(o+2>=s)break;n[o++]=224|u>>12,n[o++]=128|u>>6&63,n[o++]=128|63&u}else{if(o+3>=s)break;n[o++]=240|u>>18,n[o++]=128|u>>12&63,n[o++]=128|u>>6&63,n[o++]=128|63&u}}return n[o]=0,o-i},UTF16ToString:function(e,r){if(!e||!r)return"";var t=e>>>=0;if(-1===r||4294967295===r){for(var n=t>>>1,o=new Uint16Array(a.buffer);o[n];)++n;t=n<<1>>>0}else t=e+2*(r>>>0);if((r=t-e)<=32)return String.fromCharCode.apply(null,new Uint16Array(a.buffer,e,r/2));var i=new Uint8Array(a.buffer);return H.utf16Decoder.decode("function"==typeof SharedArrayBuffer&&i.buffer instanceof SharedArrayBuffer||"[object SharedArrayBuffer]"===Object.prototype.toString.call(i.buffer)?i.slice(e,t):i.subarray(e,t))},stringToUTF16:function(e,r,t){if(void 0===t&&(t=2147483647),t<2)return 0;for(var n=r,o=(t-=2)<2*e.length?t/2:e.length,i=new DataView(a.buffer),s=function(){return i.buffer===a.buffer?i:i=new DataView(a.buffer)},f=0;f<o;++f){var u=e.charCodeAt(f);s().setInt16(r,u,!0),r+=2}return s().setInt16(r,0,!0),r-n},newString:function(e,r,t,n,o){if(t>>>=0,!e)return 1;var i=d.envStore.get(e);i.checkGCAccess();var s=-1===t||4294967295===t,f=t>>>0;if(0!==t&&!r)return i.setLastError(1);if(!n)return i.setLastError(1);if(!(s||f<=2147483647))return i.setLastError(1);var u=o(r>>>=0,s,f);n>>>=0;var c=d.addToCurrentScope(u).id,l=new DataView(a.buffer);return(l.buffer===a.buffer?l:l=new DataView(a.buffer)).setUint32(n,c,!0),i.clearLastError()},newExternalString:function(e,r,t,n,o,i,s,f,u){if(t>>>=0,!e)return 1;var c=d.envStore.get(e);c.checkGCAccess();var l=-1===t||4294967295===t,v=t>>>0;if(0!==t&&!r)return c.setLastError(1);if(!i)return c.setLastError(1);if(!(l||v<=2147483647))return c.setLastError(1);var p=f(e,r,t,i);if(0===p){if(s){var y=new DataView(a.buffer);(y.buffer===a.buffer?y:y=new DataView(a.buffer)).setInt8(s,1,!0)}n&&c.callFinalizer(n,r,o)}return p}};function Q(e,r,t,n,o,i,s){if(!e)return 1;var f=d.envStore.get(e);if(f.checkGCAccess(),!r)return f.setLastError(1);var u=d.handleStore.get(r);if(!N.intrinsics.isView(u.value))return f.setLastError(1);var c=u.value,l=new DataView(a.buffer),v=function(){return l.buffer===a.buffer?l:l=new DataView(a.buffer)};if(t){t>>>=0;var p=void 0;switch(N.intrinsics.typedArray.tag.call(c)){case"Int8Array":p=0;break;case"Uint8Array":p=1;break;case"Uint8ClampedArray":p=2;break;case"Int16Array":p=3;break;case"Uint16Array":p=4;break;case"Int32Array":p=5;break;case"Uint32Array":p=6;break;case"Float16Array":p=11;break;case"Float32Array":p=7;break;case"Float64Array":p=8;break;case"BigInt64Array":p=9;break;case"BigUint64Array":p=10;break;default:return f.setLastError(9)}v().setInt32(t,p,!0)}if(c=N.getOrUpdateMemoryView(c),n){n>>>=0;var y=N.viewLength(c);v().setUint32(n,y,!0)}if(o||i){if(o){o>>>=0;var g=N.getViewPointer(c,!0);c=g.view;var w=g.address;v().setUint32(o,w,!0)}if(i){i>>>=0;var b=f.ensureHandleId(N.viewBuffer(c));v().setUint32(i,b,!0)}}if(s){s>>>=0;var h=N.viewByteOffset(c);v().setUint32(s,h,!0)}return f.clearLastError()}function $(e,r,t,n,o,i){if(!e)return 1;var s=d.envStore.get(e);if(s.checkGCAccess(),!r)return s.setLastError(1);var f=d.handleStore.get(r);if(!N.intrinsics.isView(f.value)||void 0!==N.intrinsics.typedArray.tag.call(f.value))return s.setLastError(1);var u=N.getOrUpdateMemoryView(f.value),c=new DataView(a.buffer),l=function(){return c.buffer===a.buffer?c:c=new DataView(a.buffer)};if(t){t>>>=0;var v=N.viewLength(u);l().setUint32(t,v,!0)}if(n||o){if(n){n>>>=0;var p=N.getViewPointer(u,!0);u=p.view;var y=p.address;l().setUint32(n,y,!0)}if(o){o>>>=0;var g=s.ensureHandleId(N.viewBuffer(u));l().setUint32(o,g,!0)}}if(i){i>>>=0;var w=N.viewByteOffset(u);l().setUint32(i,w,!0)}return s.clearLastError()}var Y=Object.freeze({__proto__:null,napi_get_array_length:function(e,r,t){if(!e)return 1;var n=d.envStore.get(e);if(n.checkGCAccess(),!n.tryCatch.isEmpty())return n.setLastError(10);if(!n.canCallIntoJs())return n.setLastError(n.moduleApiVersion>=10?23:10);n.clearLastError();try{if(!r)return n.setLastError(1);if(!t)return n.setLastError(1);var o=d.handleStore.get(r);if(!o.isArray())return n.setLastError(8);t>>>=0;var i=o.value.length>>>0,s=new DataView(a.buffer);return(s.buffer===a.buffer?s:s=new DataView(a.buffer)).setUint32(t,i,!0),n.getReturnStatus()}catch(e){return n.tryCatch.setError(e),n.setLastError(10)}},napi_get_arraybuffer_info:function(e,r,t,n){if(!e)return 1;var o=d.envStore.get(e);if(o.checkGCAccess(),!r)return o.setLastError(1);var i=d.handleStore.get(r);if(!i.isArrayBuffer()&&!N.isSharedArrayBuffer(i.value))return o.setLastError(1);var s=new DataView(a.buffer),f=function(){return s.buffer===a.buffer?s:s=new DataView(a.buffer)};if(t){t>>>=0;var u=N.getArrayBufferPointer(i.value,!0).address;f().setUint32(t,u,!0)}if(n){n>>>=0;var c=N.bufferByteLength(i.value);f().setUint32(n,c,!0)}return o.clearLastError()},napi_get_buffer_info:function(e,r,t,n){if(!e)return 1;var a=d.envStore.get(e);if(a.checkGCAccess(),!r)return a.setLastError(1);var o=d.handleStore.get(r),i=d.feature.Buffer;return N.intrinsics.isView(o.value)||"function"==typeof i&&i.isBuffer(o.value)?void 0===N.intrinsics.typedArray.tag.call(o.value)?$(e,r,n,t,0,0):Q(e,r,0,n,t,0,0):a.setLastError(1)},napi_get_dataview_info:$,napi_get_date_value:function(e,r,t){var n;if(!e)return 1;var o=d.envStore.get(e);if(o.checkGCAccess(),!o.tryCatch.isEmpty())return o.setLastError(10);if(!o.canCallIntoJs())return o.setLastError(o.moduleApiVersion>=10?23:10);o.clearLastError();try{if(!r)return o.setLastError(1);if(!t)return o.setLastError(1);var i=d.handleStore.get(r);if(!i.isDate())return o.setLastError(1);t>>>=0,n=i.value.valueOf();var s=new DataView(a.buffer);return(s.buffer===a.buffer?s:s=new DataView(a.buffer)).setFloat64(t,n,!0),o.getReturnStatus()}catch(e){return o.tryCatch.setError(e),o.setLastError(10)}},napi_get_prototype:function(e,r,t){if(!e)return 1;var n=d.envStore.get(e);if(n.checkGCAccess(),!n.tryCatch.isEmpty())return n.setLastError(10);if(!n.canCallIntoJs())return n.setLastError(n.moduleApiVersion>=10?23:10);n.clearLastError();try{if(!r)return n.setLastError(1);if(!t)return n.setLastError(1);var o=d.handleStore.get(r);if(null==o.value)throw new TypeError("Cannot convert undefined or null to object");var i=void 0;try{i=o.isObject()||o.isFunction()?o.value:Object(o.value)}catch(e){return n.setLastError(2)}t>>>=0;var s=n.ensureHandleId(Object.getPrototypeOf(i)),f=new DataView(a.buffer);return(f.buffer===a.buffer?f:f=new DataView(a.buffer)).setUint32(t,s,!0),n.getReturnStatus()}catch(e){return n.tryCatch.setError(e),n.setLastError(10)}},napi_get_typedarray_info:Q,napi_get_value_bigint_int64:function(e,r,t,n){if(!e)return 1;var o=d.envStore.get(e);if(o.checkGCAccess(),!d.feature.supportBigInt)return o.setLastError(9);if(!r)return o.setLastError(1);if(!t)return o.setLastError(1);if(!n)return o.setLastError(1);var i=d.handleStore.get(r).value;if("bigint"!=typeof i)return o.setLastError(6);n>>>=0,t>>>=0;var s=new DataView(a.buffer),f=function(){return s.buffer===a.buffer?s:s=new DataView(a.buffer)};i>=BigInt(-1)*(BigInt(1)<<BigInt(63))&&i<BigInt(1)<<BigInt(63)?f().setInt8(n,1,!0):(f().setInt8(n,0,!0),(i&=(BigInt(1)<<BigInt(64))-BigInt(1))>=BigInt(1)<<BigInt(63)&&(i-=BigInt(1)<<BigInt(64)));var u=Number(i&BigInt(4294967295)),c=Number(i>>BigInt(32));return f().setInt32(t,u,!0),f().setInt32(t+4,c,!0),o.clearLastError()},napi_get_value_bigint_uint64:function(e,r,t,n){if(!e)return 1;var o=d.envStore.get(e);if(o.checkGCAccess(),!d.feature.supportBigInt)return o.setLastError(9);if(!r)return o.setLastError(1);if(!t)return o.setLastError(1);if(!n)return o.setLastError(1);var i=d.handleStore.get(r).value;if("bigint"!=typeof i)return o.setLastError(6);n>>>=0,t>>>=0;var s=new DataView(a.buffer),f=function(){return s.buffer===a.buffer?s:s=new DataView(a.buffer)};i>=BigInt(0)&&i<BigInt(1)<<BigInt(64)?f().setInt8(n,1,!0):(f().setInt8(n,0,!0),i&=(BigInt(1)<<BigInt(64))-BigInt(1));var u=Number(i&BigInt(4294967295)),c=Number(i>>BigInt(32));return f().setUint32(t,u,!0),f().setUint32(t+4,c,!0),o.clearLastError()},napi_get_value_bigint_words:function(e,r,t,n,o){if(!e)return 1;var i=d.envStore.get(e);if(i.checkGCAccess(),!d.feature.supportBigInt)return i.setLastError(9);if(!r)return i.setLastError(1);if(!n)return i.setLastError(1);var s=d.handleStore.get(r);if(!s.isBigInt())return i.setLastError(17);var f=s.value<BigInt(0);t>>>=0,o>>>=0,n>>>=0;var u=new DataView(a.buffer),c=function(){return u.buffer===a.buffer?u:u=new DataView(a.buffer)},l=c().getUint32(n,!0);l>>>=0;for(var v=0,p=f?s.value*BigInt(-1):s.value;p!==BigInt(0);)v++,p>>=BigInt(64);if(p=f?s.value*BigInt(-1):s.value,t||o){if(!t)return i.setLastError(1);if(!o)return i.setLastError(1);for(var y=[];p!==BigInt(0);){var g=p&(BigInt(1)<<BigInt(64))-BigInt(1);y.push(g),p>>=BigInt(64)}for(var w=Math.min(l,y.length),b=0;b<w;b++){var h=Number(y[b]&BigInt(4294967295)),_=Number(y[b]>>BigInt(32));c().setUint32(o+8*b,h,!0),c().setUint32(o+(8*b+4),_,!0)}c().setInt32(t,f?1:0,!0),c().setUint32(n,w,!0)}else l=v,c().setUint32(n,l,!0);return i.clearLastError()},napi_get_value_bool:function(e,r,t){if(!e)return 1;var n=d.envStore.get(e);if(n.checkGCAccess(),!r)return n.setLastError(1);if(!t)return n.setLastError(1);var o=d.handleStore.get(r);if("boolean"!=typeof o.value)return n.setLastError(7);t>>>=0;var i=o.value?1:0,s=new DataView(a.buffer);return(s.buffer===a.buffer?s:s=new DataView(a.buffer)).setInt8(t,i,!0),n.clearLastError()},napi_get_value_double:function(e,r,t){if(!e)return 1;var n=d.envStore.get(e);if(n.checkGCAccess(),!r)return n.setLastError(1);if(!t)return n.setLastError(1);var o=d.handleStore.get(r);if("number"!=typeof o.value)return n.setLastError(6);t>>>=0;var i=o.value,s=new DataView(a.buffer);return(s.buffer===a.buffer?s:s=new DataView(a.buffer)).setFloat64(t,i,!0),n.clearLastError()},napi_get_value_external:function(e,r,t){if(!e)return 1;var n=d.envStore.get(e);if(n.checkGCAccess(),!r)return n.setLastError(1);if(!t)return n.setLastError(1);var o=d.handleStore.get(r);if(!o.isExternal())return n.setLastError(1);t>>>=0;var i=o.data(),s=new DataView(a.buffer);return(s.buffer===a.buffer?s:s=new DataView(a.buffer)).setUint32(t,i,!0),n.clearLastError()},napi_get_value_int32:function(e,r,t){if(!e)return 1;var n=d.envStore.get(e);if(n.checkGCAccess(),!r)return n.setLastError(1);if(!t)return n.setLastError(1);var o=d.handleStore.get(r);if("number"!=typeof o.value)return n.setLastError(6);t>>>=0;var i=new Int32Array([o.value])[0],s=new DataView(a.buffer);return(s.buffer===a.buffer?s:s=new DataView(a.buffer)).setInt32(t,i,!0),n.clearLastError()},napi_get_value_int64:function(e,r,t){if(!e)return 1;var n=d.envStore.get(e);if(n.checkGCAccess(),!r)return n.setLastError(1);if(!t)return n.setLastError(1);var o=d.handleStore.get(r);if("number"!=typeof o.value)return n.setLastError(6);var i=o.value;t>>>=0;var s=new DataView(a.buffer),f=function(){return s.buffer===a.buffer?s:s=new DataView(a.buffer)};return i===Number.POSITIVE_INFINITY||i===Number.NEGATIVE_INFINITY||isNaN(i)?(f().setInt32(t,0,!0),f().setInt32(t+4,0,!0)):i<-0x8000000000000000?(f().setInt32(t,0,!0),f().setInt32(t+4,2147483648,!0)):i>=0x8000000000000000?(f().setUint32(t,4294967295,!0),f().setUint32(t+4,2147483647,!0)):V(t,Math.trunc(i)),n.clearLastError()},napi_get_value_string_latin1:function(e,r,t,n,o){if(!e)return 1;var i=d.envStore.get(e);if(i.checkGCAccess(),!r)return i.setLastError(1);o>>>=0,t>>>=0,n>>>=0,n>>>=0;var s=d.handleStore.get(r);if("string"!=typeof s.value)return i.setLastError(3);var f=new DataView(a.buffer),u=function(){return f.buffer===a.buffer?f:f=new DataView(a.buffer)};if(t)if(0!==n){for(var c=0,l=void 0,v=0;v<n-1;++v)l=255&s.value.charCodeAt(v),u().setUint8(t+v,l,!0),c++;u().setUint8(t+c,0,!0),o&&u().setUint32(o,c,!0)}else o&&u().setUint32(o,0,!0);else{if(!o)return i.setLastError(1);u().setUint32(o,s.value.length,!0)}return i.clearLastError()},napi_get_value_string_utf16:function(e,r,t,n,o){if(!e)return 1;var i=d.envStore.get(e);if(i.checkGCAccess(),!r)return i.setLastError(1);o>>>=0,t>>>=0,n>>>=0,n>>>=0;var s=d.handleStore.get(r);if("string"!=typeof s.value)return i.setLastError(3);var f=new DataView(a.buffer),u=function(){return f.buffer===a.buffer?f:f=new DataView(a.buffer)};if(t)if(0!==n){var c=H.stringToUTF16(s.value,t,2*n);o&&u().setUint32(o,c/2,!0)}else o&&u().setUint32(o,0,!0);else{if(!o)return i.setLastError(1);u().setUint32(o,s.value.length,!0)}return i.clearLastError()},napi_get_value_string_utf8:function(e,r,t,n,o){if(!e)return 1;var i=d.envStore.get(e);if(i.checkGCAccess(),!r)return i.setLastError(1);o>>>=0,t>>>=0,n>>>=0,n>>>=0;var s=d.handleStore.get(r);if("string"!=typeof s.value)return i.setLastError(3);var f=new DataView(a.buffer),u=function(){return f.buffer===a.buffer?f:f=new DataView(a.buffer)};if(t)if(0!==n){var c=H.stringToUTF8(s.value,t,n);o&&u().setUint32(o,c,!0)}else o&&u().setUint32(o,0,!0);else{if(!o)return i.setLastError(1);var l=H.lengthBytesUTF8(s.value);u().setUint32(o,l,!0)}return i.clearLastError()},napi_get_value_uint32:function(e,r,t){if(!e)return 1;var n=d.envStore.get(e);if(n.checkGCAccess(),!r)return n.setLastError(1);if(!t)return n.setLastError(1);var o=d.handleStore.get(r);if("number"!=typeof o.value)return n.setLastError(6);t>>>=0;var i=new Uint32Array([o.value])[0],s=new DataView(a.buffer);return(s.buffer===a.buffer?s:s=new DataView(a.buffer)).setUint32(t,i,!0),n.clearLastError()},node_api_set_prototype:function(e,r,t){if(!e)return 1;var n=d.envStore.get(e);if(n.checkGCAccess(),!n.tryCatch.isEmpty())return n.setLastError(10);if(!n.canCallIntoJs())return n.setLastError(n.moduleApiVersion>=10?23:10);n.clearLastError();try{if(!t)return n.setLastError(1);var a=d.handleStore.get(r).value;if(null==a)throw new TypeError("Cannot convert undefined or null to object");var o=typeof a,i=void 0;try{i="object"===o&&null!==a||"function"===o?a:Object(a)}catch(e){return n.setLastError(2)}var s=d.handleStore.get(t).value;return Object.setPrototypeOf(i,s),n.getReturnStatus()}catch(e){return n.tryCatch.setError(e),n.setLastError(10)}}});function X(e,r,t,n){return H.newString(e,r,t,n,function(e,r,t){var n="",o=0,i=new DataView(a.buffer),s=function(){return i.buffer===a.buffer?i:i=new DataView(a.buffer)};if(r)for(;;){if(!(f=s().getUint8(e,!0)))break;n+=String.fromCharCode(f),e++}else for(;o<t;){var f;if(!(f=s().getUint8(e,!0)))break;n+=String.fromCharCode(f),o++,e++}return n})}function Z(e,r,t,n){return H.newString(e,r,t,n,function(e){return H.UTF16ToString(e,t)})}function K(e,r,t,n){return H.newString(e,r,t,n,function(e){return H.UTF8ToString(e,t)})}var ee=Object.freeze({__proto__:null,napi_create_bigint_int64:function(e,r,t,n){if(!e)return 1;var o,i=d.envStore.get(e);if(i.checkGCAccess(),!d.feature.supportBigInt)return i.setLastError(9);if(!t)return i.setLastError(1);o=r;var s=d.addToCurrentScope(o).id;t>>>=0;var f=new DataView(a.buffer);return(f.buffer===a.buffer?f:f=new DataView(a.buffer)).setUint32(t,s,!0),i.clearLastError()},napi_create_bigint_uint64:function(e,r,t,n){if(!e)return 1;var o,i=d.envStore.get(e);if(i.checkGCAccess(),!d.feature.supportBigInt)return i.setLastError(9);if(!t)return i.setLastError(1);o=r&(BigInt(1)<<BigInt(64))-BigInt(1);var s=d.addToCurrentScope(o).id;t>>>=0;var f=new DataView(a.buffer);return(f.buffer===a.buffer?f:f=new DataView(a.buffer)).setUint32(t,s,!0),i.clearLastError()},napi_create_bigint_words:function(e,r,t,n,o){var i,s;if(!e)return 1;var f=d.envStore.get(e);if(f.checkGCAccess(),!f.tryCatch.isEmpty())return f.setLastError(10);if(!f.canCallIntoJs())return f.setLastError(f.moduleApiVersion>=10?23:10);f.clearLastError();try{if(!d.feature.supportBigInt)return f.setLastError(9);if(!o)return f.setLastError(1);if(n>>>=0,t>>>=0,(t>>>=0)>2147483647)return f.setLastError(1);if(t>16384)throw new RangeError("Maximum BigInt size exceeded");var u=BigInt(0),c=new DataView(a.buffer),l=function(){return c.buffer===a.buffer?c:c=new DataView(a.buffer)};for(s=0;s<t;s++){var v=l().getUint32(n+8*s,!0),p=l().getUint32(n+(8*s+4),!0);u+=(BigInt(v)|BigInt(p)<<BigInt(32))<<BigInt(64*s)}return u*=BigInt(r)%BigInt(2)===BigInt(0)?BigInt(1):BigInt(-1),o>>>=0,i=d.addToCurrentScope(u).id,l().setUint32(o,i,!0),f.getReturnStatus()}catch(e){return f.tryCatch.setError(e),f.setLastError(10)}},napi_create_double:function(e,r,t){if(!e)return 1;var n=d.envStore.get(e);if(n.checkGCAccess(),!t)return n.setLastError(1);t>>>=0;var o=d.addToCurrentScope(r).id,i=new DataView(a.buffer);return(i.buffer===a.buffer?i:i=new DataView(a.buffer)).setUint32(t,o,!0),n.clearLastError()},napi_create_int32:function(e,r,t){if(!e)return 1;var n=d.envStore.get(e);if(n.checkGCAccess(),!t)return n.setLastError(1);t>>>=0;var o=d.addToCurrentScope(r).id,i=new DataView(a.buffer);return(i.buffer===a.buffer?i:i=new DataView(a.buffer)).setUint32(t,o,!0),n.clearLastError()},napi_create_int64:function(e,r,t,n){if(!e)return 1;var o,i=d.envStore.get(e);if(i.checkGCAccess(),!t)return i.setLastError(1);o=Number(r);var s=d.addToCurrentScope(o).id;t>>>=0;var f=new DataView(a.buffer);return(f.buffer===a.buffer?f:f=new DataView(a.buffer)).setUint32(t,s,!0),i.clearLastError()},napi_create_string_latin1:X,napi_create_string_utf16:Z,napi_create_string_utf8:K,napi_create_uint32:function(e,r,t){if(!e)return 1;var n=d.envStore.get(e);if(n.checkGCAccess(),!t)return n.setLastError(1);t>>>=0;var o=d.addToCurrentScope(r>>>0).id,i=new DataView(a.buffer);return(i.buffer===a.buffer?i:i=new DataView(a.buffer)).setUint32(t,o,!0),n.clearLastError()},node_api_create_external_string_latin1:function(e,r,t,n,a,o,i){return H.newExternalString(e,r,t,n,a,o,i,X,void 0)},node_api_create_external_string_utf16:function(e,r,t,n,a,o,i){return H.newExternalString(e,r,t,n,a,o,i,Z,void 0)},node_api_create_property_key_latin1:function(e,r,t,n){return X(e,r,t,n)},node_api_create_property_key_utf16:function(e,r,t,n){return Z(e,r,t,n)},node_api_create_property_key_utf8:function(e,r,t,n){return K(e,r,t,n)}});function re(e,r,t,n,a){var i,s=(r>>>=0)&&t?H.UTF8ToString(r,t):"",f=o.get(n),u=function(e){return f(e.id,e.ctx.scopeStore.currentScope.id)},c=function(e,r){return function(){var t=e.ctx.openScope(e),n=t.callbackInfo;n.data=a,n.args=arguments,n.thiz=this,n.fn=i;try{var o=e.callIntoModule(r);return o?e.ctx.handleStore.get(o).value:void 0}finally{n.data=0,n.args=void 0,n.thiz=void 0,n.fn=void 0,e.ctx.closeScope(e,t)}}};if(""===s)return{status:0,f:i=c(e,u)};if(!/^[_$a-zA-Z][_$a-zA-Z0-9]*$/.test(s))return{status:1,f:void 0};if(d.feature.supportNewFunction){var l=c(e,u);try{i=new Function("_","return function "+s+'(){"use strict";return _.apply(this,arguments);};')(l)}catch(r){i=c(e,u),d.feature.canSetFunctionName&&Object.defineProperty(i,"name",{value:s})}}else i=c(e,u),d.feature.canSetFunctionName&&Object.defineProperty(i,"name",{value:s});return{status:0,f:i}}function te(e,r,t,n,a,o,i,s,f){if(a||o){var u=void 0,c=void 0;a&&(u=re(e,0,0,a,f).f),o&&(c=re(e,0,0,o,f).f);var l={configurable:!!(4&s),enumerable:!!(2&s),get:u,set:c};Object.defineProperty(r,t,l)}else if(n){l={configurable:!!(4&s),enumerable:!!(2&s),writable:!!(1&s),value:re(e,0,0,n,f).f};Object.defineProperty(r,t,l)}else{l={configurable:!!(4&s),enumerable:!!(2&s),writable:!!(1&s),value:d.handleStore.get(i).value};Object.defineProperty(r,t,l)}}function ne(e){var r=d.handleStore.get(e);return r.isObject()||r.isFunction()?(void 0!==N&&ArrayBuffer.isView(r.value)&&N.wasmMemoryViewTable.has(r.value)&&(r=d.addToCurrentScope(N.wasmMemoryViewTable.get(r.value))),{status:0,handle:r}):{status:1}}function ae(e,r,t,n){var o;if(!e)return 1;var i=d.envStore.get(e);if(i.checkGCAccess(),!i.tryCatch.isEmpty())return i.setLastError(10);if(!i.canCallIntoJs())return i.setLastError(i.moduleApiVersion>=10?23:10);i.clearLastError();try{if(!r)return i.setLastError(1);if(0===n&&!t)return i.setLastError(1);var s=d.handleStore.get(r);if(!s.isObject()&&!s.isFunction())return i.setLastError(1);var f=i.getObjectBinding(s.value),u=f.wrapped,c=d.refStore.get(u);if(!c)return i.setLastError(1);if(t){t>>>=0,o=c.data();var l=new DataView(a.buffer);(l.buffer===a.buffer?l:l=new DataView(a.buffer)).setUint32(t,o,!0)}return 1===n&&(f.wrapped=0,1===c.ownership()?c.resetFinalizer():c.dispose()),i.getReturnStatus()}catch(e){return i.tryCatch.setError(e),i.setLastError(10)}}function oe(e,r,t,n,o,i){if(!e)return 1;var s=d.envStore.get(e);if(s.checkGCAccess(),!d.feature.supportFinalizer)return s.setLastError(9);if(!r)return s.setLastError(1);if(!n)return s.setLastError(1);var f=ne(r);if(0!==f.status)return s.setLastError(f.status);var u=f.handle,c=i?1:0;t>>>=0,n>>>=0,o>>>=0;var l=d.createReferenceWithFinalizer(s,u.id,0,c,n,t,o);if(i){i>>>=0;var v=l.id,p=new DataView(a.buffer);(p.buffer===a.buffer?p:p=new DataView(a.buffer)).setUint32(i,v,!0)}return s.clearLastError()}var ie=Object.freeze({__proto__:null,napi_add_finalizer:oe,napi_check_object_type_tag:function(e,r,t,n){var o=!0;if(!e)return 1;var i=d.envStore.get(e);if(i.checkGCAccess(),!i.tryCatch.isEmpty())return i.setLastError(10);if(!i.canCallIntoJs())return i.setLastError(i.moduleApiVersion>=10?23:10);i.clearLastError();try{if(!r)return i.setLastError(i.tryCatch.hasCaught()?10:1);var s=d.handleStore.get(r);if(!s.isObject()&&!s.isFunction())return i.setLastError(i.tryCatch.hasCaught()?10:2);if(!t)return i.setLastError(i.tryCatch.hasCaught()?10:1);if(!n)return i.setLastError(i.tryCatch.hasCaught()?10:1);var f=i.getObjectBinding(s.value);if(null!==f.tag){t>>>=0;var u=f.tag,c=new Uint32Array(a.buffer,t,4);o=u[0]===c[0]&&u[1]===c[1]&&u[2]===c[2]&&u[3]===c[3]}else o=!1;n>>>=0;var l=new DataView(a.buffer);return(l.buffer===a.buffer?l:l=new DataView(a.buffer)).setInt8(n,o?1:0,!0),i.getReturnStatus()}catch(e){return i.tryCatch.setError(e),i.setLastError(10)}},napi_define_class:function(e,r,t,n,o,i,s,f){var u,c,l;if(!e)return 1;var v=d.envStore.get(e);if(v.checkGCAccess(),!v.tryCatch.isEmpty())return v.setLastError(10);if(!v.canCallIntoJs())return v.setLastError(v.moduleApiVersion>=10?23:10);v.clearLastError();try{if(!f)return v.setLastError(1);if(!n)return v.setLastError(1);if(t>>>=0,s>>>=0,i>>>=0,(i>>>=0)>0&&!s)return v.setLastError(1);if(!(t>=-1&&t<=2147483647||4294967295===t)||!r)return v.setLastError(1);var p=re(v,r,t,n,o);if(0!==p.status)return v.setLastError(p.status);for(var y=p.f,g=void 0,w=new DataView(a.buffer),b=function(){return w.buffer===a.buffer?w:w=new DataView(a.buffer)},h=0;h<i;h++){u=s+32*h;var _=b().getUint32(u,!0),E=b().getUint32(u+4,!0),L=b().getUint32(u+8,!0),m=b().getUint32(u+12,!0),S=b().getUint32(u+16,!0),A=b().getUint32(u+20,!0);l=b().getInt32(u+24,!0),l>>>=0;var C=b().getUint32(u+28,!0);if(_)g=H.UTF8ToString(_,-1);else{if(!E)return v.setLastError(4);if("string"!=typeof(g=d.handleStore.get(E).value)&&"symbol"!=typeof g)return v.setLastError(4)}1024&l?te(v,y,g,L,m,S,A,l,C):te(v,y.prototype,g,L,m,S,A,l,C)}return c=d.addToCurrentScope(y).id,f>>>=0,b().setUint32(f,c,!0),v.getReturnStatus()}catch(e){return v.tryCatch.setError(e),v.setLastError(10)}},napi_remove_wrap:function(e,r,t){return ae(e,r,t,1)},napi_type_tag_object:function(e,r,t){if(!e)return 1;var n=d.envStore.get(e);if(n.checkGCAccess(),!n.tryCatch.isEmpty())return n.setLastError(10);if(!n.canCallIntoJs())return n.setLastError(n.moduleApiVersion>=10?23:10);n.clearLastError();try{if(!r)return n.setLastError(n.tryCatch.hasCaught()?10:1);var o=d.handleStore.get(r);if(!o.isObject()&&!o.isFunction())return n.setLastError(n.tryCatch.hasCaught()?10:2);if(!(t>>>=0))return n.setLastError(n.tryCatch.hasCaught()?10:1);var i=n.getObjectBinding(o.value);if(null!==i.tag)return n.setLastError(n.tryCatch.hasCaught()?10:1);var s=new Uint8Array(16);return s.set(new Uint8Array(a.buffer,t,16)),i.tag=new Uint32Array(s.buffer),n.getReturnStatus()}catch(e){return n.tryCatch.setError(e),n.setLastError(10)}},napi_unwrap:function(e,r,t){return ae(e,r,t,0)},napi_wrap:function(e,r,t,n,o,i){return function(e,r,t,n,o,i){var s;if(!e)return 1;var f=d.envStore.get(e);if(f.checkGCAccess(),!f.tryCatch.isEmpty())return f.setLastError(10);if(!f.canCallIntoJs())return f.setLastError(f.moduleApiVersion>=10?23:10);f.clearLastError();try{if(!d.feature.supportFinalizer){if(n)throw d.createNotSupportWeakRefError("napi_wrap",'Parameter "finalize_cb" must be 0(NULL)');if(i)throw d.createNotSupportWeakRefError("napi_wrap",'Parameter "result" must be 0(NULL)')}if(!r)return f.setLastError(1);var u=ne(r);if(0!==u.status)return f.setLastError(u.status);var c=u.handle;if(0!==f.getObjectBinding(c.value).wrapped)return f.setLastError(1);var l=void 0;if(i){if(!n)return f.setLastError(1);l=d.createReferenceWithFinalizer(f,c.id,0,1,n,t,o),i>>>=0,s=l.id;var v=new DataView(a.buffer);(v.buffer===a.buffer?v:v=new DataView(a.buffer)).setUint32(i,s,!0)}else l=n?d.createReferenceWithFinalizer(f,c.id,0,0,n,t,o):d.createReferenceWithData(f,c.id,0,0,t);return f.getObjectBinding(c.value).wrapped=l.id,f.getReturnStatus()}catch(e){return f.tryCatch.setError(e),f.setLastError(10)}}(e,r,t,n,o,i)},node_api_post_finalizer:function(e,r,t,n){if(!e)return 1;var a=d.envStore.get(e);return a.enqueueFinalizer(d.createTrackedFinalizer(a,r,t,n)),a.clearLastError()}});function se(e,r,t,n,o,i,s){var f;if(!e)return 1;var u=d.envStore.get(e);if(u.checkGCAccess(),!u.tryCatch.isEmpty())return u.setLastError(10);if(!u.canCallIntoJs())return u.setLastError(u.moduleApiVersion>=10?23:10);u.clearLastError();try{if(!s)return u.setLastError(1);if(n>>>=0,s>>>=0,n>>>=0,(t>>>=0)||(n=0),n>2147483647)throw new RangeError("Cannot create a memory view larger than 2147483647 bytes");if(t+n>a.buffer.byteLength)throw new RangeError("Memory out of range");if(!d.feature.supportFinalizer&&o)throw d.createNotSupportWeakRefError("emnapi_create_memory_view",'Parameter "finalize_cb" must be 0(NULL)');var c=void 0;switch(r){case 0:c={Ctor:Int8Array,address:t,length:n,ownership:1,runtimeAllocated:0};break;case 1:c={Ctor:Uint8Array,address:t,length:n,ownership:1,runtimeAllocated:0};break;case 2:c={Ctor:Uint8ClampedArray,address:t,length:n,ownership:1,runtimeAllocated:0};break;case 3:c={Ctor:Int16Array,address:t,length:n>>1,ownership:1,runtimeAllocated:0};break;case 4:c={Ctor:Uint16Array,address:t,length:n>>1,ownership:1,runtimeAllocated:0};break;case 5:c={Ctor:Int32Array,address:t,length:n>>2,ownership:1,runtimeAllocated:0};break;case 6:c={Ctor:Uint32Array,address:t,length:n>>2,ownership:1,runtimeAllocated:0};break;case 7:c={Ctor:Float32Array,address:t,length:n>>2,ownership:1,runtimeAllocated:0};break;case 8:c={Ctor:Float64Array,address:t,length:n>>3,ownership:1,runtimeAllocated:0};break;case 9:c={Ctor:BigInt64Array,address:t,length:n>>3,ownership:1,runtimeAllocated:0};break;case 10:c={Ctor:BigUint64Array,address:t,length:n>>3,ownership:1,runtimeAllocated:0};break;case-1:c={Ctor:DataView,address:t,length:n,ownership:1,runtimeAllocated:0};break;case 11:if("function"!=typeof Float16Array)return u.setLastError(1);c={Ctor:Float16Array,address:t,length:n>>1,ownership:1,runtimeAllocated:0};break;case-2:if(!d.feature.Buffer)throw d.createNotSupportBufferError("emnapi_create_memory_view","");c={Ctor:d.feature.Buffer,address:t,length:n,ownership:1,runtimeAllocated:0};break;default:return u.setLastError(1)}var l=c.Ctor,v=-2===r?N.getBufferFrom()(a.buffer,c.address,c.length):new l(a.buffer,c.address,c.length),p=d.addToCurrentScope(v);if(N.wasmMemoryViewTable.set(v,c),o){var y=oe(e,p.id,t,o,i,0);if(10===y){var g=u.tryCatch.extractException();throw u.clearLastError(),g}if(0!==y)return u.setLastError(y)}f=p.id;var w=new DataView(a.buffer);return(w.buffer===a.buffer?w:w=new DataView(a.buffer)).setUint32(s,f,!0),u.getReturnStatus()}catch(g){return u.tryCatch.setError(g),u.setLastError(10)}}function fe(e,r,t,n){var o;if(t=null!=t?t:0,t>>>=0,r instanceof ArrayBuffer||N.isSharedArrayBuffer(r)){if(!(s=N.getArrayBufferPointer(r,!1).address))throw new Error("Unknown ArrayBuffer address");if("number"==typeof n&&-1!==n&&4294967295!==n||(n=r.byteLength-t),0===(n>>>=0))return r;o=new Uint8Array(r,t,n);var i=new Uint8Array(a.buffer);return e?i.set(o,s):o.set(i.subarray(s,s+n)),r}if(ArrayBuffer.isView(r)){var s,f=N.getViewPointer(r,!1),u=f.view;if(!(s=f.address))throw new Error("Unknown ArrayBuffer address");if("number"==typeof n&&-1!==n&&4294967295!==n||(n=u.byteLength-t),0===(n>>>=0))return u;o=new Uint8Array(u.buffer,u.byteOffset+t,n);i=new Uint8Array(a.buffer);return e?i.set(o,s):o.set(i.subarray(s,s+n)),u}throw new TypeError("emnapiSyncMemory expect ArrayBuffer or ArrayBufferView as first parameter")}function ue(e){var r,t=e instanceof ArrayBuffer,n=e instanceof DataView,a=ArrayBuffer.isView(e)&&!n;if(!(t||a||n||N.isSharedArrayBuffer(e)))throw new TypeError("emnapiGetMemoryAddress expect ArrayBuffer or ArrayBufferView as first parameter");return{address:(r=t?N.getArrayBufferPointer(e,!1):N.getViewPointer(e,!1)).address,ownership:r.ownership,runtimeAllocated:r.runtimeAllocated}}function ce(e,r){if(null!=r&&!N.isSharedArrayBuffer(r))throw new TypeError("Expected a SharedArrayBuffer");if(!J.registry)throw new Error("FinalizationRegistry is not supported in this environment");e>>>=0;var t=J.readMeta(e),n=t.external_data;if(n>>>=0,null==r)r=new SharedArrayBuffer(t.byte_length),new Uint8Array(r).set(new Uint8Array(a.buffer,n,t.byte_length));else if(J.handleTable.has(r))return r;return Atomics.add(new Int32Array(a.buffer,e,1),0,1),N.table.has(r)||n&&N.table.set(r,{address:n,ownership:1,runtimeAllocated:0}),J.handleTable.set(r,e),J.registry.register(r,e),r}var le=Object.freeze({__proto__:null,$emnapiAcquireExternalSharedArrayBuffer:ce,$emnapiGetMemoryAddress:ue,$emnapiSyncMemory:fe,emnapi_acquire_external_sharedarraybuffer:function(e){e>>>=0,Atomics.add(new Int32Array(a.buffer,e,1),0,1)},emnapi_create_memory_view:se,emnapi_get_external_sharedarraybuffer_handle:function(e,r,t){if(!e)return 1;var n=d.envStore.get(e);if(n.checkGCAccess(),!n.tryCatch.isEmpty())return n.setLastError(10);if(!n.canCallIntoJs())return n.setLastError(n.moduleApiVersion>=10?23:10);n.clearLastError();try{if(!r)return n.setLastError(1);if(!t)return n.setLastError(1);t>>>=0;var o=d.handleStore.get(r).value;if(!N.isSharedArrayBuffer(o))return n.setLastError(1);var i=J.handleTable.get(o);if(void 0===i)return n.setLastError(1);var s=new DataView(a.buffer);return(s.buffer===a.buffer?s:s=new DataView(a.buffer)).setUint32(t,i,!0),n.getReturnStatus()}catch(e){return n.tryCatch.setError(e),n.setLastError(10)}},emnapi_get_memory_address:function(e,r,t,n,o){var i,s,f,u;if(!e)return 1;var c=d.envStore.get(e);if(c.checkGCAccess(),!c.tryCatch.isEmpty())return c.setLastError(10);if(!c.canCallIntoJs())return c.setLastError(c.moduleApiVersion>=10?23:10);c.clearLastError();try{if(!r)return c.setLastError(1);if(!t&&!n&&!o)return c.setLastError(1);i=(u=ue(c.ctx.handleStore.get(r).value)).address;var l=new DataView(a.buffer),v=function(){return l.buffer===a.buffer?l:l=new DataView(a.buffer)};return t&&(t>>>=0,v().setUint32(t,i,!0)),n&&(n>>>=0,f=u.ownership,v().setInt32(n,f,!0)),o&&(o>>>=0,s=u.runtimeAllocated,v().setInt8(o,s,!0)),c.getReturnStatus()}catch(e){return c.tryCatch.setError(e),c.setLastError(10)}},emnapi_get_runtime_version:function(e,r){if(!e)return 1;var t,n=d.envStore.get(e);if(!r)return n.setLastError(1);try{t=d.getRuntimeVersions().version}catch(e){return n.setLastError(9)}var o=t.split(".").map(function(e){return Number(e)});r>>>=0;var i=new DataView(a.buffer),s=function(){return i.buffer===a.buffer?i:i=new DataView(a.buffer)};return s().setUint32(r,o[0],!0),s().setUint32(r+4,o[1],!0),s().setUint32(r+8,o[2],!0),n.clearLastError()},emnapi_is_node_binding_available:function(){return v?1:0},emnapi_is_support_bigint:function(){return d.feature.supportBigInt?1:0},emnapi_is_support_weakref:function(){return d.feature.supportFinalizer?1:0},emnapi_release_external_sharedarraybuffer:function(e){e>>>=0,J.release(e)},emnapi_sync_memory:function(e,r,t,n,o){var i;if(!e)return 1;var s=d.envStore.get(e);if(s.checkGCAccess(),!s.tryCatch.isEmpty())return s.setLastError(10);if(!s.canCallIntoJs())return s.setLastError(s.moduleApiVersion>=10?23:10);s.clearLastError();try{if(!t)return s.setLastError(1);t>>>=0,n>>>=0,o>>>=0;var f=new DataView(a.buffer),u=function(){return f.buffer===a.buffer?f:f=new DataView(a.buffer)},c=u().getUint32(t,!0),l=s.ctx.handleStore.get(c);if(!(l.isArrayBuffer()||l.isTypedArray()||l.isDataView()||N.isSharedArrayBuffer(l.value)))return s.setLastError(1);var v=fe(Boolean(r),l.value,n,o);return l.value!==v&&(t>>>=0,i=s.ensureHandleId(v),u().setUint32(t,i,!0)),s.getReturnStatus()}catch(e){return s.tryCatch.setError(e),s.setLastError(10)}}});function de(e,r,t){e>>>=0,e>>>=0;var n=t?new SharedArrayBuffer(e):new ArrayBuffer(e);if(r){r>>>=0;var o=N.getArrayBufferPointer(n,!0).address,i=new DataView(a.buffer);(i.buffer===a.buffer?i:i=new DataView(a.buffer)).setUint32(r,o,!0)}return n}var ve=Object.freeze({__proto__:null,napi_create_array:function(e,r){if(!e)return 1;var t=d.envStore.get(e);if(t.checkGCAccess(),!r)return t.setLastError(1);r>>>=0;var n=d.addToCurrentScope([]).id,o=new DataView(a.buffer);return(o.buffer===a.buffer?o:o=new DataView(a.buffer)).setUint32(r,n,!0),t.clearLastError()},napi_create_array_with_length:function(e,r,t){if(!e)return 1;var n=d.envStore.get(e);if(n.checkGCAccess(),!t)return n.setLastError(1);r>>>=0,t>>>=0,r>>>=0;var o=d.addToCurrentScope(new Array(r)).id,i=new DataView(a.buffer);return(i.buffer===a.buffer?i:i=new DataView(a.buffer)).setUint32(t,o,!0),n.clearLastError()},napi_create_arraybuffer:function(e,r,t,n){var o;if(!e)return 1;var i=d.envStore.get(e);if(i.checkGCAccess(),!i.tryCatch.isEmpty())return i.setLastError(10);if(!i.canCallIntoJs())return i.setLastError(i.moduleApiVersion>=10?23:10);i.clearLastError();try{if(!n)return i.setLastError(1);n>>>=0;var s=de(r,t,!1);o=d.addToCurrentScope(s).id;var f=new DataView(a.buffer);return(f.buffer===a.buffer?f:f=new DataView(a.buffer)).setUint32(n,o,!0),i.getReturnStatus()}catch(e){return i.tryCatch.setError(e),i.setLastError(10)}},napi_create_buffer:function(e,r,t,n){var o,s,f;if(!e)return 1;var u=d.envStore.get(e);if(u.checkGCAccess(),!u.tryCatch.isEmpty())return u.setLastError(10);if(!u.canCallIntoJs())return u.setLastError(u.moduleApiVersion>=10?23:10);u.clearLastError();try{if(!n)return u.setLastError(1);var c=d.feature.Buffer;if(!c)throw d.createNotSupportBufferError("napi_create_buffer","");n>>>=0;var l=void 0;r>>>=0,r>>>=0;var v=new DataView(a.buffer),p=function(){return v.buffer===a.buffer?v:v=new DataView(a.buffer)};if(t&&0!==r){if(!(f=i(r)))throw new Error("Out of memory");f>>>=0,new Uint8Array(a.buffer).subarray(f,f+r).fill(0);var y=N.getBufferFrom()(a.buffer,f,r),g={Ctor:c,address:f,length:r,ownership:N.registry?0:1,runtimeAllocated:1};N.wasmMemoryViewTable.set(y,g),null===(o=N.registry)||void 0===o||o.register(g,f),s=d.addToCurrentScope(y).id,p().setUint32(n,s,!0),t>>>=0,p().setUint32(t,f,!0)}else l=c.alloc(r),s=d.addToCurrentScope(l).id,p().setUint32(n,s,!0);return u.getReturnStatus()}catch(e){return u.tryCatch.setError(e),u.setLastError(10)}},napi_create_buffer_copy:function(e,r,t,n,o){var i;if(!e)return 1;var s=d.envStore.get(e);if(s.checkGCAccess(),!s.tryCatch.isEmpty())return s.setLastError(10);if(!s.canCallIntoJs())return s.setLastError(s.moduleApiVersion>=10?23:10);s.clearLastError();try{if(!o)return s.setLastError(1);var f=d.feature.Buffer;if(!f)throw d.createNotSupportBufferError("napi_create_buffer_copy","");var u=de(r,n,!1),c=f.from(u);t>>>=0,r>>>=0,c.set(new Uint8Array(a.buffer).subarray(t,t+r)),i=d.addToCurrentScope(c).id,o>>>=0;var l=new DataView(a.buffer);return(l.buffer===a.buffer?l:l=new DataView(a.buffer)).setUint32(o,i,!0),s.getReturnStatus()}catch(e){return s.tryCatch.setError(e),s.setLastError(10)}},napi_create_dataview:function(e,r,t,n,o){if(!e)return 1;var i=d.envStore.get(e);if(i.checkGCAccess(),!i.tryCatch.isEmpty())return i.setLastError(10);if(!i.canCallIntoJs())return i.setLastError(i.moduleApiVersion>=10?23:10);i.clearLastError();try{if(!t)return i.setLastError(1);if(!o)return i.setLastError(1);r>>>=0,n>>>=0,r>>>=0,n>>>=0;var s=d.handleStore.get(t).value;return s instanceof ArrayBuffer||N.isSharedArrayBuffer(s)?function(e){if(r+n>e.byteLength){var t=new RangeError("byte_offset + byte_length should be less than or equal to the size in bytes of the array passed in");throw t.code="ERR_NAPI_INVALID_DATAVIEW_ARGS",t}var s=new DataView(e,n,r);e===a.buffer&&(N.wasmMemoryViewTable.has(s)||N.wasmMemoryViewTable.set(s,{Ctor:DataView,address:n,length:r,ownership:1,runtimeAllocated:0})),o>>>=0;var f=d.addToCurrentScope(s).id,u=new DataView(a.buffer);return(u.buffer===a.buffer?u:u=new DataView(a.buffer)).setUint32(o,f,!0),i.getReturnStatus()}(s):i.setLastError(1)}catch(e){return i.tryCatch.setError(e),i.setLastError(10)}},napi_create_date:function(e,r,t){var n;if(!e)return 1;var o=d.envStore.get(e);if(o.checkGCAccess(),!o.tryCatch.isEmpty())return o.setLastError(10);if(!o.canCallIntoJs())return o.setLastError(o.moduleApiVersion>=10?23:10);o.clearLastError();try{if(!t)return o.setLastError(1);t>>>=0,n=d.addToCurrentScope(new Date(r)).id;var i=new DataView(a.buffer);return(i.buffer===a.buffer?i:i=new DataView(a.buffer)).setUint32(t,n,!0),o.getReturnStatus()}catch(e){return o.tryCatch.setError(e),o.setLastError(10)}},napi_create_external:function(e,r,t,n,o){var i;if(!e)return 1;var s=d.envStore.get(e);if(s.checkGCAccess(),!s.tryCatch.isEmpty())return s.setLastError(10);if(!s.canCallIntoJs())return s.setLastError(s.moduleApiVersion>=10?23:10);s.clearLastError();try{if(!o)return s.setLastError(1);if(!d.feature.supportFinalizer&&t)throw d.createNotSupportWeakRefError("napi_create_external",'Parameter "finalize_cb" must be 0(NULL)');var f=d.getCurrentScope().addExternal(r);t&&d.createReferenceWithFinalizer(s,f.id,0,0,t,r,n),o>>>=0,i=f.id;var u=new DataView(a.buffer);return(u.buffer===a.buffer?u:u=new DataView(a.buffer)).setUint32(o,i,!0),s.clearLastError()}catch(e){return s.tryCatch.setError(e),s.setLastError(10)}},napi_create_external_arraybuffer:function(e,r,t,n,o,i){var s;if(!e)return 1;var f=d.envStore.get(e);if(f.checkGCAccess(),!f.tryCatch.isEmpty())return f.setLastError(10);if(!f.canCallIntoJs())return f.setLastError(f.moduleApiVersion>=10?23:10);f.clearLastError();try{if(!i)return f.setLastError(1);if(t>>>=0,i>>>=0,t>>>=0,(r>>>=0)||(t=0),r+t>a.buffer.byteLength)throw new RangeError("Memory out of range");if(!d.feature.supportFinalizer&&n)throw d.createNotSupportWeakRefError("napi_create_external_arraybuffer",'Parameter "finalize_cb" must be 0(NULL)');var u=new ArrayBuffer(t);if(0===t)try{(new(0,d.feature.MessageChannel)).port1.postMessage(u,[u])}catch(e){}else new Uint8Array(u).set(new Uint8Array(a.buffer).subarray(r,r+t)),N.table.set(u,{address:r,ownership:1,runtimeAllocated:0});var c=d.addToCurrentScope(u);if(n){var l=oe(e,c.id,r,n,o,0);if(10===l){var v=f.tryCatch.extractException();throw f.clearLastError(),v}if(0!==l)return f.setLastError(l)}s=c.id;var p=new DataView(a.buffer);return(p.buffer===a.buffer?p:p=new DataView(a.buffer)).setUint32(i,s,!0),f.getReturnStatus()}catch(v){return f.tryCatch.setError(v),f.setLastError(10)}},napi_create_external_buffer:function(e,r,t,n,a,o){return se(e,-2,t,r,n,a,o)},napi_create_object:function(e,r){if(!e)return 1;var t=d.envStore.get(e);if(t.checkGCAccess(),!r)return t.setLastError(1);r>>>=0;var n=d.addToCurrentScope({}).id,o=new DataView(a.buffer);return(o.buffer===a.buffer?o:o=new DataView(a.buffer)).setUint32(r,n,!0),t.clearLastError()},napi_create_symbol:function(e,r,t){if(!e)return 1;var n=d.envStore.get(e);if(n.checkGCAccess(),!t)return n.setLastError(1);t>>>=0;var o=new DataView(a.buffer),i=function(){return o.buffer===a.buffer?o:o=new DataView(a.buffer)};if(r){var s=d.handleStore.get(r).value;if("string"!=typeof s)return n.setLastError(3);var f=d.addToCurrentScope(Symbol(s)).id;i().setUint32(t,f,!0)}else{var u=d.addToCurrentScope(Symbol()).id;i().setUint32(t,u,!0)}return n.clearLastError()},napi_create_typedarray:function(e,r,t,n,o,i){var s;if(!e)return 1;var f=d.envStore.get(e);if(f.checkGCAccess(),!f.tryCatch.isEmpty())return f.setLastError(10);if(!f.canCallIntoJs())return f.setLastError(f.moduleApiVersion>=10?23:10);f.clearLastError();try{if(!n)return f.setLastError(1);if(!i)return f.setLastError(1);var u=d.handleStore.get(n).value;o>>>=0,t>>>=0;var c=function(e,r,t,n,o,f){var u,c;if((o>>>=0,f>>>=0,t>1)&&o%t!==0)return(c=new RangeError("start offset of ".concat(null!==(u=r.name)&&void 0!==u?u:""," should be a multiple of ").concat(t))).code="ERR_NAPI_INVALID_TYPEDARRAY_ALIGNMENT",e.tryCatch.setError(c),e.setLastError(9);if(f*t+o>n.byteLength)return(c=new RangeError("Invalid typed array length")).code="ERR_NAPI_INVALID_TYPEDARRAY_LENGTH",e.tryCatch.setError(c),e.setLastError(9);var l=new r(n,o,f);n===a.buffer&&(N.wasmMemoryViewTable.has(l)||N.wasmMemoryViewTable.set(l,{Ctor:r,address:o,length:f,ownership:1,runtimeAllocated:0})),i>>>=0,s=d.addToCurrentScope(l).id;var v=new DataView(a.buffer);return(v.buffer===a.buffer?v:v=new DataView(a.buffer)).setUint32(i,s,!0),e.getReturnStatus()};if(!(u instanceof ArrayBuffer||N.isSharedArrayBuffer(u)))return f.setLastError(1);switch(r){case 0:return c(f,Int8Array,1,u,o,t);case 1:return c(f,Uint8Array,1,u,o,t);case 2:return c(f,Uint8ClampedArray,1,u,o,t);case 3:return c(f,Int16Array,2,u,o,t);case 4:return c(f,Uint16Array,2,u,o,t);case 5:return c(f,Int32Array,4,u,o,t);case 6:return c(f,Uint32Array,4,u,o,t);case 7:return c(f,Float32Array,4,u,o,t);case 8:return c(f,Float64Array,8,u,o,t);case 9:return c(f,BigInt64Array,8,u,o,t);case 10:return c(f,BigUint64Array,8,u,o,t);case 11:return"function"!=typeof Float16Array?f.setLastError(1):c(f,Float16Array,2,u,o,t);default:return f.setLastError(1)}}catch(e){return f.tryCatch.setError(e),f.setLastError(10)}},node_api_create_buffer_from_arraybuffer:function(e,r,t,n,o){var i;if(!e)return 1;var s=d.envStore.get(e);if(s.checkGCAccess(),!s.tryCatch.isEmpty())return s.setLastError(10);if(!s.canCallIntoJs())return s.setLastError(s.moduleApiVersion>=10?23:10);s.clearLastError();try{if(!r)return s.setLastError(1);if(!o)return s.setLastError(1);t>>>=0,n>>>=0,t>>>=0,n>>>=0;var f=d.handleStore.get(r);if(!f.isArrayBuffer())return s.setLastError(1);var u=f.value;if(n+t>u.byteLength){var c=new RangeError("The byte offset + length is out of range");throw c.code="ERR_OUT_OF_RANGE",c}var l=d.feature.Buffer;if(!l)throw d.createNotSupportBufferError("node_api_create_buffer_from_arraybuffer","");var v=N.getBufferFrom()(u,t,n);u===a.buffer&&(N.wasmMemoryViewTable.has(v)||N.wasmMemoryViewTable.set(v,{Ctor:l,address:t,length:n,ownership:1,runtimeAllocated:0})),o>>>=0,i=d.addToCurrentScope(v).id;var p=new DataView(a.buffer);return(p.buffer===a.buffer?p:p=new DataView(a.buffer)).setUint32(o,i,!0),s.getReturnStatus()}catch(c){return s.tryCatch.setError(c),s.setLastError(10)}},node_api_create_external_sharedarraybuffer:function(e,r,t,n,o,i){var s;if(!e)return 1;var f=d.envStore.get(e);if(f.checkGCAccess(),!f.tryCatch.isEmpty())return f.setLastError(10);if(!f.canCallIntoJs())return f.setLastError(f.moduleApiVersion>=10?23:10);f.clearLastError();try{if(!i)return f.setLastError(1);if(t>>>=0,i>>>=0,t>>>=0,(r>>>=0)||(t=0),r+t>a.buffer.byteLength)throw new RangeError("Memory out of range");if(!J.registry&&n)throw d.createNotSupportWeakRefError("node_api_create_external_sharedarraybuffer",'Parameter "finalize_cb" must be 0(NULL)');var u=new SharedArrayBuffer(t);if(0!==t)new Uint8Array(u).set(new Uint8Array(a.buffer).subarray(r,r+t)),N.table.set(u,{address:r,ownership:1,runtimeAllocated:0});if(s=d.addToCurrentScope(u).id,n){n>>>=0,o>>>=0;var c=J.allocMeta(r,t,n,r,o);J.handleTable.set(u,c),J.registry.register(u,c)}var l=new DataView(a.buffer);return(l.buffer===a.buffer?l:l=new DataView(a.buffer)).setUint32(i,s,!0),f.getReturnStatus()}catch(e){return f.tryCatch.setError(e),f.setLastError(10)}},node_api_create_object_with_properties:function(e,r,t,n,o,i){if(!e)return 1;var s=d.envStore.get(e);if(s.checkGCAccess(),!i)return s.setLastError(1);if(o>>>=0,(o>>>=0)>0){if(!t)return s.setLastError(1);if(!n)return s.setLastError(1)}var f=r?d.handleStore.get(r).value:null,u={};t>>>=0,n>>>=0;for(var c,l=new DataView(a.buffer),v=function(){return l.buffer===a.buffer?l:l=new DataView(a.buffer)},p=0;p<o;p++){var y=d.handleStore.get(v().getUint32(t+4*p,!0)).value;if("string"!=typeof y&&"symbol"!=typeof y)return s.setLastError(4);u[y]={value:d.handleStore.get(v().getUint32(n+4*p,!0)).value,writable:!0,enumerable:!0,configurable:!0}}try{c=Object.defineProperties(Object.create(f),u)}catch(e){return s.setLastError(9)}var g=d.addToCurrentScope(c).id;return i>>>=0,v().setUint32(i,g,!0),s.clearLastError()},node_api_create_sharedarraybuffer:function(e,r,t,n){var o;if(!e)return 1;var i=d.envStore.get(e);if(i.checkGCAccess(),!i.tryCatch.isEmpty())return i.setLastError(10);if(!i.canCallIntoJs())return i.setLastError(i.moduleApiVersion>=10?23:10);i.clearLastError();try{if(!n)return i.setLastError(1);n>>>=0;var s=de(r,t,!0);o=d.addToCurrentScope(s).id;var f=new DataView(a.buffer);return(f.buffer===a.buffer?f:f=new DataView(a.buffer)).setUint32(n,o,!0),i.getReturnStatus()}catch(e){return i.tryCatch.setError(e),i.setLastError(10)}},node_api_symbol_for:function(e,r,t,n){if(!e)return 1;var o=d.envStore.get(e);if(o.checkGCAccess(),!n)return o.setLastError(1);r>>>=0,n>>>=0;var i=-1===(t>>>=0)||4294967295===t,s=t>>>0;if(0!==t&&!r)return o.setLastError(1);if(!(i||s<=2147483647))return o.setLastError(1);var f=H.UTF8ToString(r,t),u=d.addToCurrentScope(Symbol.for(f)).id,c=new DataView(a.buffer);return(c.buffer===a.buffer?c:c=new DataView(a.buffer)).setUint32(n,u,!0),o.clearLastError()}});var pe=Object.freeze({__proto__:null,napi_get_boolean:function(e,r,t){if(!e)return 1;var n=d.envStore.get(e);if(n.checkGCAccess(),!t)return n.setLastError(1);t>>>=0;var o=0===r?3:4,i=new DataView(a.buffer);return(i.buffer===a.buffer?i:i=new DataView(a.buffer)).setUint32(t,o,!0),n.clearLastError()},napi_get_global:function(e,r){if(!e)return 1;var t=d.envStore.get(e);if(t.checkGCAccess(),!r)return t.setLastError(1);r>>>=0;var n=new DataView(a.buffer);return(n.buffer===a.buffer?n:n=new DataView(a.buffer)).setUint32(r,5,!0),t.clearLastError()},napi_get_null:function(e,r){if(!e)return 1;var t=d.envStore.get(e);if(t.checkGCAccess(),!r)return t.setLastError(1);r>>>=0;var n=new DataView(a.buffer);return(n.buffer===a.buffer?n:n=new DataView(a.buffer)).setUint32(r,2,!0),t.clearLastError()},napi_get_undefined:function(e,r){if(!e)return 1;var t=d.envStore.get(e);if(t.checkGCAccess(),!r)return t.setLastError(1);r>>>=0;var n=new DataView(a.buffer);return(n.buffer===a.buffer?n:n=new DataView(a.buffer)).setUint32(r,1,!0),t.clearLastError()}});var ye=Object.freeze({__proto__:null,napi_get_instance_data:function(e,r){if(!e)return 1;var t=d.envStore.get(e);if(!r)return t.setLastError(1);r>>>=0;var n=t.getInstanceData(),o=new DataView(a.buffer);return(o.buffer===a.buffer?o:o=new DataView(a.buffer)).setUint32(r,n,!0),t.clearLastError()},napi_set_instance_data:function(e,r,t,n){if(!e)return 1;var a=d.envStore.get(e);return r>>>=0,t>>>=0,n>>>=0,a.setInstanceData(r,t,n),a.clearLastError()}});var ge=Object.freeze({__proto__:null,_emnapi_get_last_error_info:function(e,r,t,n){r>>>=0,t>>>=0,n>>>=0;var o=d.envStore.get(e).lastError,i=o.errorCode,s=o.engineErrorCode>>>0,f=o.engineReserved;f>>>=0;var u=new DataView(a.buffer),c=function(){return u.buffer===a.buffer?u:u=new DataView(a.buffer)};c().setInt32(r,i,!0),c().setUint32(t,s,!0),c().setUint32(n,f,!0)},napi_create_error:function(e,r,t,n){if(!e)return 1;var o=d.envStore.get(e);if(o.checkGCAccess(),!t)return o.setLastError(1);if(!n)return o.setLastError(1);var i=d.handleStore.get(t).value;if("string"!=typeof i)return o.setLastError(3);var s=new Error(i);if(r){var f=d.handleStore.get(r).value;if("string"!=typeof f)return o.setLastError(3);s.code=f}n>>>=0;var u=d.addToCurrentScope(s).id,c=new DataView(a.buffer);return(c.buffer===a.buffer?c:c=new DataView(a.buffer)).setUint32(n,u,!0),o.clearLastError()},napi_create_range_error:function(e,r,t,n){if(!e)return 1;var o=d.envStore.get(e);if(o.checkGCAccess(),!t)return o.setLastError(1);if(!n)return o.setLastError(1);var i=d.handleStore.get(t).value;if("string"!=typeof i)return o.setLastError(3);var s=new RangeError(i);if(r){var f=d.handleStore.get(r).value;if("string"!=typeof f)return o.setLastError(3);s.code=f}n>>>=0;var u=d.addToCurrentScope(s).id,c=new DataView(a.buffer);return(c.buffer===a.buffer?c:c=new DataView(a.buffer)).setUint32(n,u,!0),o.clearLastError()},napi_create_type_error:function(e,r,t,n){if(!e)return 1;var o=d.envStore.get(e);if(o.checkGCAccess(),!t)return o.setLastError(1);if(!n)return o.setLastError(1);var i=d.handleStore.get(t).value;if("string"!=typeof i)return o.setLastError(3);var s=new TypeError(i);if(r){var f=d.handleStore.get(r).value;if("string"!=typeof f)return o.setLastError(3);s.code=f}n>>>=0;var u=d.addToCurrentScope(s).id,c=new DataView(a.buffer);return(c.buffer===a.buffer?c:c=new DataView(a.buffer)).setUint32(n,u,!0),o.clearLastError()},napi_fatal_error:function(e,r,t,n){e>>>=0,r>>>=0,t>>>=0,n>>>=0;var a=H.UTF8ToString(e,r),o=H.UTF8ToString(t,n);v?v.napi.fatalError(a,o):l("FATAL ERROR: "+a+" "+o)},napi_fatal_exception:function(e,r){if(!e)return 1;var t=d.envStore.get(e);if(t.checkGCAccess(),!t.tryCatch.isEmpty())return t.setLastError(10);if(!t.canCallIntoJs())return t.setLastError(t.moduleApiVersion>=10?23:10);t.clearLastError();try{if(!r)return t.setLastError(1);var n=t.ctx.handleStore.get(r);try{t.triggerFatalException(n.value)}catch(e){return t.setLastError(9)}return t.clearLastError()}catch(r){return t.tryCatch.setError(r),t.setLastError(10)}},napi_get_and_clear_last_exception:function(e,r){if(!e)return 1;var t=d.envStore.get(e);if(t.checkGCAccess(),!r)return t.setLastError(1);r>>>=0;var n=new DataView(a.buffer),o=function(){return n.buffer===a.buffer?n:n=new DataView(a.buffer)};if(!t.tryCatch.hasCaught())return o().setUint32(r,1,!0),t.clearLastError();var i=t.tryCatch.exception(),s=t.ensureHandleId(i);return o().setUint32(r,s,!0),t.tryCatch.reset(),t.clearLastError()},napi_is_exception_pending:function(e,r){if(!e)return 1;var t=d.envStore.get(e);if(t.checkGCAccess(),!r)return t.setLastError(1);var n=t.tryCatch.hasCaught();r>>>=0;var o=new DataView(a.buffer);return(o.buffer===a.buffer?o:o=new DataView(a.buffer)).setInt8(r,n?1:0,!0),t.clearLastError()},napi_throw:function(e,r){if(!e)return 1;var t=d.envStore.get(e);if(t.checkGCAccess(),!t.tryCatch.isEmpty())return t.setLastError(10);if(!t.canCallIntoJs())return t.setLastError(t.moduleApiVersion>=10?23:10);t.clearLastError();try{return r?(t.tryCatch.setError(d.handleStore.get(r).value),t.clearLastError()):t.setLastError(1)}catch(e){return t.tryCatch.setError(e),t.setLastError(10)}},napi_throw_error:function(e,r,t){if(!e)return 1;var n=d.envStore.get(e);if(n.checkGCAccess(),!n.tryCatch.isEmpty())return n.setLastError(10);if(!n.canCallIntoJs())return n.setLastError(n.moduleApiVersion>=10?23:10);n.clearLastError();try{if(!t)return n.setLastError(1);r>>>=0,t>>>=0;var a=new Error(H.UTF8ToString(t,-1));return r&&(a.code=H.UTF8ToString(r,-1)),n.tryCatch.setError(a),n.clearLastError()}catch(e){return n.tryCatch.setError(e),n.setLastError(10)}},napi_throw_range_error:function(e,r,t){if(!e)return 1;var n=d.envStore.get(e);if(n.checkGCAccess(),!n.tryCatch.isEmpty())return n.setLastError(10);if(!n.canCallIntoJs())return n.setLastError(n.moduleApiVersion>=10?23:10);n.clearLastError();try{if(!t)return n.setLastError(1);r>>>=0,t>>>=0;var a=new RangeError(H.UTF8ToString(t,-1));return r&&(a.code=H.UTF8ToString(r,-1)),n.tryCatch.setError(a),n.clearLastError()}catch(e){return n.tryCatch.setError(e),n.setLastError(10)}},napi_throw_type_error:function(e,r,t){if(!e)return 1;var n=d.envStore.get(e);if(n.checkGCAccess(),!n.tryCatch.isEmpty())return n.setLastError(10);if(!n.canCallIntoJs())return n.setLastError(n.moduleApiVersion>=10?23:10);n.clearLastError();try{if(!t)return n.setLastError(1);r>>>=0,t>>>=0;var a=new TypeError(H.UTF8ToString(t,-1));return r&&(a.code=H.UTF8ToString(r,-1)),n.tryCatch.setError(a),n.clearLastError()}catch(e){return n.tryCatch.setError(e),n.setLastError(10)}},node_api_create_syntax_error:function(e,r,t,n){if(!e)return 1;var o=d.envStore.get(e);if(o.checkGCAccess(),!t)return o.setLastError(1);if(!n)return o.setLastError(1);var i=d.handleStore.get(t).value;if("string"!=typeof i)return o.setLastError(3);var s=new SyntaxError(i);if(r){var f=d.handleStore.get(r).value;if("string"!=typeof f)return o.setLastError(3);s.code=f}n>>>=0;var u=d.addToCurrentScope(s).id,c=new DataView(a.buffer);return(c.buffer===a.buffer?c:c=new DataView(a.buffer)).setUint32(n,u,!0),o.clearLastError()},node_api_throw_syntax_error:function(e,r,t){if(!e)return 1;var n=d.envStore.get(e);if(n.checkGCAccess(),!n.tryCatch.isEmpty())return n.setLastError(10);if(!n.canCallIntoJs())return n.setLastError(n.moduleApiVersion>=10?23:10);n.clearLastError();try{if(!t)return n.setLastError(1);r>>>=0,t>>>=0;var a=new SyntaxError(H.UTF8ToString(t,-1));return r&&(a.code=H.UTF8ToString(r,-1)),n.tryCatch.setError(a),n.clearLastError()}catch(e){return n.tryCatch.setError(e),n.setLastError(10)}}});function we(e,r,t,n,o,i){t>>>=0;var s=d.envStore.get(e),f=re(s,r,t,n,o);if(0!==f.status)return s.setLastError(f.status);var u=f.f;i>>>=0;var c=d.addToCurrentScope(u).id,l=new DataView(a.buffer);return(l.buffer===a.buffer?l:l=new DataView(a.buffer)).setUint32(i,c,!0),s.getReturnStatus()}var be=Object.freeze({__proto__:null,_emnapi_create_function:we,napi_call_function:function(e,r,t,n,o,i){var s,f=0;if(!e)return 1;var u=d.envStore.get(e);if(u.checkGCAccess(),!u.tryCatch.isEmpty())return u.setLastError(10);if(!u.canCallIntoJs())return u.setLastError(u.moduleApiVersion>=10?23:10);u.clearLastError();try{if(!r)return u.setLastError(1);if(n>>>=0,o>>>=0,i>>>=0,(n>>>=0)>0&&!o)return u.setLastError(1);var c=d.handleStore.get(r).value;if(!t)return u.setLastError(1);var l=d.handleStore.get(t).value;if("function"!=typeof l)return u.setLastError(1);for(var v=[],p=new DataView(a.buffer),y=function(){return p.buffer===a.buffer?p:p=new DataView(a.buffer)};f<n;f++){var g=y().getUint32(o+4*f,!0);v.push(d.handleStore.get(g).value)}var w=l.apply(c,v);return i&&(s=u.ensureHandleId(w),y().setUint32(i,s,!0)),u.clearLastError()}catch(e){return u.tryCatch.setError(e),u.setLastError(10)}},napi_create_function:function(e,r,t,n,a,o){if(!e)return 1;var i=d.envStore.get(e);if(i.checkGCAccess(),!i.tryCatch.isEmpty())return i.setLastError(10);if(!i.canCallIntoJs())return i.setLastError(i.moduleApiVersion>=10?23:10);i.clearLastError();try{return o&&n?we(e,r,t,n,a,o):i.setLastError(1)}catch(e){return i.tryCatch.setError(e),i.setLastError(10)}},napi_get_cb_info:function(e,r,t,n,o,i){if(!e)return 1;var s=d.envStore.get(e);if(!r)return s.setLastError(1);var f=d.scopeStore.get(r).callbackInfo;t>>>=0,n>>>=0;var u=new DataView(a.buffer),c=function(){return u.buffer===a.buffer?u:u=new DataView(a.buffer)};if(n){if(!t)return s.setLastError(1);var l=c().getUint32(t,!0);l>>>=0;for(var v=f.args.length,p=l<v?l:v,y=0;y<p;y++){var g=s.ensureHandleId(f.args[y]);c().setUint32(n+4*y,g,!0)}if(y<l)for(;y<l;y++)c().setUint32(n+4*y,1,!0)}if(t&&c().setUint32(t,f.args.length,!0),o){o>>>=0;var w=s.ensureHandleId(f.thiz);c().setUint32(o,w,!0)}return i&&(i>>>=0,c().setUint32(i,f.data,!0)),s.clearLastError()},napi_get_new_target:function(e,r,t){if(!e)return 1;var n=d.envStore.get(e);if(n.checkGCAccess(),!r)return n.setLastError(1);if(!t)return n.setLastError(1);t>>>=0;var o=d.scopeStore.get(r).callbackInfo,i=o.thiz,s=o.fn,f=null==i||null==i.constructor?0:i instanceof s?n.ensureHandleId(i.constructor):0,u=new DataView(a.buffer);return(u.buffer===a.buffer?u:u=new DataView(a.buffer)).setUint32(t,f,!0),n.clearLastError()},napi_new_instance:function(e,r,t,n,o){var i,s;if(!e)return 1;var f=d.envStore.get(e);if(f.checkGCAccess(),!f.tryCatch.isEmpty())return f.setLastError(10);if(!f.canCallIntoJs())return f.setLastError(f.moduleApiVersion>=10?23:10);f.clearLastError();try{if(!r)return f.setLastError(1);if(t>>>=0,n>>>=0,o>>>=0,(t>>>=0)>0&&!n)return f.setLastError(1);if(!o)return f.setLastError(1);var u=d.handleStore.get(r).value;if("function"!=typeof u)return f.setLastError(1);var c=void 0,l=new DataView(a.buffer),v=function(){return l.buffer===a.buffer?l:l=new DataView(a.buffer)};if(d.feature.supportReflect){var p=Array(t);for(i=0;i<t;i++){var y=v().getUint32(n+4*i,!0);p[i]=d.handleStore.get(y).value}c=Reflect.construct(u,p,u)}else{var g=Array(t+1);for(g[0]=void 0,i=0;i<t;i++){y=v().getUint32(n+4*i,!0);g[i+1]=d.handleStore.get(y).value}c=new(u.bind.apply(u,g))}return o&&(s=f.ensureHandleId(c),v().setUint32(o,s,!0)),f.getReturnStatus()}catch(e){return f.tryCatch.setError(e),f.setLastError(10)}}});var he=Object.freeze({__proto__:null,_emnapi_env_ref:function(e){d.envStore.get(e).ref()},_emnapi_env_unref:function(e){d.envStore.get(e).unref()},napi_add_env_cleanup_hook:function(e,r,t){if(!e)return 1;var n=d.envStore.get(e);return r?(r>>>=0,t>>>=0,d.addCleanupHook(n,r,t),0):n.setLastError(1)},napi_close_escapable_handle_scope:function(e,r){if(!e)return 1;var t=d.envStore.get(e);return t.checkGCAccess(),r?0===t.openHandleScopes?13:(d.closeScope(t),t.clearLastError()):t.setLastError(1)},napi_close_handle_scope:function(e,r){if(!e)return 1;var t=d.envStore.get(e);return t.checkGCAccess(),r?0===t.openHandleScopes?13:(d.closeScope(t),t.clearLastError()):t.setLastError(1)},napi_create_reference:function(e,r,t,n){if(!e)return 1;var o=d.envStore.get(e);if(o.checkGCAccess(),!r)return o.setLastError(1);if(!n)return o.setLastError(1);var i=d.handleStore.get(r);if(o.moduleApiVersion<10&&!(i.isObject()||i.isFunction()||i.isSymbol()))return o.setLastError(1);var s=d.createReference(o,i.id,t>>>0,1);n>>>=0;var f=new DataView(a.buffer);return(f.buffer===a.buffer?f:f=new DataView(a.buffer)).setUint32(n,s.id,!0),o.clearLastError()},napi_delete_reference:function(e,r){if(!e)return 1;var t=d.envStore.get(e);return r?(d.refStore.get(r).dispose(),t.clearLastError()):t.setLastError(1)},napi_escape_handle:function(e,r,t,n){if(!e)return 1;var o=d.envStore.get(e);if(o.checkGCAccess(),!r)return o.setLastError(1);if(!t)return o.setLastError(1);if(!n)return o.setLastError(1);var i=d.scopeStore.get(r);if(!i.escapeCalled()){t>>>=0,n>>>=0;var s=i.escape(t),f=s?s.id:0,u=new DataView(a.buffer);return(u.buffer===a.buffer?u:u=new DataView(a.buffer)).setUint32(n,f,!0),o.clearLastError()}return o.setLastError(12)},napi_get_reference_value:function(e,r,t){if(!e)return 1;var n=d.envStore.get(e);if(n.checkGCAccess(),!r)return n.setLastError(1);if(!t)return n.setLastError(1);var o=d.refStore.get(r).get(n);t>>>=0;var i=new DataView(a.buffer);return(i.buffer===a.buffer?i:i=new DataView(a.buffer)).setUint32(t,o,!0),n.clearLastError()},napi_open_escapable_handle_scope:function(e,r){if(!e)return 1;var t=d.envStore.get(e);if(t.checkGCAccess(),!r)return t.setLastError(1);var n=d.openScope(t);r>>>=0;var o=new DataView(a.buffer);return(o.buffer===a.buffer?o:o=new DataView(a.buffer)).setUint32(r,n.id,!0),t.clearLastError()},napi_open_handle_scope:function(e,r){if(!e)return 1;var t=d.envStore.get(e);if(t.checkGCAccess(),!r)return t.setLastError(1);var n=d.openScope(t);r>>>=0;var o=new DataView(a.buffer);return(o.buffer===a.buffer?o:o=new DataView(a.buffer)).setUint32(r,n.id,!0),t.clearLastError()},napi_reference_ref:function(e,r,t){if(!e)return 1;var n=d.envStore.get(e);if(n.checkGCAccess(),!r)return n.setLastError(1);var o=d.refStore.get(r).ref();if(t){t>>>=0;var i=new DataView(a.buffer);(i.buffer===a.buffer?i:i=new DataView(a.buffer)).setUint32(t,o,!0)}return n.clearLastError()},napi_reference_unref:function(e,r,t){if(!e)return 1;var n=d.envStore.get(e);if(n.checkGCAccess(),!r)return n.setLastError(1);var o=d.refStore.get(r);if(0===o.refcount())return n.setLastError(9);var i=o.unref();if(t){t>>>=0;var s=new DataView(a.buffer);(s.buffer===a.buffer?s:s=new DataView(a.buffer)).setUint32(t,i,!0)}return n.clearLastError()},napi_remove_env_cleanup_hook:function(e,r,t){if(!e)return 1;var n=d.envStore.get(e);return r?(r>>>=0,t>>>=0,d.removeCleanupHook(n,r,t),0):n.setLastError(1)}});var _e=Object.freeze({__proto__:null,_emnapi_get_filename:function(e,r,t){var n=d.envStore.get(e).filename;return r?H.stringToUTF8(n,r,t):H.lengthBytesUTF8(n)}});var Ee=Object.freeze({__proto__:null,napi_create_promise:function(e,r,t){var n,o;if(!e)return 1;var i=d.envStore.get(e);if(i.checkGCAccess(),!i.tryCatch.isEmpty())return i.setLastError(10);if(!i.canCallIntoJs())return i.setLastError(i.moduleApiVersion>=10?23:10);i.clearLastError();try{if(!r)return i.setLastError(1);if(!t)return i.setLastError(1);var s=new DataView(a.buffer),f=function(){return s.buffer===a.buffer?s:s=new DataView(a.buffer)},u=new Promise(function(e,t){var a=d.createDeferred({resolve:e,reject:t});n=a.id,r>>>=0,f().setUint32(r,n,!0)});return t>>>=0,o=d.addToCurrentScope(u).id,f().setUint32(t,o,!0),i.getReturnStatus()}catch(e){return i.tryCatch.setError(e),i.setLastError(10)}},napi_is_promise:function(e,r,t){if(!e)return 1;var n=d.envStore.get(e);if(n.checkGCAccess(),!r)return n.setLastError(1);if(!t)return n.setLastError(1);t>>>=0;var o=d.handleStore.get(r).isPromise()?1:0,i=new DataView(a.buffer);return(i.buffer===a.buffer?i:i=new DataView(a.buffer)).setInt8(t,o,!0),n.clearLastError()},napi_reject_deferred:function(e,r,t){if(!e)return 1;var n=d.envStore.get(e);if(n.checkGCAccess(),!n.tryCatch.isEmpty())return n.setLastError(10);if(!n.canCallIntoJs())return n.setLastError(n.moduleApiVersion>=10?23:10);n.clearLastError();try{return r&&t?(d.deferredStore.get(r).reject(d.handleStore.get(t).value),n.getReturnStatus()):n.setLastError(1)}catch(e){return n.tryCatch.setError(e),n.setLastError(10)}},napi_resolve_deferred:function(e,r,t){if(!e)return 1;var n=d.envStore.get(e);if(n.checkGCAccess(),!n.tryCatch.isEmpty())return n.setLastError(10);if(!n.canCallIntoJs())return n.setLastError(n.moduleApiVersion>=10?23:10);n.clearLastError();try{return r&&t?(d.deferredStore.get(r).resolve(d.handleStore.get(t).value),n.getReturnStatus()):n.setLastError(1)}catch(e){return n.tryCatch.setError(e),n.setLastError(10)}}});function Le(e,r,t,n,o,i){var s;if(!e)return 1;var f=d.envStore.get(e);if(f.checkGCAccess(),!f.tryCatch.isEmpty())return f.setLastError(10);if(!f.canCallIntoJs())return f.setLastError(f.moduleApiVersion>=10?23:10);f.clearLastError();try{if(!i)return f.setLastError(1);if(!r)return f.setLastError(1);var u=d.handleStore.get(r);if(null==u.value)throw new TypeError("Cannot convert undefined or null to object");var c=void 0;try{c=u.isObject()||u.isFunction()?u.value:Object(u.value)}catch(e){return f.setLastError(2)}if(0!==t&&1!==t)return f.setLastError(1);if(0!==o&&1!==o)return f.setLastError(1);var l=[],v=void 0,p=void 0,y=void 0,g=!0,w=/^(0|[1-9][0-9]*)$/;do{for(v=Object.getOwnPropertyNames(c),p=Object.getOwnPropertySymbols(c),y=0;y<v.length;y++)l.push({name:w.test(v[y])?Number(v[y]):v[y],desc:Object.getOwnPropertyDescriptor(c,v[y]),own:g});for(y=0;y<p.length;y++)l.push({name:p[y],desc:Object.getOwnPropertyDescriptor(c,p[y]),own:g});if(1===t)break;c=Object.getPrototypeOf(c),g=!1}while(c);var b=[],h=function(e,r,t,n){if(-1===e.indexOf(r))if(0===n)e.push(r);else if(1===n){var a="number"==typeof r?String(r):r;"string"==typeof a&&8&t||e.push(a)}};for(y=0;y<l.length;y++){var _=l[y],E=_.name,L=_.desc;if(0===n)h(b,E,n,o);else{if(8&n&&"string"==typeof E)continue;if(16&n&&"symbol"==typeof E)continue;var m=!0;switch(7&n){case 1:m=Boolean(L.writable);break;case 2:m=Boolean(L.enumerable);break;case 3:m=Boolean(L.writable&&L.enumerable);break;case 4:m=Boolean(L.configurable);break;case 5:m=Boolean(L.configurable&&L.writable);break;case 6:m=Boolean(L.configurable&&L.enumerable);break;case 7:m=Boolean(L.configurable&&L.enumerable&&L.writable)}m&&h(b,E,n,o)}}i>>>=0,s=d.addToCurrentScope(b).id;var S=new DataView(a.buffer);return(S.buffer===a.buffer?S:S=new DataView(a.buffer)).setUint32(i,s,!0),f.getReturnStatus()}catch(e){return f.tryCatch.setError(e),f.setLastError(10)}}var me=Object.freeze({__proto__:null,napi_define_properties:function(e,r,t,n){var o,i;if(!e)return 1;var s=d.envStore.get(e);if(s.checkGCAccess(),!s.tryCatch.isEmpty())return s.setLastError(10);if(!s.canCallIntoJs())return s.setLastError(s.moduleApiVersion>=10?23:10);s.clearLastError();try{if(n>>>=0,t>>>=0,(t>>>=0)>0&&!n)return s.setLastError(1);if(!r)return s.setLastError(1);var f=d.handleStore.get(r),u=f.value;if(!f.isObject()&&!f.isFunction())return s.setLastError(2);for(var c=void 0,l=new DataView(a.buffer),v=function(){return l.buffer===a.buffer?l:l=new DataView(a.buffer)},p=0;p<t;p++){o=n+32*p;var y=v().getUint32(o,!0),g=v().getUint32(o+4,!0),w=v().getUint32(o+8,!0),b=v().getUint32(o+12,!0),h=v().getUint32(o+16,!0),_=v().getUint32(o+20,!0);i=v().getInt32(o+24,!0),i>>>=0;var E=v().getUint32(o+28,!0);if(y)c=H.UTF8ToString(y,-1);else{if(!g)return s.setLastError(4);if("string"!=typeof(c=d.handleStore.get(g).value)&&"symbol"!=typeof c)return s.setLastError(4)}te(s,u,c,w,b,h,_,i,E)}return s.getReturnStatus()}catch(e){return s.tryCatch.setError(e),s.setLastError(10)}},napi_delete_element:function(e,r,t,n){var o;if(!e)return 1;var i=d.envStore.get(e);if(i.checkGCAccess(),!i.tryCatch.isEmpty())return i.setLastError(10);if(!i.canCallIntoJs())return i.setLastError(i.moduleApiVersion>=10?23:10);i.clearLastError();try{if(!r)return i.setLastError(1);var s=d.handleStore.get(r);if(!s.isObject()&&!s.isFunction())return i.setLastError(2);if(d.feature.supportReflect)o=Reflect.deleteProperty(s.value,t>>>0);else try{o=delete s.value[t>>>0]}catch(e){o=!1}if(n){n>>>=0;var f=new DataView(a.buffer);(f.buffer===a.buffer?f:f=new DataView(a.buffer)).setInt8(n,o?1:0,!0)}return i.getReturnStatus()}catch(e){return i.tryCatch.setError(e),i.setLastError(10)}},napi_delete_property:function(e,r,t,n){var o;if(!e)return 1;var i=d.envStore.get(e);if(i.checkGCAccess(),!i.tryCatch.isEmpty())return i.setLastError(10);if(!i.canCallIntoJs())return i.setLastError(i.moduleApiVersion>=10?23:10);i.clearLastError();try{if(!t)return i.setLastError(1);if(!r)return i.setLastError(1);var s=d.handleStore.get(r);if(!s.isObject()&&!s.isFunction())return i.setLastError(2);var f=d.handleStore.get(t).value;if(d.feature.supportReflect)o=Reflect.deleteProperty(s.value,f);else try{o=delete s.value[f]}catch(e){o=!1}if(n){n>>>=0;var u=new DataView(a.buffer);(u.buffer===a.buffer?u:u=new DataView(a.buffer)).setInt8(n,o?1:0,!0)}return i.getReturnStatus()}catch(e){return i.tryCatch.setError(e),i.setLastError(10)}},napi_get_all_property_names:Le,napi_get_element:function(e,r,t,n){var o;if(!e)return 1;var i=d.envStore.get(e);if(i.checkGCAccess(),!i.tryCatch.isEmpty())return i.setLastError(10);if(!i.canCallIntoJs())return i.setLastError(i.moduleApiVersion>=10?23:10);i.clearLastError();try{if(!n)return i.setLastError(1);if(!r)return i.setLastError(1);var s=d.handleStore.get(r);if(null==s.value)throw new TypeError("Cannot convert undefined or null to object");var f=void 0;try{f=s.isObject()||s.isFunction()?s.value:Object(s.value)}catch(e){return i.setLastError(2)}n>>>=0,o=i.ensureHandleId(f[t>>>0]);var u=new DataView(a.buffer);return(u.buffer===a.buffer?u:u=new DataView(a.buffer)).setUint32(n,o,!0),i.getReturnStatus()}catch(e){return i.tryCatch.setError(e),i.setLastError(10)}},napi_get_named_property:function(e,r,t,n){var o;if(!e)return 1;var i=d.envStore.get(e);if(i.checkGCAccess(),!i.tryCatch.isEmpty())return i.setLastError(10);if(!i.canCallIntoJs())return i.setLastError(i.moduleApiVersion>=10?23:10);i.clearLastError();try{if(!n)return i.setLastError(1);if(!r)return i.setLastError(1);if(!t)return i.setLastError(1);var s=d.handleStore.get(r);if(null==s.value)throw new TypeError("Cannot convert undefined or null to object");var f=void 0;try{f=s.isObject()||s.isFunction()?s.value:Object(s.value)}catch(e){return i.setLastError(2)}t>>>=0,n>>>=0,o=i.ensureHandleId(f[H.UTF8ToString(t,-1)]);var u=new DataView(a.buffer);return(u.buffer===a.buffer?u:u=new DataView(a.buffer)).setUint32(n,o,!0),i.getReturnStatus()}catch(e){return i.tryCatch.setError(e),i.setLastError(10)}},napi_get_property:function(e,r,t,n){var o;if(!e)return 1;var i=d.envStore.get(e);if(i.checkGCAccess(),!i.tryCatch.isEmpty())return i.setLastError(10);if(!i.canCallIntoJs())return i.setLastError(i.moduleApiVersion>=10?23:10);i.clearLastError();try{if(!t)return i.setLastError(1);if(!n)return i.setLastError(1);if(!r)return i.setLastError(1);var s=d.handleStore.get(r);if(null==s.value)throw new TypeError("Cannot convert undefined or null to object");var f=void 0;try{f=s.isObject()||s.isFunction()?s.value:Object(s.value)}catch(e){return i.setLastError(2)}n>>>=0,o=i.ensureHandleId(f[d.handleStore.get(t).value]);var u=new DataView(a.buffer);return(u.buffer===a.buffer?u:u=new DataView(a.buffer)).setUint32(n,o,!0),i.getReturnStatus()}catch(e){return i.tryCatch.setError(e),i.setLastError(10)}},napi_get_property_names:function(e,r,t){return Le(e,r,0,18,1,t)},napi_has_element:function(e,r,t,n){var o;if(!e)return 1;var i=d.envStore.get(e);if(i.checkGCAccess(),!i.tryCatch.isEmpty())return i.setLastError(10);if(!i.canCallIntoJs())return i.setLastError(i.moduleApiVersion>=10?23:10);i.clearLastError();try{if(!n)return i.setLastError(1);if(!r)return i.setLastError(1);var s=d.handleStore.get(r);if(null==s.value)throw new TypeError("Cannot convert undefined or null to object");var f=void 0;try{f=s.isObject()||s.isFunction()?s.value:Object(s.value)}catch(e){return i.setLastError(2)}n>>>=0,o=t>>>0 in f?1:0;var u=new DataView(a.buffer);return(u.buffer===a.buffer?u:u=new DataView(a.buffer)).setInt8(n,o,!0),i.getReturnStatus()}catch(e){return i.tryCatch.setError(e),i.setLastError(10)}},napi_has_named_property:function(e,r,t,n){var o;if(!e)return 1;var i=d.envStore.get(e);if(i.checkGCAccess(),!i.tryCatch.isEmpty())return i.setLastError(10);if(!i.canCallIntoJs())return i.setLastError(i.moduleApiVersion>=10?23:10);i.clearLastError();try{if(!n)return i.setLastError(1);if(!r)return i.setLastError(1);if(!t)return i.setLastError(1);var s=d.handleStore.get(r);if(null==s.value)throw new TypeError("Cannot convert undefined or null to object");var f=void 0;try{f=s.isObject()||s.isFunction()?s.value:Object(s.value)}catch(e){return i.setLastError(2)}t>>>=0,n>>>=0,o=H.UTF8ToString(t,-1)in f;var u=new DataView(a.buffer);return(u.buffer===a.buffer?u:u=new DataView(a.buffer)).setInt8(n,o?1:0,!0),i.getReturnStatus()}catch(e){return i.tryCatch.setError(e),i.setLastError(10)}},napi_has_own_property:function(e,r,t,n){var o;if(!e)return 1;var i=d.envStore.get(e);if(i.checkGCAccess(),!i.tryCatch.isEmpty())return i.setLastError(10);if(!i.canCallIntoJs())return i.setLastError(i.moduleApiVersion>=10?23:10);i.clearLastError();try{if(!t)return i.setLastError(1);if(!n)return i.setLastError(1);if(!r)return i.setLastError(1);var s=d.handleStore.get(r);if(null==s.value)throw new TypeError("Cannot convert undefined or null to object");var f=void 0;try{f=s.isObject()||s.isFunction()?s.value:Object(s.value)}catch(e){return i.setLastError(2)}var u=d.handleStore.get(t).value;if("string"!=typeof u&&"symbol"!=typeof u)return i.setLastError(4);o=Object.prototype.hasOwnProperty.call(f,d.handleStore.get(t).value),n>>>=0;var c=new DataView(a.buffer);return(c.buffer===a.buffer?c:c=new DataView(a.buffer)).setInt8(n,o?1:0,!0),i.getReturnStatus()}catch(e){return i.tryCatch.setError(e),i.setLastError(10)}},napi_has_property:function(e,r,t,n){var o;if(!e)return 1;var i=d.envStore.get(e);if(i.checkGCAccess(),!i.tryCatch.isEmpty())return i.setLastError(10);if(!i.canCallIntoJs())return i.setLastError(i.moduleApiVersion>=10?23:10);i.clearLastError();try{if(!t)return i.setLastError(1);if(!n)return i.setLastError(1);if(!r)return i.setLastError(1);var s=d.handleStore.get(r);if(null==s.value)throw new TypeError("Cannot convert undefined or null to object");var f=void 0;try{f=s.isObject()||s.isFunction()?s.value:Object(s.value)}catch(e){return i.setLastError(2)}n>>>=0,o=d.handleStore.get(t).value in f?1:0;var u=new DataView(a.buffer);return(u.buffer===a.buffer?u:u=new DataView(a.buffer)).setInt8(n,o,!0),i.getReturnStatus()}catch(e){return i.tryCatch.setError(e),i.setLastError(10)}},napi_object_freeze:function(e,r){if(!e)return 1;var t=d.envStore.get(e);if(t.checkGCAccess(),!t.tryCatch.isEmpty())return t.setLastError(10);if(!t.canCallIntoJs())return t.setLastError(t.moduleApiVersion>=10?23:10);t.clearLastError();try{if(!r)return t.setLastError(1);var n=d.handleStore.get(r),a=n.value;return n.isObject()||n.isFunction()?(Object.freeze(a),t.getReturnStatus()):t.setLastError(2)}catch(e){return t.tryCatch.setError(e),t.setLastError(10)}},napi_object_seal:function(e,r){if(!e)return 1;var t=d.envStore.get(e);if(t.checkGCAccess(),!t.tryCatch.isEmpty())return t.setLastError(10);if(!t.canCallIntoJs())return t.setLastError(t.moduleApiVersion>=10?23:10);t.clearLastError();try{if(!r)return t.setLastError(1);var n=d.handleStore.get(r),a=n.value;return n.isObject()||n.isFunction()?(Object.seal(a),t.getReturnStatus()):t.setLastError(2)}catch(e){return t.tryCatch.setError(e),t.setLastError(10)}},napi_set_element:function(e,r,t,n){if(!e)return 1;var a=d.envStore.get(e);if(a.checkGCAccess(),!a.tryCatch.isEmpty())return a.setLastError(10);if(!a.canCallIntoJs())return a.setLastError(a.moduleApiVersion>=10?23:10);a.clearLastError();try{if(!n)return a.setLastError(1);if(!r)return a.setLastError(1);var o=d.handleStore.get(r);return o.isObject()||o.isFunction()?(o.value[t>>>0]=d.handleStore.get(n).value,a.getReturnStatus()):a.setLastError(2)}catch(e){return a.tryCatch.setError(e),a.setLastError(10)}},napi_set_named_property:function(e,r,t,n){if(!e)return 1;var a=d.envStore.get(e);if(a.checkGCAccess(),!a.tryCatch.isEmpty())return a.setLastError(10);if(!a.canCallIntoJs())return a.setLastError(a.moduleApiVersion>=10?23:10);a.clearLastError();try{if(!n)return a.setLastError(1);if(!r)return a.setLastError(1);var o=d.handleStore.get(r);return o.isObject()||o.isFunction()?t?(t>>>=0,d.handleStore.get(r).value[H.UTF8ToString(t,-1)]=d.handleStore.get(n).value,a.getReturnStatus()):a.setLastError(1):a.setLastError(2)}catch(e){return a.tryCatch.setError(e),a.setLastError(10)}},napi_set_property:function(e,r,t,n){if(!e)return 1;var a=d.envStore.get(e);if(a.checkGCAccess(),!a.tryCatch.isEmpty())return a.setLastError(10);if(!a.canCallIntoJs())return a.setLastError(a.moduleApiVersion>=10?23:10);a.clearLastError();try{if(!t)return a.setLastError(1);if(!n)return a.setLastError(1);if(!r)return a.setLastError(1);var o=d.handleStore.get(r);return o.isObject()||o.isFunction()?(o.value[d.handleStore.get(t).value]=d.handleStore.get(n).value,a.getReturnStatus()):a.setLastError(2)}catch(e){return a.tryCatch.setError(e),a.setLastError(10)}}});var Se=Object.freeze({__proto__:null,napi_run_script:function(e,r,t){var n,o;if(!e)return 1;var i=d.envStore.get(e);if(i.checkGCAccess(),!i.tryCatch.isEmpty())return i.setLastError(10);if(!i.canCallIntoJs())return i.setLastError(i.moduleApiVersion>=10?23:10);i.clearLastError();try{if(!r)return i.setLastError(1);if(!t)return i.setLastError(1);var s=d.handleStore.get(r);if(!s.isString())return i.setLastError(3);var f=d.handleStore.get(5).value.eval(s.value);t>>>=0,o=i.ensureHandleId(f);var u=new DataView(a.buffer);(u.buffer===a.buffer?u:u=new DataView(a.buffer)).setUint32(t,o,!0),n=i.getReturnStatus()}catch(e){return i.tryCatch.setError(e),i.setLastError(10)}return n}});var Ae=Object.freeze({__proto__:null,napi_coerce_to_bool:function(e,r,t){var n;if(!e)return 1;var o=d.envStore.get(e);if(o.checkGCAccess(),!o.tryCatch.isEmpty())return o.setLastError(10);if(!o.canCallIntoJs())return o.setLastError(o.moduleApiVersion>=10?23:10);o.clearLastError();try{if(!r)return o.setLastError(1);if(!t)return o.setLastError(1);var i=d.handleStore.get(r);t>>>=0,n=i.value?4:3;var s=new DataView(a.buffer);return(s.buffer===a.buffer?s:s=new DataView(a.buffer)).setUint32(t,n,!0),o.getReturnStatus()}catch(e){return o.tryCatch.setError(e),o.setLastError(10)}},napi_coerce_to_number:function(e,r,t){var n;if(!e)return 1;var o=d.envStore.get(e);if(o.checkGCAccess(),!o.tryCatch.isEmpty())return o.setLastError(10);if(!o.canCallIntoJs())return o.setLastError(o.moduleApiVersion>=10?23:10);o.clearLastError();try{if(!r)return o.setLastError(1);if(!t)return o.setLastError(1);var i=d.handleStore.get(r);if(i.isBigInt())throw new TypeError("Cannot convert a BigInt value to a number");t>>>=0,n=d.addToCurrentScope(Number(i.value)).id;var s=new DataView(a.buffer);return(s.buffer===a.buffer?s:s=new DataView(a.buffer)).setUint32(t,n,!0),o.getReturnStatus()}catch(e){return o.tryCatch.setError(e),o.setLastError(10)}},napi_coerce_to_object:function(e,r,t){var n;if(!e)return 1;var o=d.envStore.get(e);if(o.checkGCAccess(),!o.tryCatch.isEmpty())return o.setLastError(10);if(!o.canCallIntoJs())return o.setLastError(o.moduleApiVersion>=10?23:10);o.clearLastError();try{if(!r)return o.setLastError(1);if(!t)return o.setLastError(1);var i=d.handleStore.get(r);if(null==i.value)throw new TypeError("Cannot convert undefined or null to object");t>>>=0,n=o.ensureHandleId(Object(i.value));var s=new DataView(a.buffer);return(s.buffer===a.buffer?s:s=new DataView(a.buffer)).setUint32(t,n,!0),o.getReturnStatus()}catch(e){return o.tryCatch.setError(e),o.setLastError(10)}},napi_coerce_to_string:function(e,r,t){var n;if(!e)return 1;var o=d.envStore.get(e);if(o.checkGCAccess(),!o.tryCatch.isEmpty())return o.setLastError(10);if(!o.canCallIntoJs())return o.setLastError(o.moduleApiVersion>=10?23:10);o.clearLastError();try{if(!r)return o.setLastError(1);if(!t)return o.setLastError(1);var i=d.handleStore.get(r);if(i.isSymbol())throw new TypeError("Cannot convert a Symbol value to a string");t>>>=0,n=d.addToCurrentScope(String(i.value)).id;var s=new DataView(a.buffer);return(s.buffer===a.buffer?s:s=new DataView(a.buffer)).setUint32(t,n,!0),o.getReturnStatus()}catch(e){return o.tryCatch.setError(e),o.setLastError(10)}},napi_detach_arraybuffer:function(e,r){if(!e)return 1;var t=d.envStore.get(e);if(t.checkGCAccess(),!r)return t.setLastError(1);var n=d.handleStore.get(r).value;if(!(n instanceof ArrayBuffer))return"function"==typeof SharedArrayBuffer&&n instanceof SharedArrayBuffer?t.setLastError(20):t.setLastError(19);try{(new(0,d.feature.MessageChannel)).port1.postMessage(n,[n])}catch(e){return t.setLastError(9)}return t.clearLastError()},napi_instanceof:function(e,r,t,n){var o;if(!e)return 1;var i=d.envStore.get(e);if(i.checkGCAccess(),!i.tryCatch.isEmpty())return i.setLastError(10);if(!i.canCallIntoJs())return i.setLastError(i.moduleApiVersion>=10?23:10);i.clearLastError();try{if(!r)return i.setLastError(1);if(!n)return i.setLastError(1);if(!t)return i.setLastError(1);n>>>=0;var s=new DataView(a.buffer),f=function(){return s.buffer===a.buffer?s:s=new DataView(a.buffer)};f().setInt8(n,0,!0);var u=d.handleStore.get(t);return u.isFunction()?(o=d.handleStore.get(r).value instanceof u.value?1:0,f().setInt8(n,o,!0),i.getReturnStatus()):i.setLastError(5)}catch(e){return i.tryCatch.setError(e),i.setLastError(10)}},napi_is_array:function(e,r,t){if(!e)return 1;var n=d.envStore.get(e);if(n.checkGCAccess(),!r)return n.setLastError(1);if(!t)return n.setLastError(1);t>>>=0;var o=d.handleStore.get(r).isArray()?1:0,i=new DataView(a.buffer);return(i.buffer===a.buffer?i:i=new DataView(a.buffer)).setInt8(t,o,!0),n.clearLastError()},napi_is_arraybuffer:function(e,r,t){if(!e)return 1;var n=d.envStore.get(e);if(n.checkGCAccess(),!r)return n.setLastError(1);if(!t)return n.setLastError(1);t>>>=0;var o=d.handleStore.get(r).isArrayBuffer()?1:0,i=new DataView(a.buffer);return(i.buffer===a.buffer?i:i=new DataView(a.buffer)).setInt8(t,o,!0),n.clearLastError()},napi_is_buffer:function(e,r,t){if(!e)return 1;var n=d.envStore.get(e);if(n.checkGCAccess(),!r)return n.setLastError(1);if(!t)return n.setLastError(1);t>>>=0;var o=d.handleStore.get(r).isBuffer(d.feature.Buffer)?1:0,i=new DataView(a.buffer);return(i.buffer===a.buffer?i:i=new DataView(a.buffer)).setInt8(t,o,!0),n.clearLastError()},napi_is_dataview:function(e,r,t){if(!e)return 1;var n=d.envStore.get(e);if(n.checkGCAccess(),!r)return n.setLastError(1);if(!t)return n.setLastError(1);t>>>=0;var o=d.handleStore.get(r).isDataView()?1:0,i=new DataView(a.buffer);return(i.buffer===a.buffer?i:i=new DataView(a.buffer)).setInt8(t,o,!0),n.clearLastError()},napi_is_date:function(e,r,t){if(!e)return 1;var n=d.envStore.get(e);if(n.checkGCAccess(),!r)return n.setLastError(1);if(!t)return n.setLastError(1);t>>>=0;var o=d.handleStore.get(r).isDate()?1:0,i=new DataView(a.buffer);return(i.buffer===a.buffer?i:i=new DataView(a.buffer)).setInt8(t,o,!0),n.clearLastError()},napi_is_detached_arraybuffer:function(e,r,t){if(!e)return 1;var n=d.envStore.get(e);if(n.checkGCAccess(),!n.tryCatch.isEmpty())return n.setLastError(10);if(!n.canCallIntoJs())return n.setLastError(n.moduleApiVersion>=10?23:10);n.clearLastError();try{if(!r)return n.setLastError(1);if(!t)return n.setLastError(1);var o=d.handleStore.get(r);t>>>=0;var i=new DataView(a.buffer),s=function(){return i.buffer===a.buffer?i:i=new DataView(a.buffer)};if(o.isArrayBuffer()&&0===o.value.byteLength)try{new Uint8Array(o.value)}catch(e){return s().setInt8(t,1,!0),n.getReturnStatus()}return s().setInt8(t,0,!0),n.getReturnStatus()}catch(e){return n.tryCatch.setError(e),n.setLastError(10)}},napi_is_error:function(e,r,t){if(!e)return 1;var n=d.envStore.get(e);if(n.checkGCAccess(),!r)return n.setLastError(1);if(!t)return n.setLastError(1);t>>>=0;var o=d.handleStore.get(r).value instanceof Error?1:0,i=new DataView(a.buffer);return(i.buffer===a.buffer?i:i=new DataView(a.buffer)).setInt8(t,o,!0),n.clearLastError()},napi_is_typedarray:function(e,r,t){if(!e)return 1;var n=d.envStore.get(e);if(n.checkGCAccess(),!r)return n.setLastError(1);if(!t)return n.setLastError(1);t>>>=0;var o=d.handleStore.get(r).isTypedArray()?1:0,i=new DataView(a.buffer);return(i.buffer===a.buffer?i:i=new DataView(a.buffer)).setInt8(t,o,!0),n.clearLastError()},napi_strict_equals:function(e,r,t,n){var o;if(!e)return 1;var i=d.envStore.get(e);if(i.checkGCAccess(),!i.tryCatch.isEmpty())return i.setLastError(10);if(!i.canCallIntoJs())return i.setLastError(i.moduleApiVersion>=10?23:10);i.clearLastError();try{if(!r)return i.setLastError(1);if(!t)return i.setLastError(1);if(!n)return i.setLastError(1);var s=d.handleStore.get(r).value,f=d.handleStore.get(t).value;n>>>=0,o=s===f?1:0;var u=new DataView(a.buffer);return(u.buffer===a.buffer?u:u=new DataView(a.buffer)).setInt8(n,o,!0),i.getReturnStatus()}catch(e){return i.tryCatch.setError(e),i.setLastError(10)}},napi_typeof:function(e,r,t){if(!e)return 1;var n=d.envStore.get(e);if(n.checkGCAccess(),!r)return n.setLastError(1);if(!t)return n.setLastError(1);var o,i=d.handleStore.get(r);if(t>>>=0,i.isNumber())o=3;else if(i.isBigInt())o=9;else if(i.isString())o=4;else if(i.isFunction())o=7;else if(i.isExternal())o=8;else if(i.isObject())o=6;else if(i.isBoolean())o=2;else if(i.isUndefined())o=0;else if(i.isSymbol())o=5;else{if(!i.isNull())return n.setLastError(1);o=1}var s=new DataView(a.buffer);return(s.buffer===a.buffer?s:s=new DataView(a.buffer)).setInt32(t,o,!0),n.clearLastError()},node_api_is_sharedarraybuffer:function(e,r,t){if(!e)return 1;var n=d.envStore.get(e);if(n.checkGCAccess(),!r)return n.setLastError(1);if(!t)return n.setLastError(1);var o=d.handleStore.get(r);t>>>=0;var i="function"==typeof SharedArrayBuffer&&o.value instanceof SharedArrayBuffer||"[object SharedArrayBuffer]"===Object.prototype.toString.call(o.value)?1:0,s=new DataView(a.buffer);return(s.buffer===a.buffer?s:s=new DataView(a.buffer)).setInt8(t,i,!0),n.clearLastError()}});var Ce=Object.freeze({__proto__:null,napi_get_version:function(e,r){if(!e)return 1;var t=d.envStore.get(e);if(!r)return t.setLastError(1);var n=new DataView(a.buffer);return(n.buffer===a.buffer?n:n=new DataView(a.buffer)).setUint32(r,10,!0),t.clearLastError()}});function Ve(e){for(var r=Object.keys(e),t=0;t<r.length;++t){var n=r[t];0!==n.indexOf("$")&&(0===n.indexOf("emnapi_")?y.imports.emnapi[n]=e[n]:0===n.indexOf("_emnapi_")||"napi_set_last_error"===n||"napi_clear_last_error"===n?y.imports.env[n]=e[n]:y.imports.napi[n]=e[n])}}return F.init(),N.init(),J.init(),H.init(),R.init(),S.init(),y.emnapi.syncMemory=fe,y.emnapi.getMemoryAddress=ue,y.emnapi.acquireExternalSharedArrayBuffer=ce,Ve(B),Ve(T),Ve(W),Ve(D),Ve(Y),Ve(ee),Ve(ve),Ve(pe),Ve(ie),Ve(ye),Ve(le),Ve(ge),Ve(be),Ve(he),Ve(_e),Ve(j),Ve(Ee),Ve(me),Ve(Se),Ve(Ae),Ve(Ce),y.imports.napi.napi_create_threadsafe_function=function(e,r,t,n,o,f,u,c,l,v,p){if(!e)return 1;var y=d.envStore.get(e);if(y.checkGCAccess(),!n)return y.setLastError(1);if(o>>>=0,f>>>=0,e>>>=0,u>>>=0,c>>>=0,l>>>=0,v>>>=0,o>>>=0,0===(f>>>=0))return y.setLastError(1);if(!p)return y.setLastError(1);var g,w=0;if(r>>>=0){if("function"!=typeof d.handleStore.get(r).value)return y.setLastError(1);w=d.createReference(y,r,1,1).id}else if(!v)return y.setLastError(1);if(t){if(null==(g=d.handleStore.get(t).value))return y.setLastError(2);g=Object(g)}else g={};var b=y.ensureHandleId(g),h=d.handleStore.get(n).value;if("symbol"==typeof h)return y.setLastError(3);h=String(h);var _=y.ensureHandleId(h),E=R.offset.__size__,L=i(E);if(!L)return y.setLastError(9);L>>>=0,new Uint8Array(R.ensureBufferFor(L+E)).subarray(L,L+E).fill(0);var m=d.createReference(y,b,1,1),S=m.id,A=new DataView(a.buffer),C=function(){return A.buffer===a.buffer?A:A=new DataView(a.buffer)};return C().setUint32(L+R.offset.resource,S,!0),R.initQueue(L)?(O(b,_,-1,L+R.offset.async_id),C().setInt8(L+R.offset.is_some,1,!0),C().setUint32(L+R.offset.thread_count,f,!0),C().setUint32(L+R.offset.context,l,!0),C().setUint32(L+R.offset.max_queue_size,o,!0),C().setUint32(L+R.offset.ref,w,!0),C().setUint32(L+R.offset.env,e,!0),C().setUint32(L+R.offset.finalize_data,u,!0),C().setUint32(L+R.offset.finalize_cb,c,!0),C().setUint32(L+R.offset.call_js_cb,v,!0),d.addCleanupHook(y,R.cleanup,L),R._liveSet.add(L),y.ref(),d.increaseWaitingRequestCounter(),C().setUint32(L+R.offset.async_ref,1,!0),p>>>=0,C().setUint32(p,L,!0),y.clearLastError()):(s(L),m.dispose(),y.setLastError(9))},y.imports.napi.napi_get_threadsafe_function_context=function(e,r){if(!e||!r)return l(),1;e>>>=0,r>>>=0;var t=R.getContext(e),n=new DataView(a.buffer);return(n.buffer===a.buffer?n:n=new DataView(a.buffer)).setUint32(r,t,!0),0},y.imports.napi.napi_call_threadsafe_function=function(e,r,t){return e?(e>>>=0,r>>>=0,R.push(e,r,t)):(l(),1)},y.imports.napi.napi_acquire_threadsafe_function=function(e){return e?(e>>>=0,R.getMutex(e).execute(function(){return 0===R.getState(e)?(R.addThreadCount(e),0):16})):(l(),1)},y.imports.napi.napi_release_threadsafe_function=function(e,r){if(!e)return l(),1;e>>>=0;var t=R.getMutex(e),n=R.getCond(e),a=!1,o=t.execute(function(){return 0===R.getThreadCount(e)?1:(R.subThreadCount(e),0!==R.getThreadCount(e)&&1!==r||0===R.getState(e)&&(1===r&&R.setState(e,1),1===R.getState(e)&&R.getMaxQueueSize(e)>0&&n.signal(),R.send(e)),2!==R.getState(e)||0!==R.getThreadCount(e)||(a=!0),0)});return a&&R.destroy(e),o},y.imports.napi.napi_unref_threadsafe_function=function(e,r){if(!r)return l(),1;var t=(r>>>=0)+R.offset.async_ref,n=t>>>2,a=new Uint32Array(R.ensureBufferFor(t+4)),o=Atomics.load(a,n);return o>0&&(Atomics.store(a,n,o-1),1===o&&d.decreaseWaitingRequestCounter()),0},y.imports.napi.napi_ref_threadsafe_function=function(e,r){if(!r)return l(),1;var t=(r>>>=0)+R.offset.async_ref,n=t>>>2,a=new Uint32Array(R.ensureBufferFor(t+4)),o=Atomics.load(a,n);return o||d.increaseWaitingRequestCounter(),Atomics.store(a,n,o+1),0},y}();return n}function o(r,t,n,o){const s=(o=null!=o?o:{}).getMemory,f=o.getTable,u=o.beforeInit;if(null!=s&&"function"!=typeof s)throw new TypeError("options.getMemory is not a function");if(null!=f&&"function"!=typeof f)throw new TypeError("options.getTable is not a function");if(null!=u&&"function"!=typeof u)throw new TypeError("options.beforeInit is not a function");let c;const l="object"==typeof t&&null!==t;if(l){if(t.loaded)throw new Error("napiModule has already loaded");c=t}else c=a(o);const d=o.wasi;let v,p={env:c.imports.env,napi:c.imports.napi,emnapi:c.imports.emnapi};d&&(v=new e.WASIThreads(c.childThread?{wasi:d,childThread:!0,postMessage:c.postMessage}:{wasi:d,threadManager:c.PThread,waitThreadStart:c.waitThreadStart}),Object.assign(p,"function"==typeof d.getImportObject?d.getImportObject():{wasi_snapshot_preview1:d.wasiImport}),Object.assign(p,v.getImportObject()));const y=o.overwriteImports;if("function"==typeof y){const e=y(p);"object"==typeof e&&null!==e&&(p=e)}return r(n,p,(e,t)=>{if(e)throw e;const n=t.instance;let a=n;const o=n.exports,y="memory"in o,g="memory"in p.env,w=s?s(o):y?o.memory:g?p.env.memory:void 0;if(!w)throw new Error("memory is neither exported nor imported");const b=f?f(o):o.__indirect_function_table;if(d&&!y){const e=Object.create(null);Object.assign(e,o,{memory:w}),a={exports:e}}const h=t.module;d?a=v.initialize(a,h,w):c.PThread.setup(h,w);const _=()=>{u&&u({instance:n,module:h}),c.init({instance:a,module:h,memory:w,table:b});const e={instance:n,module:h,usedInstance:a};return l||(e.napiModule=c),e};if(c.PThread.shouldPreloadWorkers()){const e=c.PThread.loadWasmModuleToAllWorkers();if(r===i)return e.then(_);throw new Error("Synchronous loading is not supported with worker pool (reuseWorker.size > 0)")}return _()})}function i(e,r,t){return n(e,r).then(e=>t(null,e),e=>t(e))}function s(e,n,a){let o;try{o=function(e,n){if(!e)throw new TypeError("Invalid wasm source");let a;if(t(n),n=null!=n?n:{},e instanceof ArrayBuffer||ArrayBuffer.isView(e))a=new r.Module(e);else{if(!(e instanceof WebAssembly.Module))throw new TypeError("Invalid wasm source");a=e}return{instance:new r.Instance(a,n),module:a}}(e,n)}catch(e){return a(e)}return a(null,o)}class f extends e.ThreadMessageHandler{constructor(e){if("function"!=typeof e.onLoad)throw new TypeError("options.onLoad is not a function");const r=e.onError;super({...e,onError:(e,t)=>{var n;const a=null===(n=this.instance)||void 0===n?void 0:n.exports.emnapi_thread_crashed;if("function"==typeof a&&a(),"function"!=typeof r)throw e;r(e,t)}}),this.napiModule=void 0}instantiate(e){const r=this.onLoad(e);return"function"==typeof r.then?r.then(e=>(this.napiModule=e.napiModule,e)):(this.napiModule=r.napiModule,r)}handle(e){var r;if(super.handle(e),null===(r=null==e?void 0:e.data)||void 0===r?void 0:r.__emnapi__){const r=e.data.__emnapi__.type,t=e.data.__emnapi__.payload;try{"async-worker-init"===r&&this.handleAfterLoad(e,()=>{this.napiModule.initWorker(t.arg,t.func)})}catch(e){this.onError(e,r)}}}}exports.MessageHandler=f,exports.createNapiModule=a,exports.instantiateNapiModule=function(e,r){return o(i,void 0,e,r)},exports.instantiateNapiModuleSync=function(e,r){return o(s,void 0,e,r)},exports.loadNapiModule=function(e,r,t){if("object"!=typeof e||null===e)throw new TypeError("Invalid napiModule");return o(i,e,r,t)},exports.loadNapiModuleSync=function(e,r,t){if("object"!=typeof e||null===e)throw new TypeError("Invalid napiModule");return o(s,e,r,t)},exports.version="1.11.3",Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(exports,r)||Object.defineProperty(exports,r,{enumerable:!0,get:function(){return e[r]}})});
|