@openclaw/discord 2026.7.1-beta.2 → 2026.7.1-beta.5
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/dist/action-runtime-api.js +1 -1
- package/dist/{api-CJvEMuA6.js → api-DPRqYi4Z.js} +2 -1
- package/dist/api.js +14 -14
- package/dist/{approval-handler.runtime-Cg7CuLSc.js → approval-handler.runtime-Bw2pZNk1.js} +24 -4
- package/dist/{audit-BCVhE9Oe.js → audit-MLpDpN3Z.js} +3 -3
- package/dist/{channel-actions-DJ_i4v9b.js → channel-actions-D_fjVUZ_.js} +5 -5
- package/dist/{channel-actions.runtime-BDW12z0o.js → channel-actions.runtime-CVHlFqQg.js} +5 -5
- package/dist/channel-config-api.js +1 -1
- package/dist/{channel-CfngVOjW.js → channel-kBTCV_g9.js} +26 -26
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.setup-BYZ78cmU.js → channel.setup-tZcpIn4e.js} +3 -3
- package/dist/{components-CBPNJhVP.js → components-BIBizbtZ.js} +10 -6
- package/dist/{config-schema-spuxW477.js → config-schema-BgIhO3ko.js} +1 -1
- package/dist/{conversation-identity-CnYbx3sO.js → conversation-identity-DWC5d8Sy.js} +2 -2
- package/dist/{directory-config-CouAqvDj.js → directory-config-ByaUKL1f.js} +1 -1
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-C8lwwDJo.js → directory-live-BX79ImQA.js} +2 -2
- package/dist/{doctor-CKIw8urm.js → doctor-Bgoxm5AN.js} +1 -1
- package/dist/{handle-action.guild-admin-CHMDXefq.js → handle-action.guild-admin-CgJSNVui.js} +2 -2
- package/dist/index.js +1 -1
- package/dist/{manager.runtime-BkMOU8kh.js → manager.runtime-D-ZJn56X.js} +28 -15
- package/dist/{message-handler-B2cEpj5S.js → message-handler-DbrX-sHg.js} +11 -8
- package/dist/{message-handler.preflight-B93Az6zg.js → message-handler.preflight-Dd-xQ-qv.js} +34 -14
- package/dist/{message-handler.process-CW5mMw4o.js → message-handler.process-CV1GmuBj.js} +29 -84
- package/dist/{message-utils-Dy9KeClm.js → message-utils-B_3yA5bN.js} +11 -6
- package/dist/{outbound-adapter-n_qRwyHZ.js → outbound-adapter-82RWi_SR.js} +138 -152
- package/dist/{pluralkit-DaWTJTmF.js → pluralkit-DcD-3EcL.js} +1 -1
- package/dist/{preflight-audio-DecwnhEA.js → preflight-audio-DYL2ABgA.js} +1 -1
- package/dist/presence-cache-z1N8MbJ3.js +45 -0
- package/dist/{probe-Bkf8mJlj.js → probe-D1ImJEo2.js} +2 -2
- package/dist/{probe.runtime-3Rerer9g.js → probe.runtime-B1dsEeBD.js} +1 -1
- package/dist/{provider-BuTO6czP.js → provider-Cm9QSAO8.js} +61 -42
- package/dist/{provider-session.runtime-DmBTGaQX.js → provider-session.runtime-DYKny61v.js} +3 -3
- package/dist/provider.runtime-BIHvVXCg.js +2 -0
- package/dist/{resolve-allowlist-common-BDNoAQll.js → resolve-allowlist-common-CWbE8XlH.js} +1 -1
- package/dist/{resolve-channels-C_rAwrkj.js → resolve-channels-CcpvWoRa.js} +3 -3
- package/dist/{resolve-users-Cz1tkemy.js → resolve-users-DJamun9s.js} +3 -3
- package/dist/{runtime-DaaaVvJm.js → runtime-C6rRmQ6l.js} +23 -20
- package/dist/runtime-api.actions.js +2 -2
- package/dist/runtime-api.js +20 -20
- package/dist/runtime-api.lookup.js +5 -5
- package/dist/runtime-api.monitor-DoCAqUlv.js +6 -0
- package/dist/runtime-api.monitor.js +6 -5
- package/dist/runtime-api.send.js +5 -5
- package/dist/runtime-api.threads.js +3 -3
- package/dist/{secret-config-contract-BjM-1hr9.js → secret-config-contract-BDNrRWvd.js} +6 -1
- package/dist/secret-contract-api.js +1 -1
- package/dist/{send-B_yfprXu.js → send-iJ0B4bAX.js} +28 -17
- package/dist/{send.components-C2psXc7A.js → send.components-D0I39utR.js} +18 -15
- package/dist/{send.outbound-BPcCF1v2.js → send.outbound-Bj61Q3a0.js} +105 -20
- package/dist/{send.receipt-CK162xD0.js → send.receipt-BpBQED_5.js} +51 -26
- package/dist/{send.shared-CUTfqvXx.js → send.shared-wAwMhHDN.js} +145 -28
- package/dist/session-binding-contract-api.js +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{shared-AnStShZr.js → shared-BQVKfnev.js} +3 -3
- package/dist/{subagent-hooks-DkO-jpvh.js → subagent-hooks-B-bJxxGg.js} +2 -2
- package/dist/subagent-hooks-api.js +1 -1
- package/dist/{system-events-XRYuwB2n.js → system-events-DVnqSyTt.js} +1 -1
- package/dist/{target-resolver-DYufMbXm.js → target-resolver-CwHaSLt3.js} +2 -2
- package/dist/targets-69w7c3vU.js +3 -0
- package/dist/{thread-bindings-BuXtcLSp.js → thread-bindings-DsTxqu3E.js} +4 -4
- package/dist/{thread-bindings.discord-api-CetgvIbE.js → thread-bindings.discord-api-BjIf9lGs.js} +4 -4
- package/dist/{thread-bindings.manager-B7AHjU4s.js → thread-bindings.manager-Bwmtqc3E.js} +3 -3
- package/dist/{transcripts-source-DW6d1eCL.js → transcripts-source-BvvM5Ns9.js} +1 -1
- package/dist/transcripts-source-api.js +1 -1
- package/dist/{typing-BMQEI8OW.js → typing-BVcJgILg.js} +1 -1
- package/node_modules/@napi-rs/wasm-runtime/dist/fs-proxy.cjs +23 -1
- package/node_modules/@napi-rs/wasm-runtime/dist/fs.js +291 -256
- package/node_modules/@napi-rs/wasm-runtime/fs-proxy.js +23 -1
- package/node_modules/@napi-rs/wasm-runtime/package.json +6 -6
- package/node_modules/@snazzah/davey/index.js +46 -46
- package/node_modules/@snazzah/davey/package.json +20 -20
- package/node_modules/@snazzah/davey-android-arm-eabi/davey.android-arm-eabi.node +0 -0
- package/node_modules/@snazzah/davey-android-arm-eabi/package.json +1 -1
- package/node_modules/@snazzah/davey-android-arm64/davey.android-arm64.node +0 -0
- package/node_modules/@snazzah/davey-android-arm64/package.json +1 -1
- package/node_modules/@snazzah/davey-darwin-arm64/davey.darwin-arm64.node +0 -0
- package/node_modules/@snazzah/davey-darwin-arm64/package.json +1 -1
- package/node_modules/@snazzah/davey-darwin-x64/davey.darwin-x64.node +0 -0
- package/node_modules/@snazzah/davey-darwin-x64/package.json +1 -1
- package/node_modules/@snazzah/davey-freebsd-x64/davey.freebsd-x64.node +0 -0
- package/node_modules/@snazzah/davey-freebsd-x64/package.json +1 -1
- package/node_modules/@snazzah/davey-linux-arm-gnueabihf/davey.linux-arm-gnueabihf.node +0 -0
- package/node_modules/@snazzah/davey-linux-arm-gnueabihf/package.json +1 -1
- package/node_modules/@snazzah/davey-linux-arm64-gnu/davey.linux-arm64-gnu.node +0 -0
- package/node_modules/@snazzah/davey-linux-arm64-gnu/package.json +1 -1
- package/node_modules/@snazzah/davey-linux-arm64-musl/davey.linux-arm64-musl.node +0 -0
- package/node_modules/@snazzah/davey-linux-arm64-musl/package.json +1 -1
- package/node_modules/@snazzah/davey-linux-x64-gnu/davey.linux-x64-gnu.node +0 -0
- package/node_modules/@snazzah/davey-linux-x64-gnu/package.json +1 -1
- package/node_modules/@snazzah/davey-linux-x64-musl/davey.linux-x64-musl.node +0 -0
- package/node_modules/@snazzah/davey-linux-x64-musl/package.json +1 -1
- package/node_modules/@snazzah/davey-wasm32-wasi/davey.wasm32-wasi.wasm +0 -0
- package/node_modules/@snazzah/davey-wasm32-wasi/package.json +2 -2
- package/node_modules/@snazzah/davey-win32-arm64-msvc/davey.win32-arm64-msvc.node +0 -0
- package/node_modules/@snazzah/davey-win32-arm64-msvc/package.json +1 -1
- package/node_modules/@snazzah/davey-win32-ia32-msvc/davey.win32-ia32-msvc.node +0 -0
- package/node_modules/@snazzah/davey-win32-ia32-msvc/package.json +1 -1
- package/node_modules/@snazzah/davey-win32-x64-msvc/davey.win32-x64-msvc.node +0 -0
- package/node_modules/@snazzah/davey-win32-x64-msvc/package.json +1 -1
- package/node_modules/@tybys/wasm-util/dist/wasm-util.esm-bundler.js +60 -48
- package/node_modules/@tybys/wasm-util/dist/wasm-util.esm.js +60 -48
- package/node_modules/@tybys/wasm-util/dist/wasm-util.esm.min.js +1 -1
- package/node_modules/@tybys/wasm-util/dist/wasm-util.js +60 -48
- package/node_modules/@tybys/wasm-util/dist/wasm-util.min.js +1 -1
- package/node_modules/@tybys/wasm-util/lib/cjs/wasi/preview1.js +62 -49
- package/node_modules/@tybys/wasm-util/lib/mjs/wasi/preview1.mjs +60 -48
- package/node_modules/@tybys/wasm-util/package.json +1 -1
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/assert/strict.d.ts +10 -1
- package/node_modules/@types/node/assert.d.ts +144 -17
- package/node_modules/@types/node/async_hooks.d.ts +9 -9
- package/node_modules/@types/node/buffer.d.ts +64 -30
- package/node_modules/@types/node/child_process.d.ts +17 -21
- package/node_modules/@types/node/cluster.d.ts +13 -13
- package/node_modules/@types/node/console.d.ts +1 -1
- package/node_modules/@types/node/crypto.d.ts +471 -575
- package/node_modules/@types/node/diagnostics_channel.d.ts +274 -32
- package/node_modules/@types/node/dns.d.ts +15 -15
- package/node_modules/@types/node/events.d.ts +3 -3
- package/node_modules/@types/node/ffi.d.ts +486 -0
- package/node_modules/@types/node/fs/promises.d.ts +7 -4
- package/node_modules/@types/node/fs.d.ts +24 -18
- package/node_modules/@types/node/globals.d.ts +4 -4
- package/node_modules/@types/node/http.d.ts +30 -5
- package/node_modules/@types/node/http2.d.ts +5 -1
- package/node_modules/@types/node/index.d.ts +1 -3
- package/node_modules/@types/node/inspector.d.ts +1 -1
- package/node_modules/@types/node/module.d.ts +16 -45
- package/node_modules/@types/node/net.d.ts +1 -1
- package/node_modules/@types/node/os.d.ts +2 -2
- package/node_modules/@types/node/package.json +4 -4
- package/node_modules/@types/node/perf_hooks.d.ts +1 -9
- package/node_modules/@types/node/process.d.ts +25 -12
- package/node_modules/@types/node/quic.d.ts +92 -11
- package/node_modules/@types/node/readline.d.ts +12 -11
- package/node_modules/@types/node/repl.d.ts +10 -10
- package/node_modules/@types/node/sqlite.d.ts +56 -1
- package/node_modules/@types/node/stream/iter.d.ts +150 -0
- package/node_modules/@types/node/stream/promises.d.ts +2 -2
- package/node_modules/@types/node/stream/web.d.ts +1 -1
- package/node_modules/@types/node/stream.d.ts +37 -5
- package/node_modules/@types/node/test/reporters.d.ts +1 -1
- package/node_modules/@types/node/test.d.ts +120 -10
- package/node_modules/@types/node/tls.d.ts +1 -1
- package/node_modules/@types/node/ts5.6/index.d.ts +2 -4
- package/node_modules/@types/node/ts5.7/index.d.ts +1 -3
- package/node_modules/@types/node/url.d.ts +3 -3
- package/node_modules/@types/node/util/types.d.ts +1 -1
- package/node_modules/@types/node/util.d.ts +22 -22
- package/node_modules/@types/node/v8.d.ts +85 -3
- package/node_modules/@types/node/vm.d.ts +9 -9
- package/node_modules/@types/node/web-globals/domexception.d.ts +15 -0
- package/node_modules/@types/node/worker_threads.d.ts +10 -12
- package/node_modules/@types/node/zlib.d.ts +3 -3
- package/node_modules/discord-api-types/CHANGELOG.md +16 -0
- package/node_modules/discord-api-types/README.md +1 -1
- package/node_modules/discord-api-types/_generated_/rest/v10/interfaces.d.ts +16 -0
- package/node_modules/discord-api-types/_generated_/rest/v10/interfaces.d.ts.map +1 -1
- package/node_modules/discord-api-types/_generated_/rest/v9/interfaces.d.ts +16 -0
- package/node_modules/discord-api-types/_generated_/rest/v9/interfaces.d.ts.map +1 -1
- package/node_modules/discord-api-types/gateway/index.mjs +1 -0
- package/node_modules/discord-api-types/gateway/v10.d.ts +125 -8
- package/node_modules/discord-api-types/gateway/v10.d.ts.map +1 -1
- package/node_modules/discord-api-types/gateway/v10.js +13 -1
- package/node_modules/discord-api-types/gateway/v10.js.map +1 -1
- package/node_modules/discord-api-types/gateway/v10.mjs +1 -0
- package/node_modules/discord-api-types/gateway/v9.d.ts +125 -8
- package/node_modules/discord-api-types/gateway/v9.d.ts.map +1 -1
- package/node_modules/discord-api-types/gateway/v9.js +13 -1
- package/node_modules/discord-api-types/gateway/v9.js.map +1 -1
- package/node_modules/discord-api-types/gateway/v9.mjs +1 -0
- package/node_modules/discord-api-types/package.json +4 -4
- package/node_modules/discord-api-types/payloads/common.d.ts +6 -0
- package/node_modules/discord-api-types/payloads/common.d.ts.map +1 -1
- package/node_modules/discord-api-types/payloads/common.js +6 -0
- package/node_modules/discord-api-types/payloads/common.js.map +1 -1
- package/node_modules/discord-api-types/payloads/v10/_interactions/ping.d.ts +1 -1
- package/node_modules/discord-api-types/payloads/v10/_interactions/ping.d.ts.map +1 -1
- package/node_modules/discord-api-types/payloads/v10/auditLog.d.ts +12 -1
- package/node_modules/discord-api-types/payloads/v10/auditLog.d.ts.map +1 -1
- package/node_modules/discord-api-types/payloads/v10/auditLog.js +2 -0
- package/node_modules/discord-api-types/payloads/v10/auditLog.js.map +1 -1
- package/node_modules/discord-api-types/payloads/v10/invite.d.ts +7 -1
- package/node_modules/discord-api-types/payloads/v10/invite.d.ts.map +1 -1
- package/node_modules/discord-api-types/payloads/v10/invite.js.map +1 -1
- package/node_modules/discord-api-types/payloads/v10/monetization.d.ts +4 -4
- package/node_modules/discord-api-types/payloads/v10/monetization.d.ts.map +1 -1
- package/node_modules/discord-api-types/payloads/v10/monetization.js +4 -4
- package/node_modules/discord-api-types/payloads/v10/monetization.js.map +1 -1
- package/node_modules/discord-api-types/payloads/v10/webhook.d.ts +2 -2
- package/node_modules/discord-api-types/payloads/v10/webhook.d.ts.map +1 -1
- package/node_modules/discord-api-types/payloads/v9/_interactions/ping.d.ts +1 -1
- package/node_modules/discord-api-types/payloads/v9/_interactions/ping.d.ts.map +1 -1
- package/node_modules/discord-api-types/payloads/v9/auditLog.d.ts +12 -1
- package/node_modules/discord-api-types/payloads/v9/auditLog.d.ts.map +1 -1
- package/node_modules/discord-api-types/payloads/v9/auditLog.js +2 -0
- package/node_modules/discord-api-types/payloads/v9/auditLog.js.map +1 -1
- package/node_modules/discord-api-types/payloads/v9/invite.d.ts +7 -1
- package/node_modules/discord-api-types/payloads/v9/invite.d.ts.map +1 -1
- package/node_modules/discord-api-types/payloads/v9/invite.js.map +1 -1
- package/node_modules/discord-api-types/payloads/v9/monetization.d.ts +4 -4
- package/node_modules/discord-api-types/payloads/v9/monetization.d.ts.map +1 -1
- package/node_modules/discord-api-types/payloads/v9/monetization.js +4 -4
- package/node_modules/discord-api-types/payloads/v9/monetization.js.map +1 -1
- package/node_modules/discord-api-types/payloads/v9/webhook.d.ts +2 -2
- package/node_modules/discord-api-types/payloads/v9/webhook.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/common.d.ts +5 -0
- package/node_modules/discord-api-types/rest/common.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/common.js +5 -0
- package/node_modules/discord-api-types/rest/common.js.map +1 -1
- package/node_modules/discord-api-types/rest/index.mjs +1 -0
- package/node_modules/discord-api-types/rest/v10/autoModeration.d.ts +1 -1
- package/node_modules/discord-api-types/rest/v10/autoModeration.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v10/channel.d.ts +49 -16
- package/node_modules/discord-api-types/rest/v10/channel.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v10/emoji.d.ts +2 -2
- package/node_modules/discord-api-types/rest/v10/emoji.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v10/guild.d.ts +9 -9
- package/node_modules/discord-api-types/rest/v10/guild.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v10/guildScheduledEvent.d.ts +1 -1
- package/node_modules/discord-api-types/rest/v10/guildScheduledEvent.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v10/index.d.ts +1 -1
- package/node_modules/discord-api-types/rest/v10/index.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v10/index.js +23 -0
- package/node_modules/discord-api-types/rest/v10/index.js.map +1 -1
- package/node_modules/discord-api-types/rest/v10/index.mjs +1 -0
- package/node_modules/discord-api-types/rest/v10/interactions.d.ts +1 -1
- package/node_modules/discord-api-types/rest/v10/interactions.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v10/invite.d.ts +67 -0
- package/node_modules/discord-api-types/rest/v10/invite.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v10/invite.js +23 -0
- package/node_modules/discord-api-types/rest/v10/invite.js.map +1 -1
- package/node_modules/discord-api-types/rest/v10/monetization.d.ts +2 -2
- package/node_modules/discord-api-types/rest/v10/monetization.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v10/soundboard.d.ts +2 -2
- package/node_modules/discord-api-types/rest/v10/soundboard.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v10/stageInstance.d.ts +1 -1
- package/node_modules/discord-api-types/rest/v10/stageInstance.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v10/sticker.d.ts +1 -1
- package/node_modules/discord-api-types/rest/v10/sticker.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v10/user.d.ts +1 -1
- package/node_modules/discord-api-types/rest/v10/user.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v10/voice.d.ts +2 -2
- package/node_modules/discord-api-types/rest/v10/voice.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v10/webhook.d.ts +6 -6
- package/node_modules/discord-api-types/rest/v10/webhook.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v9/autoModeration.d.ts +1 -1
- package/node_modules/discord-api-types/rest/v9/autoModeration.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v9/channel.d.ts +49 -16
- package/node_modules/discord-api-types/rest/v9/channel.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v9/emoji.d.ts +2 -2
- package/node_modules/discord-api-types/rest/v9/emoji.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v9/guild.d.ts +9 -9
- package/node_modules/discord-api-types/rest/v9/guild.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v9/guildScheduledEvent.d.ts +1 -1
- package/node_modules/discord-api-types/rest/v9/guildScheduledEvent.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v9/index.d.ts +1 -1
- package/node_modules/discord-api-types/rest/v9/index.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v9/index.js +23 -0
- package/node_modules/discord-api-types/rest/v9/index.js.map +1 -1
- package/node_modules/discord-api-types/rest/v9/index.mjs +1 -0
- package/node_modules/discord-api-types/rest/v9/interactions.d.ts +1 -1
- package/node_modules/discord-api-types/rest/v9/interactions.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v9/invite.d.ts +67 -0
- package/node_modules/discord-api-types/rest/v9/invite.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v9/invite.js +23 -0
- package/node_modules/discord-api-types/rest/v9/invite.js.map +1 -1
- package/node_modules/discord-api-types/rest/v9/monetization.d.ts +2 -2
- package/node_modules/discord-api-types/rest/v9/monetization.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v9/soundboard.d.ts +2 -2
- package/node_modules/discord-api-types/rest/v9/soundboard.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v9/stageInstance.d.ts +1 -1
- package/node_modules/discord-api-types/rest/v9/stageInstance.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v9/sticker.d.ts +1 -1
- package/node_modules/discord-api-types/rest/v9/sticker.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v9/user.d.ts +1 -1
- package/node_modules/discord-api-types/rest/v9/user.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v9/voice.d.ts +2 -2
- package/node_modules/discord-api-types/rest/v9/voice.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v9/webhook.d.ts +6 -6
- package/node_modules/discord-api-types/rest/v9/webhook.d.ts.map +1 -1
- package/node_modules/discord-api-types/rpc/v10.d.ts +19 -19
- package/node_modules/discord-api-types/rpc/v10.d.ts.map +1 -1
- package/node_modules/discord-api-types/v10.mjs +2 -0
- package/node_modules/discord-api-types/v9.mjs +2 -0
- package/node_modules/typebox/build/compile/validator.d.mts +2 -7
- package/node_modules/typebox/build/compile/validator.mjs +6 -36
- package/node_modules/typebox/build/error/errors.d.mts +1 -7
- package/node_modules/typebox/build/format/_idna.mjs +36 -6
- package/node_modules/typebox/build/format/_puny.mjs +4 -1
- package/node_modules/typebox/build/format/uuid.d.mts +2 -2
- package/node_modules/typebox/build/format/uuid.mjs +3 -3
- package/node_modules/typebox/build/guard/emit.d.mts +0 -4
- package/node_modules/typebox/build/guard/emit.mjs +0 -8
- package/node_modules/typebox/build/guard/guard.d.mts +4 -8
- package/node_modules/typebox/build/guard/guard.mjs +5 -13
- package/node_modules/typebox/build/schema/engine/boolean.d.mts +3 -3
- package/node_modules/typebox/build/schema/engine/boolean.mjs +4 -4
- package/node_modules/typebox/build/schema/engine/index.d.mts +0 -1
- package/node_modules/typebox/build/schema/engine/index.mjs +0 -1
- package/node_modules/typebox/build/schema/engine/schema.mjs +5 -10
- package/node_modules/typebox/build/schema/engine/type.mjs +14 -18
- package/node_modules/typebox/build/schema/types/dependencies.mjs +1 -1
- package/node_modules/typebox/build/schema/types/index.d.mts +0 -1
- package/node_modules/typebox/build/schema/types/index.mjs +0 -1
- package/node_modules/typebox/build/schema/types/schema.d.mts +1 -1
- package/node_modules/typebox/build/schema/types/schema.mjs +2 -2
- package/node_modules/typebox/build/system/locale/ar_001.mjs +0 -1
- package/node_modules/typebox/build/system/locale/bn_BD.mjs +0 -1
- package/node_modules/typebox/build/system/locale/cs_CZ.mjs +0 -1
- package/node_modules/typebox/build/system/locale/de_DE.mjs +0 -1
- package/node_modules/typebox/build/system/locale/el_GR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/en_US.mjs +0 -1
- package/node_modules/typebox/build/system/locale/es_419.mjs +0 -1
- package/node_modules/typebox/build/system/locale/es_AR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/es_ES.mjs +0 -1
- package/node_modules/typebox/build/system/locale/es_MX.mjs +0 -1
- package/node_modules/typebox/build/system/locale/fa_IR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/fil_PH.mjs +0 -1
- package/node_modules/typebox/build/system/locale/fr_CA.mjs +0 -1
- package/node_modules/typebox/build/system/locale/fr_FR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ha_NG.mjs +0 -1
- package/node_modules/typebox/build/system/locale/hi_IN.mjs +0 -1
- package/node_modules/typebox/build/system/locale/hu_HU.mjs +0 -1
- package/node_modules/typebox/build/system/locale/id_ID.mjs +0 -1
- package/node_modules/typebox/build/system/locale/it_IT.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ja_JP.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ko_KR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ms_MY.mjs +0 -1
- package/node_modules/typebox/build/system/locale/nl_NL.mjs +0 -1
- package/node_modules/typebox/build/system/locale/pl_PL.mjs +0 -1
- package/node_modules/typebox/build/system/locale/pt_BR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/pt_PT.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ro_RO.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ru_RU.mjs +0 -1
- package/node_modules/typebox/build/system/locale/sv_SE.mjs +0 -1
- package/node_modules/typebox/build/system/locale/sw_TZ.mjs +0 -1
- package/node_modules/typebox/build/system/locale/th_TH.mjs +0 -1
- package/node_modules/typebox/build/system/locale/tr_TR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/uk_UA.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ur_PK.mjs +0 -1
- package/node_modules/typebox/build/system/locale/vi_VN.mjs +0 -1
- package/node_modules/typebox/build/system/locale/yo_NG.mjs +0 -1
- package/node_modules/typebox/build/system/locale/zh_Hans.mjs +0 -1
- package/node_modules/typebox/build/system/locale/zh_Hant.mjs +0 -1
- package/node_modules/typebox/build/system/memory/clone.d.mts +2 -3
- package/node_modules/typebox/build/system/memory/clone.mjs +73 -26
- package/node_modules/typebox/build/system/settings/settings.d.mts +15 -0
- package/node_modules/typebox/build/system/settings/settings.mjs +3 -1
- package/node_modules/typebox/build/type/action/_add_immutable.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_add_immutable.mjs +11 -0
- package/node_modules/typebox/build/type/action/_add_optional.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_add_optional.mjs +11 -0
- package/node_modules/typebox/build/type/action/_add_readonly.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_add_readonly.mjs +11 -0
- package/node_modules/typebox/build/type/action/_remove_immutable.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_remove_immutable.mjs +11 -0
- package/node_modules/typebox/build/type/action/_remove_optional.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_remove_optional.mjs +11 -0
- package/node_modules/typebox/build/type/action/_remove_readonly.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_remove_readonly.mjs +11 -0
- package/node_modules/typebox/build/type/action/conditional.d.mts +2 -3
- package/node_modules/typebox/build/type/action/conditional.mjs +2 -1
- package/node_modules/typebox/build/type/action/index.d.mts +7 -4
- package/node_modules/typebox/build/type/action/index.mjs +7 -4
- package/node_modules/typebox/build/type/action/mapped.d.mts +2 -3
- package/node_modules/typebox/build/type/action/mapped.mjs +2 -1
- package/node_modules/typebox/build/type/action/module.d.mts +8 -7
- package/node_modules/typebox/build/type/action/module.mjs +7 -6
- package/node_modules/typebox/build/type/action/readonly_object.d.mts +0 -5
- package/node_modules/typebox/build/type/action/readonly_object.mjs +0 -5
- package/node_modules/typebox/build/type/action/with.d.mts +11 -0
- package/node_modules/typebox/build/type/action/with.mjs +11 -0
- package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +1 -1
- package/node_modules/typebox/build/type/engine/call/instantiate.d.mts +1 -3
- package/node_modules/typebox/build/type/engine/call/instantiate.mjs +3 -2
- package/node_modules/typebox/build/type/engine/call/resolve_arguments.mjs +2 -2
- package/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.d.mts +3 -4
- package/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.mjs +2 -1
- package/node_modules/typebox/build/type/engine/cyclic/candidates.d.mts +2 -3
- package/node_modules/typebox/build/type/engine/cyclic/candidates.mjs +3 -6
- package/node_modules/typebox/build/type/engine/cyclic/check.d.mts +6 -9
- package/node_modules/typebox/build/type/engine/cyclic/check.mjs +10 -16
- package/node_modules/typebox/build/type/engine/cyclic/dependencies.d.mts +1 -4
- package/node_modules/typebox/build/type/engine/cyclic/dependencies.mjs +9 -15
- package/node_modules/typebox/build/type/engine/cyclic/extends.d.mts +1 -4
- package/node_modules/typebox/build/type/engine/cyclic/extends.mjs +8 -14
- package/node_modules/typebox/build/type/engine/cyclic/instantiate.d.mts +2 -5
- package/node_modules/typebox/build/type/engine/cyclic/instantiate.mjs +3 -2
- package/node_modules/typebox/build/type/engine/enum/index.d.mts +0 -1
- package/node_modules/typebox/build/type/engine/enum/index.mjs +0 -1
- package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +1 -2
- package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +2 -6
- package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +10 -6
- package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +10 -6
- package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +2 -1
- package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +3 -3
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +17 -5
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +34 -8
- package/node_modules/typebox/build/type/engine/exclude/operation.d.mts +5 -6
- package/node_modules/typebox/build/type/engine/exclude/operation.mjs +11 -12
- package/node_modules/typebox/build/type/engine/extract/operation.d.mts +5 -6
- package/node_modules/typebox/build/type/engine/extract/operation.mjs +11 -12
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs +14 -0
- package/node_modules/typebox/build/type/engine/immutable/instantiate_remove.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/immutable/instantiate_remove.mjs +14 -0
- package/node_modules/typebox/build/type/engine/index.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/index.mjs +2 -2
- package/node_modules/typebox/build/type/engine/indexable/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/indexable/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/indexable/from_enum.d.mts +3 -3
- package/node_modules/typebox/build/type/engine/indexable/from_enum.mjs +4 -4
- package/node_modules/typebox/build/type/engine/indexable/from_template_literal.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/indexable/from_template_literal.mjs +3 -3
- package/node_modules/typebox/build/type/engine/indexable/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/indexable/from_type.mjs +9 -6
- package/node_modules/typebox/build/type/engine/indexed/instantiate.d.mts +2 -1
- package/node_modules/typebox/build/type/engine/indexed/instantiate.mjs +5 -2
- package/node_modules/typebox/build/type/engine/instantiate.d.mts +44 -31
- package/node_modules/typebox/build/type/engine/instantiate.mjs +82 -83
- package/node_modules/typebox/build/type/engine/interface/instantiate.d.mts +3 -6
- package/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.mjs +3 -3
- package/node_modules/typebox/build/type/engine/keyof/instantiate.d.mts +2 -1
- package/node_modules/typebox/build/type/engine/keyof/instantiate.mjs +5 -1
- package/node_modules/typebox/build/type/engine/mapped/mapped_operation.d.mts +4 -4
- package/node_modules/typebox/build/type/engine/mapped/mapped_operation.mjs +3 -3
- package/node_modules/typebox/build/type/engine/mapped/mapped_variants.d.mts +5 -4
- package/node_modules/typebox/build/type/engine/mapped/mapped_variants.mjs +10 -5
- package/node_modules/typebox/build/type/engine/module/instantiate.d.mts +7 -9
- package/node_modules/typebox/build/type/engine/module/instantiate.mjs +17 -15
- package/node_modules/typebox/build/type/engine/object/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/object/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/object/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/object/from_type.mjs +8 -5
- package/node_modules/typebox/build/type/engine/object/from_union.mjs +2 -2
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs +14 -0
- package/node_modules/typebox/build/type/engine/optional/instantiate_remove.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/optional/instantiate_remove.mjs +14 -0
- package/node_modules/typebox/build/type/engine/parameters/instantiate.d.mts +3 -4
- package/node_modules/typebox/build/type/engine/parameters/instantiate.mjs +2 -1
- package/node_modules/typebox/build/type/engine/partial/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/partial/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/partial/from_intersect.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/partial/from_intersect.mjs +3 -2
- package/node_modules/typebox/build/type/engine/partial/from_object.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/partial/from_object.mjs +2 -2
- package/node_modules/typebox/build/type/engine/partial/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/partial/from_type.mjs +7 -4
- package/node_modules/typebox/build/type/engine/priority/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/priority/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/priority/priority.d.mts +20 -0
- package/node_modules/typebox/build/type/engine/priority/priority.mjs +28 -0
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs +14 -0
- package/node_modules/typebox/build/type/engine/readonly/instantiate_remove.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/readonly/instantiate_remove.mjs +14 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_array.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_array.mjs +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_intersect.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/readonly_object/from_intersect.mjs +3 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_object.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_object.mjs +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_tuple.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_tuple.mjs +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/readonly_object/from_type.mjs +8 -5
- package/node_modules/typebox/build/type/engine/record/from_key_enum.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/record/from_key_enum.mjs +2 -2
- package/node_modules/typebox/build/type/engine/record/from_key_template_literal.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/record/from_key_template_literal.mjs +2 -2
- package/node_modules/typebox/build/type/engine/ref/instantiate.d.mts +3 -3
- package/node_modules/typebox/build/type/engine/ref/instantiate.mjs +6 -6
- package/node_modules/typebox/build/type/engine/required/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/required/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/required/from_intersect.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/required/from_intersect.mjs +3 -2
- package/node_modules/typebox/build/type/engine/required/from_object.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/required/from_object.mjs +2 -2
- package/node_modules/typebox/build/type/engine/required/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/required/from_type.mjs +7 -4
- package/node_modules/typebox/build/type/engine/template_literal/decode.mjs +3 -3
- package/node_modules/typebox/build/type/engine/template_literal/encode.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/template_literal/encode.mjs +6 -6
- package/node_modules/typebox/build/type/engine/template_literal/is_finite.mjs +1 -1
- package/node_modules/typebox/build/type/engine/template_literal/is_pattern.mjs +1 -0
- package/node_modules/typebox/build/type/engine/this/expand_this.d.mts +1 -4
- package/node_modules/typebox/build/type/engine/this/expand_this.mjs +7 -13
- package/node_modules/typebox/build/type/engine/with/instantiate.d.mts +8 -0
- package/node_modules/typebox/build/type/engine/{options → with}/instantiate.mjs +5 -5
- package/node_modules/typebox/build/type/extends/dependent.d.mts +6 -0
- package/node_modules/typebox/build/type/extends/dependent.mjs +6 -0
- package/node_modules/typebox/build/type/extends/enum.d.mts +4 -4
- package/node_modules/typebox/build/type/extends/enum.mjs +3 -2
- package/node_modules/typebox/build/type/extends/extends_left.d.mts +5 -7
- package/node_modules/typebox/build/type/extends/extends_left.mjs +24 -27
- package/node_modules/typebox/build/type/extends/extends_right.d.mts +7 -5
- package/node_modules/typebox/build/type/extends/extends_right.mjs +20 -15
- package/node_modules/typebox/build/type/extends/inference.mjs +1 -1
- package/node_modules/typebox/build/type/extends/object.d.mts +8 -1
- package/node_modules/typebox/build/type/extends/object.mjs +25 -3
- package/node_modules/typebox/build/type/extends/parameters.mjs +2 -2
- package/node_modules/typebox/build/type/extends/record.d.mts +13 -0
- package/node_modules/typebox/build/type/extends/record.mjs +23 -0
- package/node_modules/typebox/build/type/extends/template_literal.d.mts +3 -3
- package/node_modules/typebox/build/type/extends/template_literal.mjs +3 -3
- package/node_modules/typebox/build/type/extends/tuple.d.mts +3 -6
- package/node_modules/typebox/build/type/extends/tuple.mjs +6 -5
- package/node_modules/typebox/build/type/extends/union.mjs +2 -2
- package/node_modules/typebox/build/type/script/mapping.d.mts +84 -99
- package/node_modules/typebox/build/type/script/mapping.mjs +81 -85
- package/node_modules/typebox/build/type/script/parser.d.mts +40 -40
- package/node_modules/typebox/build/type/script/parser.mjs +22 -22
- package/node_modules/typebox/build/type/script/script.d.mts +3 -4
- package/node_modules/typebox/build/type/script/script.mjs +3 -2
- package/node_modules/typebox/build/type/script/token/internal/guard.d.mts +1 -1
- package/node_modules/typebox/build/type/script/token/internal/guard.mjs +1 -1
- package/node_modules/typebox/build/type/script/token/internal/take.mjs +1 -1
- package/node_modules/typebox/build/type/script/token/until.mjs +2 -2
- package/node_modules/typebox/build/type/types/_codec.d.mts +12 -12
- package/node_modules/typebox/build/type/types/_codec.mjs +0 -1
- package/node_modules/typebox/build/type/types/_immutable.d.mts +2 -9
- package/node_modules/typebox/build/type/types/_immutable.mjs +2 -10
- package/node_modules/typebox/build/type/types/_optional.d.mts +2 -9
- package/node_modules/typebox/build/type/types/_optional.mjs +2 -11
- package/node_modules/typebox/build/type/types/_readonly.d.mts +2 -9
- package/node_modules/typebox/build/type/types/_readonly.mjs +2 -10
- package/node_modules/typebox/build/type/types/_refine.d.mts +8 -10
- package/node_modules/typebox/build/type/types/_refine.mjs +1 -2
- package/node_modules/typebox/build/type/types/call.d.mts +3 -3
- package/node_modules/typebox/build/type/types/call.mjs +3 -2
- package/node_modules/typebox/build/type/types/deferred.d.mts +1 -0
- package/node_modules/typebox/build/type/types/deferred.mjs +1 -1
- package/node_modules/typebox/build/type/types/dependent.d.mts +17 -0
- package/node_modules/typebox/build/type/types/dependent.mjs +24 -0
- package/node_modules/typebox/build/type/types/enum.d.mts +3 -1
- package/node_modules/typebox/build/type/types/enum.mjs +5 -0
- package/node_modules/typebox/build/type/types/index.d.mts +1 -4
- package/node_modules/typebox/build/type/types/index.mjs +1 -4
- package/node_modules/typebox/build/type/types/number.d.mts +1 -1
- package/node_modules/typebox/build/type/types/number.mjs +1 -1
- package/node_modules/typebox/build/type/types/record.d.mts +13 -7
- package/node_modules/typebox/build/type/types/record.mjs +15 -9
- package/node_modules/typebox/build/type/types/static.d.mts +2 -5
- package/node_modules/typebox/build/typebox.d.mts +4 -8
- package/node_modules/typebox/build/typebox.mjs +4 -8
- package/node_modules/typebox/build/value/clean/clean.mjs +4 -2
- package/node_modules/typebox/build/value/clean/from_intersect.mjs +2 -2
- package/node_modules/typebox/build/value/clean/from_type.mjs +8 -10
- package/node_modules/typebox/build/value/clean/from_union.d.mts +1 -1
- package/node_modules/typebox/build/value/clean/from_union.mjs +1 -2
- package/node_modules/typebox/build/value/clone/clone.mjs +2 -73
- package/node_modules/typebox/build/value/codec/decode.mjs +4 -2
- package/node_modules/typebox/build/value/codec/encode.mjs +4 -2
- package/node_modules/typebox/build/value/codec/from_array.mjs +1 -4
- package/node_modules/typebox/build/value/codec/from_object.mjs +1 -4
- package/node_modules/typebox/build/value/codec/from_record.mjs +2 -7
- package/node_modules/typebox/build/value/codec/from_tuple.mjs +1 -4
- package/node_modules/typebox/build/value/codec/from_union.mjs +2 -3
- package/node_modules/typebox/build/value/convert/from_enum.mjs +3 -4
- package/node_modules/typebox/build/value/convert/from_template_literal.d.mts +1 -1
- package/node_modules/typebox/build/value/convert/from_template_literal.mjs +2 -3
- package/node_modules/typebox/build/value/convert/from_type.mjs +19 -21
- package/node_modules/typebox/build/value/create/from_enum.mjs +2 -2
- package/node_modules/typebox/build/value/create/from_type.mjs +23 -31
- package/node_modules/typebox/build/value/default/from_object.mjs +1 -1
- package/node_modules/typebox/build/value/default/from_type.mjs +8 -10
- package/node_modules/typebox/build/value/index.d.mts +0 -1
- package/node_modules/typebox/build/value/index.mjs +0 -1
- package/node_modules/typebox/build/value/repair/from_enum.mjs +2 -3
- package/node_modules/typebox/build/value/repair/from_type.mjs +24 -22
- package/node_modules/typebox/build/value/shared/union_priority_sort.d.mts +6 -2
- package/node_modules/typebox/build/value/shared/union_priority_sort.mjs +62 -26
- package/node_modules/typebox/build/value/value.d.mts +0 -1
- package/node_modules/typebox/build/value/value.mjs +0 -1
- package/node_modules/typebox/package.json +25 -25
- package/node_modules/typebox/readme.md +97 -80
- package/node_modules/undici-types/agent.d.ts +0 -2
- package/node_modules/undici-types/client.d.ts +25 -19
- package/node_modules/undici-types/dispatcher.d.ts +7 -33
- package/node_modules/undici-types/dispatcher1-wrapper.d.ts +7 -0
- package/node_modules/undici-types/fetch.d.ts +24 -4
- package/node_modules/undici-types/h2c-client.d.ts +6 -6
- package/node_modules/undici-types/handlers.d.ts +1 -2
- package/node_modules/undici-types/header.d.ts +5 -0
- package/node_modules/undici-types/index.d.ts +3 -1
- package/node_modules/undici-types/interceptors.d.ts +1 -1
- package/node_modules/undici-types/package.json +1 -1
- package/node_modules/undici-types/pool.d.ts +0 -2
- package/node_modules/undici-types/proxy-agent.d.ts +2 -2
- package/node_modules/undici-types/round-robin-pool.d.ts +0 -2
- package/node_modules/undici-types/snapshot-agent.d.ts +4 -0
- package/node_modules/undici-types/socks5-proxy-agent.d.ts +2 -2
- package/node_modules/undici-types/webidl.d.ts +0 -1
- package/npm-shrinkwrap.json +85 -85
- package/openclaw.plugin.json +1 -1
- package/package.json +6 -6
- package/dist/gateway-registry-DPxmW0Db.js +0 -74
- package/dist/provider.runtime-CqZpKOCE.js +0 -2
- package/dist/runtime-api.monitor-ChuqOjHq.js +0 -6
- package/dist/targets-BA7gf0K0.js +0 -3
- package/node_modules/@types/node/compatibility/iterators.d.ts +0 -21
- package/node_modules/typebox/build/schema/engine/_guard.d.mts +0 -6
- package/node_modules/typebox/build/schema/engine/_guard.mjs +0 -26
- package/node_modules/typebox/build/schema/types/_guard.d.mts +0 -10
- package/node_modules/typebox/build/schema/types/_guard.mjs +0 -16
- package/node_modules/typebox/build/type/action/_optional.d.mts +0 -19
- package/node_modules/typebox/build/type/action/_optional.mjs +0 -40
- package/node_modules/typebox/build/type/action/_readonly.d.mts +0 -19
- package/node_modules/typebox/build/type/action/_readonly.mjs +0 -40
- package/node_modules/typebox/build/type/action/awaited.d.mts +0 -15
- package/node_modules/typebox/build/type/action/awaited.mjs +0 -15
- package/node_modules/typebox/build/type/action/options.d.mts +0 -11
- package/node_modules/typebox/build/type/action/options.mjs +0 -11
- package/node_modules/typebox/build/type/engine/awaited/instantiate.d.mts +0 -11
- package/node_modules/typebox/build/type/engine/awaited/instantiate.mjs +0 -20
- package/node_modules/typebox/build/type/engine/enum/enum_to_union.d.mts +0 -14
- package/node_modules/typebox/build/type/engine/enum/enum_to_union.mjs +0 -24
- package/node_modules/typebox/build/type/engine/options/index.d.mts +0 -1
- package/node_modules/typebox/build/type/engine/options/index.mjs +0 -1
- package/node_modules/typebox/build/type/engine/options/instantiate.d.mts +0 -8
- package/node_modules/typebox/build/type/extends/async_iterator.d.mts +0 -7
- package/node_modules/typebox/build/type/extends/async_iterator.mjs +0 -9
- package/node_modules/typebox/build/type/extends/iterator.d.mts +0 -7
- package/node_modules/typebox/build/type/extends/iterator.mjs +0 -9
- package/node_modules/typebox/build/type/extends/promise.d.mts +0 -7
- package/node_modules/typebox/build/type/extends/promise.mjs +0 -9
- package/node_modules/typebox/build/type/types/async_iterator.d.mts +0 -20
- package/node_modules/typebox/build/type/types/async_iterator.mjs +0 -28
- package/node_modules/typebox/build/type/types/base.d.mts +0 -50
- package/node_modules/typebox/build/type/types/base.mjs +0 -84
- package/node_modules/typebox/build/type/types/iterator.d.mts +0 -20
- package/node_modules/typebox/build/type/types/iterator.mjs +0 -28
- package/node_modules/typebox/build/type/types/promise.d.mts +0 -21
- package/node_modules/typebox/build/type/types/promise.mjs +0 -29
- package/node_modules/typebox/build/value/clean/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/clean/from_base.mjs +0 -4
- package/node_modules/typebox/build/value/convert/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/convert/from_base.mjs +0 -4
- package/node_modules/typebox/build/value/create/from_async_iterator.d.mts +0 -2
- package/node_modules/typebox/build/value/create/from_async_iterator.mjs +0 -5
- package/node_modules/typebox/build/value/create/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/create/from_base.mjs +0 -4
- package/node_modules/typebox/build/value/create/from_iterator.d.mts +0 -2
- package/node_modules/typebox/build/value/create/from_iterator.mjs +0 -5
- package/node_modules/typebox/build/value/create/from_promise.d.mts +0 -2
- package/node_modules/typebox/build/value/create/from_promise.mjs +0 -5
- package/node_modules/typebox/build/value/default/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/default/from_base.mjs +0 -5
- package/node_modules/typebox/build/value/mutate/error.d.mts +0 -3
- package/node_modules/typebox/build/value/mutate/error.mjs +0 -6
- package/node_modules/typebox/build/value/mutate/from_array.d.mts +0 -2
- package/node_modules/typebox/build/value/mutate/from_array.mjs +0 -16
- package/node_modules/typebox/build/value/mutate/from_object.d.mts +0 -2
- package/node_modules/typebox/build/value/mutate/from_object.mjs +0 -40
- package/node_modules/typebox/build/value/mutate/from_unknown.d.mts +0 -2
- package/node_modules/typebox/build/value/mutate/from_unknown.mjs +0 -7
- package/node_modules/typebox/build/value/mutate/from_value.d.mts +0 -2
- package/node_modules/typebox/build/value/mutate/from_value.mjs +0 -12
- package/node_modules/typebox/build/value/mutate/index.d.mts +0 -1
- package/node_modules/typebox/build/value/mutate/index.mjs +0 -1
- package/node_modules/typebox/build/value/mutate/mutate.d.mts +0 -11
- package/node_modules/typebox/build/value/mutate/mutate.mjs +0 -41
- package/node_modules/typebox/build/value/repair/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/repair/from_base.mjs +0 -8
- /package/node_modules/typebox/build/type/engine/{awaited → with}/index.d.mts +0 -0
- /package/node_modules/typebox/build/type/engine/{awaited → with}/index.mjs +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).wasmUtil={})}(this,(function(t){"use strict";const e="undefined"!=typeof WebAssembly?WebAssembly:"undefined"!=typeof WXWebAssembly?WXWebAssembly:void 0;if(!e)throw new Error("WebAssembly is not supported in this environment");function n(t,e){if(null===t||"object"!=typeof t)throw new TypeError(`${e} must be an object. Received ${null===t?"null":typeof t}`)}function r(t,e){if("string"!=typeof t)throw new TypeError(`${e} must be a string. Received ${null===t?"null":typeof t}`)}function i(t,e){if("function"!=typeof t)throw new TypeError(`${e} must be a function. Received ${null===t?"null":typeof t}`)}function s(t,e){if(void 0!==t)throw new TypeError(`${e} must be undefined. Received ${null===t?"null":typeof t}`)}function o(t){return!(!t||"object"!=typeof t&&"function"!=typeof t||"function"!=typeof t.then)}function a(t,e){const n=Object.create(null);return Object.keys(t).forEach((r=>{const i=t[r];Object.defineProperty(n,r,{enumerable:!0,value:e(i,r)})})),n}function c(t,e,n){return"function"==typeof SharedArrayBuffer&&t.buffer instanceof SharedArrayBuffer||"[object SharedArrayBuffer]"===Object.prototype.toString.call(t.buffer.constructor)?t.slice(e,n):t.subarray(e,n)}const u=["asyncify_get_state","asyncify_start_rewind","asyncify_start_unwind","asyncify_stop_rewind","asyncify_stop_unwind"];function f(t,e,n,r){if("function"!=typeof t.exports[r]||n<=0)return{wasm64:e,dataPtr:16,start:e?32:24,end:1024};const i=t.exports[r],s=e?Number(i(BigInt(16)+BigInt(n))):i(8+n);if(0===s)throw new Error("Allocate asyncify data failed");return e?{wasm64:e,dataPtr:s,start:s+16,end:s+16+n}:{wasm64:e,dataPtr:s,start:s+8,end:s+8+n}}class h{constructor(){this.value=void 0,this.exports=void 0,this.dataPtr=0}init(t,n,r){var i,s;if(this.exports)throw new Error("Asyncify has been initialized");if(!(t instanceof e.Memory))throw new TypeError("Require WebAssembly.Memory object");const o=n.exports;for(let t=0;t<u.length;++t)if("function"!=typeof o[u[t]])throw new TypeError("Invalid asyncify wasm");let a;const c=Boolean(r.wasm64);a=r.tryAllocate?!0===r.tryAllocate?f(n,c,4096,"malloc"):f(n,c,null!==(i=r.tryAllocate.size)&&void 0!==i?i:4096,null!==(s=r.tryAllocate.name)&&void 0!==s?s:"malloc"):{wasm64:c,dataPtr:16,start:c?32:24,end:1024},this.dataPtr=a.dataPtr,c?new BigInt64Array(t.buffer,this.dataPtr).set([BigInt(a.start),BigInt(a.end)]):new Int32Array(t.buffer,this.dataPtr).set([a.start,a.end]),this.exports=this.wrapExports(o,r.wrapExports);const h=Object.create(e.Instance.prototype);return Object.defineProperty(h,"exports",{value:this.exports}),h}assertState(){if(0!==this.exports.asyncify_get_state())throw new Error("Asyncify state error")}wrapImportFunction(t){const e=this;return function(){for(;2===e.exports.asyncify_get_state();)return e.exports.asyncify_stop_rewind(),e.value;e.assertState();const n=t.apply(this,arguments);if(!o(n))return n;e.exports.asyncify_start_unwind(e.dataPtr),e.value=n}}wrapImports(t){const e={};return Object.keys(t).forEach((n=>{const r=t[n],i={};Object.keys(r).forEach((t=>{const e=r[t];i[t]="function"==typeof e?this.wrapImportFunction(e):e})),e[n]=i})),e}wrapExportFunction(t){const e=this;return async function(){e.assertState();let n=t.apply(this,arguments);for(;1===e.exports.asyncify_get_state();)e.exports.asyncify_stop_unwind(),e.value=await e.value,e.assertState(),e.exports.asyncify_start_rewind(e.dataPtr),n=t.call(this);return e.assertState(),n}}wrapExports(t,e){return a(t,((t,n)=>{let r=-1!==u.indexOf(n)||"function"!=typeof t;return Array.isArray(e)&&(r=r||-1===e.indexOf(n)),r?t:this.wrapExportFunction(t)}))}}function d(t){if(t&&"object"!=typeof t)throw new TypeError("imports must be an object or undefined")}function g(t,n){return"undefined"!=typeof wx&&"undefined"!=typeof __wxConfig?e.instantiate(t,n):fetch(t).then((t=>t.arrayBuffer())).then((t=>e.instantiate(t,n)))}function l(t,n){let r;if(d(n),n=null!=n?n:{},t instanceof ArrayBuffer||ArrayBuffer.isView(t))return e.instantiate(t,n);if(t instanceof e.Module)return e.instantiate(t,n).then((e=>({instance:e,module:t})));if("string"!=typeof t&&!(t instanceof URL))throw new TypeError("Invalid source");if("function"==typeof e.instantiateStreaming){let i;try{i=fetch(t),r=e.instantiateStreaming(i,n).catch((()=>g(t,n)))}catch(e){r=g(t,n)}}else r=g(t,n);return r}function _(t,n){let r;if(d(n),n=null!=n?n:{},t instanceof ArrayBuffer||ArrayBuffer.isView(t))r=new e.Module(t);else{if(!(t instanceof WebAssembly.Module))throw new TypeError("Invalid source");r=t}return{instance:new e.Instance(r,n),module:r}}const p=46,y=47,E=92,I=58,m=65,A=90,b=97,T=122;function w(t){return t===y||t===E}function B(t){return t>=m&&t<=A||t>=b&&t<=T}const N="undefined"!=typeof process&&"win32"===process.platform;function S(t){return t===y}function P(t,e,n,r){let i="",s=0,o=-1,a=0,c=0;for(let u=0;u<=t.length;++u){if(u<t.length)c=t.charCodeAt(u);else{if(r(c))break;c=y}if(r(c)){if(o===u-1||1===a);else if(2===a){if(i.length<2||2!==s||i.charCodeAt(i.length-1)!==p||i.charCodeAt(i.length-2)!==p){if(i.length>2){const t=i.indexOf(n);-1===t?(i="",s=0):(i=i.slice(0,t),s=i.length-1-i.indexOf(n)),o=u,a=0;continue}if(0!==i.length){i="",s=0,o=u,a=0;continue}}e&&(i+=i.length>0?`${n}..`:"..",s=2)}else i.length>0?i+=`${n}${t.slice(o+1,u)}`:i=t.slice(o+1,u),s=u-o-1;o=u,a=0}else c===p&&-1!==a?++a:a=-1}return i}function D(...t){if(N)return function(t){let e="",n="",i=!1;for(let s=t.length-1;s>=-1;s--){let o;if(s>=0){if(o=t[s],r(o,"path"),0===o.length)continue}else if(0===e.length)o="undefined"!=typeof process&&"function"==typeof process.cwd?process.cwd():"";else{const t=`=${e}`,n="undefined"!=typeof process?process.env:void 0;o=n&&"string"==typeof n[t]?n[t]:"undefined"!=typeof process&&"function"==typeof process.cwd?process.cwd():"",(void 0===o||o.slice(0,2).toLowerCase()!==e.toLowerCase()&&o.charCodeAt(2)===E)&&(o=`${e}\\`)}const a=o.length;let c=0,u="",f=!1;const h=o.charCodeAt(0);if(1===a)w(h)&&(c=1,f=!0);else if(w(h))if(f=!0,w(o.charCodeAt(1))){let t=2,e=t;for(;t<a&&!w(o.charCodeAt(t));)t++;if(t<a&&t!==e){const n=o.slice(e,t);for(e=t;t<a&&w(o.charCodeAt(t));)t++;if(t<a&&t!==e){for(e=t;t<a&&!w(o.charCodeAt(t));)t++;t!==a&&t===e||(u=`\\\\${n}\\${o.slice(e,t)}`,c=t)}}}else c=1;else B(h)&&o.charCodeAt(1)===I&&(u=o.slice(0,2),c=2,a>2&&w(o.charCodeAt(2))&&(f=!0,c=3));if(u.length>0)if(e.length>0){if(u.toLowerCase()!==e.toLowerCase())continue}else e=u;if(i){if(e.length>0)break}else if(n=`${o.slice(c)}\\${n}`,i=f,f&&e.length>0)break}return n=P(n,!i,"\\",w),e+(i?"\\":"")+n||"."}(t);let e="",n=!1;for(let i=t.length-1;i>=-1&&!n;i--){const s=i>=0?t[i]:"/";r(s,"path"),0!==s.length&&(e=`${s}/${e}`,n=s.charCodeAt(0)===y)}return e=P(e,!n,"/",S),n?`/${e}`:e.length>0?e:"."}const F={FD_DATASYNC:BigInt(1)<<BigInt(0),FD_READ:BigInt(1)<<BigInt(1),FD_SEEK:BigInt(1)<<BigInt(2),FD_FDSTAT_SET_FLAGS:BigInt(1)<<BigInt(3),FD_SYNC:BigInt(1)<<BigInt(4),FD_TELL:BigInt(1)<<BigInt(5),FD_WRITE:BigInt(1)<<BigInt(6),FD_ADVISE:BigInt(1)<<BigInt(7),FD_ALLOCATE:BigInt(1)<<BigInt(8),PATH_CREATE_DIRECTORY:BigInt(1)<<BigInt(9),PATH_CREATE_FILE:BigInt(1)<<BigInt(10),PATH_LINK_SOURCE:BigInt(1)<<BigInt(11),PATH_LINK_TARGET:BigInt(1)<<BigInt(12),PATH_OPEN:BigInt(1)<<BigInt(13),FD_READDIR:BigInt(1)<<BigInt(14),PATH_READLINK:BigInt(1)<<BigInt(15),PATH_RENAME_SOURCE:BigInt(1)<<BigInt(16),PATH_RENAME_TARGET:BigInt(1)<<BigInt(17),PATH_FILESTAT_GET:BigInt(1)<<BigInt(18),PATH_FILESTAT_SET_SIZE:BigInt(1)<<BigInt(19),PATH_FILESTAT_SET_TIMES:BigInt(1)<<BigInt(20),FD_FILESTAT_GET:BigInt(1)<<BigInt(21),FD_FILESTAT_SET_SIZE:BigInt(1)<<BigInt(22),FD_FILESTAT_SET_TIMES:BigInt(1)<<BigInt(23),PATH_SYMLINK:BigInt(1)<<BigInt(24),PATH_REMOVE_DIRECTORY:BigInt(1)<<BigInt(25),PATH_UNLINK_FILE:BigInt(1)<<BigInt(26),POLL_FD_READWRITE:BigInt(1)<<BigInt(27),SOCK_SHUTDOWN:BigInt(1)<<BigInt(28),SOCK_ACCEPT:BigInt(1)<<BigInt(29)};class v extends Error{constructor(t,e){super(t),this.errno=e}getErrorMessage(){return function(t){switch(t){case 0:return"Success";case 1:return"Argument list too long";case 2:return"Permission denied";case 3:return"Address in use";case 4:return"Address not available";case 5:return"Address family not supported by protocol";case 6:return"Resource temporarily unavailable";case 7:return"Operation already in progress";case 8:return"Bad file descriptor";case 9:return"Bad message";case 10:return"Resource busy";case 11:return"Operation canceled";case 12:return"No child process";case 13:return"Connection aborted";case 14:return"Connection refused";case 15:return"Connection reset by peer";case 16:return"Resource deadlock would occur";case 17:return"Destination address required";case 18:return"Domain error";case 19:return"Quota exceeded";case 20:return"File exists";case 21:return"Bad address";case 22:return"File too large";case 23:return"Host is unreachable";case 24:return"Identifier removed";case 25:return"Illegal byte sequence";case 26:return"Operation in progress";case 27:return"Interrupted system call";case 28:return"Invalid argument";case 29:return"I/O error";case 30:return"Socket is connected";case 31:return"Is a directory";case 32:return"Symbolic link loop";case 33:return"No file descriptors available";case 34:return"Too many links";case 35:return"Message too large";case 36:return"Multihop attempted";case 37:return"Filename too long";case 38:return"Network is down";case 39:return"Connection reset by network";case 40:return"Network unreachable";case 41:return"Too many files open in system";case 42:return"No buffer space available";case 43:return"No such device";case 44:return"No such file or directory";case 45:return"Exec format error";case 46:return"No locks available";case 47:return"Link has been severed";case 48:return"Out of memory";case 49:return"No message of the desired type";case 50:return"Protocol not available";case 51:return"No space left on device";case 52:return"Function not implemented";case 53:return"Socket not connected";case 54:return"Not a directory";case 55:return"Directory not empty";case 56:return"State not recoverable";case 57:return"Not a socket";case 58:return"Not supported";case 59:return"Not a tty";case 60:return"No such device or address";case 61:return"Value too large for data type";case 62:return"Previous owner died";case 63:return"Operation not permitted";case 64:return"Broken pipe";case 65:return"Protocol error";case 66:return"Protocol not supported";case 67:return"Protocol wrong type for socket";case 68:return"Result not representable";case 69:return"Read-only file system";case 70:return"Invalid seek";case 71:return"No such process";case 72:return"Stale file handle";case 73:return"Operation timed out";case 74:return"Text file busy";case 75:return"Cross-device link";case 76:return"Capabilities insufficient";default:return"Unknown error"}}(this.errno)}}Object.defineProperty(v.prototype,"name",{configurable:!0,writable:!0,value:"WasiError"});const U=F.FD_DATASYNC|F.FD_READ|F.FD_SEEK|F.FD_FDSTAT_SET_FLAGS|F.FD_SYNC|F.FD_TELL|F.FD_WRITE|F.FD_ADVISE|F.FD_ALLOCATE|F.PATH_CREATE_DIRECTORY|F.PATH_CREATE_FILE|F.PATH_LINK_SOURCE|F.PATH_LINK_TARGET|F.PATH_OPEN|F.FD_READDIR|F.PATH_READLINK|F.PATH_RENAME_SOURCE|F.PATH_RENAME_TARGET|F.PATH_FILESTAT_GET|F.PATH_FILESTAT_SET_SIZE|F.PATH_FILESTAT_SET_TIMES|F.FD_FILESTAT_GET|F.FD_FILESTAT_SET_TIMES|F.FD_FILESTAT_SET_SIZE|F.PATH_SYMLINK|F.PATH_UNLINK_FILE|F.PATH_REMOVE_DIRECTORY|F.POLL_FD_READWRITE|F.SOCK_SHUTDOWN|F.SOCK_ACCEPT,R=U,L=U,H=U,O=U,C=F.FD_DATASYNC|F.FD_READ|F.FD_SEEK|F.FD_FDSTAT_SET_FLAGS|F.FD_SYNC|F.FD_TELL|F.FD_WRITE|F.FD_ADVISE|F.FD_ALLOCATE|F.FD_FILESTAT_GET|F.FD_FILESTAT_SET_SIZE|F.FD_FILESTAT_SET_TIMES|F.POLL_FD_READWRITE,k=BigInt(0),x=F.FD_FDSTAT_SET_FLAGS|F.FD_SYNC|F.FD_ADVISE|F.PATH_CREATE_DIRECTORY|F.PATH_CREATE_FILE|F.PATH_LINK_SOURCE|F.PATH_LINK_TARGET|F.PATH_OPEN|F.FD_READDIR|F.PATH_READLINK|F.PATH_RENAME_SOURCE|F.PATH_RENAME_TARGET|F.PATH_FILESTAT_GET|F.PATH_FILESTAT_SET_SIZE|F.PATH_FILESTAT_SET_TIMES|F.FD_FILESTAT_GET|F.FD_FILESTAT_SET_TIMES|F.PATH_SYMLINK|F.PATH_UNLINK_FILE|F.PATH_REMOVE_DIRECTORY|F.POLL_FD_READWRITE,M=x|C,W=F.FD_READ|F.FD_FDSTAT_SET_FLAGS|F.FD_WRITE|F.FD_FILESTAT_GET|F.POLL_FD_READWRITE|F.SOCK_SHUTDOWN,z=U,K=F.FD_READ|F.FD_FDSTAT_SET_FLAGS|F.FD_WRITE|F.FD_FILESTAT_GET|F.POLL_FD_READWRITE,j=BigInt(0);function $(t,e,n,r){const i={base:BigInt(0),inheriting:BigInt(0)};if(0===r)throw new v("Unknown file type",28);switch(r){case 4:i.base=C,i.inheriting=k;break;case 3:i.base=x,i.inheriting=M;break;case 6:case 5:i.base=W,i.inheriting=z;break;case 2:-1!==t.indexOf(e)?(i.base=K,i.inheriting=j):(i.base=H,i.inheriting=O);break;case 1:i.base=R,i.inheriting=L;break;default:i.base=BigInt(0),i.inheriting=BigInt(0)}const s=3&n;return 0===s?i.base&=~F.FD_WRITE:1===s&&(i.base&=~F.FD_READ),i}function G(t,e){let n=0;if("number"==typeof e&&e>=0)n=e;else for(let e=0;e<t.length;e++){n+=t[e].length}let r=0;const i=new Uint8Array(n);for(let e=0;e<t.length;e++){const n=t[e];i.set(n,r),r+=n.length}return i}class Y{constructor(t,e,n,r,i,s,o,a){this.id=t,this.fd=e,this.path=n,this.realPath=r,this.type=i,this.rightsBase=s,this.rightsInheriting=o,this.preopen=a,this.pos=BigInt(0),this.size=BigInt(0)}seek(t,e){if(0===e)this.pos=BigInt(t);else if(1===e)this.pos+=BigInt(t);else{if(2!==e)throw new v("Unknown whence",29);this.pos=BigInt(this.size)-BigInt(t)}return this.pos}}class V extends Y{constructor(t,e,n,r,i,s,o,a,c){super(e,n,r,i,s,o,a,c),this._log=t,this._buf=null}write(t){const e=t;if(this._buf&&(t=G([this._buf,t]),this._buf=null),-1===t.indexOf(10))return this._buf=t,e.byteLength;let n,r=0,i=0;for(;-1!==(n=t.indexOf(10,r));){const e=(new TextDecoder).decode(t.subarray(i,n));this._log(e),r+=n-i+1,i=n+1}return r<t.length&&(this._buf=t.slice(r)),e.byteLength}}function Z(t){return t.isBlockDevice()?1:t.isCharacterDevice()?2:t.isDirectory()?3:t.isSocket()?6:t.isFile()?4:t.isSymbolicLink()?7:0}function q(t,e,n){t.setBigUint64(e,n.dev,!0),t.setBigUint64(e+8,n.ino,!0),t.setBigUint64(e+16,BigInt(Z(n)),!0),t.setBigUint64(e+24,n.nlink,!0),t.setBigUint64(e+32,n.size,!0),t.setBigUint64(e+40,n.atimeMs*BigInt(1e6),!0),t.setBigUint64(e+48,n.mtimeMs*BigInt(1e6),!0),t.setBigUint64(e+56,n.ctimeMs*BigInt(1e6),!0)}class X{constructor(t){this.used=0,this.size=t.size,this.fds=Array(t.size),this.stdio=[t.in,t.out,t.err],this.print=t.print,this.printErr=t.printErr,this.insertStdio(t.in,0,"<stdin>"),this.insertStdio(t.out,1,"<stdout>"),this.insertStdio(t.err,2,"<stderr>")}insertStdio(t,e,n){const{base:r,inheriting:i}=$(this.stdio,t,2,2),s=this.insert(t,n,n,2,r,i,0);if(s.id!==e)throw new v(`id: ${s.id} !== expected: ${e}`,8);return s}insert(t,e,n,r,i,s,o){var a,c;let u,f=-1;if(this.used>=this.size){const t=2*this.size;this.fds.length=t,f=this.size,this.size=t}else for(let t=0;t<this.size;++t)if(null==this.fds[t]){f=t;break}return u="<stdout>"===e?new V(null!==(a=this.print)&&void 0!==a?a:console.log,f,t,e,n,r,i,s,o):"<stderr>"===e?new V(null!==(c=this.printErr)&&void 0!==c?c:console.error,f,t,e,n,r,i,s,o):new Y(f,t,e,n,r,i,s,o),this.fds[f]=u,this.used++,u}get(t,e,n){if(t>=this.size)throw new v("Invalid fd",8);const r=this.fds[t];if(!r||r.id!==t)throw new v("Bad file descriptor",8);if((~r.rightsBase&e)!==BigInt(0)||(~r.rightsInheriting&n)!==BigInt(0))throw new v("Capabilities insufficient",76);return r}remove(t){if(t>=this.size)throw new v("Invalid fd",8);const e=this.fds[t];if(!e||e.id!==t)throw new v("Bad file descriptor",8);this.fds[t]=void 0,this.used--}}class Q extends X{constructor(t){super(t),this.fs=t.fs}getFileTypeByFd(t){return Z(this.fs.fstatSync(t,{bigint:!0}))}insertPreopen(t,e,n){const r=this.getFileTypeByFd(t);if(3!==r)throw new v(`Preopen not dir: ["${e}", "${n}"]`,54);const i=$(this.stdio,t,0,r);return this.insert(t,e,n,r,i.base,i.inheriting,1)}renumber(t,e){if(t===e)return;if(t>=this.size||e>=this.size)throw new v("Invalid fd",8);const n=this.fds[t],r=this.fds[e];if(!n||!r||n.id!==t||r.id!==e)throw new v("Invalid fd",8);this.fs.closeSync(n.fd),this.fds[t]=this.fds[e],this.fds[t].id=t,this.fds[e]=void 0,this.used--}}class J extends X{constructor(t){super(t)}async getFileTypeByFd(t){return Z(await t.stat({bigint:!0}))}async insertPreopen(t,e,n){const r=await this.getFileTypeByFd(t);if(3!==r)throw new v(`Preopen not dir: ["${e}", "${n}"]`,54);const i=$(this.stdio,t.fd,0,r);return this.insert(t,e,n,r,i.base,i.inheriting,1)}async renumber(t,e){if(t===e)return;if(t>=this.size||e>=this.size)throw new v("Invalid fd",8);const n=this.fds[t],r=this.fds[e];if(!n||!r||n.id!==t||r.id!==e)throw new v("Invalid fd",8);await n.fd.close(),this.fds[t]=this.fds[e],this.fds[t].id=t,this.fds[e]=void 0,this.used--}}const tt=function(){return e.Memory}();class et extends tt{constructor(t){super(t)}get HEAP8(){return new Int8Array(super.buffer)}get HEAPU8(){return new Uint8Array(super.buffer)}get HEAP16(){return new Int16Array(super.buffer)}get HEAPU16(){return new Uint16Array(super.buffer)}get HEAP32(){return new Int32Array(super.buffer)}get HEAPU32(){return new Uint32Array(super.buffer)}get HEAP64(){return new BigInt64Array(super.buffer)}get HEAPU64(){return new BigUint64Array(super.buffer)}get HEAPF32(){return new Float32Array(super.buffer)}get HEAPF64(){return new Float64Array(super.buffer)}get view(){return new DataView(super.buffer)}}function nt(t){return Object.getPrototypeOf(t)===e.Memory.prototype&&Object.setPrototypeOf(t,et.prototype),t}function rt(){const t=e.Function;if("function"!=typeof t)throw new Error('WebAssembly.Function is not supported in this environment. If you are using V8 based browser like Chrome, try to specify --js-flags="--wasm-staging --experimental-wasm-stack-switching"');return t}function it(t,e,n){const r=rt();if("function"!=typeof t)throw new TypeError("Function required");const i=e.slice(0);return i.unshift("externref"),new r({parameters:i,results:n},t,{suspending:"first"})}function st(t){const e=rt();if("function"!=typeof t)throw new TypeError("Function required");return new e({parameters:[...e.type(t).parameters.slice(1)],results:["externref"]},t,{promising:"first"})}const ot="undefined"!=typeof process&&"win32"===process.platform;function at(t){let e=3&t;return 0!=(64&t)&&(e|=256),0!=(128&t)&&(e|=1024),0!=(512&t)&&(e|=512),0!=(1024&t)&&(e|=8),e}function ct(t,e){if(0===t.length||0===e.length)return 0;let n=0,r=e.length-n;for(let i=0;i<t.length;++i){const s=t[i];if(r<s.length)return s.set(e.subarray(n,n+r),0),n+=r,r=0,n;s.set(e.subarray(n,n+s.length),0),n+=s.length,r-=s.length}return n}const ut=new WeakMap,ft=new WeakMap,ht=new WeakMap;function dt(t){return ut.get(t)}function gt(t){const e=ht.get(t);if(!e)throw new Error("filesystem is unavailable");return e}function lt(t){if(t instanceof v)return t.errno;switch(t.code){case"ENOENT":return 44;case"EBADF":return 8;case"EINVAL":return 28;case"EPERM":return 63;case"EPROTO":return 65;case"EEXIST":return 20;case"ENOTDIR":return 54;case"EMFILE":return 33;case"EACCES":return 2;case"EISDIR":return 31;case"ENOTEMPTY":return 55;case"ENOSYS":return 52}throw t}function _t(t,e){return Object.defineProperty(e,"name",{value:t}),e}function pt(t,e,n){let r;try{r=t.apply(e,n)}catch(t){return lt(t)}return o(r)?r.then((t=>t),lt):r}function yt(t,e,n){let r=!1;const i=(()=>{try{return}catch(t){return}})();return"string"==typeof i&&i.split(",").includes("wasi")&&(r=!0),_t(e,r?function(){const r=Array.prototype.slice.call(arguments);let i=[`${e}(${Array.from({length:arguments.length}).map((()=>"%d")).join(", ")})`];return i=i.concat(r),console.debug.apply(console,i),pt(n,t,r)}:function(){return pt(n,t,arguments)})}function Et(t,e,n,r){let i=D(e.realPath,n);if(1==(1&r))try{i=t.readlinkSync(i)}catch(t){if("EINVAL"!==t.code&&"ENOENT"!==t.code)throw t}return i}async function It(t,e,n,r){let i=D(e.realPath,n);if(1==(1&r))try{i=await t.promises.readlink(i)}catch(t){if("EINVAL"!==t.code&&"ENOENT"!==t.code)throw t}return i}const mt=new TextEncoder,At=new TextDecoder,bt=(BigInt(1)<<BigInt(63))-BigInt(1);function Tt(){const t=window.prompt();if(null===t)return new Uint8Array;return(new TextEncoder).encode(t+"\n")}function wt(t){return Boolean(-16&t)||3==(3&t)||12==(12&t)}class Bt{constructor(t,n,r,i,s,o){this.args_get=yt(this,"args_get",(function(t,e){if(t=Number(t),e=Number(e),0===t||0===e)return 28;const{HEAPU8:n,view:r}=dt(this),i=ft.get(this).args;for(let s=0;s<i.length;++s){const o=i[s];r.setInt32(t,e,!0),t+=4;const a=mt.encode(o+"\0");n.set(a,e),e+=a.length}return 0})),this.args_sizes_get=yt(this,"args_sizes_get",(function(t,e){if(t=Number(t),e=Number(e),0===t||0===e)return 28;const{view:n}=dt(this),r=ft.get(this).args;return n.setUint32(t,r.length,!0),n.setUint32(e,mt.encode(r.join("\0")+"\0").length,!0),0})),this.environ_get=yt(this,"environ_get",(function(t,e){if(t=Number(t),e=Number(e),0===t||0===e)return 28;const{HEAPU8:n,view:r}=dt(this),i=ft.get(this).env;for(let s=0;s<i.length;++s){const o=i[s];r.setInt32(t,e,!0),t+=4;const a=mt.encode(o+"\0");n.set(a,e),e+=a.length}return 0})),this.environ_sizes_get=yt(this,"environ_sizes_get",(function(t,e){if(t=Number(t),e=Number(e),0===t||0===e)return 28;const{view:n}=dt(this),r=ft.get(this);return n.setUint32(t,r.env.length,!0),n.setUint32(e,mt.encode(r.env.join("\0")+"\0").length,!0),0})),this.clock_res_get=yt(this,"clock_res_get",(function(t,e){if(0===(e=Number(e)))return 28;const{view:n}=dt(this);switch(t){case 0:return n.setBigUint64(e,BigInt(1e6),!0),0;case 1:case 2:case 3:return n.setBigUint64(e,BigInt(1e3),!0),0;default:return 28}})),this.clock_time_get=yt(this,"clock_time_get",(function(t,e,n){if(0===(n=Number(n)))return 28;const{view:r}=dt(this);switch(t){case 0:return r.setBigUint64(n,BigInt(Date.now())*BigInt(1e6),!0),0;case 1:case 2:case 3:{const t=performance.now()/1e3,e=Math.trunc(t),i=Math.floor(1e3*(t-e)),s=BigInt(e)*BigInt(1e9)+BigInt(i)*BigInt(1e6);return r.setBigUint64(n,s,!0),0}default:return 28}})),this.fd_advise=yt(this,"fd_advise",(function(t,e,n,r){return 52})),this.fd_fdstat_get=yt(this,"fd_fdstat_get",(function(t,e){if(0===(e=Number(e)))return 28;const n=ft.get(this).fds.get(t,BigInt(0),BigInt(0)),{view:r}=dt(this);return r.setUint16(e,n.type,!0),r.setUint16(e+2,0,!0),r.setBigUint64(e+8,n.rightsBase,!0),r.setBigUint64(e+16,n.rightsInheriting,!0),0})),this.fd_fdstat_set_flags=yt(this,"fd_fdstat_set_flags",(function(t,e){return 52})),this.fd_fdstat_set_rights=yt(this,"fd_fdstat_set_rights",(function(t,e,n){const r=ft.get(this).fds.get(t,BigInt(0),BigInt(0));return(e|r.rightsBase)>r.rightsBase||(n|r.rightsInheriting)>r.rightsInheriting?76:(r.rightsBase=e,r.rightsInheriting=n,0)})),this.fd_prestat_get=yt(this,"fd_prestat_get",(function(t,e){if(0===(e=Number(e)))return 28;const n=ft.get(this);let r;try{r=n.fds.get(t,BigInt(0),BigInt(0))}catch(t){if(t instanceof v)return t.errno;throw t}if(1!==r.preopen)return 28;const{view:i}=dt(this);return i.setUint32(e,0,!0),i.setUint32(e+4,mt.encode(r.path).length,!0),0})),this.fd_prestat_dir_name=yt(this,"fd_prestat_dir_name",(function(t,e,n){if(e=Number(e),n=Number(n),0===e)return 28;const r=ft.get(this).fds.get(t,BigInt(0),BigInt(0));if(1!==r.preopen)return 8;const i=mt.encode(r.path);if(i.length>n)return 42;const{HEAPU8:s}=dt(this);return s.set(i,e),0})),this.fd_seek=yt(this,"fd_seek",(function(t,e,n,r){if(0===(r=Number(r)))return 28;if(0===t||1===t||2===t)return 0;const i=ft.get(this).fds.get(t,F.FD_SEEK,BigInt(0)).seek(e,n),{view:s}=dt(this);return s.setBigUint64(r,i,!0),0})),this.fd_tell=yt(this,"fd_tell",(function(t,e){const n=ft.get(this).fds.get(t,F.FD_TELL,BigInt(0)),r=BigInt(n.pos),{view:i}=dt(this);return i.setBigUint64(Number(e),r,!0),0})),this.poll_oneoff=yt(this,"poll_oneoff",(function(t,e,n,r){if(t=Number(t),e=Number(e),r=Number(r),n=Number(n),n>>>=0,0===t||0===e||0===n||0===r)return 28;const{view:i}=dt(this);i.setUint32(r,0,!0);let s,o=0,a=BigInt(0),c=BigInt(0),u=0,f=BigInt(0);const h=Array(n);for(o=0;o<n;o++){s=t+48*o;const e=i.getBigUint64(s,!0),n=i.getUint8(s+8),r=i.getUint32(s+16,!0),a=i.getBigUint64(s+24,!0),c=i.getBigUint64(s+32,!0),u=i.getUint16(s+40,!0);h[o]={userdata:e,type:n,u:{clock:{clock_id:r,timeout:a,precision:c,flags:u},fd_readwrite:{fd:r}}}}const d=[];for(o=0;o<n;o++)switch(s=h[o],s.type){case 0:if(1===s.u.clock.flags){const t=BigInt(Date.now())*BigInt(1e6);c=s.u.clock.timeout-t}else c=s.u.clock.timeout;(0===u||c<f)&&(f=c,a=s.userdata,u=1);break;case 1:case 2:d.push(s);break;default:return 28}if(d.length>0){for(o=0;o<d.length;o++){const t=d[o],n=e+32*o;i.setBigUint64(n,t.userdata,!0),i.setUint32(n+8,52,!0),i.setUint32(n+12,t.type,!0),i.setBigUint64(n+16,BigInt(0),!0),i.setUint16(n+24,0,!0),i.setUint32(r,1,!0)}return i.setUint32(r,d.length,!0),0}if(u){!function(t,e){const n=Date.now()+t;let r=!1;for(;Date.now()<n;)if(e()){r=!0;break}}(Number(f/BigInt(1e6)),(()=>!1));const t=e;i.setBigUint64(t,a,!0),i.setUint32(t+8,0,!0),i.setUint32(t+12,0,!0),i.setUint32(r,1,!0)}return 0})),this.proc_exit=yt(this,"proc_exit",(function(t){return"object"==typeof process&&null!==process&&"function"==typeof process.exit&&process.exit(t),0})),this.proc_raise=yt(this,"proc_raise",(function(t){return 52})),this.sched_yield=yt(this,"sched_yield",(function(){return 0})),this.random_get="undefined"!=typeof crypto&&"function"==typeof crypto.getRandomValues?yt(this,"random_get",(function(t,e){if(0===(t=Number(t)))return 28;e=Number(e);const{HEAPU8:n,view:r}=dt(this);if("function"==typeof SharedArrayBuffer&&n.buffer instanceof SharedArrayBuffer||"[object SharedArrayBuffer]"===Object.prototype.toString.call(n.buffer)){for(let n=t;n<t+e;++n)r.setUint8(n,Math.floor(256*Math.random()));return 0}let i;const s=65536;for(i=0;i+s<e;i+=s)crypto.getRandomValues(n.subarray(t+i,t+i+s));return crypto.getRandomValues(n.subarray(t+i,t+e)),0})):yt(this,"random_get",(function(t,e){if(0===(t=Number(t)))return 28;e=Number(e);const{view:n}=dt(this);for(let r=t;r<t+e;++r)n.setUint8(r,Math.floor(256*Math.random()));return 0})),this.sock_recv=yt(this,"sock_recv",(function(){return 58})),this.sock_send=yt(this,"sock_send",(function(){return 58})),this.sock_shutdown=yt(this,"sock_shutdown",(function(){return 58})),this.sock_accept=yt(this,"sock_accept",(function(){return 58})),ft.set(this,{fds:r,args:t,env:n}),s&&ht.set(this,s);const a=this;function u(t,e,n,r,s){a[t]=i?o?o.wrapImportFunction(yt(a,t,n)):it(yt(a,t,n),r,s):yt(a,t,e)}function f(t,e,n,r){const i=ft.get(this).fds.get(t,F.FD_FILESTAT_SET_TIMES,BigInt(0));return 2==(2&r)&&(e=BigInt(1e6*Date.now())),8==(8&r)&&(n=BigInt(1e6*Date.now())),{fileDescriptor:i,atim:e,mtim:n}}function h(t,e,n,r){const i=(e&(F.FD_READ|F.FD_READDIR))!==BigInt(0),s=(e&(F.FD_DATASYNC|F.FD_WRITE|F.FD_ALLOCATE|F.FD_FILESTAT_SET_SIZE))!==BigInt(0);let o=s?i?2:1:0,a=F.PATH_OPEN,c=e|n;return 0!=(1&t)&&(o|=64,a|=F.PATH_CREATE_FILE),0!=(2&t)&&(o|=65536),0!=(4&t)&&(o|=128),0!=(8&t)&&(o|=512,a|=F.PATH_FILESTAT_SET_SIZE),0!=(1&r)&&(o|=1024),0!=(2&r)&&(c|=F.FD_DATASYNC),0!=(4&r)&&(o|=2048),0!=(8&r)&&(o|=1052672,c|=F.FD_SYNC),0!=(16&r)&&(o|=1052672,c|=F.FD_SYNC),s&&0==(1536&o)&&(c|=F.FD_SEEK),{flags:o,needed_base:a,needed_inheriting:c}}u("fd_allocate",(function(t,e,n){const r=ft.get(this),i=gt(this),s=r.fds.get(t,F.FD_ALLOCATE,BigInt(0));return i.fstatSync(s.fd,{bigint:!0}).size<e+n&&i.ftruncateSync(s.fd,Number(e+n)),0}),(async function(t,e,n){const r=ft.get(this).fds.get(t,F.FD_ALLOCATE,BigInt(0)).fd;return(await r.stat({bigint:!0})).size<e+n&&await r.truncate(Number(e+n)),0}),["i32","i64","f64"],["i32"]),u("fd_close",(function(t){const e=ft.get(this),n=e.fds.get(t,BigInt(0),BigInt(0));return gt(this).closeSync(n.fd),e.fds.remove(t),0}),(async function(t){const e=ft.get(this),n=e.fds.get(t,BigInt(0),BigInt(0));return await n.fd.close(),e.fds.remove(t),0}),["i32"],["i32"]),u("fd_datasync",(function(t){const e=ft.get(this).fds.get(t,F.FD_DATASYNC,BigInt(0));return gt(this).fdatasyncSync(e.fd),0}),(async function(t){const e=ft.get(this).fds.get(t,F.FD_DATASYNC,BigInt(0));return await e.fd.datasync(),0}),["i32"],["i32"]),u("fd_filestat_get",(function(t,e){if(0===(e=Number(e)))return 28;const n=ft.get(this).fds.get(t,F.FD_FILESTAT_GET,BigInt(0)),r=gt(this).fstatSync(n.fd,{bigint:!0}),{view:i}=dt(this);return q(i,e,r),0}),(async function(t,e){if(0===(e=Number(e)))return 28;const n=ft.get(this).fds.get(t,F.FD_FILESTAT_GET,BigInt(0)).fd,r=await n.stat({bigint:!0}),{view:i}=dt(this);return q(i,e,r),0}),["i32","i32"],["i32"]),u("fd_filestat_set_size",(function(t,e){const n=ft.get(this).fds.get(t,F.FD_FILESTAT_SET_SIZE,BigInt(0));return gt(this).ftruncateSync(n.fd,Number(e)),0}),(async function(t,e){const n=ft.get(this).fds.get(t,F.FD_FILESTAT_SET_SIZE,BigInt(0)).fd;return await n.truncate(Number(e)),0}),["i32","i64"],["i32"]),u("fd_filestat_set_times",(function(t,e,n,r){if(wt(r))return 28;const{fileDescriptor:i,atim:s,mtim:o}=f.call(this,t,e,n,r);return gt(this).futimesSync(i.fd,Number(s),Number(o)),0}),(async function(t,e,n,r){if(wt(r))return 28;const{fileDescriptor:i,atim:s,mtim:o}=f.call(this,t,e,n,r),a=i.fd;return await a.utimes(Number(s),Number(o)),0}),["i32","i64","i64","i32"],["i32"]),u("fd_pread",(function(t,e,n,r,i){if(e=Number(e),i=Number(i),0===e&&n||0===i||r>bt)return 28;const{HEAPU8:s,view:o}=dt(this),a=ft.get(this).fds.get(t,F.FD_READ|F.FD_SEEK,BigInt(0));if(!n)return o.setUint32(i,0,!0),0;let c=0;const u=Array.from({length:Number(n)},((t,n)=>{const r=e+8*n,i=o.getInt32(r,!0),a=o.getUint32(r+4,!0);return c+=a,s.subarray(i,i+a)}));let f=0;const h=(()=>{try{return new Uint8Array(new SharedArrayBuffer(c))}catch(t){return new Uint8Array(c)}})();h._isBuffer=!0;const d=gt(this).readSync(a.fd,h,0,h.length,Number(r));return f=h?ct(u,h.subarray(0,d)):0,o.setUint32(i,f,!0),0}),(async function(t,e,n,r,i){if(e=Number(e),i=Number(i),0===e&&n||0===i||r>bt)return 28;const{HEAPU8:s,view:o}=dt(this),a=ft.get(this).fds.get(t,F.FD_READ|F.FD_SEEK,BigInt(0));if(!n)return o.setUint32(i,0,!0),0;let c=0;const u=Array.from({length:Number(n)},((t,n)=>{const r=e+8*n,i=o.getInt32(r,!0),a=o.getUint32(r+4,!0);return c+=a,s.subarray(i,i+a)}));let f=0;const h=new Uint8Array(c);h._isBuffer=!0;const{bytesRead:d}=await a.fd.read(h,0,h.length,Number(r));return f=h?ct(u,h.subarray(0,d)):0,o.setUint32(i,f,!0),0}),["i32","i32","i32","i64","i32"],["i32"]),u("fd_pwrite",(function(t,e,n,r,i){if(e=Number(e),i=Number(i),0===e&&n||0===i||r>bt)return 28;const{HEAPU8:s,view:o}=dt(this),a=ft.get(this).fds.get(t,F.FD_WRITE|F.FD_SEEK,BigInt(0));if(!n)return o.setUint32(i,0,!0),0;const c=G(Array.from({length:Number(n)},((t,n)=>{const r=e+8*n,i=o.getInt32(r,!0),a=o.getUint32(r+4,!0);return s.subarray(i,i+a)}))),u=gt(this).writeSync(a.fd,c,0,c.length,Number(r));return o.setUint32(i,u,!0),0}),(async function(t,e,n,r,i){if(e=Number(e),i=Number(i),0===e&&n||0===i||r>bt)return 28;const{HEAPU8:s,view:o}=dt(this),a=ft.get(this).fds.get(t,F.FD_WRITE|F.FD_SEEK,BigInt(0));if(!n)return o.setUint32(i,0,!0),0;const c=G(Array.from({length:Number(n)},((t,n)=>{const r=e+8*n,i=o.getInt32(r,!0),a=o.getUint32(r+4,!0);return s.subarray(i,i+a)}))),{bytesWritten:u}=await a.fd.write(c,0,c.length,Number(r));return o.setUint32(i,u,!0),0}),["i32","i32","i32","i64","i32"],["i32"]),u("fd_read",(function(t,e,n,r){if(e=Number(e),r=Number(r),0===e&&n||0===r)return 28;const{HEAPU8:i,view:s}=dt(this),o=ft.get(this).fds.get(t,F.FD_READ,BigInt(0));if(!n)return s.setUint32(r,0,!0),0;let a=0;const c=Array.from({length:Number(n)},((t,n)=>{const r=e+8*n,o=s.getInt32(r,!0),c=s.getUint32(r+4,!0);return a+=c,i.subarray(o,o+c)}));let u,f=0;if(0===t){if("undefined"==typeof window||"function"!=typeof window.prompt)return 58;u=Tt(),f=u?ct(c,u):0}else{u=(()=>{try{return new Uint8Array(new SharedArrayBuffer(a))}catch(t){return new Uint8Array(a)}})(),u._isBuffer=!0;const t=gt(this).readSync(o.fd,u,0,u.length,Number(o.pos));f=u?ct(c,u.subarray(0,t)):0,o.pos+=BigInt(f)}return s.setUint32(r,f,!0),0}),(async function(t,e,n,r){if(e=Number(e),r=Number(r),0===e&&n||0===r)return 28;const{HEAPU8:i,view:s}=dt(this),o=ft.get(this).fds.get(t,F.FD_READ,BigInt(0));if(!n)return s.setUint32(r,0,!0),0;let a=0;const c=Array.from({length:Number(n)},((t,n)=>{const r=e+8*n,o=s.getInt32(r,!0),c=s.getUint32(r+4,!0);return a+=c,i.subarray(o,o+c)}));let u,f=0;if(0===t){if("undefined"==typeof window||"function"!=typeof window.prompt)return 58;u=Tt(),f=u?ct(c,u):0}else{u=new Uint8Array(a),u._isBuffer=!0;const{bytesRead:t}=await o.fd.read(u,0,u.length,Number(o.pos));f=u?ct(c,u.subarray(0,t)):0,o.pos+=BigInt(f)}return s.setUint32(r,f,!0),0}),["i32","i32","i32","i32"],["i32"]),u("fd_readdir",(function(t,e,n,r,i){if(e=Number(e),n=Number(n),i=Number(i),0===e||0===i)return 0;const s=ft.get(this).fds.get(t,F.FD_READDIR,BigInt(0)),o=gt(this),a=o.readdirSync(s.realPath,{withFileTypes:!0}),{HEAPU8:c,view:u}=dt(this);let f=0;for(let t=Number(r);t<a.length;t++){const r=mt.encode(a[t].name),i=o.statSync(D(s.realPath,a[t].name),{bigint:!0}),u=new Uint8Array(24+r.byteLength),h=new DataView(u.buffer);let d;h.setBigUint64(0,BigInt(t+1),!0),h.setBigUint64(8,BigInt(i.ino?i.ino:0),!0),h.setUint32(16,r.byteLength,!0),d=a[t].isFile()?4:a[t].isDirectory()?3:a[t].isSymbolicLink()?7:a[t].isCharacterDevice()?2:a[t].isBlockDevice()?1:a[t].isSocket()?6:0,h.setUint8(20,d),u.set(r,24);const g=u.slice(0,Math.min(u.length,n-f));c.set(g,e+f),f+=g.byteLength}return u.setUint32(i,f,!0),0}),(async function(t,e,n,r,i){if(e=Number(e),n=Number(n),i=Number(i),0===e||0===i)return 0;const s=ft.get(this).fds.get(t,F.FD_READDIR,BigInt(0)),o=gt(this),a=await o.promises.readdir(s.realPath,{withFileTypes:!0}),{HEAPU8:c,view:u}=dt(this);let f=0;for(let t=Number(r);t<a.length;t++){const r=mt.encode(a[t].name),i=await o.promises.stat(D(s.realPath,a[t].name),{bigint:!0}),u=new Uint8Array(24+r.byteLength),h=new DataView(u.buffer);let d;h.setBigUint64(0,BigInt(t+1),!0),h.setBigUint64(8,BigInt(i.ino?i.ino:0),!0),h.setUint32(16,r.byteLength,!0),d=a[t].isFile()?4:a[t].isDirectory()?3:a[t].isSymbolicLink()?7:a[t].isCharacterDevice()?2:a[t].isBlockDevice()?1:a[t].isSocket()?6:0,h.setUint8(20,d),u.set(r,24);const g=u.slice(0,Math.min(u.length,n-f));c.set(g,e+f),f+=g.byteLength}return u.setUint32(i,f,!0),0}),["i32","i32","i32","i64","i32"],["i32"]),u("fd_renumber",(function(t,e){return ft.get(this).fds.renumber(e,t),0}),(async function(t,e){const n=ft.get(this);return await n.fds.renumber(e,t),0}),["i32","i32"],["i32"]),u("fd_sync",(function(t){const e=ft.get(this).fds.get(t,F.FD_SYNC,BigInt(0));return gt(this).fsyncSync(e.fd),0}),(async function(t){const e=ft.get(this).fds.get(t,F.FD_SYNC,BigInt(0));return await e.fd.sync(),0}),["i32"],["i32"]),u("fd_write",(function(t,e,n,r){if(e=Number(e),r=Number(r),0===e&&n||0===r)return 28;const{HEAPU8:i,view:s}=dt(this),o=ft.get(this).fds.get(t,F.FD_WRITE,BigInt(0));if(!n)return s.setUint32(r,0,!0),0;const a=G(Array.from({length:Number(n)},((t,n)=>{const r=e+8*n,o=s.getInt32(r,!0),a=s.getUint32(r+4,!0);return i.subarray(o,o+a)})));let c;if(1===t||2===t)c=o.write(a);else{c=gt(this).writeSync(o.fd,a,0,a.length,Number(o.pos)),o.pos+=BigInt(c)}return s.setUint32(r,c,!0),0}),(async function(t,e,n,r){if(e=Number(e),r=Number(r),0===e&&n||0===r)return 28;const{HEAPU8:i,view:s}=dt(this),o=ft.get(this).fds.get(t,F.FD_WRITE,BigInt(0));if(!n)return s.setUint32(r,0,!0),0;const a=G(Array.from({length:Number(n)},((t,n)=>{const r=e+8*n,o=s.getInt32(r,!0),a=s.getUint32(r+4,!0);return i.subarray(o,o+a)})));let c;return 1===t||2===t?c=o.write(a):(c=await(await o.fd.write(a,0,a.length,Number(o.pos))).bytesWritten,o.pos+=BigInt(c)),s.setUint32(r,c,!0),0}),["i32","i32","i32","i32"],["i32"]),u("path_create_directory",(function(t,e,n){if(e=Number(e),n=Number(n),0===e)return 28;const{HEAPU8:r}=dt(this),i=ft.get(this).fds.get(t,F.PATH_CREATE_DIRECTORY,BigInt(0));let s=At.decode(c(r,e,e+n));s=D(i.realPath,s);return gt(this).mkdirSync(s),0}),(async function(t,e,n){if(e=Number(e),n=Number(n),0===e)return 28;const{HEAPU8:r}=dt(this),i=ft.get(this).fds.get(t,F.PATH_CREATE_DIRECTORY,BigInt(0));let s=At.decode(c(r,e,e+n));s=D(i.realPath,s);const o=gt(this);return await o.promises.mkdir(s),0}),["i32","i32","i32"],["i32"]),u("path_filestat_get",(function(t,e,n,r,i){if(n=Number(n),r=Number(r),i=Number(i),0===n||0===i)return 28;const{HEAPU8:s,view:o}=dt(this),a=ft.get(this).fds.get(t,F.PATH_FILESTAT_GET,BigInt(0));let u=At.decode(c(s,n,n+r));const f=gt(this);let h;return u=D(a.realPath,u),h=1==(1&e)?f.statSync(u,{bigint:!0}):f.lstatSync(u,{bigint:!0}),q(o,i,h),0}),(async function(t,e,n,r,i){if(n=Number(n),r=Number(r),i=Number(i),0===n||0===i)return 28;const{HEAPU8:s,view:o}=dt(this),a=ft.get(this).fds.get(t,F.PATH_FILESTAT_GET,BigInt(0));let u=At.decode(c(s,n,n+r));const f=gt(this);let h;return u=D(a.realPath,u),h=1==(1&e)?await f.promises.stat(u,{bigint:!0}):await f.promises.lstat(u,{bigint:!0}),q(o,i,h),0}),["i32","i32","i32","i32","i32"],["i32"]),u("path_filestat_set_times",(function(t,e,n,r,i,s,o){if(n=Number(n),r=Number(r),0===n)return 28;const{HEAPU8:a}=dt(this),u=ft.get(this).fds.get(t,F.PATH_FILESTAT_SET_TIMES,BigInt(0));if(wt(o))return 28;const f=gt(this),h=Et(f,u,At.decode(c(a,n,n+r)),e);return 2==(2&o)&&(i=BigInt(1e6*Date.now())),8==(8&o)&&(s=BigInt(1e6*Date.now())),f.utimesSync(h,Number(i),Number(s)),0}),(async function(t,e,n,r,i,s,o){if(n=Number(n),r=Number(r),0===n)return 28;const{HEAPU8:a}=dt(this),u=ft.get(this).fds.get(t,F.PATH_FILESTAT_SET_TIMES,BigInt(0));if(wt(o))return 28;const f=gt(this),h=await It(f,u,At.decode(c(a,n,n+r)),e);return 2==(2&o)&&(i=BigInt(1e6*Date.now())),8==(8&o)&&(s=BigInt(1e6*Date.now())),await f.promises.utimes(h,Number(i),Number(s)),0}),["i32","i32","i32","i32","i64","i64","i32"],["i32"]),u("path_link",(function(t,e,n,r,i,s,o){if(n=Number(n),r=Number(r),s=Number(s),o=Number(o),0===n||0===s)return 28;const a=ft.get(this);let u,f;t===i?u=f=a.fds.get(t,F.PATH_LINK_SOURCE|F.PATH_LINK_TARGET,BigInt(0)):(u=a.fds.get(t,F.PATH_LINK_SOURCE,BigInt(0)),f=a.fds.get(i,F.PATH_LINK_TARGET,BigInt(0)));const{HEAPU8:h}=dt(this),d=gt(this),g=Et(d,u,At.decode(c(h,n,n+r)),e),l=D(f.realPath,At.decode(c(h,s,s+o)));return d.linkSync(g,l),0}),(async function(t,e,n,r,i,s,o){if(n=Number(n),r=Number(r),s=Number(s),o=Number(o),0===n||0===s)return 28;const a=ft.get(this);let u,f;t===i?u=f=a.fds.get(t,F.PATH_LINK_SOURCE|F.PATH_LINK_TARGET,BigInt(0)):(u=a.fds.get(t,F.PATH_LINK_SOURCE,BigInt(0)),f=a.fds.get(i,F.PATH_LINK_TARGET,BigInt(0)));const{HEAPU8:h}=dt(this),d=gt(this),g=await It(d,u,At.decode(c(h,n,n+r)),e),l=D(f.realPath,At.decode(c(h,s,s+o)));return await d.promises.link(g,l),0}),["i32","i32","i32","i32","i32","i32","i32"],["i32"]),u("path_open",(function(t,e,n,r,i,s,o,a,u){if(n=Number(n),u=Number(u),0===n||0===u)return 28;r=Number(r),s=BigInt(s),o=BigInt(o);const{flags:f,needed_base:d,needed_inheriting:g}=h(i,s,o,a),l=ft.get(this),_=l.fds.get(t,d,g),p=dt(this),y=p.HEAPU8,E=At.decode(c(y,n,n+r)),I=gt(this),m=Et(I,_,E,e),A=I.openSync(m,ot?at(f):f,438),b=l.fds.getFileTypeByFd(A);if(3!==b&&(0!=(2&i)||m.endsWith("/")))return 54;const{base:T,inheriting:w}=$(l.fds.stdio,A,f,b),B=l.fds.insert(A,m,m,b,s&T,o&w,0),N=I.fstatSync(A,{bigint:!0});N.isFile()&&(B.size=N.size,0!=(1024&f)&&(B.pos=N.size));return p.view.setInt32(u,B.id,!0),0}),(async function(t,e,n,r,i,s,o,a,u){if(n=Number(n),u=Number(u),0===n||0===u)return 28;r=Number(r),s=BigInt(s),o=BigInt(o);const{flags:f,needed_base:d,needed_inheriting:g}=h(i,s,o,a),l=ft.get(this),_=l.fds.get(t,d,g),p=dt(this),y=p.HEAPU8,E=At.decode(c(y,n,n+r)),I=gt(this),m=await It(I,_,E,e),A=await I.promises.open(m,ot?at(f):f,438),b=await l.fds.getFileTypeByFd(A);if(0!=(2&i)&&3!==b)return 54;const{base:T,inheriting:w}=$(l.fds.stdio,A.fd,f,b),B=l.fds.insert(A,m,m,b,s&T,o&w,0),N=await A.stat({bigint:!0});N.isFile()&&(B.size=N.size,0!=(1024&f)&&(B.pos=N.size));return p.view.setInt32(u,B.id,!0),0}),["i32","i32","i32","i32","i32","i64","i64","i32","i32"],["i32"]),u("path_readlink",(function(t,e,n,r,i,s){if(e=Number(e),n=Number(n),r=Number(r),i=Number(i),s=Number(s),0===e||0===r||0===s)return 28;const{HEAPU8:o,view:a}=dt(this),u=ft.get(this).fds.get(t,F.PATH_READLINK,BigInt(0));let f=At.decode(c(o,e,e+n));f=D(u.realPath,f);const h=gt(this).readlinkSync(f),d=mt.encode(h),g=Math.min(d.length,i);return g>=i?42:(o.set(d.subarray(0,g),r),o[r+g]=0,a.setUint32(s,g,!0),0)}),(async function(t,e,n,r,i,s){if(e=Number(e),n=Number(n),r=Number(r),i=Number(i),s=Number(s),0===e||0===r||0===s)return 28;const{HEAPU8:o,view:a}=dt(this),u=ft.get(this).fds.get(t,F.PATH_READLINK,BigInt(0));let f=At.decode(c(o,e,e+n));f=D(u.realPath,f);const h=gt(this),d=await h.promises.readlink(f),g=mt.encode(d),l=Math.min(g.length,i);return l>=i?42:(o.set(g.subarray(0,l),r),o[r+l]=0,a.setUint32(s,l,!0),0)}),["i32","i32","i32","i32","i32","i32"],["i32"]),u("path_remove_directory",(function(t,e,n){if(e=Number(e),n=Number(n),0===e)return 28;const{HEAPU8:r}=dt(this),i=ft.get(this).fds.get(t,F.PATH_REMOVE_DIRECTORY,BigInt(0));let s=At.decode(c(r,e,e+n));s=D(i.realPath,s);return gt(this).rmdirSync(s),0}),(async function(t,e,n){if(e=Number(e),n=Number(n),0===e)return 28;const{HEAPU8:r}=dt(this),i=ft.get(this).fds.get(t,F.PATH_REMOVE_DIRECTORY,BigInt(0));let s=At.decode(c(r,e,e+n));s=D(i.realPath,s);const o=gt(this);return await o.promises.rmdir(s),0}),["i32","i32","i32"],["i32"]),u("path_rename",(function(t,e,n,r,i,s){if(e=Number(e),n=Number(n),i=Number(i),s=Number(s),0===e||0===i)return 28;const o=ft.get(this);let a,u;t===r?a=u=o.fds.get(t,F.PATH_RENAME_SOURCE|F.PATH_RENAME_TARGET,BigInt(0)):(a=o.fds.get(t,F.PATH_RENAME_SOURCE,BigInt(0)),u=o.fds.get(r,F.PATH_RENAME_TARGET,BigInt(0)));const{HEAPU8:f}=dt(this),h=D(a.realPath,At.decode(c(f,e,e+n))),d=D(u.realPath,At.decode(c(f,i,i+s)));return gt(this).renameSync(h,d),0}),(async function(t,e,n,r,i,s){if(e=Number(e),n=Number(n),i=Number(i),s=Number(s),0===e||0===i)return 28;const o=ft.get(this);let a,u;t===r?a=u=o.fds.get(t,F.PATH_RENAME_SOURCE|F.PATH_RENAME_TARGET,BigInt(0)):(a=o.fds.get(t,F.PATH_RENAME_SOURCE,BigInt(0)),u=o.fds.get(r,F.PATH_RENAME_TARGET,BigInt(0)));const{HEAPU8:f}=dt(this),h=D(a.realPath,At.decode(c(f,e,e+n))),d=D(u.realPath,At.decode(c(f,i,i+s))),g=gt(this);return await g.promises.rename(h,d),0}),["i32","i32","i32","i32","i32","i32"],["i32"]),u("path_symlink",(function(t,e,n,r,i){if(t=Number(t),e=Number(e),r=Number(r),i=Number(i),0===t||0===r)return 28;const{HEAPU8:s}=dt(this),o=ft.get(this).fds.get(n,F.PATH_SYMLINK,BigInt(0)),a=At.decode(c(s,t,t+e));if(a.length>0&&"/"===a[0])return 63;let u=At.decode(c(s,r,r+i));u=D(o.realPath,u);return gt(this).symlinkSync(a,u),0}),(async function(t,e,n,r,i){if(t=Number(t),e=Number(e),r=Number(r),i=Number(i),0===t||0===r)return 28;const{HEAPU8:s}=dt(this),o=ft.get(this).fds.get(n,F.PATH_SYMLINK,BigInt(0)),a=At.decode(c(s,t,t+e));let u=At.decode(c(s,r,r+i));u=D(o.realPath,u);const f=gt(this);return await f.promises.symlink(a,u),0}),["i32","i32","i32","i32","i32"],["i32"]),u("path_unlink_file",(function(t,e,n){if(e=Number(e),n=Number(n),0===e)return 28;const{HEAPU8:r}=dt(this),i=ft.get(this).fds.get(t,F.PATH_UNLINK_FILE,BigInt(0));let s=At.decode(c(r,e,e+n));s=D(i.realPath,s);return gt(this).unlinkSync(s),0}),(async function(t,e,n){if(e=Number(e),n=Number(n),0===e)return 28;const{HEAPU8:r}=dt(this),i=ft.get(this).fds.get(t,F.PATH_UNLINK_FILE,BigInt(0));let s=At.decode(c(r,e,e+n));s=D(i.realPath,s);const o=gt(this);return await o.promises.unlink(s),0}),["i32","i32","i32"],["i32"]),this._setMemory=function(t){if(!(t instanceof e.Memory))throw new TypeError('"instance.exports.memory" property must be a WebAssembly.Memory');ut.set(a,nt(t))}}static createSync(t,e,n,r,i,s,o){const a=new Q({size:3,in:r[0],out:r[1],err:r[2],fs:i,print:s,printErr:o}),c=new Bt(t,e,a,!1,i);if(n.length>0)for(let t=0;t<n.length;++t){const e=i.realpathSync(n[t].realPath,"utf8"),r=i.openSync(e,"r",438);a.insertPreopen(r,n[t].mappedPath,e)}return c}static async createAsync(t,e,n,r,i,s,o,a){const c=new J({size:3,in:r[0],out:r[1],err:r[2],print:s,printErr:o}),u=new Bt(t,e,c,!0,i,a);if(n.length>0)for(let t=0;t<n.length;++t){const e=n[t],r=await i.promises.realpath(e.realPath),s=await i.promises.open(r,"r",438);await c.insertPreopen(s,e.mappedPath,r)}return u}}const Nt=Object.freeze(Object.create(null)),St=Symbol("kExitCode"),Pt=Symbol("kSetMemory"),Dt=Symbol("kStarted"),Ft=Symbol("kInstance"),vt=Symbol("kBindingName");function Ut(t){var e;let s;if(n(t,"options"),void 0!==t.version)switch(r(t.version,"options.version"),t.version){case"unstable":s=Bt,this[vt]="wasi_unstable";break;case"preview1":s=Bt,this[vt]="wasi_snapshot_preview1";break;default:throw new TypeError(`unsupported WASI version "${t.version}"`)}else s=Bt,this[vt]="wasi_snapshot_preview1";void 0!==t.args&&function(t,e){if(!Array.isArray(t))throw new TypeError(`${e} must be an array. Received ${null===t?"null":typeof t}`)}(t.args,"options.args");const o=(null!==(e=t.args)&&void 0!==e?e:[]).map(String),a=[];void 0!==t.env&&(n(t.env,"options.env"),Object.entries(t.env).forEach((({0:t,1:e})=>{void 0!==e&&a.push(`${t}=${e}`)})));const c=[];if(void 0!==t.preopens&&(n(t.preopens,"options.preopens"),Object.entries(t.preopens).forEach((({0:t,1:e})=>c.push({mappedPath:String(t),realPath:String(e)})))),c.length>0){if(void 0===t.fs)throw new Error("filesystem is disabled, can not preopen directory");try{n(t.fs,"options.fs")}catch(t){throw new TypeError("Node.js fs like implementation is not provided")}}void 0!==t.print&&i(t.print,"options.print"),void 0!==t.printErr&&i(t.printErr,"options.printErr"),void 0!==t.returnOnExit&&function(t,e){if("boolean"!=typeof t)throw new TypeError(`${e} must be a boolean. Received ${null===t?"null":typeof t}`)}(t.returnOnExit,"options.returnOnExit");return{args:o,env:a,preopens:c,stdio:[0,1,2],_WASI:s}}function Rt(t,e){this[Pt]=t,this.wasiImport=e,this[Dt]=!1,this[St]=0,this[Ft]=void 0}class Lt{constructor(t=Nt){const{args:e,env:n,preopens:r,stdio:i,_WASI:s}=Ut.call(this,t),o=s.createSync(e,n,r,i,t.fs,t.print,t.printErr),a=o._setMemory;delete o._setMemory,Rt.call(this,a,o),t.returnOnExit&&(o.proc_exit=Ht.bind(this))}finalizeBindings(t,e){var r,{memory:i=(null===(r=null==t?void 0:t.exports)||void 0===r?void 0:r.memory)}=void 0===e?{}:e;if(this[Dt])throw new Error("WASI instance has already started");n(t,"instance"),n(t.exports,"instance.exports"),this[Pt](i),this[Ft]=t,this[Dt]=!0}start(t){this.finalizeBindings(t);const{_start:e,_initialize:n}=this[Ft].exports;let r;i(e,"instance.exports._start"),s(n,"instance.exports._initialize");try{r=e()}catch(t){if(t!==St)throw t}return r instanceof Promise?r.then((()=>this[St]),(t=>{if(t!==St)throw t;return this[St]})):this[St]}initialize(t){this.finalizeBindings(t);const{_start:e,_initialize:n}=this[Ft].exports;if(s(e,"instance.exports._start"),void 0!==n)return i(n,"instance.exports._initialize"),n()}getImportObject(){return{[this[vt]]:this.wasiImport}}}function Ht(t){throw this[St]=t,St}t.Asyncify=h,t.Memory=et,t.WASI=Lt,t.WebAssemblyMemory=tt,t.asyncifyLoad=function(t,e,n){d(n),n=null!=n?n:{};const r=new h;return l(e,n=r.wrapImports(n)).then((e=>{var i;const s=e.instance.exports.memory||(null===(i=n.env)||void 0===i?void 0:i.memory);return{module:e.module,instance:r.init(s,e.instance,t)}}))},t.asyncifyLoadSync=function(t,e,n){var r;d(n),n=null!=n?n:{};const i=new h,s=_(e,n=i.wrapImports(n)),o=s.instance.exports.memory||(null===(r=n.env)||void 0===r?void 0:r.memory);return{module:s.module,instance:i.init(o,s.instance,t)}},t.createAsyncWASI=async function(t=Nt){const e=Object.create(Lt.prototype),{args:r,env:s,preopens:o,stdio:a,_WASI:c}=Ut.call(e,t);void 0!==t.asyncify&&(n(t.asyncify,"options.asyncify"),i(t.asyncify.wrapImportFunction,"options.asyncify.wrapImportFunction"));const u=await c.createAsync(r,s,o,a,t.fs,t.print,t.printErr,t.asyncify),f=u._setMemory;return delete u._setMemory,Rt.call(e,f,u),t.returnOnExit&&(u.proc_exit=Ht.bind(e)),e},t.extendMemory=nt,t.load=l,t.loadSync=_,t.wrapAsyncExport=st,t.wrapAsyncImport=it,t.wrapExports=function(t,e){return a(t,((t,n)=>{let r="function"!=typeof t;return Array.isArray(e)&&(r=r||-1===e.indexOf(n)),r?t:st(t)}))},Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).wasmUtil={})}(this,(function(t){"use strict";const e="undefined"!=typeof WebAssembly?WebAssembly:"undefined"!=typeof WXWebAssembly?WXWebAssembly:void 0;if(!e)throw new Error("WebAssembly is not supported in this environment");function n(t,e){if(null===t||"object"!=typeof t)throw new TypeError(`${e} must be an object. Received ${null===t?"null":typeof t}`)}function r(t,e){if("string"!=typeof t)throw new TypeError(`${e} must be a string. Received ${null===t?"null":typeof t}`)}function i(t,e){if("function"!=typeof t)throw new TypeError(`${e} must be a function. Received ${null===t?"null":typeof t}`)}function s(t,e){if(void 0!==t)throw new TypeError(`${e} must be undefined. Received ${null===t?"null":typeof t}`)}function o(t){return!(!t||"object"!=typeof t&&"function"!=typeof t||"function"!=typeof t.then)}function a(t,e){const n=Object.create(null);return Object.keys(t).forEach((r=>{const i=t[r];Object.defineProperty(n,r,{enumerable:!0,value:e(i,r)})})),n}function c(t,e,n){return"function"==typeof SharedArrayBuffer&&t.buffer instanceof SharedArrayBuffer||"[object SharedArrayBuffer]"===Object.prototype.toString.call(t.buffer.constructor)?t.slice(e,n):t.subarray(e,n)}const u=["asyncify_get_state","asyncify_start_rewind","asyncify_start_unwind","asyncify_stop_rewind","asyncify_stop_unwind"];function f(t,e,n,r){if("function"!=typeof t.exports[r]||n<=0)return{wasm64:e,dataPtr:16,start:e?32:24,end:1024};const i=t.exports[r],s=e?Number(i(BigInt(16)+BigInt(n))):i(8+n);if(0===s)throw new Error("Allocate asyncify data failed");return e?{wasm64:e,dataPtr:s,start:s+16,end:s+16+n}:{wasm64:e,dataPtr:s,start:s+8,end:s+8+n}}class h{constructor(){this.value=void 0,this.exports=void 0,this.dataPtr=0}init(t,n,r){var i,s;if(this.exports)throw new Error("Asyncify has been initialized");if(!(t instanceof e.Memory))throw new TypeError("Require WebAssembly.Memory object");const o=n.exports;for(let t=0;t<u.length;++t)if("function"!=typeof o[u[t]])throw new TypeError("Invalid asyncify wasm");let a;const c=Boolean(r.wasm64);a=r.tryAllocate?!0===r.tryAllocate?f(n,c,4096,"malloc"):f(n,c,null!==(i=r.tryAllocate.size)&&void 0!==i?i:4096,null!==(s=r.tryAllocate.name)&&void 0!==s?s:"malloc"):{wasm64:c,dataPtr:16,start:c?32:24,end:1024},this.dataPtr=a.dataPtr,c?new BigInt64Array(t.buffer,this.dataPtr).set([BigInt(a.start),BigInt(a.end)]):new Int32Array(t.buffer,this.dataPtr).set([a.start,a.end]),this.exports=this.wrapExports(o,r.wrapExports);const h=Object.create(e.Instance.prototype);return Object.defineProperty(h,"exports",{value:this.exports}),h}assertState(){if(0!==this.exports.asyncify_get_state())throw new Error("Asyncify state error")}wrapImportFunction(t){const e=this;return function(){for(;2===e.exports.asyncify_get_state();)return e.exports.asyncify_stop_rewind(),e.value;e.assertState();const n=t.apply(this,arguments);if(!o(n))return n;e.exports.asyncify_start_unwind(e.dataPtr),e.value=n}}wrapImports(t){const e={};return Object.keys(t).forEach((n=>{const r=t[n],i={};Object.keys(r).forEach((t=>{const e=r[t];i[t]="function"==typeof e?this.wrapImportFunction(e):e})),e[n]=i})),e}wrapExportFunction(t){const e=this;return async function(){e.assertState();let n=t.apply(this,arguments);for(;1===e.exports.asyncify_get_state();)e.exports.asyncify_stop_unwind(),e.value=await e.value,e.assertState(),e.exports.asyncify_start_rewind(e.dataPtr),n=t.call(this);return e.assertState(),n}}wrapExports(t,e){return a(t,((t,n)=>{let r=-1!==u.indexOf(n)||"function"!=typeof t;return Array.isArray(e)&&(r=r||-1===e.indexOf(n)),r?t:this.wrapExportFunction(t)}))}}function d(t){if(t&&"object"!=typeof t)throw new TypeError("imports must be an object or undefined")}function g(t,n){return"undefined"!=typeof wx&&"undefined"!=typeof __wxConfig?e.instantiate(t,n):fetch(t).then((t=>t.arrayBuffer())).then((t=>e.instantiate(t,n)))}function l(t,n){let r;if(d(n),n=null!=n?n:{},t instanceof ArrayBuffer||ArrayBuffer.isView(t))return e.instantiate(t,n);if(t instanceof e.Module)return e.instantiate(t,n).then((e=>({instance:e,module:t})));if("string"!=typeof t&&!(t instanceof URL))throw new TypeError("Invalid source");if("function"==typeof e.instantiateStreaming){let i;try{i=fetch(t),r=e.instantiateStreaming(i,n).catch((()=>g(t,n)))}catch(e){r=g(t,n)}}else r=g(t,n);return r}function _(t,n){let r;if(d(n),n=null!=n?n:{},t instanceof ArrayBuffer||ArrayBuffer.isView(t))r=new e.Module(t);else{if(!(t instanceof WebAssembly.Module))throw new TypeError("Invalid source");r=t}return{instance:new e.Instance(r,n),module:r}}const p=46,y=47,m=92,E=58,I=65,b=90,A=97,T=122;function w(t){return t===y||t===m}function B(t){return t>=I&&t<=b||t>=A&&t<=T}const N="undefined"!=typeof process&&"win32"===process.platform;function S(t){return t===y}function P(t,e,n,r){let i="",s=0,o=-1,a=0,c=0;for(let u=0;u<=t.length;++u){if(u<t.length)c=t.charCodeAt(u);else{if(r(c))break;c=y}if(r(c)){if(o===u-1||1===a);else if(2===a){if(i.length<2||2!==s||i.charCodeAt(i.length-1)!==p||i.charCodeAt(i.length-2)!==p){if(i.length>2){const t=i.indexOf(n);-1===t?(i="",s=0):(i=i.slice(0,t),s=i.length-1-i.indexOf(n)),o=u,a=0;continue}if(0!==i.length){i="",s=0,o=u,a=0;continue}}e&&(i+=i.length>0?`${n}..`:"..",s=2)}else i.length>0?i+=`${n}${t.slice(o+1,u)}`:i=t.slice(o+1,u),s=u-o-1;o=u,a=0}else c===p&&-1!==a?++a:a=-1}return i}function D(...t){if(N)return function(t){let e="",n="",i=!1;for(let s=t.length-1;s>=-1;s--){let o;if(s>=0){if(o=t[s],r(o,"path"),0===o.length)continue}else if(0===e.length)o="undefined"!=typeof process&&"function"==typeof process.cwd?process.cwd():"";else{const t=`=${e}`,n="undefined"!=typeof process?process.env:void 0;o=n&&"string"==typeof n[t]?n[t]:"undefined"!=typeof process&&"function"==typeof process.cwd?process.cwd():"",(void 0===o||o.slice(0,2).toLowerCase()!==e.toLowerCase()&&o.charCodeAt(2)===m)&&(o=`${e}\\`)}const a=o.length;let c=0,u="",f=!1;const h=o.charCodeAt(0);if(1===a)w(h)&&(c=1,f=!0);else if(w(h))if(f=!0,w(o.charCodeAt(1))){let t=2,e=t;for(;t<a&&!w(o.charCodeAt(t));)t++;if(t<a&&t!==e){const n=o.slice(e,t);for(e=t;t<a&&w(o.charCodeAt(t));)t++;if(t<a&&t!==e){for(e=t;t<a&&!w(o.charCodeAt(t));)t++;t!==a&&t===e||(u=`\\\\${n}\\${o.slice(e,t)}`,c=t)}}}else c=1;else B(h)&&o.charCodeAt(1)===E&&(u=o.slice(0,2),c=2,a>2&&w(o.charCodeAt(2))&&(f=!0,c=3));if(u.length>0)if(e.length>0){if(u.toLowerCase()!==e.toLowerCase())continue}else e=u;if(i){if(e.length>0)break}else if(n=`${o.slice(c)}\\${n}`,i=f,f&&e.length>0)break}return n=P(n,!i,"\\",w),e+(i?"\\":"")+n||"."}(t);let e="",n=!1;for(let i=t.length-1;i>=-1&&!n;i--){const s=i>=0?t[i]:"/";r(s,"path"),0!==s.length&&(e=`${s}/${e}`,n=s.charCodeAt(0)===y)}return e=P(e,!n,"/",S),n?`/${e}`:e.length>0?e:"."}const F={FD_DATASYNC:BigInt(1)<<BigInt(0),FD_READ:BigInt(1)<<BigInt(1),FD_SEEK:BigInt(1)<<BigInt(2),FD_FDSTAT_SET_FLAGS:BigInt(1)<<BigInt(3),FD_SYNC:BigInt(1)<<BigInt(4),FD_TELL:BigInt(1)<<BigInt(5),FD_WRITE:BigInt(1)<<BigInt(6),FD_ADVISE:BigInt(1)<<BigInt(7),FD_ALLOCATE:BigInt(1)<<BigInt(8),PATH_CREATE_DIRECTORY:BigInt(1)<<BigInt(9),PATH_CREATE_FILE:BigInt(1)<<BigInt(10),PATH_LINK_SOURCE:BigInt(1)<<BigInt(11),PATH_LINK_TARGET:BigInt(1)<<BigInt(12),PATH_OPEN:BigInt(1)<<BigInt(13),FD_READDIR:BigInt(1)<<BigInt(14),PATH_READLINK:BigInt(1)<<BigInt(15),PATH_RENAME_SOURCE:BigInt(1)<<BigInt(16),PATH_RENAME_TARGET:BigInt(1)<<BigInt(17),PATH_FILESTAT_GET:BigInt(1)<<BigInt(18),PATH_FILESTAT_SET_SIZE:BigInt(1)<<BigInt(19),PATH_FILESTAT_SET_TIMES:BigInt(1)<<BigInt(20),FD_FILESTAT_GET:BigInt(1)<<BigInt(21),FD_FILESTAT_SET_SIZE:BigInt(1)<<BigInt(22),FD_FILESTAT_SET_TIMES:BigInt(1)<<BigInt(23),PATH_SYMLINK:BigInt(1)<<BigInt(24),PATH_REMOVE_DIRECTORY:BigInt(1)<<BigInt(25),PATH_UNLINK_FILE:BigInt(1)<<BigInt(26),POLL_FD_READWRITE:BigInt(1)<<BigInt(27),SOCK_SHUTDOWN:BigInt(1)<<BigInt(28),SOCK_ACCEPT:BigInt(1)<<BigInt(29)};class v extends Error{constructor(t,e){super(t),this.errno=e}getErrorMessage(){return function(t){switch(t){case 0:return"Success";case 1:return"Argument list too long";case 2:return"Permission denied";case 3:return"Address in use";case 4:return"Address not available";case 5:return"Address family not supported by protocol";case 6:return"Resource temporarily unavailable";case 7:return"Operation already in progress";case 8:return"Bad file descriptor";case 9:return"Bad message";case 10:return"Resource busy";case 11:return"Operation canceled";case 12:return"No child process";case 13:return"Connection aborted";case 14:return"Connection refused";case 15:return"Connection reset by peer";case 16:return"Resource deadlock would occur";case 17:return"Destination address required";case 18:return"Domain error";case 19:return"Quota exceeded";case 20:return"File exists";case 21:return"Bad address";case 22:return"File too large";case 23:return"Host is unreachable";case 24:return"Identifier removed";case 25:return"Illegal byte sequence";case 26:return"Operation in progress";case 27:return"Interrupted system call";case 28:return"Invalid argument";case 29:return"I/O error";case 30:return"Socket is connected";case 31:return"Is a directory";case 32:return"Symbolic link loop";case 33:return"No file descriptors available";case 34:return"Too many links";case 35:return"Message too large";case 36:return"Multihop attempted";case 37:return"Filename too long";case 38:return"Network is down";case 39:return"Connection reset by network";case 40:return"Network unreachable";case 41:return"Too many files open in system";case 42:return"No buffer space available";case 43:return"No such device";case 44:return"No such file or directory";case 45:return"Exec format error";case 46:return"No locks available";case 47:return"Link has been severed";case 48:return"Out of memory";case 49:return"No message of the desired type";case 50:return"Protocol not available";case 51:return"No space left on device";case 52:return"Function not implemented";case 53:return"Socket not connected";case 54:return"Not a directory";case 55:return"Directory not empty";case 56:return"State not recoverable";case 57:return"Not a socket";case 58:return"Not supported";case 59:return"Not a tty";case 60:return"No such device or address";case 61:return"Value too large for data type";case 62:return"Previous owner died";case 63:return"Operation not permitted";case 64:return"Broken pipe";case 65:return"Protocol error";case 66:return"Protocol not supported";case 67:return"Protocol wrong type for socket";case 68:return"Result not representable";case 69:return"Read-only file system";case 70:return"Invalid seek";case 71:return"No such process";case 72:return"Stale file handle";case 73:return"Operation timed out";case 74:return"Text file busy";case 75:return"Cross-device link";case 76:return"Capabilities insufficient";default:return"Unknown error"}}(this.errno)}}Object.defineProperty(v.prototype,"name",{configurable:!0,writable:!0,value:"WasiError"});const U=F.FD_DATASYNC|F.FD_READ|F.FD_SEEK|F.FD_FDSTAT_SET_FLAGS|F.FD_SYNC|F.FD_TELL|F.FD_WRITE|F.FD_ADVISE|F.FD_ALLOCATE|F.PATH_CREATE_DIRECTORY|F.PATH_CREATE_FILE|F.PATH_LINK_SOURCE|F.PATH_LINK_TARGET|F.PATH_OPEN|F.FD_READDIR|F.PATH_READLINK|F.PATH_RENAME_SOURCE|F.PATH_RENAME_TARGET|F.PATH_FILESTAT_GET|F.PATH_FILESTAT_SET_SIZE|F.PATH_FILESTAT_SET_TIMES|F.FD_FILESTAT_GET|F.FD_FILESTAT_SET_TIMES|F.FD_FILESTAT_SET_SIZE|F.PATH_SYMLINK|F.PATH_UNLINK_FILE|F.PATH_REMOVE_DIRECTORY|F.POLL_FD_READWRITE|F.SOCK_SHUTDOWN|F.SOCK_ACCEPT,R=U,L=U,H=U,x=U,O=F.FD_DATASYNC|F.FD_READ|F.FD_SEEK|F.FD_FDSTAT_SET_FLAGS|F.FD_SYNC|F.FD_TELL|F.FD_WRITE|F.FD_ADVISE|F.FD_ALLOCATE|F.FD_FILESTAT_GET|F.FD_FILESTAT_SET_SIZE|F.FD_FILESTAT_SET_TIMES|F.POLL_FD_READWRITE,M=BigInt(0),C=F.FD_FDSTAT_SET_FLAGS|F.FD_SYNC|F.FD_ADVISE|F.PATH_CREATE_DIRECTORY|F.PATH_CREATE_FILE|F.PATH_LINK_SOURCE|F.PATH_LINK_TARGET|F.PATH_OPEN|F.FD_READDIR|F.PATH_READLINK|F.PATH_RENAME_SOURCE|F.PATH_RENAME_TARGET|F.PATH_FILESTAT_GET|F.PATH_FILESTAT_SET_SIZE|F.PATH_FILESTAT_SET_TIMES|F.FD_FILESTAT_GET|F.FD_FILESTAT_SET_TIMES|F.PATH_SYMLINK|F.PATH_UNLINK_FILE|F.PATH_REMOVE_DIRECTORY|F.POLL_FD_READWRITE,k=C|O,W=F.FD_READ|F.FD_FDSTAT_SET_FLAGS|F.FD_WRITE|F.FD_FILESTAT_GET|F.POLL_FD_READWRITE|F.SOCK_SHUTDOWN,z=U,K=F.FD_READ|F.FD_FDSTAT_SET_FLAGS|F.FD_WRITE|F.FD_FILESTAT_GET|F.POLL_FD_READWRITE,j=BigInt(0);function $(t,e,n,r){const i={base:BigInt(0),inheriting:BigInt(0)};if(0===r)throw new v("Unknown file type",28);switch(r){case 4:i.base=O,i.inheriting=M;break;case 3:i.base=C,i.inheriting=k;break;case 6:case 5:i.base=W,i.inheriting=z;break;case 2:-1!==t.indexOf(e)?(i.base=K,i.inheriting=j):(i.base=H,i.inheriting=x);break;case 1:i.base=R,i.inheriting=L;break;default:i.base=BigInt(0),i.inheriting=BigInt(0)}const s=3&n;return 0===s?i.base&=~F.FD_WRITE:1===s&&(i.base&=~F.FD_READ),i}function G(t,e){let n=0;if("number"==typeof e&&e>=0)n=e;else for(let e=0;e<t.length;e++){n+=t[e].length}let r=0;const i=new Uint8Array(n);for(let e=0;e<t.length;e++){const n=t[e];i.set(n,r),r+=n.length}return i}class Y{constructor(t,e,n,r,i,s,o,a){this.id=t,this.fd=e,this.path=n,this.realPath=r,this.type=i,this.rightsBase=s,this.rightsInheriting=o,this.preopen=a,this.pos=BigInt(0),this.size=BigInt(0)}seek(t,e){if(0===e)this.pos=BigInt(t);else if(1===e)this.pos+=BigInt(t);else{if(2!==e)throw new v("Unknown whence",29);this.pos=BigInt(this.size)-BigInt(t)}return this.pos}}class V extends Y{constructor(t,e,n,r,i,s,o,a,c){super(e,n,r,i,s,o,a,c),this._log=t,this._buf=null}write(t){const e=t;if(this._buf&&(t=G([this._buf,t]),this._buf=null),-1===t.indexOf(10))return this._buf=t,e.byteLength;let n,r=0,i=0;for(;-1!==(n=t.indexOf(10,r));){const e=(new TextDecoder).decode(t.subarray(i,n));this._log(e),r+=n-i+1,i=n+1}return r<t.length&&(this._buf=t.slice(r)),e.byteLength}}function Z(t){return t.isBlockDevice()?1:t.isCharacterDevice()?2:t.isDirectory()?3:t.isSocket()?6:t.isFile()?4:t.isSymbolicLink()?7:0}function q(t,e,n){t.setBigUint64(e,n.dev,!0),t.setBigUint64(e+8,n.ino,!0),t.setBigUint64(e+16,BigInt(Z(n)),!0),t.setBigUint64(e+24,n.nlink,!0),t.setBigUint64(e+32,n.size,!0),t.setBigUint64(e+40,n.atimeMs*BigInt(1e6),!0),t.setBigUint64(e+48,n.mtimeMs*BigInt(1e6),!0),t.setBigUint64(e+56,n.ctimeMs*BigInt(1e6),!0)}class X{constructor(t){this.used=0,this.size=t.size,this.fds=Array(t.size),this.stdio=[t.in,t.out,t.err],this.print=t.print,this.printErr=t.printErr,this.insertStdio(t.in,0,"<stdin>"),this.insertStdio(t.out,1,"<stdout>"),this.insertStdio(t.err,2,"<stderr>")}insertStdio(t,e,n){const{base:r,inheriting:i}=$(this.stdio,t,2,2),s=this.insert(t,n,n,2,r,i,0);if(s.id!==e)throw new v(`id: ${s.id} !== expected: ${e}`,8);return s}insert(t,e,n,r,i,s,o){var a,c;let u,f=-1;if(this.used>=this.size){const t=2*this.size;this.fds.length=t,f=this.size,this.size=t}else for(let t=0;t<this.size;++t)if(null==this.fds[t]){f=t;break}return u="<stdout>"===e?new V(null!==(a=this.print)&&void 0!==a?a:console.log,f,t,e,n,r,i,s,o):"<stderr>"===e?new V(null!==(c=this.printErr)&&void 0!==c?c:console.error,f,t,e,n,r,i,s,o):new Y(f,t,e,n,r,i,s,o),this.fds[f]=u,this.used++,u}get(t,e,n){if(t>=this.size)throw new v("Invalid fd",8);const r=this.fds[t];if(!r||r.id!==t)throw new v("Bad file descriptor",8);if((~r.rightsBase&e)!==BigInt(0)||(~r.rightsInheriting&n)!==BigInt(0))throw new v("Capabilities insufficient",76);return r}remove(t){if(t>=this.size)throw new v("Invalid fd",8);const e=this.fds[t];if(!e||e.id!==t)throw new v("Bad file descriptor",8);this.fds[t]=void 0,this.used--}}class Q extends X{constructor(t){super(t),this.fs=t.fs}getFileTypeByFd(t){return Z(this.fs.fstatSync(t,{bigint:!0}))}insertPreopen(t,e,n){const r=this.getFileTypeByFd(t);if(3!==r)throw new v(`Preopen not dir: ["${e}", "${n}"]`,54);const i=$(this.stdio,t,0,r);return this.insert(t,e,n,r,i.base,i.inheriting,1)}renumber(t,e){if(t===e)return;if(t>=this.size||e>=this.size)throw new v("Invalid fd",8);const n=this.fds[t],r=this.fds[e];if(!n||!r||n.id!==t||r.id!==e)throw new v("Invalid fd",8);this.fs.closeSync(n.fd),this.fds[t]=this.fds[e],this.fds[t].id=t,this.fds[e]=void 0,this.used--}}class J extends X{constructor(t){super(t)}async getFileTypeByFd(t){return Z(await t.stat({bigint:!0}))}async insertPreopen(t,e,n){const r=await this.getFileTypeByFd(t);if(3!==r)throw new v(`Preopen not dir: ["${e}", "${n}"]`,54);const i=$(this.stdio,t.fd,0,r);return this.insert(t,e,n,r,i.base,i.inheriting,1)}async renumber(t,e){if(t===e)return;if(t>=this.size||e>=this.size)throw new v("Invalid fd",8);const n=this.fds[t],r=this.fds[e];if(!n||!r||n.id!==t||r.id!==e)throw new v("Invalid fd",8);await n.fd.close(),this.fds[t]=this.fds[e],this.fds[t].id=t,this.fds[e]=void 0,this.used--}}const tt=function(){return e.Memory}();class et extends tt{constructor(t){super(t)}get HEAP8(){return new Int8Array(super.buffer)}get HEAPU8(){return new Uint8Array(super.buffer)}get HEAP16(){return new Int16Array(super.buffer)}get HEAPU16(){return new Uint16Array(super.buffer)}get HEAP32(){return new Int32Array(super.buffer)}get HEAPU32(){return new Uint32Array(super.buffer)}get HEAP64(){return new BigInt64Array(super.buffer)}get HEAPU64(){return new BigUint64Array(super.buffer)}get HEAPF32(){return new Float32Array(super.buffer)}get HEAPF64(){return new Float64Array(super.buffer)}get view(){return new DataView(super.buffer)}}function nt(t){return Object.getPrototypeOf(t)===e.Memory.prototype&&Object.setPrototypeOf(t,et.prototype),t}function rt(){const t=e.Function;if("function"!=typeof t)throw new Error('WebAssembly.Function is not supported in this environment. If you are using V8 based browser like Chrome, try to specify --js-flags="--wasm-staging --experimental-wasm-stack-switching"');return t}function it(t,e,n){const r=rt();if("function"!=typeof t)throw new TypeError("Function required");const i=e.slice(0);return i.unshift("externref"),new r({parameters:i,results:n},t,{suspending:"first"})}function st(t){const e=rt();if("function"!=typeof t)throw new TypeError("Function required");return new e({parameters:[...e.type(t).parameters.slice(1)],results:["externref"]},t,{promising:"first"})}const ot="undefined"!=typeof process&&"win32"===process.platform;function at(t){let e=3&t;return 0!=(64&t)&&(e|=256),0!=(128&t)&&(e|=1024),0!=(512&t)&&(e|=512),0!=(1024&t)&&(e|=8),e}function ct(t,e){if(0===t.length||0===e.length)return 0;let n=0,r=e.length-n;for(let i=0;i<t.length;++i){const s=t[i];if(r<s.length)return s.set(e.subarray(n,n+r),0),n+=r,r=0,n;s.set(e.subarray(n,n+s.length),0),n+=s.length,r-=s.length}return n}const ut=new WeakMap,ft=new WeakMap,ht=new WeakMap;function dt(t,e=0){const n=ut.get(t);return function(t,e){let n=t.buffer;e>n.byteLength&&(t.grow(0),n=t.buffer)}(n,e),n}function gt(t){const e=ht.get(t);if(!e)throw new Error("filesystem is unavailable");return e}function lt(t){if(t instanceof v)return t.errno;switch(t.code){case"ENOENT":return 44;case"EBADF":return 8;case"EINVAL":return 28;case"EPERM":return 63;case"EPROTO":return 65;case"EEXIST":return 20;case"ENOTDIR":return 54;case"EMFILE":return 33;case"EACCES":return 2;case"EISDIR":return 31;case"ENOTEMPTY":return 55;case"ENOSYS":return 52}throw t}function _t(t,e){return Object.defineProperty(e,"name",{value:t}),e}function pt(t,e,n){let r;try{r=t.apply(e,n)}catch(t){return lt(t)}return o(r)?r.then((t=>t),lt):r}function yt(t,e,n){let r=!1;const i=(()=>{try{return}catch(t){return}})();return"string"==typeof i&&i.split(",").includes("wasi")&&(r=!0),_t(e,r?function(){const r=Array.prototype.slice.call(arguments);let i=[`${e}(${Array.from({length:arguments.length}).map((()=>"%d")).join(", ")})`];return i=i.concat(r),console.debug.apply(console,i),pt(n,t,r)}:function(){return pt(n,t,arguments)})}function mt(t,e,n,r){let i=D(e.realPath,n);if(1==(1&r))try{i=t.readlinkSync(i)}catch(t){if("EINVAL"!==t.code&&"ENOENT"!==t.code)throw t}return i}async function Et(t,e,n,r){let i=D(e.realPath,n);if(1==(1&r))try{i=await t.promises.readlink(i)}catch(t){if("EINVAL"!==t.code&&"ENOENT"!==t.code)throw t}return i}const It=new TextEncoder,bt=new TextDecoder,At=(BigInt(1)<<BigInt(63))-BigInt(1);function Tt(){const t=window.prompt();if(null===t)return new Uint8Array;return(new TextEncoder).encode(t+"\n")}function wt(t){return Boolean(-16&t)||3==(3&t)||12==(12&t)}class Bt{constructor(t,n,r,i,s,o){this.args_get=yt(this,"args_get",(function(t,e){if(t=Number(t),e=Number(e),0===t||0===e)return 28;const n=ft.get(this).args,r=It.encode(n.join("\0")+"\0").length,{HEAPU8:i,view:s}=dt(this,Math.max(t+4*n.length,e+r));for(let r=0;r<n.length;++r){const o=n[r];s.setInt32(t,e,!0),t+=4;const a=It.encode(o+"\0");i.set(a,e),e+=a.length}return 0})),this.args_sizes_get=yt(this,"args_sizes_get",(function(t,e){if(t=Number(t),e=Number(e),0===t||0===e)return 28;const{view:n}=dt(this,Math.max(t+4,e+4)),r=ft.get(this).args;return n.setUint32(t,r.length,!0),n.setUint32(e,It.encode(r.join("\0")+"\0").length,!0),0})),this.environ_get=yt(this,"environ_get",(function(t,e){if(t=Number(t),e=Number(e),0===t||0===e)return 28;const n=ft.get(this).env,r=It.encode(n.join("\0")+"\0").length,{HEAPU8:i,view:s}=dt(this,Math.max(t+4*n.length,e+r));for(let r=0;r<n.length;++r){const o=n[r];s.setInt32(t,e,!0),t+=4;const a=It.encode(o+"\0");i.set(a,e),e+=a.length}return 0})),this.environ_sizes_get=yt(this,"environ_sizes_get",(function(t,e){if(t=Number(t),e=Number(e),0===t||0===e)return 28;const{view:n}=dt(this,Math.max(t+4,e+4)),r=ft.get(this);return n.setUint32(t,r.env.length,!0),n.setUint32(e,It.encode(r.env.join("\0")+"\0").length,!0),0})),this.clock_res_get=yt(this,"clock_res_get",(function(t,e){if(0===(e=Number(e)))return 28;const{view:n}=dt(this,e+8);switch(t){case 0:return n.setBigUint64(e,BigInt(1e6),!0),0;case 1:case 2:case 3:return n.setBigUint64(e,BigInt(1e3),!0),0;default:return 28}})),this.clock_time_get=yt(this,"clock_time_get",(function(t,e,n){if(0===(n=Number(n)))return 28;const{view:r}=dt(this,n+8);switch(t){case 0:return r.setBigUint64(n,BigInt(Date.now())*BigInt(1e6),!0),0;case 1:case 2:case 3:{const t=performance.now()/1e3,e=Math.trunc(t),i=Math.floor(1e3*(t-e)),s=BigInt(e)*BigInt(1e9)+BigInt(i)*BigInt(1e6);return r.setBigUint64(n,s,!0),0}default:return 28}})),this.fd_advise=yt(this,"fd_advise",(function(t,e,n,r){return 52})),this.fd_fdstat_get=yt(this,"fd_fdstat_get",(function(t,e){if(0===(e=Number(e)))return 28;const n=ft.get(this).fds.get(t,BigInt(0),BigInt(0)),{view:r}=dt(this,e+24);return r.setUint16(e,n.type,!0),r.setUint16(e+2,0,!0),r.setBigUint64(e+8,n.rightsBase,!0),r.setBigUint64(e+16,n.rightsInheriting,!0),0})),this.fd_fdstat_set_flags=yt(this,"fd_fdstat_set_flags",(function(t,e){return 52})),this.fd_fdstat_set_rights=yt(this,"fd_fdstat_set_rights",(function(t,e,n){const r=ft.get(this).fds.get(t,BigInt(0),BigInt(0));return(e|r.rightsBase)>r.rightsBase||(n|r.rightsInheriting)>r.rightsInheriting?76:(r.rightsBase=e,r.rightsInheriting=n,0)})),this.fd_prestat_get=yt(this,"fd_prestat_get",(function(t,e){if(0===(e=Number(e)))return 28;const n=ft.get(this);let r;try{r=n.fds.get(t,BigInt(0),BigInt(0))}catch(t){if(t instanceof v)return t.errno;throw t}if(1!==r.preopen)return 28;const{view:i}=dt(this,e+8);return i.setUint32(e,0,!0),i.setUint32(e+4,It.encode(r.path).length,!0),0})),this.fd_prestat_dir_name=yt(this,"fd_prestat_dir_name",(function(t,e,n){if(e=Number(e),n=Number(n),0===e)return 28;const r=ft.get(this).fds.get(t,BigInt(0),BigInt(0));if(1!==r.preopen)return 8;const i=It.encode(r.path),s=i.length;if(s>n)return 42;const{HEAPU8:o}=dt(this,e+s);return o.set(i,e),0})),this.fd_seek=yt(this,"fd_seek",(function(t,e,n,r){if(0===(r=Number(r)))return 28;if(0===t||1===t||2===t)return 0;const i=ft.get(this).fds.get(t,F.FD_SEEK,BigInt(0)).seek(e,n),{view:s}=dt(this,r+8);return s.setBigUint64(r,i,!0),0})),this.fd_tell=yt(this,"fd_tell",(function(t,e){const n=ft.get(this).fds.get(t,F.FD_TELL,BigInt(0)),r=BigInt(n.pos),{view:i}=dt(this,Number(e)+8);return i.setBigUint64(Number(e),r,!0),0})),this.poll_oneoff=yt(this,"poll_oneoff",(function(t,e,n,r){if(t=Number(t),e=Number(e),r=Number(r),n=Number(n),n>>>=0,0===t||0===e||0===n||0===r)return 28;const{view:i}=dt(this,Math.max(t+48*n,e+32*n,r+4));i.setUint32(r,0,!0);let s,o=0,a=BigInt(0),c=BigInt(0),u=0,f=BigInt(0);const h=Array(n);for(o=0;o<n;o++){s=t+48*o;const e=i.getBigUint64(s,!0),n=i.getUint8(s+8),r=i.getUint32(s+16,!0),a=i.getBigUint64(s+24,!0),c=i.getBigUint64(s+32,!0),u=i.getUint16(s+40,!0);h[o]={userdata:e,type:n,u:{clock:{clock_id:r,timeout:a,precision:c,flags:u},fd_readwrite:{fd:r}}}}const d=[];for(o=0;o<n;o++)switch(s=h[o],s.type){case 0:if(1===s.u.clock.flags){const t=BigInt(Date.now())*BigInt(1e6);c=s.u.clock.timeout-t}else c=s.u.clock.timeout;(0===u||c<f)&&(f=c,a=s.userdata,u=1);break;case 1:case 2:d.push(s);break;default:return 28}if(d.length>0){for(o=0;o<d.length;o++){const t=d[o],n=e+32*o;i.setBigUint64(n,t.userdata,!0),i.setUint32(n+8,52,!0),i.setUint32(n+12,t.type,!0),i.setBigUint64(n+16,BigInt(0),!0),i.setUint16(n+24,0,!0),i.setUint32(r,1,!0)}return i.setUint32(r,d.length,!0),0}if(u){!function(t,e){const n=Date.now()+t;let r=!1;for(;Date.now()<n;)if(e()){r=!0;break}}(Number(f/BigInt(1e6)),(()=>!1));const t=e;i.setBigUint64(t,a,!0),i.setUint32(t+8,0,!0),i.setUint32(t+12,0,!0),i.setUint32(r,1,!0)}return 0})),this.proc_exit=yt(this,"proc_exit",(function(t){return"object"==typeof process&&null!==process&&"function"==typeof process.exit&&process.exit(t),0})),this.proc_raise=yt(this,"proc_raise",(function(t){return 52})),this.sched_yield=yt(this,"sched_yield",(function(){return 0})),this.random_get="undefined"!=typeof crypto&&"function"==typeof crypto.getRandomValues?yt(this,"random_get",(function(t,e){if(0===(t=Number(t)))return 28;e=Number(e);const{HEAPU8:n,view:r}=dt(this,t+e);if("function"==typeof SharedArrayBuffer&&n.buffer instanceof SharedArrayBuffer||"[object SharedArrayBuffer]"===Object.prototype.toString.call(n.buffer)){for(let n=t;n<t+e;++n)r.setUint8(n,Math.floor(256*Math.random()));return 0}let i;const s=65536;for(i=0;i+s<e;i+=s)crypto.getRandomValues(n.subarray(t+i,t+i+s));return crypto.getRandomValues(n.subarray(t+i,t+e)),0})):yt(this,"random_get",(function(t,e){if(0===(t=Number(t)))return 28;e=Number(e);const{view:n}=dt(this,t+e);for(let r=t;r<t+e;++r)n.setUint8(r,Math.floor(256*Math.random()));return 0})),this.sock_recv=yt(this,"sock_recv",(function(){return 58})),this.sock_send=yt(this,"sock_send",(function(){return 58})),this.sock_shutdown=yt(this,"sock_shutdown",(function(){return 58})),this.sock_accept=yt(this,"sock_accept",(function(){return 58})),ft.set(this,{fds:r,args:t,env:n}),s&&ht.set(this,s);const a=this;function u(t,e,n,r,s){a[t]=i?o?o.wrapImportFunction(yt(a,t,n)):it(yt(a,t,n),r,s):yt(a,t,e)}function f(t,e,n,r){const i=ft.get(this).fds.get(t,F.FD_FILESTAT_SET_TIMES,BigInt(0));return 2==(2&r)&&(e=BigInt(1e6*Date.now())),8==(8&r)&&(n=BigInt(1e6*Date.now())),{fileDescriptor:i,atim:e,mtim:n}}function h(t,e,n,r){const i=(e&(F.FD_READ|F.FD_READDIR))!==BigInt(0),s=(e&(F.FD_DATASYNC|F.FD_WRITE|F.FD_ALLOCATE|F.FD_FILESTAT_SET_SIZE))!==BigInt(0);let o=s?i?2:1:0,a=F.PATH_OPEN,c=e|n;return 0!=(1&t)&&(o|=64,a|=F.PATH_CREATE_FILE),0!=(2&t)&&(o|=65536),0!=(4&t)&&(o|=128),0!=(8&t)&&(o|=512,a|=F.PATH_FILESTAT_SET_SIZE),0!=(1&r)&&(o|=1024),0!=(2&r)&&(c|=F.FD_DATASYNC),0!=(4&r)&&(o|=2048),0!=(8&r)&&(o|=1052672,c|=F.FD_SYNC),0!=(16&r)&&(o|=1052672,c|=F.FD_SYNC),s&&0==(1536&o)&&(c|=F.FD_SEEK),{flags:o,needed_base:a,needed_inheriting:c}}u("fd_allocate",(function(t,e,n){const r=ft.get(this),i=gt(this),s=r.fds.get(t,F.FD_ALLOCATE,BigInt(0));return i.fstatSync(s.fd,{bigint:!0}).size<e+n&&i.ftruncateSync(s.fd,Number(e+n)),0}),(async function(t,e,n){const r=ft.get(this).fds.get(t,F.FD_ALLOCATE,BigInt(0)).fd;return(await r.stat({bigint:!0})).size<e+n&&await r.truncate(Number(e+n)),0}),["i32","i64","f64"],["i32"]),u("fd_close",(function(t){const e=ft.get(this),n=e.fds.get(t,BigInt(0),BigInt(0));return gt(this).closeSync(n.fd),e.fds.remove(t),0}),(async function(t){const e=ft.get(this),n=e.fds.get(t,BigInt(0),BigInt(0));return await n.fd.close(),e.fds.remove(t),0}),["i32"],["i32"]),u("fd_datasync",(function(t){const e=ft.get(this).fds.get(t,F.FD_DATASYNC,BigInt(0));return gt(this).fdatasyncSync(e.fd),0}),(async function(t){const e=ft.get(this).fds.get(t,F.FD_DATASYNC,BigInt(0));return await e.fd.datasync(),0}),["i32"],["i32"]),u("fd_filestat_get",(function(t,e){if(0===(e=Number(e)))return 28;const n=ft.get(this).fds.get(t,F.FD_FILESTAT_GET,BigInt(0)),r=gt(this).fstatSync(n.fd,{bigint:!0}),{view:i}=dt(this,e+64);return q(i,e,r),0}),(async function(t,e){if(0===(e=Number(e)))return 28;const n=ft.get(this).fds.get(t,F.FD_FILESTAT_GET,BigInt(0)).fd,r=await n.stat({bigint:!0}),{view:i}=dt(this,e+64);return q(i,e,r),0}),["i32","i32"],["i32"]),u("fd_filestat_set_size",(function(t,e){const n=ft.get(this).fds.get(t,F.FD_FILESTAT_SET_SIZE,BigInt(0));return gt(this).ftruncateSync(n.fd,Number(e)),0}),(async function(t,e){const n=ft.get(this).fds.get(t,F.FD_FILESTAT_SET_SIZE,BigInt(0)).fd;return await n.truncate(Number(e)),0}),["i32","i64"],["i32"]),u("fd_filestat_set_times",(function(t,e,n,r){if(wt(r))return 28;const{fileDescriptor:i,atim:s,mtim:o}=f.call(this,t,e,n,r);return gt(this).futimesSync(i.fd,Number(s),Number(o)),0}),(async function(t,e,n,r){if(wt(r))return 28;const{fileDescriptor:i,atim:s,mtim:o}=f.call(this,t,e,n,r),a=i.fd;return await a.utimes(Number(s),Number(o)),0}),["i32","i64","i64","i32"],["i32"]),u("fd_pread",(function(t,e,n,r,i){if(e=Number(e),i=Number(i),0===e&&n||0===i||r>At)return 28;const{HEAPU8:s,view:o}=dt(this,Math.max(e+8*Number(n),i+4)),a=ft.get(this).fds.get(t,F.FD_READ|F.FD_SEEK,BigInt(0));if(!n)return o.setUint32(i,0,!0),0;let c=0;const u=Array.from({length:Number(n)},((t,n)=>{const r=e+8*n,i=o.getInt32(r,!0),a=o.getUint32(r+4,!0);return c+=a,s.subarray(i,i+a)}));let f=0;const h=(()=>{try{return new Uint8Array(new SharedArrayBuffer(c))}catch(t){return new Uint8Array(c)}})();h._isBuffer=!0;const d=gt(this).readSync(a.fd,h,0,h.length,Number(r));return f=h?ct(u,h.subarray(0,d)):0,o.setUint32(i,f,!0),0}),(async function(t,e,n,r,i){if(e=Number(e),i=Number(i),0===e&&n||0===i||r>At)return 28;const{HEAPU8:s,view:o}=dt(this,Math.max(e+8*Number(n),i+4)),a=ft.get(this).fds.get(t,F.FD_READ|F.FD_SEEK,BigInt(0));if(!n)return o.setUint32(i,0,!0),0;let c=0;const u=Array.from({length:Number(n)},((t,n)=>{const r=e+8*n,i=o.getInt32(r,!0),a=o.getUint32(r+4,!0);return c+=a,s.subarray(i,i+a)}));let f=0;const h=new Uint8Array(c);h._isBuffer=!0;const{bytesRead:d}=await a.fd.read(h,0,h.length,Number(r));return f=h?ct(u,h.subarray(0,d)):0,o.setUint32(i,f,!0),0}),["i32","i32","i32","i64","i32"],["i32"]),u("fd_pwrite",(function(t,e,n,r,i){if(e=Number(e),i=Number(i),0===e&&n||0===i||r>At)return 28;const{HEAPU8:s,view:o}=dt(this,Math.max(e+8*Number(n),i+4)),a=ft.get(this).fds.get(t,F.FD_WRITE|F.FD_SEEK,BigInt(0));if(!n)return o.setUint32(i,0,!0),0;const c=G(Array.from({length:Number(n)},((t,n)=>{const r=e+8*n,i=o.getInt32(r,!0),a=o.getUint32(r+4,!0);return s.subarray(i,i+a)}))),u=gt(this).writeSync(a.fd,c,0,c.length,Number(r));return o.setUint32(i,u,!0),0}),(async function(t,e,n,r,i){if(e=Number(e),i=Number(i),0===e&&n||0===i||r>At)return 28;const{HEAPU8:s,view:o}=dt(this,Math.max(e+8*Number(n),i+4)),a=ft.get(this).fds.get(t,F.FD_WRITE|F.FD_SEEK,BigInt(0));if(!n)return o.setUint32(i,0,!0),0;const c=G(Array.from({length:Number(n)},((t,n)=>{const r=e+8*n,i=o.getInt32(r,!0),a=o.getUint32(r+4,!0);return s.subarray(i,i+a)}))),{bytesWritten:u}=await a.fd.write(c,0,c.length,Number(r));return o.setUint32(i,u,!0),0}),["i32","i32","i32","i64","i32"],["i32"]),u("fd_read",(function(t,e,n,r){if(e=Number(e),r=Number(r),0===e&&n||0===r)return 28;const{HEAPU8:i,view:s}=dt(this,Math.max(e+8*Number(n),r+4)),o=ft.get(this).fds.get(t,F.FD_READ,BigInt(0));if(!n)return s.setUint32(r,0,!0),0;let a=0;const c=Array.from({length:Number(n)},((t,n)=>{const r=e+8*n,o=s.getInt32(r,!0),c=s.getUint32(r+4,!0);return a+=c,i.subarray(o,o+c)}));let u,f=0;if(0===t){if("undefined"==typeof window||"function"!=typeof window.prompt)return 58;u=Tt(),f=u?ct(c,u):0}else{u=(()=>{try{return new Uint8Array(new SharedArrayBuffer(a))}catch(t){return new Uint8Array(a)}})(),u._isBuffer=!0;const t=gt(this).readSync(o.fd,u,0,u.length,Number(o.pos));f=u?ct(c,u.subarray(0,t)):0,o.pos+=BigInt(f)}return s.setUint32(r,f,!0),0}),(async function(t,e,n,r){if(e=Number(e),r=Number(r),0===e&&n||0===r)return 28;const{HEAPU8:i,view:s}=dt(this,Math.max(e+8*Number(n),r+4)),o=ft.get(this).fds.get(t,F.FD_READ,BigInt(0));if(!n)return s.setUint32(r,0,!0),0;let a=0;const c=Array.from({length:Number(n)},((t,n)=>{const r=e+8*n,o=s.getInt32(r,!0),c=s.getUint32(r+4,!0);return a+=c,i.subarray(o,o+c)}));let u,f=0;if(0===t){if("undefined"==typeof window||"function"!=typeof window.prompt)return 58;u=Tt(),f=u?ct(c,u):0}else{u=new Uint8Array(a),u._isBuffer=!0;const{bytesRead:t}=await o.fd.read(u,0,u.length,Number(o.pos));f=u?ct(c,u.subarray(0,t)):0,o.pos+=BigInt(f)}return s.setUint32(r,f,!0),0}),["i32","i32","i32","i32"],["i32"]),u("fd_readdir",(function(t,e,n,r,i){if(e=Number(e),n=Number(n),i=Number(i),0===e||0===i)return 0;const s=ft.get(this).fds.get(t,F.FD_READDIR,BigInt(0)),o=gt(this),a=o.readdirSync(s.realPath,{withFileTypes:!0}),{HEAPU8:c,view:u}=dt(this,Math.max(e+n,i+4));let f=0;for(let t=Number(r);t<a.length;t++){const r=It.encode(a[t].name),i=o.statSync(D(s.realPath,a[t].name),{bigint:!0}),u=new Uint8Array(24+r.byteLength),h=new DataView(u.buffer);let d;h.setBigUint64(0,BigInt(t+1),!0),h.setBigUint64(8,BigInt(i.ino?i.ino:0),!0),h.setUint32(16,r.byteLength,!0),d=a[t].isFile()?4:a[t].isDirectory()?3:a[t].isSymbolicLink()?7:a[t].isCharacterDevice()?2:a[t].isBlockDevice()?1:a[t].isSocket()?6:0,h.setUint8(20,d),u.set(r,24);const g=u.slice(0,Math.min(u.length,n-f));c.set(g,e+f),f+=g.byteLength}return u.setUint32(i,f,!0),0}),(async function(t,e,n,r,i){if(e=Number(e),n=Number(n),i=Number(i),0===e||0===i)return 0;const s=ft.get(this).fds.get(t,F.FD_READDIR,BigInt(0)),o=gt(this),a=await o.promises.readdir(s.realPath,{withFileTypes:!0}),{HEAPU8:c,view:u}=dt(this,Math.max(e+n,i+4));let f=0;for(let t=Number(r);t<a.length;t++){const r=It.encode(a[t].name),i=await o.promises.stat(D(s.realPath,a[t].name),{bigint:!0}),u=new Uint8Array(24+r.byteLength),h=new DataView(u.buffer);let d;h.setBigUint64(0,BigInt(t+1),!0),h.setBigUint64(8,BigInt(i.ino?i.ino:0),!0),h.setUint32(16,r.byteLength,!0),d=a[t].isFile()?4:a[t].isDirectory()?3:a[t].isSymbolicLink()?7:a[t].isCharacterDevice()?2:a[t].isBlockDevice()?1:a[t].isSocket()?6:0,h.setUint8(20,d),u.set(r,24);const g=u.slice(0,Math.min(u.length,n-f));c.set(g,e+f),f+=g.byteLength}return u.setUint32(i,f,!0),0}),["i32","i32","i32","i64","i32"],["i32"]),u("fd_renumber",(function(t,e){return ft.get(this).fds.renumber(e,t),0}),(async function(t,e){const n=ft.get(this);return await n.fds.renumber(e,t),0}),["i32","i32"],["i32"]),u("fd_sync",(function(t){const e=ft.get(this).fds.get(t,F.FD_SYNC,BigInt(0));return gt(this).fsyncSync(e.fd),0}),(async function(t){const e=ft.get(this).fds.get(t,F.FD_SYNC,BigInt(0));return await e.fd.sync(),0}),["i32"],["i32"]),u("fd_write",(function(t,e,n,r){if(e=Number(e),r=Number(r),0===e&&n||0===r)return 28;const{HEAPU8:i,view:s}=dt(this,Math.max(e+8*Number(n),r+4)),o=ft.get(this).fds.get(t,F.FD_WRITE,BigInt(0));if(!n)return s.setUint32(r,0,!0),0;const a=G(Array.from({length:Number(n)},((t,n)=>{const r=e+8*n,o=s.getInt32(r,!0),a=s.getUint32(r+4,!0);return i.subarray(o,o+a)})));let c;if(1===t||2===t)c=o.write(a);else{c=gt(this).writeSync(o.fd,a,0,a.length,Number(o.pos)),o.pos+=BigInt(c)}return s.setUint32(r,c,!0),0}),(async function(t,e,n,r){if(e=Number(e),r=Number(r),0===e&&n||0===r)return 28;const{HEAPU8:i,view:s}=dt(this,Math.max(e+8*Number(n),r+4)),o=ft.get(this).fds.get(t,F.FD_WRITE,BigInt(0));if(!n)return s.setUint32(r,0,!0),0;const a=G(Array.from({length:Number(n)},((t,n)=>{const r=e+8*n,o=s.getInt32(r,!0),a=s.getUint32(r+4,!0);return i.subarray(o,o+a)})));let c;return 1===t||2===t?c=o.write(a):(c=await(await o.fd.write(a,0,a.length,Number(o.pos))).bytesWritten,o.pos+=BigInt(c)),s.setUint32(r,c,!0),0}),["i32","i32","i32","i32"],["i32"]),u("path_create_directory",(function(t,e,n){if(e=Number(e),n=Number(n),0===e)return 28;const{HEAPU8:r}=dt(this,e+n),i=ft.get(this).fds.get(t,F.PATH_CREATE_DIRECTORY,BigInt(0));let s=bt.decode(c(r,e,e+n));s=D(i.realPath,s);return gt(this).mkdirSync(s),0}),(async function(t,e,n){if(e=Number(e),n=Number(n),0===e)return 28;const{HEAPU8:r}=dt(this,e+n),i=ft.get(this).fds.get(t,F.PATH_CREATE_DIRECTORY,BigInt(0));let s=bt.decode(c(r,e,e+n));s=D(i.realPath,s);const o=gt(this);return await o.promises.mkdir(s),0}),["i32","i32","i32"],["i32"]),u("path_filestat_get",(function(t,e,n,r,i){if(n=Number(n),r=Number(r),i=Number(i),0===n||0===i)return 28;const{HEAPU8:s,view:o}=dt(this,Math.max(n+r,i+64)),a=ft.get(this).fds.get(t,F.PATH_FILESTAT_GET,BigInt(0));let u=bt.decode(c(s,n,n+r));const f=gt(this);let h;return u=D(a.realPath,u),h=1==(1&e)?f.statSync(u,{bigint:!0}):f.lstatSync(u,{bigint:!0}),q(o,i,h),0}),(async function(t,e,n,r,i){if(n=Number(n),r=Number(r),i=Number(i),0===n||0===i)return 28;const{HEAPU8:s,view:o}=dt(this,Math.max(n+r,i+64)),a=ft.get(this).fds.get(t,F.PATH_FILESTAT_GET,BigInt(0));let u=bt.decode(c(s,n,n+r));const f=gt(this);let h;return u=D(a.realPath,u),h=1==(1&e)?await f.promises.stat(u,{bigint:!0}):await f.promises.lstat(u,{bigint:!0}),q(o,i,h),0}),["i32","i32","i32","i32","i32"],["i32"]),u("path_filestat_set_times",(function(t,e,n,r,i,s,o){if(n=Number(n),r=Number(r),0===n)return 28;const{HEAPU8:a}=dt(this,n+r),u=ft.get(this).fds.get(t,F.PATH_FILESTAT_SET_TIMES,BigInt(0));if(wt(o))return 28;const f=gt(this),h=mt(f,u,bt.decode(c(a,n,n+r)),e);return 2==(2&o)&&(i=BigInt(1e6*Date.now())),8==(8&o)&&(s=BigInt(1e6*Date.now())),f.utimesSync(h,Number(i),Number(s)),0}),(async function(t,e,n,r,i,s,o){if(n=Number(n),r=Number(r),0===n)return 28;const{HEAPU8:a}=dt(this,n+r),u=ft.get(this).fds.get(t,F.PATH_FILESTAT_SET_TIMES,BigInt(0));if(wt(o))return 28;const f=gt(this),h=await Et(f,u,bt.decode(c(a,n,n+r)),e);return 2==(2&o)&&(i=BigInt(1e6*Date.now())),8==(8&o)&&(s=BigInt(1e6*Date.now())),await f.promises.utimes(h,Number(i),Number(s)),0}),["i32","i32","i32","i32","i64","i64","i32"],["i32"]),u("path_link",(function(t,e,n,r,i,s,o){if(n=Number(n),r=Number(r),s=Number(s),o=Number(o),0===n||0===s)return 28;const a=ft.get(this);let u,f;t===i?u=f=a.fds.get(t,F.PATH_LINK_SOURCE|F.PATH_LINK_TARGET,BigInt(0)):(u=a.fds.get(t,F.PATH_LINK_SOURCE,BigInt(0)),f=a.fds.get(i,F.PATH_LINK_TARGET,BigInt(0)));const{HEAPU8:h}=dt(this,Math.max(n+r,s+o)),d=gt(this),g=mt(d,u,bt.decode(c(h,n,n+r)),e),l=D(f.realPath,bt.decode(c(h,s,s+o)));return d.linkSync(g,l),0}),(async function(t,e,n,r,i,s,o){if(n=Number(n),r=Number(r),s=Number(s),o=Number(o),0===n||0===s)return 28;const a=ft.get(this);let u,f;t===i?u=f=a.fds.get(t,F.PATH_LINK_SOURCE|F.PATH_LINK_TARGET,BigInt(0)):(u=a.fds.get(t,F.PATH_LINK_SOURCE,BigInt(0)),f=a.fds.get(i,F.PATH_LINK_TARGET,BigInt(0)));const{HEAPU8:h}=dt(this,Math.max(n+r,s+o)),d=gt(this),g=await Et(d,u,bt.decode(c(h,n,n+r)),e),l=D(f.realPath,bt.decode(c(h,s,s+o)));return await d.promises.link(g,l),0}),["i32","i32","i32","i32","i32","i32","i32"],["i32"]),u("path_open",(function(t,e,n,r,i,s,o,a,u){if(n=Number(n),u=Number(u),0===n||0===u)return 28;r=Number(r),s=BigInt(s),o=BigInt(o);const{flags:f,needed_base:d,needed_inheriting:g}=h(i,s,o,a),l=ft.get(this),_=l.fds.get(t,d,g),p=dt(this,Math.max(n+r,u+4)),y=p.HEAPU8,m=bt.decode(c(y,n,n+r)),E=gt(this),I=mt(E,_,m,e),b=E.openSync(I,ot?at(f):f,438),A=l.fds.getFileTypeByFd(b);if(3!==A&&(0!=(2&i)||I.endsWith("/")))return 54;const{base:T,inheriting:w}=$(l.fds.stdio,b,f,A),B=l.fds.insert(b,I,I,A,s&T,o&w,0),N=E.fstatSync(b,{bigint:!0});N.isFile()&&(B.size=N.size,0!=(1024&f)&&(B.pos=N.size));return p.view.setInt32(u,B.id,!0),0}),(async function(t,e,n,r,i,s,o,a,u){if(n=Number(n),u=Number(u),0===n||0===u)return 28;r=Number(r),s=BigInt(s),o=BigInt(o);const{flags:f,needed_base:d,needed_inheriting:g}=h(i,s,o,a),l=ft.get(this),_=l.fds.get(t,d,g),p=dt(this,Math.max(n+r,u+4)),y=p.HEAPU8,m=bt.decode(c(y,n,n+r)),E=gt(this),I=await Et(E,_,m,e),b=await E.promises.open(I,ot?at(f):f,438),A=await l.fds.getFileTypeByFd(b);if(0!=(2&i)&&3!==A)return 54;const{base:T,inheriting:w}=$(l.fds.stdio,b.fd,f,A),B=l.fds.insert(b,I,I,A,s&T,o&w,0),N=await b.stat({bigint:!0});N.isFile()&&(B.size=N.size,0!=(1024&f)&&(B.pos=N.size));return p.view.setInt32(u,B.id,!0),0}),["i32","i32","i32","i32","i32","i64","i64","i32","i32"],["i32"]),u("path_readlink",(function(t,e,n,r,i,s){if(e=Number(e),n=Number(n),r=Number(r),i=Number(i),s=Number(s),0===e||0===r||0===s)return 28;const{HEAPU8:o,view:a}=dt(this,Math.max(e+n,r+i,s+4)),u=ft.get(this).fds.get(t,F.PATH_READLINK,BigInt(0));let f=bt.decode(c(o,e,e+n));f=D(u.realPath,f);const h=gt(this).readlinkSync(f),d=It.encode(h),g=Math.min(d.length,i);return g>=i?42:(o.set(d.subarray(0,g),r),o[r+g]=0,a.setUint32(s,g,!0),0)}),(async function(t,e,n,r,i,s){if(e=Number(e),n=Number(n),r=Number(r),i=Number(i),s=Number(s),0===e||0===r||0===s)return 28;const{HEAPU8:o,view:a}=dt(this,Math.max(e+n,r+i,s+4)),u=ft.get(this).fds.get(t,F.PATH_READLINK,BigInt(0));let f=bt.decode(c(o,e,e+n));f=D(u.realPath,f);const h=gt(this),d=await h.promises.readlink(f),g=It.encode(d),l=Math.min(g.length,i);return l>=i?42:(o.set(g.subarray(0,l),r),o[r+l]=0,a.setUint32(s,l,!0),0)}),["i32","i32","i32","i32","i32","i32"],["i32"]),u("path_remove_directory",(function(t,e,n){if(e=Number(e),n=Number(n),0===e)return 28;const{HEAPU8:r}=dt(this,e+n),i=ft.get(this).fds.get(t,F.PATH_REMOVE_DIRECTORY,BigInt(0));let s=bt.decode(c(r,e,e+n));s=D(i.realPath,s);return gt(this).rmdirSync(s),0}),(async function(t,e,n){if(e=Number(e),n=Number(n),0===e)return 28;const{HEAPU8:r}=dt(this,e+n),i=ft.get(this).fds.get(t,F.PATH_REMOVE_DIRECTORY,BigInt(0));let s=bt.decode(c(r,e,e+n));s=D(i.realPath,s);const o=gt(this);return await o.promises.rmdir(s),0}),["i32","i32","i32"],["i32"]),u("path_rename",(function(t,e,n,r,i,s){if(e=Number(e),n=Number(n),i=Number(i),s=Number(s),0===e||0===i)return 28;const o=ft.get(this);let a,u;t===r?a=u=o.fds.get(t,F.PATH_RENAME_SOURCE|F.PATH_RENAME_TARGET,BigInt(0)):(a=o.fds.get(t,F.PATH_RENAME_SOURCE,BigInt(0)),u=o.fds.get(r,F.PATH_RENAME_TARGET,BigInt(0)));const{HEAPU8:f}=dt(this,Math.max(e+n,i+s)),h=D(a.realPath,bt.decode(c(f,e,e+n))),d=D(u.realPath,bt.decode(c(f,i,i+s)));return gt(this).renameSync(h,d),0}),(async function(t,e,n,r,i,s){if(e=Number(e),n=Number(n),i=Number(i),s=Number(s),0===e||0===i)return 28;const o=ft.get(this);let a,u;t===r?a=u=o.fds.get(t,F.PATH_RENAME_SOURCE|F.PATH_RENAME_TARGET,BigInt(0)):(a=o.fds.get(t,F.PATH_RENAME_SOURCE,BigInt(0)),u=o.fds.get(r,F.PATH_RENAME_TARGET,BigInt(0)));const{HEAPU8:f}=dt(this,Math.max(e+n,i+s)),h=D(a.realPath,bt.decode(c(f,e,e+n))),d=D(u.realPath,bt.decode(c(f,i,i+s))),g=gt(this);return await g.promises.rename(h,d),0}),["i32","i32","i32","i32","i32","i32"],["i32"]),u("path_symlink",(function(t,e,n,r,i){if(t=Number(t),e=Number(e),r=Number(r),i=Number(i),0===t||0===r)return 28;const{HEAPU8:s}=dt(this,Math.max(t+e,r+i)),o=ft.get(this).fds.get(n,F.PATH_SYMLINK,BigInt(0)),a=bt.decode(c(s,t,t+e));if(a.length>0&&"/"===a[0])return 63;let u=bt.decode(c(s,r,r+i));u=D(o.realPath,u);return gt(this).symlinkSync(a,u),0}),(async function(t,e,n,r,i){if(t=Number(t),e=Number(e),r=Number(r),i=Number(i),0===t||0===r)return 28;const{HEAPU8:s}=dt(this,Math.max(t+e,r+i)),o=ft.get(this).fds.get(n,F.PATH_SYMLINK,BigInt(0)),a=bt.decode(c(s,t,t+e));let u=bt.decode(c(s,r,r+i));u=D(o.realPath,u);const f=gt(this);return await f.promises.symlink(a,u),0}),["i32","i32","i32","i32","i32"],["i32"]),u("path_unlink_file",(function(t,e,n){if(e=Number(e),n=Number(n),0===e)return 28;const{HEAPU8:r}=dt(this,e+n),i=ft.get(this).fds.get(t,F.PATH_UNLINK_FILE,BigInt(0));let s=bt.decode(c(r,e,e+n));s=D(i.realPath,s);return gt(this).unlinkSync(s),0}),(async function(t,e,n){if(e=Number(e),n=Number(n),0===e)return 28;const{HEAPU8:r}=dt(this,e+n),i=ft.get(this).fds.get(t,F.PATH_UNLINK_FILE,BigInt(0));let s=bt.decode(c(r,e,e+n));s=D(i.realPath,s);const o=gt(this);return await o.promises.unlink(s),0}),["i32","i32","i32"],["i32"]),this._setMemory=function(t){if(!(t instanceof e.Memory))throw new TypeError('"instance.exports.memory" property must be a WebAssembly.Memory');ut.set(a,nt(t))}}static createSync(t,e,n,r,i,s,o){const a=new Q({size:3,in:r[0],out:r[1],err:r[2],fs:i,print:s,printErr:o}),c=new Bt(t,e,a,!1,i);if(n.length>0)for(let t=0;t<n.length;++t){const e=i.realpathSync(n[t].realPath,"utf8"),r=i.openSync(e,"r",438);a.insertPreopen(r,n[t].mappedPath,e)}return c}static async createAsync(t,e,n,r,i,s,o,a){const c=new J({size:3,in:r[0],out:r[1],err:r[2],print:s,printErr:o}),u=new Bt(t,e,c,!0,i,a);if(n.length>0)for(let t=0;t<n.length;++t){const e=n[t],r=await i.promises.realpath(e.realPath),s=await i.promises.open(r,"r",438);await c.insertPreopen(s,e.mappedPath,r)}return u}}const Nt=Object.freeze(Object.create(null)),St=Symbol("kExitCode"),Pt=Symbol("kSetMemory"),Dt=Symbol("kStarted"),Ft=Symbol("kInstance"),vt=Symbol("kBindingName");function Ut(t){var e;let s;if(n(t,"options"),void 0!==t.version)switch(r(t.version,"options.version"),t.version){case"unstable":s=Bt,this[vt]="wasi_unstable";break;case"preview1":s=Bt,this[vt]="wasi_snapshot_preview1";break;default:throw new TypeError(`unsupported WASI version "${t.version}"`)}else s=Bt,this[vt]="wasi_snapshot_preview1";void 0!==t.args&&function(t,e){if(!Array.isArray(t))throw new TypeError(`${e} must be an array. Received ${null===t?"null":typeof t}`)}(t.args,"options.args");const o=(null!==(e=t.args)&&void 0!==e?e:[]).map(String),a=[];void 0!==t.env&&(n(t.env,"options.env"),Object.entries(t.env).forEach((({0:t,1:e})=>{void 0!==e&&a.push(`${t}=${e}`)})));const c=[];if(void 0!==t.preopens&&(n(t.preopens,"options.preopens"),Object.entries(t.preopens).forEach((({0:t,1:e})=>c.push({mappedPath:String(t),realPath:String(e)})))),c.length>0){if(void 0===t.fs)throw new Error("filesystem is disabled, can not preopen directory");try{n(t.fs,"options.fs")}catch(t){throw new TypeError("Node.js fs like implementation is not provided")}}void 0!==t.print&&i(t.print,"options.print"),void 0!==t.printErr&&i(t.printErr,"options.printErr"),void 0!==t.returnOnExit&&function(t,e){if("boolean"!=typeof t)throw new TypeError(`${e} must be a boolean. Received ${null===t?"null":typeof t}`)}(t.returnOnExit,"options.returnOnExit");return{args:o,env:a,preopens:c,stdio:[0,1,2],_WASI:s}}function Rt(t,e){this[Pt]=t,this.wasiImport=e,this[Dt]=!1,this[St]=0,this[Ft]=void 0}class Lt{constructor(t=Nt){const{args:e,env:n,preopens:r,stdio:i,_WASI:s}=Ut.call(this,t),o=s.createSync(e,n,r,i,t.fs,t.print,t.printErr),a=o._setMemory;delete o._setMemory,Rt.call(this,a,o),t.returnOnExit&&(o.proc_exit=Ht.bind(this))}finalizeBindings(t,e){var r,{memory:i=(null===(r=null==t?void 0:t.exports)||void 0===r?void 0:r.memory)}=void 0===e?{}:e;if(this[Dt])throw new Error("WASI instance has already started");n(t,"instance"),n(t.exports,"instance.exports"),this[Pt](i),this[Ft]=t,this[Dt]=!0}start(t){this.finalizeBindings(t);const{_start:e,_initialize:n}=this[Ft].exports;let r;i(e,"instance.exports._start"),s(n,"instance.exports._initialize");try{r=e()}catch(t){if(t!==St)throw t}return r instanceof Promise?r.then((()=>this[St]),(t=>{if(t!==St)throw t;return this[St]})):this[St]}initialize(t){this.finalizeBindings(t);const{_start:e,_initialize:n}=this[Ft].exports;if(s(e,"instance.exports._start"),void 0!==n)return i(n,"instance.exports._initialize"),n()}getImportObject(){return{[this[vt]]:this.wasiImport}}}function Ht(t){throw this[St]=t,St}t.Asyncify=h,t.Memory=et,t.WASI=Lt,t.WebAssemblyMemory=tt,t.asyncifyLoad=function(t,e,n){d(n),n=null!=n?n:{};const r=new h;return l(e,n=r.wrapImports(n)).then((e=>{var i;const s=e.instance.exports.memory||(null===(i=n.env)||void 0===i?void 0:i.memory);return{module:e.module,instance:r.init(s,e.instance,t)}}))},t.asyncifyLoadSync=function(t,e,n){var r;d(n),n=null!=n?n:{};const i=new h,s=_(e,n=i.wrapImports(n)),o=s.instance.exports.memory||(null===(r=n.env)||void 0===r?void 0:r.memory);return{module:s.module,instance:i.init(o,s.instance,t)}},t.createAsyncWASI=async function(t=Nt){const e=Object.create(Lt.prototype),{args:r,env:s,preopens:o,stdio:a,_WASI:c}=Ut.call(e,t);void 0!==t.asyncify&&(n(t.asyncify,"options.asyncify"),i(t.asyncify.wrapImportFunction,"options.asyncify.wrapImportFunction"));const u=await c.createAsync(r,s,o,a,t.fs,t.print,t.printErr,t.asyncify),f=u._setMemory;return delete u._setMemory,Rt.call(e,f,u),t.returnOnExit&&(u.proc_exit=Ht.bind(e)),e},t.extendMemory=nt,t.load=l,t.loadSync=_,t.wrapAsyncExport=st,t.wrapAsyncImport=it,t.wrapExports=function(t,e){return a(t,((t,n)=>{let r="function"!=typeof t;return Array.isArray(e)&&(r=r||-1===e.indexOf(n)),r?t:st(t)}))},Object.defineProperty(t,"__esModule",{value:!0})}));
|